/* Starter styles. Rebrand everything in :root first; the layout rules below are the parts
   the engine depends on (journey layer, bands, scrub stage, slams, drawer). */
:root {
  --navy: #0E1A2B;
  --slate: #2B3A4A;
  --amber: #F2A33A;
  --amber-soft: #F6BB64;
  --aqua: #5ED3E0;
  --paper: #F8F6F2;
  --paper-2: #EEEAE1;
  --ink: #0E1A2B;
  --ink-soft: #2B3A4A;
  --line: rgba(14, 26, 43, .12);
  --line-dark: rgba(255, 255, 255, .14);
  --bg: var(--paper);
  --accent: var(--amber);
  --b0: var(--paper);  --b1: var(--amber);  --b2: var(--paper-2);  --b3: var(--navy);  --b4: var(--navy);
  --display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --text: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Consolas", monospace;
  --gutter: clamp(18px, 4vw, 64px);
  --col: min(560px, calc(100vw - 2 * var(--gutter)));
  --radius: 14px;
  --radius-lg: 22px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
html, body { overflow-x: clip; }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--text); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Nav ---------- */
.nav { position: fixed; z-index: 50; top: 14px; left: 50%; translate: -50% 0; width: min(1240px, calc(100% - 2 * var(--gutter)));
  display: flex; align-items: center; gap: 22px; padding: 8px 8px 8px 20px; border-radius: 14px;
  background: rgba(13, 15, 18, .72); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); color: #fff; }
.mark { font: 400 22px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
.links { display: flex; gap: 20px; margin-left: auto; }
.links a { font-size: 14px; opacity: .75; text-decoration: none; }
.links a:hover { opacity: 1; }

.btn { position: relative; display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; border-radius: 11px; padding: 12px 18px; font-weight: 600; white-space: nowrap; text-decoration: none; transition: transform .2s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #111; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.line { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.big { padding: 18px 28px; font-size: 17px; border-radius: 14px; }
.btn.wide { width: 100%; justify-content: center; padding: 18px; }

/* ---------- The traveling subject ---------- */
.journey { position: fixed; z-index: 20; top: 0; left: 50%; width: var(--col); height: 100vh; translate: -50% 0; pointer-events: none;
  will-change: transform; transform-origin: 50% 0; filter: drop-shadow(0 26px 28px rgba(0, 0, 0, .3)); }
.journey canvas { width: 100%; height: 100%; display: block; }
.loading { position: fixed; left: 50%; bottom: 30px; translate: -50% 0; z-index: 60; font-size: 13px; opacity: .7; transition: opacity .6s; }
.loading.done { opacity: 0; }

/* ---------- Bands: a normal scrolling page in flat color ---------- */
.band { position: relative; min-height: 165vh; display: flex; align-items: center; padding: 0 var(--gutter); overflow: hidden; }
.band.short { min-height: 100vh; }
.b0 { background: var(--b0); align-items: flex-start; padding-top: 24vh; }
.b0 .giant { top: 82vh; }
.b1 { background: var(--b1); color: #111; }
.b2 { background: var(--b2); color: #111; }
.b3 { background: var(--b3); }
.b4 { background: var(--b4); }
/* copy sits beside the subject column, never behind it */
.copy { position: relative; z-index: 25; width: min(36ch, calc(50vw - var(--col) / 2 - var(--gutter) - 24px)); }
.copy.left { margin-right: auto; }
.copy.right { margin-left: auto; text-align: right; }
.copy.center { margin: 0 auto; text-align: center; width: min(40ch, 100%); }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--accent); margin-bottom: 16px; }
h1 { font: 400 clamp(52px, 7vw, 116px)/.95 var(--display); text-transform: uppercase; }
h2 { font: 400 clamp(36px, 4.6vw, 76px)/1 var(--display); text-transform: uppercase; }
.copy p { margin-top: 16px; opacity: .88; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.copy.right .ctas { justify-content: flex-end; }
.copy.center .ctas { justify-content: center; }

.giant { position: absolute; z-index: 0; left: 50%; top: 60%; translate: calc(-50% + var(--dx, 0px)) -50%; white-space: nowrap; pointer-events: none; user-select: none;
  font: 400 clamp(120px, 20vw, 380px)/.8 var(--display); text-transform: uppercase; color: color-mix(in srgb, var(--accent) 22%, transparent); }

.reveal > * { opacity: 0; transform: translateY(40px); transition: opacity .8s, transform .8s cubic-bezier(.2, .8, .2, 1); }
.reveal.in > * { opacity: 1; transform: none; }
.reveal.in > *:nth-child(2) { transition-delay: .08s; } .reveal.in > *:nth-child(3) { transition-delay: .16s; } .reveal.in > *:nth-child(4) { transition-delay: .24s; }

/* ---------- Scrub sections: tall track, sticky full-screen stage ---------- */
.scrub { position: relative; height: 420vh; background: #000; }
.stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.slam { position: absolute; z-index: 2; left: var(--gutter); bottom: 12vh; max-width: 90vw; color: #fff; opacity: 0; transform: scale(1.5); filter: blur(14px);
  transition: opacity .35s, transform .5s cubic-bezier(.2, 1.4, .3, 1), filter .35s; text-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.slam[data-k="1"] { left: auto; right: var(--gutter); text-align: right; }
.slam[data-k="2"] { left: 50%; translate: -50% 0; text-align: center; }
.slam b { display: block; font: 400 clamp(140px, 24vw, 440px)/.85 var(--display); }
.slam span { display: block; margin-top: 10px; font-size: clamp(16px, 1.6vw, 22px); font-weight: 600; }
.slam.on { opacity: 1; transform: none; filter: none; }
.slam.gone { opacity: 0; transform: scale(.85) translateY(-6vh); filter: blur(10px); }

.foot { padding: 40px var(--gutter) 120px; font-size: 14px; opacity: .7; text-align: center; background: var(--b4); }

/* ---------- Sticky CTA pill + lead drawer ---------- */
.pill { position: fixed; z-index: 45; left: 50%; bottom: 18px; translate: -50% 140%; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 16px;
  background: rgba(13, 15, 18, .85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; font-size: 14px; transition: translate .5s cubic-bezier(.2, .8, .2, 1); }
.pill.on { translate: -50% 0; }
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 80; top: 0; right: 0; height: 100%; width: min(440px, 100%); background: var(--bg); color: var(--ink); padding: 64px 28px 28px; overflow-y: auto;
  transform: translateX(100%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.drawer.open { transform: none; }
.drawer h2 { font-size: 44px; margin-bottom: 20px; }
.x { position: absolute; top: 18px; right: 20px; background: none; border: 0; cursor: pointer; opacity: .7; }
.fld { display: block; margin-bottom: 14px; }
.fld span { display: block; font-size: 13px; opacity: .7; margin-bottom: 6px; }
.fld input, .fld textarea { width: 100%; padding: 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); }
.err { min-height: 22px; color: #ff8a7a; font-size: 14px; margin: 4px 0 10px; }

/* ---------- Phones: subject in the lower half, words on top ---------- */
@media (max-width: 760px) {
  .links { display: none; }
  .nav .btn { margin-left: auto; }
  .band { align-items: flex-start; padding-top: 16vh; }
  .copy, .copy.left, .copy.right { width: 100%; margin: 0; text-align: left; }
  .copy.right .ctas { justify-content: flex-start; }
  .giant, .b0 .giant { font-size: 19vw; top: 88%; }
  .b0 { padding-top: 14vh; }
  .slam b { font-size: 34vw; }
  .slam, .slam[data-k="1"], .slam[data-k="2"] { left: var(--gutter); right: auto; translate: none; text-align: left; bottom: 14vh; }
  .pill > span { display: none; }
  .stage .rail { top: 84px; bottom: auto; }   /* the sticky pill owns the bottom of a phone screen */
}
@media (prefers-reduced-motion: reduce) {
  .reveal > *, .slam { transition: none; }
}

/* ---------- Scrub extras ---------- */
.rail { position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 26px; display: flex; justify-content: space-between; padding-top: 14px;
  border-top: 2px solid rgba(255, 255, 255, .18); font-size: 12px; font-weight: 600; letter-spacing: .04em; color: rgba(255, 255, 255, .45); }
.rail i { position: absolute; left: 0; top: -2px; height: 2px; background: var(--accent); }
.rail span { transition: color .3s; }
.rail span.on { color: #fff; }
/* letterbox layout: the shot shrinks to 21:9 between hits and bursts open while a stat is on */
.scrub[data-layout="letterbox"] canvas { clip-path: inset(calc(var(--lb, 1) * 22vh) 0); transition: clip-path .5s cubic-bezier(.2, .8, .2, 1); }
.scrub[data-layout="letterbox"]:has(.slam.on) canvas { --lb: 0; }
/* porthole layout: the shot plays inside a circle that grows with scroll */
.scrub[data-layout="porthole"] canvas { clip-path: circle(calc(18% + var(--p, 0) * 70%) at 50% 50%); }

/* ---------- Extras (extras.js) ---------- */
.compare { position: relative; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; touch-action: none; cursor: ew-resize; user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .knob { position: absolute; top: 0; bottom: 0; width: 4px; translate: -50% 0; background: #fff; border: 0; cursor: ew-resize; }
.compare .knob::after { content: "\2194"; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 48px; height: 48px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-size: 22px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.scratch { position: relative; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; touch-action: none; }
.scratch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.prize { position: absolute; left: 50%; bottom: 24px; translate: -50% 20px; padding: 14px 20px; border-radius: 12px; background: var(--accent); color: #111; font-weight: 700; opacity: 0; transition: opacity .5s, translate .5s; white-space: nowrap; }
.won .prize { opacity: 1; translate: -50% 0; }
.tapgame { position: relative; height: min(70vh, 620px); border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%), #111; display: grid; place-items: center; touch-action: manipulation; }
.tapgame > button:first-child { z-index: 2; } 
.tapgame .hud { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font-weight: 700; font-size: 18px; }
.target { position: absolute; bottom: -80px; width: 64px; height: 64px; border: 0; border-radius: 50%; cursor: pointer; background: var(--accent) center / cover no-repeat; animation: rise linear forwards; }
.target.hit { animation: none; transform: scale(1.6); opacity: 0; transition: .25s; }
@keyframes rise { to { transform: translateY(calc(-1 * min(70vh, 620px) - 160px)); } }
