/* ════════════════════════════════════════════════════════════════════════
   DriverIndex — design system
   Look & feel inspired by the official F1 visual language: Titillium Web,
   racing red #E10600, carbon dark surfaces, chamfered "cut" corners.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --red: #E10600;
  --red-bright: #FF2D23;
  --bg: #15151E;
  --bg-deep: #0E0E14;
  --surface: #1D1D27;
  --surface-2: #24242F;
  --hairline: #2C2C38;
  --text: #F5F5F7;
  --text-2: #B9B9C5;
  --text-3: #83838F;
  --good: #2BD97C;
  --bad: #FF5252;
  --font: 'Titillium Web', 'Segoe UI', system-ui, sans-serif;
  --cut: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  --cut-sm: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  --maxw: 1240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3 { line-height: 1.15; }
::selection { background: var(--red); color: #fff; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: 32px;
  padding: 0 28px;
  height: 64px;
  border-bottom: 1px solid var(--hairline);
}
/* background lives on its own layer (not on .site-header) because
   backdrop-filter/filter on an ancestor creates a new containing block for
   position:fixed descendants — that trapped the mobile #mainNav panel inside
   the header's 64px box instead of the viewport. */
.site-header-bg {
  position: absolute; inset: 0; z-index: -1;
  background: rgba(14, 14, 20, .92);
  backdrop-filter: blur(12px);
}
.site-header::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 55%, transparent 100%);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 34px; height: 22px; }
.logo-word {
  font-weight: 900; font-style: italic; font-size: 1.22rem; letter-spacing: .02em;
  color: #fff; white-space: nowrap;
}
.logo-word em { font-style: italic; color: var(--red-bright); }
.logo-word.sm { font-size: 1rem; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav > a, .dd-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 64px;
  background: none; border: none; cursor: pointer;
  color: var(--text-2);
  font-size: .92rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  transition: color .18s;
}
.main-nav > a:hover, .dd-btn:hover, .main-nav > a.active, .dropdown.active .dd-btn { color: #fff; }
.main-nav > a::after, .dd-btn::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px;
  background: var(--red); transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.main-nav > a:hover::after, .main-nav > a.active::after,
.dd-btn:hover::after, .dropdown.active .dd-btn::after { transform: scaleX(1); }
.caret {
  width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
.dropdown.open .caret { transform: rotate(225deg) translateY(-2px); }

.dropdown { position: relative; }
.dd-menu {
  position: absolute; top: 64px; left: 0; min-width: 260px;
  background: var(--surface); border: 1px solid var(--hairline); border-top: 3px solid var(--red);
  clip-path: var(--cut);
  padding: 8px 0 14px;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .18s, transform .18s, visibility .18s;
  max-height: 70vh; overflow-y: auto;
}
.dd-menu-wide { min-width: 320px; }
.dropdown.open .dd-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dd-menu a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 18px; font-size: .92rem; color: var(--text-2);
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.dd-menu a:hover { background: rgba(255,255,255,.05); color: #fff; border-left-color: var(--red); }
.dd-key {
  font-weight: 900; font-style: italic; color: var(--red-bright);
  min-width: 1.4em; font-size: 1.02rem;
}
.dd-sub { margin-left: auto; font-size: .78rem; color: var(--text-3); font-weight: 600; }

.burger { display: none; }

/* ── start lights intro ─────────────────────────────────────────────── */
#lights {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 42px;
  transition: transform .55s cubic-bezier(.7, 0, .3, 1), opacity .4s;
}
#lights.out { transform: translateY(-100%); opacity: 0; pointer-events: none; }
#lights.gone { display: none; }
.lights-rig {
  display: flex; gap: 18px; padding: 22px 26px;
  background: #050508; border-radius: 14px; border: 1px solid #26262e;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.light-col { display: flex; flex-direction: column; gap: 14px; }
.pod {
  width: 54px; height: 54px; border-radius: 50%;
  background: #17171c; border: 2px solid #26262e;
  transition: none;
}
.light-col.lit .pod {
  background: radial-gradient(circle at 35% 30%, #ff6b57, var(--red) 60%, #8f0400);
  border-color: #ff3b2d;
  box-shadow: 0 0 28px 6px rgba(225, 6, 0, .55);
}
.lights-hint {
  color: var(--text-3); font-size: .95rem; letter-spacing: .35em; text-transform: uppercase;
  font-weight: 600;
}

/* ── generic page scaffolding ───────────────────────────────────────── */
#app { min-height: 70vh; outline: none; }
.page { animation: pageIn .45s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 {
  font-size: 1.6rem; font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .02em;
}
.section-head h2::before { content: "// "; color: var(--red-bright); font-style: normal; }
.section-head .sub { color: var(--text-3); font-size: .95rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}
.card-pad { padding: 22px 24px; }
.card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.card .hint { color: var(--text-3); font-size: .85rem; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal.revealed { opacity: 1; transform: none; }

/* ── hero ───────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 92px 0 74px;
  background:
    radial-gradient(1100px 420px at 82% -10%, rgba(225, 6, 0, .16), transparent 62%),
    radial-gradient(700px 300px at 8% 110%, rgba(225, 6, 0, .08), transparent 60%),
    var(--bg-deep);
  border-bottom: 1px solid var(--hairline);
}
.hero-stripes {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
}
.hero-stripes span {
  position: absolute; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(225,6,0,.8), transparent);
  animation: streak 3.2s linear infinite;
}
.hero-stripes span:nth-child(1) { top: 22%; width: 340px; animation-delay: 0s; }
.hero-stripes span:nth-child(2) { top: 45%; width: 220px; animation-delay: 1.1s; }
.hero-stripes span:nth-child(3) { top: 68%; width: 420px; animation-delay: 2s; }
.hero-stripes span:nth-child(4) { top: 84%; width: 180px; animation-delay: .6s; }
@keyframes streak { from { left: -30%; opacity: 0; } 12% { opacity: 1; } to { left: 108%; opacity: 0; } }

.hero-inner { position: relative; }
.hero-kicker {
  display: inline-block; margin-bottom: 18px; padding: 5px 14px;
  background: rgba(225,6,0,.14); border: 1px solid rgba(225,6,0,.4);
  clip-path: var(--cut-sm);
  color: var(--red-bright); font-weight: 700; font-size: .8rem; letter-spacing: .22em; text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .01em;
  max-width: 820px;
}
.hero h1 .accent { color: var(--red-bright); }
.hero p.lead {
  margin-top: 18px; max-width: 640px;
  color: var(--text-2); font-size: 1.12rem; line-height: 1.6;
}
.hero-math {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 20px;
  padding: 10px 18px 10px 10px; max-width: 640px;
  background: rgba(225,6,0,.08); border: 1px solid rgba(225,6,0,.3); border-radius: 8px;
  color: var(--text-2); font-size: .88rem; line-height: 1.5;
}
.hero-math-ico {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-weight: 900; font-style: italic; font-size: 1rem;
}
.hero-cta { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; clip-path: var(--cut-sm);
  font-weight: 700; font-size: .92rem; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; border: none;
  transition: transform .18s, filter .18s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.07); color: #fff; border: 1px solid var(--hairline); }
.btn .arrow { font-style: normal; transition: transform .18s; }
.btn:hover .arrow { transform: translateX(4px); }

.hero-stats { display: flex; gap: 0; margin-top: 52px; flex-wrap: wrap; }
.hstat { padding: 0 34px; border-left: 1px solid var(--hairline); }
.hstat:first-child { border-left: none; padding-left: 0; }
.hstat .v { font-size: 2.2rem; font-weight: 900; font-style: italic; color: #fff; }
.hstat .v em { font-style: italic; color: var(--red-bright); font-size: 1.2rem; }
.hstat .l { color: var(--text-3); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }

/* ── pillars ("what is") ────────────────────────────────────────────── */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pillar {
  position: relative; padding: 26px 24px;
  background: var(--surface); border: 1px solid var(--hairline);
  clip-path: var(--cut);
  transition: transform .22s, border-color .22s;
}
.pillar:hover { transform: translateY(-4px); border-color: rgba(225,6,0,.5); }
.pillar .num {
  font-size: 2.6rem; font-weight: 900; font-style: italic; color: rgba(255,255,255,.07);
  position: absolute; top: 8px; right: 20px;
}
.pillar h3 { font-size: 1.06rem; font-weight: 700; margin-bottom: 8px; }
.pillar h3::before { content: ""; display: inline-block; width: 18px; height: 3px; background: var(--red); margin-right: 10px; vertical-align: middle; }
.pillar p { color: var(--text-2); font-size: .92rem; line-height: 1.55; }

/* ── podium ─────────────────────────────────────────────────────────── */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 18px; align-items: end; }
.pod-card {
  position: relative; overflow: hidden;
  border-radius: 10px; clip-path: var(--cut);
  padding: 24px 22px 20px;
  min-height: 220px;
  display: flex; flex-direction: column;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--team) 42%, #14141c) 0%, #14141c 62%);
  border: 1px solid color-mix(in srgb, var(--team) 45%, transparent);
  transition: transform .25s cubic-bezier(.2,.7,.3,1);
}
.pod-card:hover { transform: translateY(-6px); }
.pod-card.first { min-height: 262px; }
.pod-card::after {                       /* sheen sweep */
  content: ""; position: absolute; top: 0; bottom: 0; width: 60%;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.08) 50%, transparent 70%);
  left: -80%; transition: left .6s ease;
}
.pod-card:hover::after { left: 120%; }
.pod-pos {
  font-size: 1.5rem; font-weight: 900; font-style: italic;
  color: #fff;
}
.pod-pos sup { font-size: .7rem; letter-spacing: .05em; }
.pod-name { margin-top: 8px; font-size: 1.35rem; line-height: 1.2; }
.pod-name .fn { font-weight: 400; display: block; font-size: 1rem; color: var(--text-2); }
.pod-name .ln { font-weight: 900; text-transform: uppercase; }
.pod-team { color: var(--text-2); font-size: .85rem; margin-top: 2px; }
.pod-bignum {
  position: absolute; right: 14px; top: 44px;
  font-size: 4.6rem; font-weight: 900; font-style: italic;
  color: color-mix(in srgb, var(--team) 55%, transparent);
  line-height: 1;
}
.pod-pts { margin-top: auto; padding-top: 18px; }
.pod-pts .v { font-size: 2.2rem; font-weight: 900; font-style: italic; }
.pod-pts .u { font-size: .78rem; color: var(--text-2); font-weight: 700; letter-spacing: .1em; }
.pod-delta { font-size: .8rem; margin-top: 4px; }

/* ── tables ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.di {
  width: 100%; border-collapse: collapse; font-size: .95rem;
  min-width: 680px;
}
table.di th {
  text-align: left; padding: 10px 14px;
  color: var(--text-3); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border-bottom: 2px solid var(--hairline);
  white-space: nowrap;
}
table.di th.num, table.di td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.di th.center { text-align: center; }
table.di td { padding: 11px 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
table.di tbody tr { transition: background .15s; }
table.di tbody tr:hover { background: rgba(255,255,255,.04); }
table.di tbody tr.muted { opacity: .45; }
table.di .pos { font-weight: 900; font-style: italic; font-size: 1.05rem; width: 2.4em; }
.tbar { display: inline-block; width: 4px; height: 1.15em; border-radius: 2px; margin-right: 10px; vertical-align: -0.18em; }
.drv { font-weight: 700; }
.drv small { color: var(--text-3); font-weight: 600; margin-left: 8px; }
.team-cell { color: var(--text-2); }
.ptscell { font-weight: 900; font-style: italic; font-size: 1.05rem; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px; font-size: .78rem; font-weight: 700;
}
.chip.up { background: rgba(43,217,124,.13); color: var(--good); }
.chip.down { background: rgba(255,82,82,.12); color: var(--bad); }
.chip.flat { background: rgba(255,255,255,.07); color: var(--text-3); }

/* micro rating bar inside table cells */
.rbar {
  position: relative; display: inline-block; vertical-align: middle;
  width: 110px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08);
  margin-right: 10px;
}
.rbar i {
  position: absolute; inset: 0 auto 0 0; border-radius: 3px;
  background: var(--red); width: 0;
  transition: width .8s cubic-bezier(.2,.7,.3,1);
}

/* heat cells (score tables) */
td.heat { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 52px; }
td.heat span { display: inline-block; min-width: 40px; padding: 3px 6px; border-radius: 6px; }
td.heat .nd { color: var(--text-3); font-weight: 400; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: #fff; }
th.sorted { color: var(--red-bright); }

/* ── charts ─────────────────────────────────────────────────────────── */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-grid .wide { grid-column: 1 / -1; }
/* race pages: charts always stacked, never side by side — dense tables/heatmaps
   need the full width to stay readable at any viewport size */
.chart-grid-stacked { grid-template-columns: 1fr; }
.chart-box { min-height: 380px; }
.chart-box .plot { width: 100%; height: 420px; }
.chart-box .plot.tall { height: 560px; }
.chart-box .plot.xtall { height: 680px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 22px 0; flex-wrap: wrap; }
.chart-head h3 { font-size: 1rem; font-weight: 700; }
.chart-head .hint { font-size: .8rem; color: var(--text-3); }

/* driver picker chips (evolution chart) */
.picker { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 22px 0; }
.pick {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px; border-radius: 18px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--hairline);
  color: var(--text-2); font-size: .8rem; font-weight: 700;
  transition: all .16s;
}
.pick .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #888); }
.pick.on { background: rgba(255,255,255,.1); color: #fff; border-color: var(--c, #888); }
.pick:hover { color: #fff; }

/* ── score pages ────────────────────────────────────────────────────── */
.score-hero {
  position: relative; overflow: hidden;
  padding: 64px 0 44px;
  background: radial-gradient(900px 360px at 88% -20%, rgba(225,6,0,.16), transparent 60%), var(--bg-deep);
  border-bottom: 1px solid var(--hairline);
}
.score-hero .watermark {
  position: absolute; right: 2%; top: 50%; transform: translateY(-52%);
  font-size: clamp(10rem, 26vw, 20rem); font-weight: 900; font-style: italic;
  color: rgba(255,255,255,.045); line-height: 1; pointer-events: none;
}
.score-kicker { color: var(--red-bright); font-weight: 700; letter-spacing: .22em; text-transform: uppercase; font-size: .8rem; }
.score-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 900; font-style: italic; text-transform: uppercase; margin-top: 6px; }
.score-hero p.desc { max-width: 660px; margin-top: 14px; color: var(--text-2); font-size: 1.04rem; line-height: 1.6; }

/* ── driver pages & the index ───────────────────────────────────────── */
.driver-hero {
  position: relative; overflow: hidden;
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--hairline);
  background:
    radial-gradient(1000px 460px at 86% -24%, color-mix(in srgb, var(--team, #E10600) 34%, transparent), transparent 64%),
    var(--bg-deep);
}
.driver-hero .watermark {
  position: absolute; right: 2%; top: 50%; transform: translateY(-52%);
  font-size: clamp(9rem, 24vw, 18rem); font-weight: 900; font-style: italic;
  color: color-mix(in srgb, var(--team, #fff) 14%, transparent); line-height: 1; pointer-events: none;
}
.driver-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 400; font-style: italic;
  text-transform: uppercase; margin-top: 8px;
}
.driver-hero h1 .ln { font-weight: 900; }
.driver-hero .hstat .v em { font-style: italic; color: var(--text-3); font-size: 1.1rem; }

.drvlink { display: inline-flex; align-items: center; cursor: pointer; }
.drvlink:hover .drv { color: var(--red-bright); }
.drvlink .drv { transition: color .15s; }

.strengths { display: flex; flex-direction: column; gap: 11px; padding: 16px 22px 24px; }
.strength { display: flex; align-items: center; gap: 12px; }
.strength .k { font-weight: 900; font-style: italic; color: var(--red-bright); width: 1.2em; font-size: 1.02rem; }
.strength .n { width: 148px; font-size: .84rem; color: var(--text-2); font-weight: 600; }
.strength .rbar { flex: 1; width: auto; margin-right: 0; }
.strength .v { font-weight: 900; font-style: italic; width: 3em; text-align: right; font-variant-numeric: tabular-nums; }
.strength:hover .n { color: #fff; }

.dd-lead { border-bottom: 1px solid var(--hairline); margin-bottom: 6px; padding-bottom: 12px !important; }
.dd-lead .dd-key { color: var(--red-bright); }

/* compare-with control + chart legends (driver page) */
.cmp-wrap {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-3); font-size: .82rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.cmp-select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface-2) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23B9B9C5' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: #fff; border: 1px solid var(--hairline); border-radius: 8px;
  padding: 8px 34px 8px 14px; cursor: pointer;
  font-family: var(--font); font-size: .88rem; font-weight: 600;
  letter-spacing: normal; text-transform: none;
  transition: border-color .15s;
  max-width: 300px;
}
.cmp-select:hover, .cmp-select:focus { border-color: var(--red); outline: none; }
.cmp-select option { background: var(--surface); color: var(--text); }

.chart-legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center;
  padding: 12px 22px 0;
  font-size: .84rem; font-weight: 700; color: var(--text-2);
}
.chart-legend .key { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend svg { width: 28px; height: 6px; flex: none; }

/* clickable variant (points-race chart): dims name + swatch together when a
   driver's line is toggled off, instead of only hiding the line with no cue */
.legend-clickable .key {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: var(--text-2); cursor: pointer;
  opacity: 1; transition: opacity .15s;
}
.legend-clickable .key:hover { color: #fff; }
.legend-clickable .key.off { opacity: .32; }

/* ── race pages ─────────────────────────────────────────────────────── */
.race-hero {
  position: relative; overflow: hidden;
  padding: 58px 0 40px;
  background: radial-gradient(900px 400px at 12% -30%, rgba(225,6,0,.18), transparent 62%), var(--bg-deep);
  border-bottom: 1px solid var(--hairline);
}
.race-crumb { display: flex; gap: 10px; align-items: center; color: var(--text-3); font-size: .84rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.race-crumb .rnd {
  background: var(--red); color: #fff; font-weight: 900; font-style: italic;
  padding: 2px 10px; clip-path: var(--cut-sm);
}
.race-hero h1 { font-size: clamp(1.9rem, 4.6vw, 3.2rem); font-weight: 900; font-style: italic; text-transform: uppercase; margin-top: 10px; }
.race-hero .meta { color: var(--text-2); margin-top: 6px; }
.race-nav { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.race-nav .btn { padding: 9px 18px; font-size: .8rem; }

.duo-podium { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-podium { padding: 18px 20px; }
.mini-podium h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mini-podium h3 .tag {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  padding: 3px 10px; border-radius: 4px;
}
.tag.di { background: rgba(225,6,0,.16); color: var(--red-bright); }
.tag.off { background: rgba(255,255,255,.08); color: var(--text-2); }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.mini-row:last-child { border-bottom: none; }
.mini-row .p { font-weight: 900; font-style: italic; width: 1.6em; color: var(--text-2); }
.mini-row .n { font-weight: 700; }
.mini-row .t { color: var(--text-3); font-size: .82rem; margin-left: auto; }

/* gallery */
.gal-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.gal-pill {
  padding: 7px 18px; border-radius: 20px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--hairline);
  color: var(--text-2); font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  transition: all .16s;
}
.gal-pill.on { background: var(--red); border-color: var(--red); color: #fff; }
/* always one analytics chart per row — a 2-up grid crushes these dense plots */
.gallery { display: grid; grid-template-columns: 1fr; gap: 18px; }
.gal-item {
  cursor: zoom-in; overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.gal-item:hover { transform: translateY(-3px); border-color: rgba(225,6,0,.5); }
.gal-item .imgwrap { background: var(--surface); overflow: hidden; border-bottom: 1px solid var(--hairline); }
.gal-item img { width: 100%; transition: transform .35s ease; }
.gal-item:hover img { transform: scale(1.02); }
.gal-item figcaption { display: block; padding: 14px 18px 18px; }
.gal-cat {
  display: inline-block; margin-bottom: 6px; padding: 2px 9px; border-radius: 20px;
  background: rgba(225,6,0,.14); color: var(--red-bright);
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.gal-title { display: block; font-size: .96rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.gal-desc { display: block; font-size: .85rem; line-height: 1.55; color: var(--text-2); }
.gal-empty { color: var(--text-3); font-size: .95rem; padding: 26px; text-align: center; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(8, 8, 12, .93); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox figure { max-width: min(1400px, 92vw); max-height: 88vh; display: flex; flex-direction: column; gap: 10px; }
.lightbox img { max-height: 80vh; width: auto; max-width: 100%; margin: 0 auto; border-radius: 8px; background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.lightbox figcaption { text-align: center; color: var(--text-2); font-weight: 600; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255,255,255,.08); border: 1px solid var(--hairline);
  color: #fff; cursor: pointer; border-radius: 50%;
  width: 46px; height: 46px; font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: var(--red); }
.lb-close { top: 22px; right: 26px; }
.lb-prev { left: 26px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 26px; top: 50%; transform: translateY(-50%); }

/* ── about ──────────────────────────────────────────────────────────── */
.prose { max-width: 760px; color: var(--text-2); line-height: 1.7; font-size: 1.02rem; }
.prose h3 { color: var(--text); margin: 30px 0 10px; font-weight: 700; }
.prose p + p { margin-top: 14px; }
.prose strong { color: var(--text); }

/* ── ticker ─────────────────────────────────────────────────────────── */
.ticker {
  overflow: hidden; border-bottom: 1px solid var(--hairline);
  background: var(--bg-deep);
  height: 38px; display: flex; align-items: center;
}
.ticker-track { display: flex; gap: 44px; white-space: nowrap; animation: tick 46s linear infinite; padding-left: 100%; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-100%); } }
.tick-item { font-size: .8rem; color: var(--text-3); font-weight: 600; letter-spacing: .04em; }
.tick-item b { color: var(--text); font-style: italic; }
.tick-item .rd { color: var(--red-bright); font-weight: 900; font-style: italic; }

/* ── footer ─────────────────────────────────────────────────────────── */
.site-footer { margin-top: 60px; border-top: 1px solid var(--hairline); background: var(--bg-deep); }
.foot-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 36px 24px;
  display: flex; gap: 40px; justify-content: space-between; flex-wrap: wrap;
}
.foot-brand p { color: var(--text-3); font-size: .85rem; margin-top: 6px; font-style: italic; }
.foot-meta { max-width: 560px; color: var(--text-3); font-size: .82rem; line-height: 1.6; }
.foot-meta strong { color: var(--text-2); }
.foot-disclaimer { margin-top: 8px; opacity: .8; }
.foot-notice { margin-top: 8px; color: var(--red-bright); opacity: .85; }

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .pillars, .podium, .duo-podium, .chart-grid { grid-template-columns: 1fr; }
  .podium { align-items: stretch; }
  .pod-card.first { order: -1; }
  .burger {
    display: flex; align-items: center; gap: 9px; margin-left: auto;
    background: none; border: none; cursor: pointer; padding: 8px;
    color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  }
  .burger-icon { display: flex; flex-direction: column; gap: 5px; }
  .burger-icon span { width: 24px; height: 2px; background: #fff; transition: transform .2s, opacity .2s; }
  .burger[aria-expanded="true"] .burger-icon span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger[aria-expanded="true"] .burger-icon span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] .burger-icon span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .main-nav {
    position: fixed; top: 64px; right: 0; bottom: 0; width: min(320px, 84vw);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-deep); border-left: 1px solid var(--hairline);
    padding: 12px 0; transform: translateX(100%); transition: transform .25s ease;
    overflow-y: auto; z-index: 95;
  }
  .main-nav.open { transform: none; }
  .main-nav > a, .dd-btn { height: 52px; width: 100%; justify-content: flex-start; }
  .dd-menu { position: static; opacity: 1; visibility: visible; transform: none; display: none; border: none; border-top: none; clip-path: none; background: rgba(255,255,255,.03); }
  .dropdown.open .dd-menu { display: block; }
  .hero-stats { gap: 22px; }
  .hstat { padding: 0 22px; }
}

/* ?noanim=1 — hard-off for every transition/animation (verification, print) */
html.no-anim *, html.no-anim *::before, html.no-anim *::after {
  transition: none !important; animation: none !important;
}

/* reduced motion: keep it calm */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
  #lights { display: none !important; }
}
