/* ============================================================
   hummatov.com — "Night Bus"
   ------------------------------------------------------------
   Departure-board logic: signal amber on night-window blue-black,
   condensed display type, and data set in tabular monospace.

   Committed single-theme design. Every colour is painted
   explicitly so nothing borrows a browser default.
   ============================================================ */

:root {
  /* ground */
  --night:    #0E1418;
  --surf:     #161E24;
  --surf-2:   #1B242B;
  --surf-3:   #212C34;

  /* lines */
  --rule:     #26333B;
  --rule-soft:#1C262C;

  /* ink */
  --text:     #DDE5EA;
  --dim:      #7E9099;
  --faint:    #56666F;

  /* signal */
  --amber:    #E9A63C;
  --amber-dk: #8A5F17;
  --cyan:     #63B7C2;

  --radius:   4px;
  --radius-lg:6px;

  --disp: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;

  /* The page frame is wide; running text is capped separately by its own
     max-width, so lines never stretch past a comfortable reading measure. */
  --maxw: 1280px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

img { display: block; max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }

/* ---------- shared type ---------- */
h1, h2, h3 {
  font-family: var(--disp);
  text-transform: uppercase;
  line-height: 1.02;
  margin: 0 0 16px;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: clamp(38px, 6.6vw, 78px); letter-spacing: .01em; }
h2 { font-size: clamp(25px, 3.6vw, 35px); letter-spacing: .075em; }
h3 { font-size: 20.5px; letter-spacing: .05em; }

p { color: var(--dim); margin: 0 0 16px; }
p.lead { font-size: 20px; color: var(--text); max-width: 62ch; line-height: 1.7; }

.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 18px;
}
.kicker.cool { color: var(--cyan); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(22, 30, 36, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 26px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  font-family: var(--disp);
  font-size: 21px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.brand em { font-style: normal; color: var(--amber); }

.tabs { display: flex; gap: 3px; }
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  padding: 8px 15px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color .16s, background .16s;
}
.tab:hover { color: var(--text); background: var(--surf-2); }
.tab[aria-selected="true"] {
  color: var(--night);
  background: var(--amber);
  font-weight: 600;
}

/* ============================================================
   PANELS + SECTIONS
   ============================================================ */
.panel { display: none; }
.panel.is-active { display: block; animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

section { padding: 68px 0; }
section + section { border-top: 1px solid var(--rule-soft); }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: 84px 0 66px; }
.hero h1 { max-width: 15ch; margin-bottom: 26px; }
.hero h1 span { display: block; }
.hero h1 em { font-style: normal; color: var(--amber); }

/* Text on the left, photograph on the right — the photograph is what earns
   the extra page width. Without it the right-hand side is just emptier. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 56px;
  align-items: center;
}
.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  filter: saturate(.92) contrast(1.04);
  /* dissolve the left and bottom edges into the page rather than sitting in
     a hard rectangle — the photograph has bright sky and would otherwise
     punch a hole in the dark ground */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 26%),
    linear-gradient(to bottom, #000 72%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 26%),
    linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-composite: intersect;
}

/* departure-board readout of the headline facts */
.readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 1px;
  margin-top: 38px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.readout div { background: var(--surf); padding: 14px 16px; }
.readout dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.readout dd {
  margin: 0;
  font-family: var(--disp);
  font-size: 22px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
}
.readout dd small {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: none;
  color: var(--dim);
  margin-top: 3px;
}
.readout dd.hot { color: var(--amber); }

/* ============================================================
   PORTRAIT
   ============================================================ */
.portrait-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 36px;
  align-items: start;
}
/* the biography column, held to a readable measure on a wide page */
.portrait-row p { max-width: 64ch; }
.portrait { margin: 0; text-align: center; }
.portrait img {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
  background: var(--surf-2);
  /* a thin amber ring, held off the photo by the night ground */
  box-shadow: 0 0 0 2px var(--night), 0 0 0 3.5px var(--amber-dk);
}
.portrait figcaption {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ============================================================
   CARDS
   ============================================================ */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surf);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  /* a column so the date rule can be pinned to the bottom — see .card .when */
  display: flex;
  flex-direction: column;
}
.card h3 { margin-bottom: 5px; }
.card .sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 11px;
}
/* The card stretches to the page frame, but its prose does not — long lines
   are hard to track back to the start of the next one. */
.card p { margin: 0; font-size: 15.5px; max-width: 68ch; }
.card .when {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .07em;
  color: var(--faint);
  /* pinned to the foot of the card, so the rules line up across a row even
     when one card carries more text than its neighbour */
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
}
.card.wide { padding: 26px 28px; }
.card.wide h3 { font-size: 25px; margin-bottom: 4px; }
.card.wide p { font-size: 15.5px; }
/* Stacked cards need a gap between them, but grid cells already have `gap` —
   applying a margin there would shove every card down inside its own cell. */
.wrap > .card + .card { margin-top: 14px; }

.bullets { margin: 18px 0 0; padding: 0; list-style: none; }
.bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--dim);
  font-size: 15.5px;
  max-width: 68ch;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 1px; top: 10px;
  width: 7px; height: 1.5px;
  background: var(--amber-dk);
}

/* ============================================================
   SKILLS
   ============================================================ */
.skillset { display: grid; gap: 26px; }
.skill-group h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--faint);
  margin-bottom: 12px;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  background: var(--surf);
  border: 1px solid var(--rule);
  padding: 5px 10px;
  border-radius: var(--radius);
  transition: color .15s, border-color .15s;
}
.tag:hover { color: var(--text); border-color: var(--amber-dk); }

/* ============================================================
   CERTIFICATIONS
   Each row links out to the issuer's own verification page —
   a claim anyone can check, so it is styled as a live thing
   rather than as another self-assessed skill tag.
   ============================================================ */
.certs { display: grid; gap: 10px; }
.cert {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 20px;
  padding: 16px 20px;
  background: var(--surf);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color .16s, background .16s;
}
a.cert:hover, a.cert:focus-visible {
  border-color: var(--amber-dk);
  background: var(--surf-2);
  text-decoration: none;
}
.cert-issuer {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}
.cert-name {
  font-family: var(--disp);
  font-size: 19px;
  letter-spacing: .045em;
  text-transform: uppercase;
  color: var(--text);
}
.cert-name b {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--faint);
  margin-left: 9px;
  white-space: nowrap;
}
.cert-when {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .07em;
  color: var(--faint);
  white-space: nowrap;
}
.cert-verify {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
}
a.cert:hover .cert-name { color: var(--amber); }

/* ============================================================
   ERASMUS JOURNEY — map
   ============================================================ */
#map {
  height: 500px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule);
  background: #0B1013;
  z-index: 1;
}
.leaflet-container { background: #0B1013 !important; font-family: var(--body) !important; }
.leaflet-control-attribution {
  background: rgba(14,20,24,.85) !important;
  color: var(--faint) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--dim) !important; }
.leaflet-bar a {
  background: var(--surf-2) !important;
  color: var(--text) !important;
  border-color: var(--rule) !important;
}
.leaflet-bar a:hover { background: var(--surf-3) !important; }

.pin {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--night);
  box-shadow: 0 0 0 1.5px var(--cyan), 0 0 12px rgba(99,183,194,.5);
  transition: transform .16s;
}
.pin.is-home {
  background: var(--amber);
  box-shadow: 0 0 0 1.5px var(--amber), 0 0 14px rgba(233,166,60,.6);
}
.pin-wrap:hover .pin,
.pin-wrap.is-current .pin { transform: scale(1.4); }
/* ---- flight animation ---- */
.plane-wrap { pointer-events: none; }
.plane {
  width: 22px;
  height: 22px;
  transform-origin: 50% 50%;
  transition: opacity .4s ease, scale .4s ease;
  filter: drop-shadow(0 0 7px rgba(233, 166, 60, .75));
}
.plane svg { display: block; width: 100%; height: 100%; fill: var(--amber); }
.plane-wrap.has-landed .plane { opacity: 0; scale: .55; }
.flight-trail { transition: stroke-opacity .5s ease; }

/* ---- arrival: the whole country lights up in its own flag ----
   Only opacity and filter are animated. Leaflet positions an image overlay
   with `transform`, so touching transform here would tear it off the map. */
.country-flash {
  opacity: 0;
  filter: brightness(1);
  transition: opacity .45s ease, filter .45s ease;
  will-change: opacity, filter;
}
.country-flash.is-lit {
  opacity: .94;
  /* the drop-shadow follows the PNG's alpha, so the glow traces the coastline */
  filter: brightness(1.3) saturate(1.12)
          drop-shadow(0 0 14px rgba(233, 166, 60, .85));
}
.country-flash.is-fading {
  opacity: 0;
  filter: brightness(1);
  transition: opacity 1.1s ease, filter 1.1s ease;
}

.pin-label {
  position: absolute;
  left: 20px; top: -3px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text);
  background: rgba(14,20,24,.88);
  border: 1px solid var(--rule);
  padding: 2px 7px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
}
/* Move a label off its default right-hand side where it would otherwise cover
   a neighbouring city's clickable pin. The Stockholm / Helsinki / Tallinn
   cluster is the reason this exists — see labelSide in js/places.js. */
.pin-wrap.label-left .pin-label { left: auto; right: 20px; }
.pin-wrap.label-top .pin-label {
  left: 50%;
  top: auto;
  bottom: 19px;
  transform: translateX(-50%);
}

.map-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 12px 0 0;
}

/* ============================================================
   ERASMUS JOURNEY — city detail
   ============================================================ */
.detail {
  background: var(--surf);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 30px 32px 34px;
  scroll-margin-top: 78px;
}
.detail .empty {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  margin: 0;
}
.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.detail-head h3 { margin: 0; font-size: 34px; letter-spacing: .04em; }
.detail-head .country {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.detail-head .country.home { color: var(--amber); }
.flag {
  width: 21px;
  height: 14px;
  border-radius: 2px;
  flex: none;
  /* a hairline so white-edged flags don't dissolve into the dark card */
  box-shadow: 0 0 0 1px rgba(221, 229, 234, .18);
}
.detail .blurb { font-size: 19px; color: var(--text); max-width: 62ch; }
.detail .story p { font-size: 16.5px; line-height: 1.78; max-width: 66ch; }

/* photo grid — every frame carries its own line underneath */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 18px;
  margin-top: 26px;
}
.photo-grid figure {
  margin: 0;
  background: var(--surf-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity .18s;
  background: var(--surf-3);
}
.photo-grid img:hover { opacity: .84; }
.photo-grid figcaption {
  padding: 11px 13px 13px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--dim);
}
.photo-grid figcaption b {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 5px;
}
.photo-grid figcaption .pending {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--faint);
}

/* ============================================================
   CONTACT
   ============================================================ */
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.link-chip {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  border: 1px solid var(--rule);
  background: var(--surf);
  padding: 10px 15px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .16s, background .16s;
}
a.link-chip:hover { border-color: var(--amber-dk); background: var(--surf-2); text-decoration: none; }
.link-chip b {
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
a.link-chip:hover b { color: var(--amber); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6, 9, 11, .95);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 40px 30px;
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  border-radius: var(--radius);
  object-fit: contain;
}
.lightbox .lb-cap {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
  text-align: center;
  max-width: 62ch;
}
.lightbox .lb-cap b {
  color: var(--amber);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 10px;
  margin-right: 8px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--rule-soft);
  padding: 34px 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--faint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  /* below this the photograph would be a stripe, so drop it and give the
     words the full width instead */
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-figure { display: none; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .portrait-row { grid-template-columns: 1fr; gap: 26px; justify-items: start; }
  .portrait { text-align: left; }
  .portrait img { margin: 0; }
  #map { height: 400px; }
}
@media (max-width: 620px) {
  .header-inner { height: auto; padding: 11px 16px; flex-direction: column; align-items: flex-start; gap: 9px; }
  .tabs { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .wrap { padding: 0 16px; }
  section { padding: 46px 0; }
  .hero { padding: 52px 0 42px; }
  .detail { padding: 22px 18px 26px; }
  /* stack the certification rows so long course names never squeeze the link */
  .cert { grid-template-columns: 1fr auto; gap: 6px 14px; padding: 15px 16px; }
  .cert-issuer { grid-column: 1; }
  .cert-when { grid-column: 2; grid-row: 1; text-align: right; }
  .cert-name { grid-column: 1 / -1; font-size: 15.5px; }
  .cert-name b { display: block; margin: 4px 0 0; }
  .cert-verify { grid-column: 1 / -1; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .lightbox { padding: 20px 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
