:root {
  --ink: #0f1115;
  --cobalt: #2340d4;
  --paper: #f1efe9;
  --paper-dim: rgba(241, 239, 233, 0.72);
  --signal: #ff5a1f;
  --gutter: clamp(16px, 4vw, 56px);
  --display: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  /* z-index scale: hero type < canvas < content < grain < nav < loader */
  --z-type: 0;
  --z-canvas: 1;
  --z-content: 2;
  --z-grain: 3;
  --z-nav: 4;
  --z-loader: 5;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--cobalt);
  color: var(--paper);
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }

a { color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: var(--ink);
  display: grid;
  place-items: center;
  transform-origin: center;
}
.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.loader__label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--paper-dim);
}
.loader__pct {
  font-size: clamp(64px, 14vw, 180px);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.loader__line {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 2px;
  background: var(--paper);
  transform: scaleX(0);
  opacity: 0;
  box-shadow: 0 0 24px var(--paper);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  height: 68px;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.nav__brand {
  text-decoration: none;
  font-weight: 800;
  font-variation-settings: "wdth" 75;
  text-transform: uppercase;
  font-size: 20px;
  letter-spacing: 0.01em;
}
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__channel {
  justify-self: end;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Layers ---------- */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-canvas);
  pointer-events: none;
}

.hero-type {
  position: fixed;
  inset: 0;
  z-index: var(--z-type);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--gutter);
  pointer-events: none;
  text-transform: uppercase;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  line-height: 0.82;
  font-size: clamp(120px, 27vw, 460px);
  letter-spacing: -0.01em;
  color: var(--paper);
}
.hero-type__line { display: block; will-change: transform; }
.hero-type__line--right { align-self: flex-end; }

.grain {
  position: fixed;
  inset: -50%;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, .footer { position: relative; z-index: var(--z-content); }

/* ---------- Sections ---------- */
.section {
  min-height: 100dvh;
  padding: 96px var(--gutter);
  display: grid;
  align-items: center;
}

.display {
  margin: 0 0 24px;
  text-transform: uppercase;
  font-weight: 900;
  font-variation-settings: "wdth" 70;
  font-size: clamp(48px, 7vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.005em;
}
.display em {
  font-style: italic;
  color: var(--signal);
  display: inline-block;
  padding-bottom: 4px;
  line-height: 1.1;
}
.display--xl { font-size: clamp(56px, 10vw, 168px); }

.body {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.55;
  color: var(--paper-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s;
}
.btn:hover { background: var(--signal); color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible, .nav a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}

/* Hero */
.hero { align-items: end; }
.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 340px;
  padding-bottom: 8px;
}
.hero__sub {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
}

/* Split sections: copy on one side, the TV occupies the other */
.split { grid-template-columns: repeat(12, 1fr); }
.split__copy { grid-column: 1 / span 5; }
.split--right .split__copy { grid-column: 8 / span 5; }

.bands {
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 460px;
}
.band { border-top: 1px solid rgba(241, 239, 233, 0.25); padding-top: 14px; }
.band dt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--signal);
  font-weight: 600;
}
.band dd {
  margin: 6px 0 0;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.band dd span {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  margin: 0 10px;
  vertical-align: middle;
  color: var(--paper-dim);
}

/* Centered: TV sits large in the middle, copy anchors to the bottom */
.centered { align-items: end; justify-items: center; text-align: center; }
.centered__copy { display: flex; flex-direction: column; align-items: center; }
.centered .body { max-width: 52ch; }

/* Stats */
.stats__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  width: 100%;
}
.stat { display: flex; flex-direction: column; gap: 12px; }
.stat--offset { margin-top: 18vh; }
.stat__num {
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-size: clamp(120px, 18vw, 300px);
  line-height: 0.8;
  color: var(--paper);
}
.stat:first-child .stat__num { color: var(--signal); }
.stat__label { font-size: 16px; color: var(--paper-dim); max-width: 22ch; }

/* Finale */
.finale {
  min-height: 140dvh;
  align-content: center;
  justify-items: start;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}
.finale.is-dragging { cursor: grabbing; }
.finale__title {
  margin: 0;
  text-transform: uppercase;
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  font-size: clamp(96px, 19vw, 320px);
  line-height: 0.82;
}
.finale__hint {
  margin: 24px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--paper-dim);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--gutter);
  font-size: 13px;
  color: var(--paper-dim);
  border-top: 1px solid rgba(241, 239, 233, 0.18);
}

/* ---------- Mobile: TV lives in the top half, copy in the bottom half ---------- */
@media (max-width: 767px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__links { display: none; }
  .section { align-items: end; padding: 96px 16px 64px; }
  .split, .split--right { grid-template-columns: 1fr; }
  .split__copy, .split--right .split__copy { grid-column: 1; }
  .hero-type { justify-content: flex-start; padding-top: 11vh; }
  .stats__grid { grid-template-columns: 1fr; gap: 40px; }
  .stat--offset { margin-top: 0; }
  .stats { align-items: center; }
  .finale { min-height: 120dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .nav__links a::after { transition: none; }
}
