@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("/assets/fonts/outfit-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #07080c; --bg2: #0d0f15; --ink: #f4f1ea; --muted: #b9b5ab; --steel: #d5dde6;
  --red: #e10600; --amber: #ffb000; --green: #1fd16b; --line: rgba(244,241,234,.14);
  --bar: 60px;
  --serif: "Fraunces", Georgia, serif; --sans: "Outfit", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 8px); }
body { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: .5rem .8rem; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

/* ---------- Always-on header + slider ---------- */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--bar); padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: linear-gradient(to bottom, rgba(7,8,12,.92), rgba(7,8,12,.55)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }
.brand img { display: block; border-radius: 7px; }
.switch { position: relative; display: flex; align-items: center; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(13,15,21,.9); }
.switch .pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--ink); transition: transform .45s cubic-bezier(.6,.05,.2,1), width .45s cubic-bezier(.6,.05,.2,1); }
.switch .sw { position: relative; z-index: 1; border: 0; background: none; padding: .45rem 1rem; border-radius: 999px; font-weight: 600; font-size: .95rem; white-space: nowrap; transition: color .3s; }
.switch .sw.on { color: var(--bg); }
.switch .vs { position: relative; z-index: 1; padding: 0 .1rem; font-family: var(--serif); font-style: italic; color: var(--amber); font-size: .9rem; }
body[data-side="f1"] .switch .pill { background: var(--steel); }

/* ---------- Scenes ---------- */
main { padding-top: var(--bar); }
.side[hidden] { display: none; }
.stage { position: relative; height: calc(100vh - var(--bar)); height: calc(100svh - var(--bar)); overflow: hidden; background: radial-gradient(ellipse at 50% 120%, #1a0d10 0%, var(--bg) 60%); }
.sc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1rem 1.25rem 4.5rem; }
.big, .when, .date, .spots b, .podium b, .lineup li::before, .pos { font-feature-settings: "lnum" 1; font-variant-numeric: lining-nums; }
.big { font-family: var(--serif); font-weight: 700; font-size: clamp(2.8rem, 11vw, 7.5rem); line-height: .98; letter-spacing: -.02em; margin: 0; }
.mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.mask > span { display: inline-block; }
.amber { color: var(--amber); }
.sub, .kick { margin: 1rem 0 0; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; font-weight: 500; }
.kick { font-size: clamp(1rem, 3.4vw, 1.5rem); color: var(--steel); margin: .4rem 0; }
.date { font-family: var(--serif); font-weight: 800; font-size: clamp(5rem, 24vw, 15rem); line-height: .9; letter-spacing: -.04em; margin: 0; background: linear-gradient(180deg, var(--ink) 30%, #8e8a82); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flag { margin-top: 1.5rem; width: min(26rem, 80%); height: 34px; background: repeating-conic-gradient(var(--ink) 0 25%, var(--bg) 0 50%) 0 0 / 34px 34px; border: 1px solid var(--line); transform-origin: left center; }

.rig { display: flex; gap: clamp(.5rem, 2.4vw, 1.1rem); margin-bottom: 2rem; padding: 1rem 1.1rem; background: #111319; border: 1px solid var(--line); border-radius: 18px; }
.pod { display: flex; flex-direction: column; gap: .5rem; padding: .4rem; background: #06070a; border-radius: 12px; }
.pod i { display: block; width: clamp(34px, 9vw, 78px); aspect-ratio: 1; border-radius: 50%; background: #1a1c22; box-shadow: inset 0 0 0 2px rgba(255,255,255,.04); transition: background .12s, box-shadow .12s; }
.pod.red i { background: var(--red); box-shadow: 0 0 28px rgba(225,6,0,.75), inset 0 0 12px rgba(255,255,255,.25); }
.rig.go .pod i { background: var(--green); box-shadow: 0 0 28px rgba(31,209,107,.7), inset 0 0 12px rgba(255,255,255,.25); }

.sc-karts { padding-bottom: 4rem; }
.track { width: min(100%, 900px); height: auto; max-height: 58%; overflow: visible; }
.asphalt { fill: none; stroke: #20232c; stroke-width: 64; stroke-linejoin: round; }
.trail { fill: none; stroke: var(--red); stroke-width: 4; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .85; }
.kart { transform-box: fill-box; }
.over { text-align: center; margin-top: 1rem; }
.over.top { margin: 0 0 1rem; }
.over .big { font-size: clamp(2.6rem, 10vw, 6.5rem); }

.hint { position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); display: grid; justify-items: center; gap: .4rem; color: var(--muted); font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; pointer-events: none; }
.hint i { width: 1px; height: 28px; background: linear-gradient(var(--ink), transparent); animation: drip 1.6s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.skipdown { position: absolute; right: 1rem; bottom: 1rem; font-size: .8rem; color: var(--muted); text-decoration: none; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(7,8,12,.6); }
.skipdown:hover { color: var(--ink); }

/* ---------- Fantasy scenes ---------- */
.sc-race { justify-content: center; }
.chart { width: min(100%, 980px); height: auto; flex: 0 1 auto; max-height: 56%; overflow: visible; }
.legend { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.1rem; margin: 1rem 0 0; padding: 0; font-size: .85rem; color: var(--muted); }
.legend li::before { content: ''; display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); margin-right: .4rem; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .28; stroke-dasharray: 1; stroke-dashoffset: 1; }
.chart .ln.hi { stroke-width: 4; opacity: 1; }
.chart .dot { opacity: 0; }
#rnd { color: var(--ink); font-weight: 700; }
.podium { list-style: none; margin: 1.5rem 0 0; padding: 0; width: min(36rem, 100%); display: grid; gap: .7rem; text-align: left; }
.podium li { position: relative; display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .8rem; align-items: baseline; padding: .75rem 1rem .95rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(13,15,21,.8); overflow: hidden; }
.podium .pos { font-family: var(--serif); color: var(--amber); font-weight: 700; }
.podium .tm { font-weight: 600; }
.podium b { font-family: var(--serif); font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.podium i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--w); background: linear-gradient(90deg, var(--amber), var(--red)); transform-origin: left; }
.podium li.me { opacity: .85; border-style: dashed; }
.podium li.me i { background: var(--steel); }

/* ---------- Core block (the thing that matters) ---------- */
.core, .film { max-width: 44rem; margin: 0 auto; padding: 4.5rem 1.25rem 3rem; text-align: center; }
.eyebrow { margin: 0; color: var(--amber); letter-spacing: .24em; text-transform: uppercase; font-size: .8rem; font-weight: 600; }
.when { font-family: var(--serif); font-weight: 700; font-size: clamp(2.2rem, 8.4vw, 4.2rem); line-height: 1.04; letter-spacing: -.02em; margin: .6rem 0 .5rem; }
.when em { color: var(--red); font-style: normal; }
.where { margin: 0; font-size: 1.25rem; color: var(--steel); }
.lineup-head { margin-top: 3rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .7rem; }
.lineup-head h3 { margin: 0; font-size: .95rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.spots { margin: 0; font-size: 1.1rem; }
.spots b { font-family: var(--serif); font-size: 2.1rem; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.spots.low b { color: var(--amber); }
.spots.none b { color: var(--red); }
.lineup { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .9rem; text-align: left; counter-reset: p; }
.lineup li { counter-increment: p; display: flex; align-items: center; gap: .6rem; min-height: 3rem; padding: .5rem .8rem; border-radius: 12px; border: 1px dashed rgba(244,241,234,.16); color: rgba(244,241,234,.28); font-size: 1rem; overflow: hidden; }
.lineup li::before { content: "P" counter(p); font-family: var(--serif); font-weight: 700; font-size: .85rem; color: inherit; min-width: 2rem; }
.lineup li:nth-child(even) { transform: translateY(1.1rem); }
.lineup li.on { border-style: solid; border-color: var(--line); background: #11131a; color: var(--ink); font-weight: 600; }
.lineup li.on::before { color: var(--amber); }
.lineup li.pend { opacity: .75; }
.lineup li .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup li.open .n { font-weight: 400; font-size: .9rem; }
.lineup { padding-bottom: 1.2rem; }
.action { margin-top: 2.6rem; }
.cta { width: 100%; border: 0; border-radius: 18px; padding: 1.35rem 1.5rem; font-family: var(--serif); font-weight: 700; font-size: clamp(1.4rem, 5.4vw, 2rem); letter-spacing: -.01em; color: #04110a; background: var(--green); box-shadow: 0 0 0 0 rgba(31,209,107,.5); animation: pulse 2.4s ease-out infinite; transition: transform .2s; }
.cta:hover { transform: translateY(-2px); }
.cta[aria-expanded="true"] { display: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,209,107,.45); } 100% { box-shadow: 0 0 0 22px rgba(31,209,107,0); } }
.join { display: flex; flex-direction: column; gap: .7rem; }
.join[hidden], .full[hidden] { display: none; }
.join input[type=text]:not(.hp) { width: 100%; padding: 1.2rem 1.2rem; border-radius: 16px; border: 2px solid var(--ink); background: #0d0f15; font-size: 1.4rem; text-align: center; }
.join input:focus { outline: none; border-color: var(--green); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.join .go { border: 0; border-radius: 16px; padding: 1.1rem; font-weight: 700; font-size: 1.2rem; color: #04110a; background: var(--green); }
.join .go[disabled] { opacity: .6; }
.full { margin: 0; font-family: var(--serif); font-weight: 800; font-size: clamp(2rem, 9vw, 3.4rem); display: flex; align-items: center; justify-content: center; gap: .8rem; color: var(--ink); }
.chq { width: 2.4rem; height: 2.4rem; background: repeating-conic-gradient(var(--ink) 0 25%, var(--bg) 0 50%) 0 0 / 1.2rem 1.2rem; border: 1px solid var(--line); }
.msg { min-height: 1.4rem; margin: .8rem 0 0; color: var(--muted); font-size: .98rem; }
.msg.err { color: #ff8b84; }
.fine { color: var(--muted); font-size: .85rem; line-height: 1.6; margin: 2.2rem 0 0; opacity: .85; }

/* ---------- Film ---------- */
.film { padding-top: 4rem; }
.reel { position: relative; margin: 1.8rem auto 0; width: min(20rem, 78%); aspect-ratio: 9 / 16; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.reel video { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; border: 0; background: linear-gradient(to top, rgba(7,8,12,.45), transparent 50%); }
.play svg { width: 5rem; height: 5rem; padding: 1.3rem 1.1rem 1.3rem 1.5rem; border-radius: 50%; fill: var(--bg); background: var(--ink); transition: transform .25s; }
.play:hover svg { transform: scale(1.08); }
.reel.playing .play { display: none; }

.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem 3rem; opacity: .6; }

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  :root { --bar: 56px; }
  .brand span { display: none; }
  .bar { justify-content: center; }
  .switch { width: 100%; max-width: 22rem; justify-content: space-between; }
  .switch .sw { flex: 1; padding: .5rem .4rem; font-size: .92rem; }
  .lineup li { padding: .45rem .65rem; font-size: .95rem; }
  .skipdown { right: .7rem; bottom: .8rem; }
  .hint { display: none; }
}
@media (min-width: 900px) {
  .lineup { grid-template-columns: 1fr 1fr 1fr; }
  .lineup li:nth-child(even) { transform: none; }
  .lineup li:nth-child(3n+2) { transform: translateY(1.1rem); }
  .core { max-width: 52rem; }
}

/* ---------- Reduced motion: stacked, static, complete ---------- */
.reduced .stage { height: auto; overflow: visible; }
.reduced .sc { position: relative; inset: auto; min-height: 70svh; padding-bottom: 2rem; }
.reduced .hint, .reduced .skipdown { display: none; }
.reduced .chart .ln { stroke-dashoffset: 0; }
.reduced .chart .dot { opacity: 1; }
.reduced .cta { animation: none; }
.reduced .hint i { animation: none; }

/* Fraunces' flat-topped 3 reads like a 5 at display size: set every functional number in Outfit. */
.time, .spots b, .podium b, .podium .pos, .lineup li::before { font-family: var(--sans); }
.time { font-weight: 700; letter-spacing: -.01em; }
.spots b { font-weight: 700; }
.podium .pos { font-weight: 700; }
