/* Layout concept: one continuous 3D take. A fixed WebGL stage (a villa at blue hour, a platform gate,
   a stream of travellers) under a fixed text layer; scrolling only drives the camera through
   Strategy, The Film, The Season and Results, then an opaque contact section slides over it.
   Deliberately single-theme: the whole page is a night frame. */
:root {
  --display: "Noto Serif Display", "GFS Didot", "Didot", "Bodoni 72", "Times New Roman", serif;
  --body: "Commissioner", "Helvetica Neue", Arial, sans-serif;

  --ink: #07090c;
  --stone: #ece7dd;
  --mute: #a19c93;
  --line: rgba(236,231,221,.16);
  --blue: #5b93d1;
  --blue-hi: #9cc4f0;
  --amber: #e3a66b;

  --ease: cubic-bezier(.2,.7,.1,1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--ink); color: var(--stone);
  font: 350 1.0625rem/1.7 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; }
::selection { background: var(--blue); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
h1, h2 { font-family: var(--display); font-weight: 300; margin: 0; line-height: 1.1; letter-spacing: -.012em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button { font-family: inherit; }
.label {
  font: 500 .7rem/1.2 var(--body); letter-spacing: .22em; text-transform: uppercase; color: var(--mute);
  display: inline-flex; align-items: center; gap: .9rem;
}
.label::before { content: ""; flex: none; width: 2.2rem; height: 1px; background: var(--blue); }

/* ---------- stage ---------- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
html.no3d body { background: linear-gradient(rgba(7,9,12,.5), rgba(7,9,12,.7)), url(../img/hero.webp) 62% center / cover fixed, #0a1323; }
html.no3d #gl, html.no3d .labels, html.no3d .game { display: none; }

.fx { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.fx .scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,5,8,.86) 0%, rgba(4,5,8,.55) 32%, rgba(4,5,8,0) 58%); }
.fx .vig { position: absolute; inset: 0; background: radial-gradient(ellipse 90% 80% at 58% 52%, transparent 52%, rgba(3,4,6,.72) 100%); }
.fx .grain { position: absolute; inset: -50%; opacity: .085; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: no-preference) {
  .fx .grain { animation: grain 1s steps(6) infinite; }
  @keyframes grain { 0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); } }
}
.lb { position: absolute; left: 0; right: 0; height: 0; background: #000; overflow: hidden; display: flex; align-items: center; }
.lb.t { top: 0; } .lb.b { bottom: 0; }
.hudrow { width: 100%; display: flex; justify-content: space-between; gap: 1rem; padding-left: max(20px, env(safe-area-inset-left, 0px), 5vw); padding-right: max(20px, env(safe-area-inset-right, 0px), 5vw); font: 400 .64rem/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: #8a857d; font-variant-numeric: tabular-nums; opacity: 0; }
.lb.t .hudrow { padding-top: env(safe-area-inset-top, 0px); }
.rec { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #d14b45; margin-right: .6rem; vertical-align: -.05rem; }
@media (prefers-reduced-motion: no-preference) { .rec { animation: blink 1.2s steps(2) infinite; } @keyframes blink { 50% { opacity: .2; } } }

/* ---------- 3D labels ---------- */
.labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; font: 500 .66rem/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--stone); opacity: 0; padding-bottom: .7rem; will-change: transform, opacity; text-shadow: 0 0 10px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.9); }
.lbl::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: .5rem; background: currentColor; opacity: .6; }
.lbl.ota { color: var(--amber); } .lbl.site { color: var(--blue-hi); } .lbl.tag { color: var(--blue-hi); }
.lbl.tag { white-space: normal; width: max-content; max-width: 10.5rem; text-align: center; line-height: 1.45; }
.lbl.below { padding: .7rem 0 0; } .lbl.below::after { bottom: auto; top: 0; }
@media (max-width: 760px) { .lbl.tag { font-size: .58rem; letter-spacing: .14em; max-width: 7.5rem; } }
.lbl.month { padding: 0; letter-spacing: .1em; color: #c9c3b8; font-size: .62rem; text-transform: none; }
.lbl.month::after { display: none; }
.hint { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; }
.hint i { position: absolute; left: -1px; top: -46px; width: 2px; height: 92px; background: linear-gradient(transparent, var(--blue-hi), transparent); }
.hint b { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border: 1px solid var(--blue-hi); border-radius: 50%; }
.hint span { position: absolute; left: 18px; top: -.4rem; white-space: nowrap; font: 500 .66rem/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--blue-hi); }
@media (prefers-reduced-motion: no-preference) {
  .hint i { animation: swipe 1.9s var(--ease) infinite; }
  .hint b { animation: ping 1.9s ease-out infinite; }
  @keyframes swipe { 0% { transform: translateY(-34px) scaleY(.15); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(34px) scaleY(1); opacity: 0; } }
  @keyframes ping { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
}
#slice { position: fixed; inset: 0; z-index: 4; pointer-events: none; }

/* pointer-specific wording */
.tch { display: none; }
@media (hover: none) and (pointer: coarse) { .tch { display: inline; } .dsk { display: none; } }

/* ---------- header ---------- */
.top { position: fixed; left: 0; right: 0; top: 0; z-index: 10; padding-top: env(safe-area-inset-top, 0px); background: linear-gradient(rgba(4,5,8,.6), rgba(4,5,8,0)); transition: background .5s var(--ease); }
.top.solid { background: rgba(7,9,12,.9); backdrop-filter: blur(12px); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; padding-left: max(20px, env(safe-area-inset-left, 0px), 5vw); padding-right: max(20px, env(safe-area-inset-right, 0px), 5vw); }
.logo { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--stone); }
.logo .mk { width: 2.1rem; height: 2.1rem; flex: none; }
.logo .name { font: 400 .74rem/1 var(--body); letter-spacing: .34em; text-transform: uppercase; white-space: nowrap; }
.logo .name b { font-weight: 600; }
.top nav { display: flex; align-items: center; gap: 1.6rem; }
.top nav a.cta { text-decoration: none; font-size: .86rem; letter-spacing: .04em; color: var(--stone); border-bottom: 1px solid var(--blue); padding-bottom: .2rem; }
.langsw { display: inline-flex; gap: .15rem; border: 1px solid var(--line); padding: .15rem; }
.langsw button { background: transparent; border: 0; color: var(--mute); cursor: pointer; font: 500 .68rem/1 var(--body); letter-spacing: .14em; padding: .45rem .55rem; }
.langsw button:hover { color: var(--stone); }
.langsw button[aria-pressed="true"] { background: var(--stone); color: var(--ink); }
.top nav a.cta .cta-s { display: none; }
@media (max-width: 560px) { .top nav { gap: .9rem; } .top nav a.cta { font-size: .8rem; white-space: nowrap; } .top nav a.cta .cta-l { display: none; } .top nav a.cta .cta-s { display: inline; } .logo .name { font-size: .62rem; letter-spacing: .22em; } .logo .mk { width: 1.8rem; height: 1.8rem; } }
@media (max-width: 380px) { .top nav { gap: .6rem; } .logo { gap: .55rem; } .logo .name { font-size: .54rem; letter-spacing: .14em; } .langsw button { padding: .45rem .45rem; } }

/* ---------- chapter rail ---------- */
.rail { position: fixed; right: max(20px, env(safe-area-inset-right, 0px), 3vw); top: 50%; transform: translateY(-50%); z-index: 5; display: grid; gap: 1rem; opacity: 0; transition: opacity .5s; pointer-events: none; }
.rail.show { opacity: 1; pointer-events: auto; }
.rail button { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; background: none; border: 0; color: var(--mute); cursor: pointer; font: 500 .64rem/1 var(--body); letter-spacing: .18em; text-transform: uppercase; padding: .25rem 0; }
.rail button span { opacity: 0; transform: translateX(6px); transition: opacity .4s, transform .4s; }
.rail button i { width: 1.4rem; height: 1px; background: currentColor; transition: width .4s var(--ease), background .4s; }
.rail button.on { color: var(--stone); }
.rail button.on i { width: 2.8rem; background: var(--blue); }
.rail button.on span, .rail button:hover span, .rail button:focus-visible span { opacity: 1; transform: none; }
@media (max-width: 760px) { .rail { display: none; } }

/* ---------- text layer ---------- */
.panels { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.panel, .hero-ui { position: absolute; inset: 0; opacity: 0; will-change: opacity, transform; }
.hero-ui { opacity: 1; }
.gut { padding-left: max(20px, env(safe-area-inset-left, 0px), 5vw); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

.hero-top { position: absolute; left: 0; top: clamp(6.5rem, 17vh, 11rem); width: min(44rem, 52vw); }
.hero-top h1 { margin-top: 1.3rem; font-size: clamp(2rem, 3.7vw, 3.8rem); line-height: 1.1; }
.hero-top h1 em { font-style: italic; color: #f0d6ae; }
.game { position: absolute; left: 0; bottom: clamp(2.2rem, 8vh, 5.5rem); width: min(27rem, 44vw); display: grid; gap: .9rem; }
.on .game { pointer-events: auto; }
.tick { display: flex; align-items: baseline; gap: .8rem; font-size: .9rem; color: #cfc9be; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.tick .dot { flex: none; width: .5rem; height: .5rem; border-radius: 50%; transform: translateY(-.05rem); }
.tick.paid .dot { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.tick.kept .dot { background: var(--blue-hi); box-shadow: 0 0 12px var(--blue-hi); }
.tick b { margin-left: auto; font: 300 1.5rem/1 var(--display); color: var(--stone); font-variant-numeric: lining-nums tabular-nums; }
.tick.kept { opacity: 0; transform: translateY(6px); }
.game.cut .tick.kept { opacity: 1; transform: none; }
.game.cut .tick.paid { opacity: .55; }
.game .prompt { font-size: .98rem; color: #ddd7cc; max-width: 40ch; border-top: 1px solid var(--line); padding-top: .9rem; }
.game .post, .game.cut .pre { display: none; }
.game.cut .post { display: block; }
.game .gbtns { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; }
.game.cut .gbtns .pre { display: none; }
.game:not(.cut) .gbtns .post { display: none; }
.game .fine { font-size: .74rem; color: var(--mute); letter-spacing: .02em; }
.btn {
  display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; cursor: pointer;
  font: 500 .88rem/1 var(--body); letter-spacing: .06em;
  padding: .95rem 1.4rem; color: var(--ink); background: var(--stone); border: 0;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover { background: var(--blue); color: var(--ink); }
.btn:hover .arr { transform: translateY(3px); }
.ghost { background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--mute); padding: .2rem 0; cursor: pointer; font: 400 .85rem/1.2 var(--body); letter-spacing: .04em; }
.ghost:hover { color: var(--stone); border-color: var(--blue); }
.cue { position: absolute; left: 50%; bottom: clamp(1.4rem, 4vh, 2.4rem); transform: translateX(-50%); font: 500 .62rem/1 var(--body); letter-spacing: .3em; text-transform: uppercase; color: var(--mute); display: grid; justify-items: center; gap: .7rem; }
.cue::after { content: ""; width: 1px; height: 2.4rem; background: linear-gradient(var(--stone), transparent); opacity: .6; }
@media (prefers-reduced-motion: no-preference) { .cue::after { animation: cue 2.4s ease-in-out infinite; transform-origin: top; } @keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } } }

.panel .inner { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: min(33rem, 42vw); display: grid; gap: 1.2rem; }
.panel.on .inner { pointer-events: auto; }
.num { font: 300 italic clamp(3.4rem, 6vw, 5.6rem)/0.9 var(--display); color: var(--blue-hi); opacity: .9; }
.panel h2 { font-size: clamp(2.2rem, 4.2vw, 3.8rem); }
.panel p { color: #d6d0c5; font-size: 1.06rem; max-width: 40ch; }
@media (min-width: 761px) { #p2 .inner { left: auto; right: clamp(6rem, 10vw, 10rem); } }
.panel .inner, .hero-top { text-shadow: 0 1px 18px rgba(0,0,0,.55); }

.panel .fine { font-size: .76rem; color: var(--mute); max-width: 46ch; }

@media (max-width: 760px) {
  .fx .scrim { background: linear-gradient(180deg, rgba(4,5,8,.62) 0%, rgba(4,5,8,0) 32%, rgba(4,5,8,0) 42%, rgba(4,5,8,.86) 72%); }
  .hero-top { top: clamp(5.6rem, 13vh, 8rem); width: auto; right: 0; }
  .hero-top h1 { font-size: clamp(1.7rem, 7.2vw, 2.4rem); }
  .game { width: auto; right: 0; bottom: max(1.4rem, env(safe-area-inset-bottom, 0px)); gap: .7rem; }
  .cue { display: none; }
  .panel .inner { top: auto; bottom: max(2rem, env(safe-area-inset-bottom, 0px)); transform: none; width: auto; right: 0; gap: .8rem; }
  .num { font-size: 2.8rem; }
  .panel h2 { font-size: clamp(2rem, 8.4vw, 2.6rem); }
  .panel p { font-size: 1rem; }
}

/* ---------- scroll spacers + contact ---------- */
main { position: relative; z-index: 1; }
.space { display: block; }
#hero { height: 100vh; height: 100svh; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; }
#ch1 { height: 170vh; } #ch2 { height: 190vh; } #ch3 { height: 180vh; } #ch4 { height: 300vh; }

#contact { position: relative; padding-top: 38vh; background: linear-gradient(180deg, rgba(7,9,12,0) 0, rgba(7,9,12,.85) 22vh, var(--ink) 38vh); }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 3.5rem 5rem; align-items: start; padding-bottom: clamp(5rem, 10vw, 8rem); }
.contact h2 { font-size: clamp(2.5rem, 5.6vw, 4.6rem); max-width: 14ch; margin-top: 1.4rem; }
.contact h2 em { font-style: italic; color: #c8d9ee; }
.contact .lead { margin-top: 1.6rem; max-width: 52ch; color: #c2bcb1; font-size: 1.08rem; }
.contact form { display: grid; gap: 1.6rem; min-width: 0; }
.contact .f { display: grid; gap: .3rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.contact input[type="text"], .contact select, .contact textarea {
  width: 100%; background: transparent; color: var(--stone); border: 0; border-bottom: 1px solid rgba(236,231,221,.3); border-radius: 0;
  font: 350 1.05rem var(--body); letter-spacing: 0; text-transform: none; padding: .6rem 0;
}
.contact select option { background: var(--ink); }
.contact textarea { min-height: 7rem; resize: vertical; }
.contact input:focus, .contact select:focus, .contact textarea:focus { border-color: var(--blue); }
.contact .who { margin-top: 2.2rem; max-width: 52ch; }
.contact .who ul { list-style: none; margin-top: .9rem; display: grid; gap: .65rem; padding: 0; }
.contact .who li { position: relative; padding-left: 1.3rem; color: #c2bcb1; font-size: .98rem; line-height: 1.5; }
.contact .who li::before { content: ""; position: absolute; left: 0; top: .72em; width: .7rem; height: 1px; background: var(--blue); }
.contact .meta { margin-top: 2.4rem; display: grid; gap: .3rem; font-size: .95rem; color: #b3ada2; }
#status { font-size: .92rem; color: #d3cdc2; min-height: 1.4em; }
#brief { white-space: pre-wrap; border: 1px solid var(--line); padding: 1rem; font: 350 .88rem/1.6 var(--body); color: #d3cdc2; margin: 0; }
footer { position: relative; z-index: 1; background: var(--ink); border-top: 1px solid var(--line); padding-block: 2.6rem; color: var(--mute); font-size: .85rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; justify-content: space-between; }
footer .logo .mk { width: 1.8rem; height: 1.8rem; }
