/* WorldFlight — site stylesheet */
:root {
  /* light (default): white and pale-sky surfaces, logo red + a deeper logo blue for text */
  --bg: #ffffff;
  --bg-2: #f1f6fb;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --line: rgba(16, 42, 82, .10);
  --line-2: rgba(16, 42, 82, .18);
  --text: #0e1f33;
  --soft: #33465c;
  --muted: #4b5f77;
  --faint: #7d8da1;
  --accent: #d7141f;          /* logo red */
  --accent-2: #1478c2;        /* logo blue, deepened for text on white */
  --accent-2-hover: #0d5f9e;
  --on-accent-2: #ffffff;
  --tint: rgba(16, 42, 82, .04);
  --tint-2: rgba(16, 42, 82, .07);
  --tint-strong: rgba(16, 42, 82, .28);
  --header-bg: rgba(255, 255, 255, .82);
  --header-solid: rgba(255, 255, 255, .98);
  --th-bg: #f4f8fc;
  --day-bg: #eef4fa;
  --map-bg: radial-gradient(120% 90% at 50% 0%, #f7fbfe 0%, #e9f2fa 75%);
  --map-land: #b1c8dd;
  --map-done: #a9b6c6;
  --map-alt: #7d8da1;
  --map-hl: #0e1f33;
  --tip-bg: rgba(255, 255, 255, .97);
  --live-pill-text: #b3121b;
  --logo-tile: #f6f8fb;
  --card-shadow: 0 1px 2px rgba(16, 42, 82, .05), 0 12px 32px -20px rgba(16, 42, 82, .28);
  --hero-bg: radial-gradient(70% 90% at 85% 10%, #dcecf8 0%, transparent 60%), linear-gradient(180deg, #f1f7fc 0%, #ffffff 100%);
  --shadow: 0 24px 60px -28px rgba(16, 42, 82, .4);
  --footer-bg: #0b2545;
  --rfds-bg: #f1f6fb;
  --red: #e3141f;             /* logo red, for fills */
  --live: #e3141f;            /* in-flight / live states */
  --donate: #e3141f;          /* RFDS / donate */
  --donate-2: #c60f19;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1200px;
  /* typography follows SimIFE: Albert Sans for everything, IBM Plex Mono for codes and times */
  --display: "Albert Sans", Helvetica, Arial, sans-serif;
  --body: "Albert Sans", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
/* dark: the whole page when chosen, and always for the footer and the lightbox */
:root[data-theme="dark"], .site-footer, dialog.lightbox {
  --bg: #070b16;
  --bg-2: #0b1122;
  --surface: #0f172b;
  --surface-2: #141e36;
  --line: rgba(148, 170, 214, .14);
  --line-2: rgba(148, 170, 214, .24);
  --text: #e8edf7;
  --soft: #c3cce0;
  --muted: #94a3bf;
  --faint: #66748f;
  --accent: #ff4d57;
  --accent-2: #8fd0f0;
  --accent-2-hover: #c4e9fa;
  --on-accent-2: #06223a;
  --tint: rgba(255, 255, 255, .04);
  --tint-2: rgba(255, 255, 255, .08);
  --tint-strong: rgba(255, 255, 255, .35);
  --header-bg: rgba(7, 11, 22, .72);
  --header-solid: rgba(7, 11, 22, .97);
  --th-bg: #0d1428;
  --day-bg: #0b1224;
  --map-bg: radial-gradient(120% 90% at 50% 0%, #101a33 0%, #080d1b 70%);
  --map-land: #2a3a5e;
  --map-done: #6b7894;
  --map-alt: #c9d6ea;
  --map-hl: #ffffff;
  --tip-bg: rgba(10, 16, 32, .96);
  --live-pill-text: #ffd9d4;
  --logo-tile: #f3f5f9;
  --card-shadow: none;
  --hero-bg: radial-gradient(70% 90% at 85% 10%, #13213f 0%, transparent 60%), linear-gradient(180deg, #0b1122 0%, #070b16 100%);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
  --live: #ff4d57;
  --donate-2: #ff3b44;
  color-scheme: dark;
}
:root[data-theme="dark"] { --footer-bg: #050811; --rfds-bg: #ffffff; }
.site-footer, dialog.lightbox { color: var(--text); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent-2-hover); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.08; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 300; line-height: 1.04; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 400; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent-2); color: var(--on-accent-2); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em; justify-content: center;
  font: 700 .95rem/1 var(--body); padding: .95em 1.4em; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text); background: var(--tint);
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:hover { color: var(--text); background: var(--tint-2); border-color: var(--tint-strong); transform: translateY(-1px); }
.btn-primary { background: var(--accent-2); color: var(--on-accent-2); border-color: transparent; }
.btn-primary:hover { background: var(--accent-2-hover); color: var(--on-accent-2); }
.btn-donate { background: var(--donate); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -10px rgba(229, 72, 58, .8); }
.btn-donate:hover { background: var(--donate-2); color: #fff; }
.btn-sm { padding: .62em 1.05em; font-size: .85rem; }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 40px; height: 40px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(143, 208, 240, .25), 0 4px 14px -4px rgba(143, 208, 240, .45); }
.brand-mark.lg { width: 64px; height: 64px; }
.brand-text { font: 700 1.15rem/1 var(--display); letter-spacing: -.01em; display: flex; flex-direction: column; gap: 3px; }
.brand-text small { font: 700 .62rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.primary { display: flex; gap: 2px; margin-left: auto; }
.primary a { color: var(--muted); font-weight: 500; font-size: .92rem; padding: .5em .8em; border-radius: 8px; transition: color .15s, background .15s; }
.primary a:hover { color: var(--text); background: var(--tint); }
.primary a[aria-current="page"] { color: var(--text); background: var(--tint-2); }
.bar-actions { display: flex; align-items: center; gap: 10px; }
.live-pill {
  display: none; align-items: center; gap: 7px; font: 700 .72rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase;
  color: var(--live-pill-text); padding: .6em .85em; border-radius: 999px; border: 1px solid rgba(229, 72, 58, .45); background: rgba(229, 72, 58, .12);
}
.live-pill:hover { color: #fff; background: var(--red); }
/* shown only while the Twitch stream is live (site.js sets :root.is-live) */
:root.is-live .live-pill { display: inline-flex; }
.live-only { display: none !important; }
:root.is-live .live-only { display: inline-flex !important; }
.live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--donate-2); box-shadow: 0 0 0 0 rgba(255, 106, 87, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255, 106, 87, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 106, 87, 0); } }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; padding: 0; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.menu-btn span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1080px) {
  .menu-btn { display: inline-flex; }
  .primary {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0; margin: 0; padding: 8px 16px 20px;
    background: var(--header-solid); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  }
  .primary a { padding: .9em .4em; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .menu-open .primary { opacity: 1; transform: none; pointer-events: auto; }
  .bar-actions { margin-left: auto; }
}
@media (max-width: 480px) {
  :root.is-live .brand-text { display: none; }  /* make room for LIVE on phones */
  .brand-text small { display: none; }
}

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section.tight { padding: clamp(40px, 6vw, 72px) 0; }
.section.alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-block: 1px solid var(--line); }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 700 .74rem/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head h2 { margin: 0; max-width: 20ch; }
.section-head p { margin: 0; color: var(--muted); max-width: 46ch; }

/* ---------- hero: copy on the left, framed photo + countdown on the right ---------- */
.hero { position: relative; background: var(--hero-bg); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-inner { padding: clamp(48px, 7vw, 96px) 0 clamp(72px, 9vw, 120px); display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 4.8vw, 4rem); margin-bottom: .35em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); font-weight: 400; }
.hero .lede { color: var(--muted); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-visual { position: relative; padding-bottom: 150px; }
.hero-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius) + 8px); box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero-visual .countdown-card { position: absolute; left: -40px; right: 64px; bottom: 0; }

.countdown-card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.countdown-card .label { font: 700 .72rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.countdown-card .label b { color: var(--live); font-weight: 600; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 18px; }
.countdown div { background: var(--tint); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; text-align: center; }
.countdown span { display: block; font: 300 clamp(1.8rem, 3.2vw, 2.5rem)/1 var(--body); color: var(--text); font-variant-numeric: tabular-nums; }
.countdown small { display: block; font: 700 .66rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-top: 8px; }
.cd-leg { display: flex; align-items: center; gap: 14px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.cd-leg .icao { font: 600 1.35rem/1 var(--mono); }
.cd-leg .icao small { display: block; font: 400 .74rem/1.3 var(--body); color: var(--muted); margin-top: 4px; }
.cd-leg .path { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px); position: relative; }
.cd-leg .path::after { content: "✈"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); color: var(--accent); font-size: 1rem; background: var(--surface); padding: 0 6px; }
.cd-meta { margin: 14px 0 0; font-size: .86rem; color: var(--muted); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stat { padding: 28px 26px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 300 clamp(2rem, 3.8vw, 2.9rem)/1 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat b sup { font-size: .5em; color: var(--accent); margin-left: 2px; }
.stat span { display: block; margin-top: 10px; color: var(--muted); font-size: .9rem; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: border-color .2s, transform .2s, background .2s; color: var(--text); display: flex; flex-direction: column;
}
a.card:hover { border-color: rgba(255, 77, 87, .45); transform: translateY(-3px); color: var(--text); background: var(--surface-2); }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(143, 208, 240, .1); color: var(--accent-2); margin-bottom: 18px; }
.card .ico svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card .go { margin-top: auto; padding-top: 18px; font: 700 .78rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.card.feature { background: linear-gradient(140deg, rgba(255, 77, 87, .12), transparent 60%), var(--surface); }

/* ---------- route map ---------- */
.map-frame { position: relative; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--map-bg); overflow: hidden; box-shadow: var(--card-shadow); }
.map-frame::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 8.333% 11.1%; opacity: .35; mask-image: radial-gradient(ellipse at center, #000 40%, transparent 85%); }
.route-svg { display: block; width: 100%; height: auto; position: relative; }
.route-svg .land { stroke: var(--map-land); stroke-width: 3.1; stroke-linecap: round; fill: none; }
.route-svg .legs path { fill: none; stroke: var(--accent-2); stroke-width: 1.6; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(143, 208, 240, .6)); }
.route-svg .alts path { fill: none; stroke: var(--map-alt); stroke-width: 1.1; stroke-dasharray: 3 3; opacity: .8; }
.route-svg .legs path.done { stroke: var(--map-done); filter: none; }
.route-svg .legs path.now { stroke: var(--live); stroke-width: 2.4; filter: drop-shadow(0 0 5px rgba(255, 77, 87, .8)); stroke-dasharray: 6 4; animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -10; } }
.route-svg .pin circle { fill: var(--surface); stroke: var(--accent); stroke-width: 1.4; }
.route-svg .pin.home circle { fill: var(--red); stroke: #fff; stroke-width: 1.6; }
.route-svg .pin:hover circle { fill: var(--accent); }
.route-svg .start-label text { font: 600 11px var(--mono); letter-spacing: .1em; fill: var(--accent); }
/* sequential draw: timings come from site.js (--dur, --delay per sector; --delay per pin) */
.route-svg.animate .legs path, .route-svg.animate .alts path { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw var(--dur) linear var(--delay) forwards; }
.route-svg.animate .pin { opacity: 0; animation: pin-in .35s ease-out var(--delay) forwards; }
.route-svg.animate .pin circle { transform-box: fill-box; transform-origin: center; animation: pin-pop .45s ease-out var(--delay); }
@keyframes pin-in { to { opacity: 1; } }
@keyframes pin-pop { 0% { transform: scale(2.2); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.map-legend { position: absolute; left: 18px; bottom: 16px; display: flex; gap: 16px; flex-wrap: wrap; font: 700 .7rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.map-legend i { display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--accent-2); }
.map-legend i.alt { background: repeating-linear-gradient(90deg, var(--map-alt) 0 3px, transparent 3px 6px); }
.map-legend i.now { background: var(--live); }
.map-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* ---------- prose / split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split.wide-left { grid-template-columns: 1.2fr .8fr; }
.photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; left: 14px; bottom: 14px; font: 500 .72rem/1 var(--mono); letter-spacing: .08em; background: rgba(7, 11, 22, .75); padding: 8px 10px; border-radius: 8px; color: #dfe6f0; }
.prose { max-width: 68ch; }
.prose p { color: var(--soft); }
.prose p:first-of-type { font-size: 1.15rem; color: var(--text); }
.checklist { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; color: var(--soft); }
.checklist li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 3px; border-radius: 6px; background: rgba(143, 208, 240, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%238fd0f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }

/* ---------- timeline (about) ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: t; }
.timeline li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.timeline b { display: block; font: 300 1.9rem/1 var(--display); color: var(--accent); margin-bottom: 10px; }
.timeline p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- teams ---------- */
.teams { columns: 3 260px; column-gap: 18px; }
.team-group { break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.team-group h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin-bottom: 12px; }
.cc { font: 600 .66rem/1 var(--mono); letter-spacing: .08em; padding: 5px 6px; border-radius: 6px; background: rgba(255, 77, 87, .14); color: var(--accent); }
.team-group ul { list-style: none; padding: 0; margin: 0; }
.team-group li + li { border-top: 1px solid var(--line); }
.team-group a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; color: var(--soft); font-size: .95rem; }
.team-group a:hover { color: var(--accent); }
.ext { color: var(--faint); transition: transform .15s; }
.team-group a:hover .ext { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- partners ---------- */
.partner-strip { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.partner-strip a { background: var(--logo-tile); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; height: 64px; width: 148px; display: grid; place-items: center; opacity: .78; filter: grayscale(1); transition: opacity .2s, filter .2s, transform .2s; }
.partner-strip a:hover { opacity: 1; filter: none; transform: translateY(-2px); }
.partner-strip img { max-height: 44px; width: auto; max-width: 100%; object-fit: contain; }
.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.partner { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .2s, border-color .2s; }
.partner:hover { transform: translateY(-3px); border-color: rgba(255, 77, 87, .45); color: var(--text); }
.partner .logo { background: var(--logo-tile); border-bottom: 1px solid var(--line); height: 120px; display: grid; place-items: center; padding: 18px; }
.partner .logo img { max-height: 84px; max-width: 80%; width: auto; object-fit: contain; }
.partner .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.partner .body strong { font: 600 1.08rem/1.25 var(--display); }
.partner .body span { color: var(--muted); font-size: .92rem; }
.partner .body em { margin-top: auto; padding-top: 8px; font: 500 .74rem/1 var(--mono); font-style: normal; color: var(--accent-2); }

/* ---------- page header ---------- */
.page-head { padding: clamp(64px, 9vw, 110px) 0 clamp(32px, 4vw, 48px); position: relative; overflow: hidden; }
.page-head::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 60vw; height: 60vw; background: radial-gradient(closest-side, rgba(143, 208, 240, .12), transparent); pointer-events: none; }
.page-logo { position: absolute; right: max(16px, (100% - var(--wrap)) / 2); top: 50%; transform: translateY(-40%) rotate(-6deg); width: clamp(160px, 20vw, 260px); filter: drop-shadow(0 20px 40px rgba(16, 42, 82, .35)); }
@media (max-width: 900px) { .page-logo { display: none; } }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); max-width: 18ch; }
.page-head .lede { margin-bottom: 0; }

/* ---------- toolbar / tables ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .search { flex: 1 1 260px; position: relative; }
.toolbar input[type="search"], .toolbar select {
  width: 100%; font: 500 .95rem/1 var(--body); color: var(--text); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 13px 14px 13px 40px; appearance: none;
}
.toolbar select { padding: 13px 38px 13px 14px; width: auto; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%2394a3bf' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 77, 87, .18); }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; }
.seg button { font: 600 .82rem/1 var(--body); color: var(--muted); background: transparent; border: 0; padding: 10px 14px; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: thin; }
.chips button { flex: none; font: 600 .8rem/1 var(--body); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--accent-2); color: var(--on-accent-2); border-color: transparent; }
.zone-note { font-size: .85rem; color: var(--muted); margin: 0 0 18px; }
.zone-note b { color: var(--text); font-weight: 600; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { position: sticky; top: 0; z-index: 1; text-align: left; font: 700 .68rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); background: var(--th-bg); padding: 14px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: var(--tint); }
table.data .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-row td { background: var(--day-bg); font: 700 .76rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); padding: 12px 16px; }
.fid { font: 600 .9rem/1 var(--mono); color: var(--text); white-space: nowrap; }
.rt { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.rt b { font: 600 .92rem/1 var(--mono); }
.rt small { display: block; font: 400 .78rem/1.3 var(--body); color: var(--muted); margin-top: 3px; }
.rt .arrow { color: var(--faint); }
.win { font-family: var(--mono); font-size: .86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.win small { display: block; color: var(--faint); font-size: .74rem; margin-top: 3px; }
.crew { font-size: .88rem; line-height: 1.45; }
.crew span { display: block; white-space: nowrap; }
.crew em { font-style: normal; font: 600 .62rem/1 var(--mono); color: var(--faint); letter-spacing: .08em; margin-right: 6px; }
.crew .tbd { color: var(--faint); font-style: italic; }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 700 .64rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.badge.alt { background: rgba(143, 208, 240, .12); color: var(--accent-2); }
.badge.now { background: rgba(255, 77, 87, .14); color: var(--live); }
.badge.now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.8s infinite; }
.badge.done { background: var(--tint-2); color: var(--faint); }
.badge.next { background: rgba(255, 77, 87, .14); color: var(--accent); }
tr.is-done td { opacity: .55; }
tr.is-now { background: rgba(255, 77, 87, .06); }
tr.is-alt .fid { color: var(--accent-2); }
.empty { padding: 48px; text-align: center; color: var(--muted); }
.table-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: .84rem; color: var(--faint); }
.route-str { font: 400 .72rem/1.4 var(--mono); color: var(--faint); max-width: 34ch; white-space: normal; word-break: break-word; }

/* mobile: tables become cards */
@media (max-width: 760px) {
  table.data.stack thead { display: none; }
  table.data.stack, table.data.stack tbody, table.data.stack tr, table.data.stack td { display: block; width: 100%; }
  table.data.stack tr:not(.day-row) { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
  table.data.stack td { padding: 0; border: 0; }
  table.data.stack td[data-label]::before { content: attr(data-label); display: block; font: 700 .6rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
  table.data.stack .num { text-align: left; }
  table.data.stack .wide { grid-column: 1 / -1; }
  table.data.stack tr.day-row td { padding: 12px 16px; }
  table.data.stack td.r { text-align: right; }
  .rt, .win, .crew span { white-space: normal; }
}

/* ---------- leg list (route page) ---------- */
.legs-days { columns: 3 320px; column-gap: 18px; }
.leg-day { break-inside: avoid; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.leg-day h3 { font: 700 .74rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; display: flex; justify-content: space-between; }
.leg-day h3 span { color: var(--faint); }
.leg-day ol { list-style: none; margin: 0; padding: 0; }
.leg-item { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; cursor: default; }
.leg-item:first-child { border-top: 0; }
.leg-item .fid { font-size: .8rem; color: var(--muted); }
.leg-item .cities { min-width: 0; }
.leg-item .cities b { display: block; font-weight: 600; line-height: 1.35; }
.leg-item .cities i { display: block; font: normal 400 .72rem/1.4 var(--mono); color: var(--faint); margin-top: 2px; }
.leg-item .arrow { color: var(--accent); margin: 0 2px; }
.leg-item .nm { font: 500 .78rem var(--mono); color: var(--muted); white-space: nowrap; }
.leg-item .tag { grid-column: 2 / -1; justify-self: start; font: 700 .6rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); background: rgba(143, 208, 240, .12); padding: 4px 6px; border-radius: 5px; margin-top: -4px; }
.leg-item.is-alt .fid { color: var(--accent-2); }
.leg-item:hover, .leg-item.hl { color: var(--accent); }
.leg-item.is-done { opacity: .5; }
.leg-item.is-now { color: var(--live); }
.route-svg .legs path.hl, .route-svg .alts path.hl { stroke: var(--map-hl); stroke-width: 3; opacity: 1; }

/* ---------- archive ---------- */
.year-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.year-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.year-stats b { display: block; font: 300 1.7rem/1 var(--display); font-variant-numeric: tabular-nums; }
.year-stats span { font-size: .82rem; color: var(--muted); }
.leaderboard { list-style: none; padding: 0; margin: 0; counter-reset: lb; }
.leaderboard li { counter-increment: lb; display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: .93rem; }
.leaderboard li:first-child { border-top: 0; }
.leaderboard li::before { content: counter(lb); font: 600 .78rem var(--mono); color: var(--faint); }
.leaderboard li:nth-child(-n+3)::before { color: var(--accent); }
.leaderboard button { all: unset; cursor: pointer; color: var(--text); }
.leaderboard button:hover { color: var(--accent); }
.leaderboard .bar-v { font: 500 .8rem var(--mono); color: var(--muted); }
.archive-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.archive-side { position: sticky; top: 88px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.side-card h3 { font-size: 1rem; }
.pager { display: flex; gap: 8px; align-items: center; }
.pager button { font: 600 .82rem/1 var(--body); color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 12px; }
.gallery .shot { all: unset; cursor: zoom-in; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.gallery .shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* one 2x2 hero tile + one wide tile: 12 photos fill 4 columns x 4 rows with no holes */
.gallery { grid-auto-flow: dense; }
.gallery .shot:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery .shot:nth-child(8) { grid-column: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gallery .shot:hover img { transform: scale(1.05); }
dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1200px, 94vw); max-height: 92vh; }
dialog.lightbox::backdrop { background: rgba(3, 6, 14, .9); backdrop-filter: blur(6px); }
dialog.lightbox img { max-height: 86vh; width: auto; margin: 0 auto; border-radius: 12px; }
dialog.lightbox .lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; color: var(--muted); font: 500 .8rem var(--mono); }
dialog.lightbox button { font: 600 .85rem var(--body); color: var(--text); background: rgba(255, 255, 255, .08); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 14px; cursor: pointer; }

/* ---------- donate band ---------- */
.donate-band { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 6px); padding: clamp(36px, 6vw, 64px); background: linear-gradient(120deg, #2a0d10 0%, #4a1414 40%, #7a1f17 100%); border: 1px solid rgba(255, 106, 87, .3); display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center; }
.donate-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 106, 87, .35), transparent); }
.donate-band h2 { margin-bottom: .3em; }
.donate-band p { color: #f2c9c2; margin: 0; max-width: 56ch; }
.donate-band .btn { position: relative; z-index: 1; background: #fff; color: #7a1f17; }
.donate-band .btn:hover { background: #ffe9e5; }

/* ---------- resources ---------- */
.res-hero { background: linear-gradient(135deg, rgba(143, 208, 240, .14), rgba(255, 77, 87, .08)), var(--surface); border: 1px solid var(--line-2); border-radius: calc(var(--radius) + 6px); padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1.3fr auto; gap: 32px; align-items: center; }
.res-hero h2 { margin-bottom: .3em; }
.res-hero p { color: var(--muted); margin: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--footer-bg); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding: 64px 0 40px; }
.footer-about p { color: var(--muted); font-size: .93rem; margin: 16px 0 20px; max-width: 42ch; }
.site-footer h4 { font: 700 .72rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer ul a { color: var(--soft); font-size: .93rem; }
.site-footer ul a:hover { color: var(--accent); }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0 32px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--faint); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner, .split, .split.wide-left, .archive-layout, .donate-band, .res-hero { grid-template-columns: 1fr; }
  .grid-4, .timeline { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .archive-side { position: static; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery .shot:nth-child(8) { grid-column: auto; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .timeline, .footer-grid { grid-template-columns: 1fr; }
  .year-stats { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 140px; }
  .gallery .shot:nth-child(8) { grid-column: span 2; }
  .partner-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .partner-strip a { width: auto; height: 52px; padding: 6px 8px; border-radius: 10px; }
  .partner-strip img { max-height: 36px; }
  .map-legend { position: static; padding: 0 16px 14px; }
  .route-svg .start-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .route-svg.animate .legs path, .route-svg.animate .alts path { stroke-dasharray: none; stroke-dashoffset: 0; }
  .route-svg.animate .pin { opacity: 1; }
}

/* ---------- live roster note ---------- */
.dot-live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 8px; vertical-align: middle; animation: pulse 1.8s infinite; }

/* ---------- map sector pop-up ---------- */
.route-svg .hits path { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.map-tip { position: absolute; z-index: 5; width: min(320px, calc(100% - 16px)); background: var(--tip-bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: .86rem; pointer-events: none; }
.map-tip .tip-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.map-tip .tip-route { line-height: 1.4; margin-bottom: 10px; }
.map-tip .tip-route b { font-weight: 600; }
.map-tip .tip-route i { font: normal 400 .74rem var(--mono); color: var(--faint); }
.map-tip .tip-route .arrow { color: var(--accent); }
.map-tip dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.map-tip dt { font: 700 .62rem/1.6 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.map-tip dd { margin: 0; font-family: var(--mono); font-size: .78rem; }
.map-tip dd small { display: block; color: var(--muted); font-size: .72rem; }
.map-tip .crew span { display: block; font-family: var(--body); }

/* ---------- RFDS ---------- */
.rfds-card { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; background: var(--rfds-bg); color: #0b2545; border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: clamp(28px, 5vw, 56px); }
.rfds-card .kicker { color: var(--red); }
.rfds-card h2 { color: #003c71; }
.rfds-card p { color: #33475b; max-width: 60ch; }
.rfds-logo img { width: 100%; height: auto; }
.btn-light { color: #003c71; border-color: rgba(0, 60, 113, .3); background: transparent; }
.btn-light:hover { color: #003c71; background: rgba(0, 60, 113, .06); border-color: #003c71; }
.rfds-chip { height: 34px; width: auto; background: #fff; padding: 5px 9px; border-radius: 8px; }
@media (max-width: 760px) { .rfds-card { grid-template-columns: 1fr; } .rfds-logo { max-width: 280px; } }

/* ---------- light-theme depth ---------- */
.stats, .card, .team-group, .partner, .table-wrap, .leg-day, .side-card, .timeline li, .year-stats div, .res-hero { box-shadow: var(--card-shadow); }
.photo { box-shadow: var(--shadow); }

/* ---------- theme toggle ---------- */
.theme-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; transition: color .15s, background .15s; }
.theme-btn:hover { color: var(--text); background: var(--tint); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon, :root[data-theme="dark"] .theme-btn .sun { display: block; }
.theme-btn .sun, :root[data-theme="dark"] .theme-btn .moon { display: none; }

@media (max-width: 1000px) {
  .hero-visual { padding-bottom: 0; }
  .hero-visual .countdown-card { position: relative; left: auto; right: auto; margin: -56px 16px 0; }
}

/* ---------- fixed-width schedule columns: every row lines up whatever the city names ---------- */
table.data.fixed { table-layout: fixed; min-width: 980px; }
table.data.fixed td { overflow: hidden; }
.c-flight { width: 104px; } .c-status { width: 110px; } .c-ap { width: 15%; } .c-win { width: 140px; } .c-dist { width: 108px; }
table.data .ap b { display: block; font: 600 .92rem/1.2 var(--mono); }
table.data .ap small { display: block; margin-top: 3px; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.data.fixed .crew span { overflow: hidden; text-overflow: ellipsis; }
#arch { min-width: 860px; }
#arch .c-flight { width: 92px; } #arch .c-ap { width: 15%; } #arch .c-dist { width: 92px; }
.c-when { width: 104px; }
.rt-toggle { display: block; margin-top: 6px; font: 700 .62rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); background: transparent; border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 7px; cursor: pointer; }
.rt-toggle:hover, .rt-toggle[aria-expanded="true"] { background: var(--tint-2); }
tr.route-row td { background: var(--surface-2); padding: 10px 16px 14px; white-space: normal; }
tr.route-row .route-label { display: block; font: 700 .62rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
tr.route-row code { font: 400 .8rem/1.6 var(--mono); color: var(--soft); word-break: break-word; }
table.data tr[hidden] { display: none !important; }
@media (max-width: 760px) {
  table.data.fixed, #arch { min-width: 0; table-layout: auto; }
  table.data.stack .rt-toggle { display: inline-block; margin: 0 0 0 10px; vertical-align: middle; }
  table.data.stack tr.route-row { display: block; }
  table.data .ap small { white-space: normal; }
}
