:root {
  --bg: #080b14;
  --bg-2: #0c1020;
  --surface: #121829;
  --ink: #eaeefb;
  --muted: #8b93ac;
  --faint: #39415c;
  --flight: #ffb020;
  --flight-glow: #ffcf6b;
  --car: #35d0ba;
  --flight2: #b06bff;
  --flight2-glow: #cd9fff;
  --car2: #b06bff;
  --line: #1e2640;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 800px at 70% -10%, #15203f 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
#ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.hero, .journey, .wrapped, footer { position: relative; z-index: 1; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Language and the original, quiet year title. */
.lang-toggle {
  position: fixed; top: 14px; right: 16px; z-index: 50;
  display: flex; gap: 2px; padding: 3px;
  background: #0d1324dd; border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(6px);
}
.lang-toggle button { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; padding: 6px 10px; border-radius: 999px; }
.lang-toggle button.active { background: var(--flight); color: #1a1205; }
.hero { min-height: 84vh; display: flex; flex-direction: column; justify-content: center; padding: 72px 0 48px; }
.hero .kicker { letter-spacing: .3em; text-transform: uppercase; color: var(--flight); font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-size: clamp(64px, 9vw, 120px); line-height: .95; margin: 0 0 10px; font-weight: 800; letter-spacing: -.02em; }
.hero h1 .yr { background: linear-gradient(120deg, var(--flight) 0%, var(--flight-glow) 60%, #fff 120%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { color: var(--muted); font-size: clamp(16px, 2.4vw, 22px); max-width: 670px; }
.period-label { color: #adb5cb; font-size: 13px; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.scroll-hint { display: inline-block; margin-top: 34px; color: var(--muted); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; }

.journey { padding: 30px 0 10px; }
.section-head h2 { font-size: clamp(26px, 4vw, 40px); margin: 0; letter-spacing: -.02em; }
.section-head p { color: var(--muted); margin: 6px 0 0; }
.stage { width: 100%; padding: 0 clamp(12px, 3vw, 44px); }
.map-card {
  --map-base-height: clamp(236px, calc(84vh - 354px), 476px);
  --timeline-cards-height: 120px;
  --timeline-height: calc(var(--timeline-cards-height) + 88px);
  --axis-clearance: 64px;
  /* Give the space saved by the compact cards directly to the map. */
  display: grid; grid-template-rows: calc(var(--map-base-height) * 1.2 + 216px - var(--timeline-height)) var(--timeline-height) 64px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px;
  overflow: hidden; scroll-margin-top: 64px;
}
.map-card > .map-viewport { grid-column: 1; grid-row: 1 / 3; margin-bottom: var(--axis-clearance); }
.map-card > .journey-timeline { grid-column: 1; grid-row: 2; position: relative; z-index: 1; }
.map-card > .map-footer { grid-column: 1; grid-row: 3; }
.map-topline { position: absolute; inset: 0 0 auto; z-index: 2; min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 20px; background: linear-gradient(180deg, #080b14b8, #080b1459 65%, transparent); pointer-events: none; text-shadow: 0 1px 8px #000; }
.map-badge { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.m-month { color: var(--flight-glow); font-size: 15px; font-weight: 750; letter-spacing: .025em; font-variant-numeric: tabular-nums; }
.m-dest { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.odometer { flex-shrink: 0; text-align: right; color: var(--flight-glow); font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; pointer-events: auto; }
.distance-total { display: flex; justify-content: flex-end; align-items: center; gap: 8px; color: #fff; }
.together-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; color: var(--flight-glow); font-size: inherit; font-weight: 750; white-space: nowrap; }
.together-total b { font: inherit; }
#sharedDaysCaption, #distanceUnitSymbol { font-size: 12px; font-weight: 500; }
#sharedDaysCaption { color: var(--flight-glow); }
.vehicle-caption { pointer-events: none; }
.vehicle-caption rect { fill: #0b1223; fill-opacity: .9; stroke-width: .6; stroke-opacity: .6; }
.vehicle-caption text { font-size: 10px; font-weight: 650; }
.unit-toggle { display: inline-flex; padding: 1px; border: 1px solid var(--line); border-radius: 5px; background: #080d19; }
.unit-toggle button { border: 0; border-radius: 3px; padding: 1px 5px; background: transparent; color: var(--muted); font-size: 9px; line-height: 12px; }
.unit-toggle button.active { color: var(--ink); background: #39415c; }
.map-viewport { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#map { width: 100%; height: 100%; display: block; }
.country { fill: #161e33; stroke: #090e1d; stroke-width: .65; vector-effect: non-scaling-stroke; }
.graticule { fill: none; stroke: #ffffff0b; stroke-width: .55; vector-effect: non-scaling-stroke; }
.airport { fill: #bbc3da; }
.travel-route { stroke-linejoin: round; }
.markers-layer, .labels-layer, .shared-stays-layer { pointer-events: none; }
.shared-disc { fill: #0d1629; fill-opacity: .58; }
.shared-ring { fill: none; stroke-width: 2; stroke-linecap: round; opacity: .88; }
.shared-gold { stroke: var(--flight); }
.shared-purple { stroke: var(--flight2); }
.shared-days { fill: #fff; font-size: 29px; font-weight: 750; paint-order: stroke; stroke: #0b1020; stroke-width: 2px; }
.shared-unit { fill: #fff; font-size: 10px; font-weight: 600; paint-order: stroke; stroke: #0b1020; stroke-width: 2px; }
.shared-caption { fill: #c7d0e8; font-size: 9px; letter-spacing: .02em; paint-order: stroke; stroke: #0b1020; stroke-width: 2px; }
.city-label { fill: #fff; font-size: 11px; font-weight: 650; paint-order: stroke; stroke: #05070f; stroke-width: 3px; stroke-linejoin: round; }
.label-leader { stroke: #eaeefb; stroke-width: .8; }
.city-label-group.label-reveal { animation: labelReveal .9s ease-out both; animation-delay: var(--reveal-delay, 0ms); }
@keyframes labelReveal { from { opacity: 0; } to { opacity: 1; } }

/* Compact cards are pinned to calendar dates, in their own area below the map. */
.journey-timeline { display: grid; grid-template-rows: var(--timeline-cards-height) 62px; gap: 4px; padding: 12px 20px 8px; border-top: 1px solid transparent; border-bottom: 1px solid var(--line); background: transparent; }
.timeline-cards { --journey-card-width: 268px; --card-stack-offset: 28px; position: relative; min-width: 0; }
.journey-card { position: absolute; width: min(var(--journey-card-width), calc(100% - 8px)); display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid #39415c; border-radius: 12px; background: #141c2e; box-shadow: inset 2px 0 var(--flight), 0 8px 22px #0005; transition: opacity .2s ease; }
.journey-card.p2 { box-shadow: inset 2px 0 var(--flight2), 0 8px 22px #0005; }
.journey-card.is-shared { box-shadow: inset 2px 0 var(--flight), inset -2px 0 var(--flight2), 0 8px 22px #0005; }
.journey-card.is-underneath { opacity: .45; }
.journey-card.is-underneath .readout-title { -webkit-line-clamp: 1; }
.journey-card:hover, .journey-card:focus { z-index: 10 !important; opacity: 1; }
.journey-card:hover .readout-title, .journey-card:focus .readout-title { -webkit-line-clamp: 2; }
.journey-card:focus-visible { outline: 2px solid #eaeefbaa; outline-offset: 2px; }
.timeline-cards:has(.journey-card:hover, .journey-card:focus) .journey-card:not(:hover):not(:focus) { opacity: .3; }
.traveller-symbol { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.route-person .traveller-symbol { width: 13px; height: 13px; }
.person-dot { width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.readout-title { margin: 0; font-size: 13px; font-weight: 650; line-height: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex-shrink: 0; }
.card-routes { display: grid; gap: 1px; margin-top: 4px; }
.readout-route { display: flex; align-items: center; gap: 6px; min-width: 0; color: #b2bbd0; font-size: 10px; line-height: 14px; }
.route-person { flex-shrink: 0; font-size: 9px; }
.readout-route-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 6px; font-size: 9px; line-height: 12px; color: var(--muted); white-space: nowrap; }
.readout-phase { overflow: hidden; text-overflow: ellipsis; }
.journey-card[data-phase="intro"] .readout-phase { color: var(--ink); }
.readout-empty { display: grid; height: 100%; align-content: center; color: var(--muted); text-align: center; font-size: 13px; }
.map-footer { padding: 10px 20px 12px; }
.yearbar { position: relative; z-index: 2; display: flex; align-items: flex-start; gap: 12px; }
.yb-end { font-size: 10px; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.yb-track { position: relative; flex: 1; height: 18px; }
.yb-line, .yb-fill { position: absolute; top: 8px; left: 0; height: 2px; border-radius: 2px; }
.yb-line { width: 100%; background: var(--line); }
.yb-fill { width: 0; background: var(--flight); }
.yb-head { position: absolute; top: 4px; left: 0; width: 10px; height: 10px; transform: translateX(-50%); border-radius: 50%; background: var(--flight-glow); box-shadow: 0 0 10px #ffb02055; }
#ybTicks { position: absolute; inset: 0; pointer-events: none; }
.yb-tick { position: absolute; top: 50%; width: 5px; height: 5px; transform: translate(-50%, -50%); border-radius: 50%; background: #6a7390; }
.yb-tick.is-active { width: 7px; height: 7px; background: var(--tick-color); box-shadow: 0 0 6px #eaeefb33; }
#ybLabels { position: absolute; top: 20px; left: 0; width: 100%; z-index: 3; pointer-events: none; }
.yb-label { position: absolute; padding: 0; border: 0; background: none; color: #a1abc1; font-size: 9px; line-height: 12px; white-space: nowrap; pointer-events: auto; }
.yb-label:hover, .yb-label:focus-visible, .yb-label.is-active { color: var(--flight-glow); }
#yearSeek { position: absolute; inset: -5px 0; width: 100%; height: 28px; margin: 0; opacity: 0; cursor: pointer; touch-action: none; }
.yb-track:focus-within { outline: 1px solid #a6aec3; outline-offset: 4px; border-radius: 3px; }
.map-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.btn { background: var(--flight); color: #1a1205; border: 0; font-weight: 700; padding: 9px 17px; border-radius: 999px; font-size: 13px; min-width: 132px; }
.btn:hover { background: var(--flight-glow); }
.playback-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* Reference chapters retain the original two-column layout. */
.timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 30px 0 20px; }
.trip { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; min-width: 0; }
.trip.active { outline: 1px solid #eaeefb66; box-shadow: 0 18px 60px -30px #000; }
.trip.shared { background: linear-gradient(150deg, #2a1e05, #1a1205); border-color: #ffb02055; }
.trip.solo-p2 { border-color: #b06bff33; background: linear-gradient(150deg, #201329, #121829); }
.trip .t-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.t-month { color: var(--flight); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.solo-p2 .t-month { color: var(--flight2-glow); }
.trip-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.shared .trip-kind { color: var(--flight-glow); }
.trip h3 { margin: 6px 0 3px; font-size: 23px; line-height: 1.22; letter-spacing: -.015em; overflow-wrap: break-word; }
.t-dest { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.person-block { margin-top: 10px; padding: 2px 0 2px 10px; border-left: 2px solid var(--flight); }
.person-block.p2 { border-left-color: var(--flight2); }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 2px 0 9px; }
.city { font-weight: 650; font-size: 13px; }
.route-connector { font-size: 12px; margin: 0 1px; }
.gap { color: var(--muted); letter-spacing: 2px; }
.t-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; color: #b1b8cb; font-size: 11px; }
.t-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.trip-jump { margin-top: 18px; padding: 6px 0; border: 0; background: transparent; color: #c8cfe0; font-size: 11px; font-weight: 600; }
.trip-jump span { margin-left: 6px; color: var(--flight); }
.solo-p2 .trip-jump span { color: var(--flight2); }
.trip-jump:hover { color: #fff; }

.wrapped { padding: 70px 0 40px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-height: 165px; display: flex; flex-direction: column; gap: 12px; }
.tile .big { font-size: clamp(28px, 3.5vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.tile .cap { color: #a6aec3; font-size: 13px; }
.tile.accent { background: linear-gradient(150deg, #2a1e05, #1a1205); border-color: #ffb02044; }
.tile.accent .big { color: var(--flight-glow); }
.tile.featured { grid-column: span 2; background: linear-gradient(125deg, #2a1e05, #25172f); border-color: #ffb02066; }
.tile.featured .big { font-size: 64px; }
.tile.featured .cap { color: var(--ink); font-size: 20px; font-weight: 650; }
.tile-people { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; margin-top: auto; }
.tile-people > span { display: inline-flex; align-items: center; gap: 4px; }
.tile-people .p1 { color: var(--flight-glow); }
.tile-people .p2 { color: var(--flight2-glow); }
.tile-people b { color: var(--ink); margin-left: 5px; font-weight: 600; }
.tile-note { color: var(--muted); font-size: 11px; margin-top: auto; }
.stats-note { color: var(--muted); font-size: 11px; line-height: 1.6; max-width: 850px; margin: 20px 0 0; }
footer { color: #778099; text-align: center; padding: 45px 0 65px; font-size: 11px; }

@media (max-width: 900px) {
  .timeline { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-card { --map-base-height: clamp(220px, calc(86svh - 350px), 410px); --timeline-height: calc(var(--timeline-cards-height) + 102px); --axis-clearance: 78px; }
  .journey-timeline { grid-template-rows: var(--timeline-cards-height) 76px; }
  .map-topline { min-height: 68px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 20px; }
  .hero .kicker { font-size: 11px; }
  .map-topline { padding: 10px 12px; gap: 10px; }
  .m-month { font-size: 13px; }
  .m-dest { font-size: 11px; }
  .odometer { font-size: 15px; }
  .journey-timeline { padding-left: 12px; padding-right: 12px; }
  .timeline-cards { --journey-card-width: 244px; }
  .map-footer { padding-left: 12px; padding-right: 12px; }
  .city-label { font-size: 10px; }
  .tiles { grid-template-columns: 1fr; }
  .tile.featured { grid-column: auto; }
  .trip { padding: 18px; }
  .trip h3 { font-size: 21px; }
  .tile .big { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .journey-card { transition: none; } .city-label-group.label-reveal { animation: none; } }
