/* Publicis UGC Studio — intro. The feed universe is the page; the words float over it.
   Taste rules for the words (two-line headlines, one line under each, sentence case, no labels above headings).
   Depth needs glow and bloom, so the no-glow rules are broken on purpose in the 3D layer only. */
:root {
  --space: #030406; --ink: #eeeeec; --muted: #a9a59c; --accent: #f6e016; --accent-ink: #0c0a08;
  --display: "Panchang", system-ui, sans-serif; --text: "Stack Sans Text", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --big: clamp(2.2rem, 0.9rem + 4.4vw, 5.6rem);
}
* { box-sizing: border-box; }
html { background: var(--space); }
body { margin: 0; background: var(--space); color: var(--ink); font-family: var(--text); font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100svh; display: block; z-index: 0; }

/* top bar */
.top { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px clamp(16px, 3vw, 40px); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 52px; width: auto; }
.brand span { font-family: var(--display); font-size: 0.8rem; color: var(--muted); }
.top a, .top button { white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.sound { color: var(--muted); font-size: 0.9rem; transition: color 180ms ease; }
.sound:hover, .sound[aria-pressed="true"] { color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.5rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 500; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.btn:hover { background: var(--ink); }
.btn:active { transform: scale(0.96); }
.btn-big { min-height: 3.8rem; padding: 0 2.4rem; font-size: 1.15rem; }

/* the timecode: every second of the feed, counted */
.timecode { position: fixed; z-index: 15; left: clamp(16px, 3vw, 40px); bottom: clamp(14px, 3vh, 34px); font-family: var(--display); font-size: clamp(2.4rem, 1.6rem + 2.6vw, 4.6rem); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); opacity: 0.92; }
.timecode span { font-size: 0.45em; margin-left: 0.08em; color: var(--accent); }
.timecode.held { color: var(--accent); }

/* rail */
.rail { position: fixed; z-index: 15; right: clamp(12px, 2vw, 26px); top: 50%; transform: translateY(-50%); display: grid; gap: 11px; }
.rail a { display: block; width: 8px; height: 8px; border-radius: 50%; background: rgba(238, 238, 236, 0.28); transition: transform 260ms var(--ease-out), background-color 260ms ease; }
.rail a.on { background: var(--accent); transform: scale(1.7); }
.rail a:hover { background: var(--ink); }

/* the chapters: words floating over the world */
#chapters { position: relative; z-index: 5; pointer-events: none; }
.s { min-height: 150svh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px; padding: 0 clamp(18px, 7vw, 120px); }
.s.right { align-items: flex-end; text-align: right; }
.s.center { align-items: center; text-align: center; }
.s > * { pointer-events: auto; }
.big { font-family: var(--display); font-weight: 700; font-size: var(--big); line-height: 1.0; letter-spacing: -0.025em; max-width: 13ch; text-wrap: balance; }
.line { max-width: 31ch; color: var(--ink); text-wrap: pretty; }
.js .s .big, .js .s .line, .js .s .btn, .js .s .game, .js .s .verdict { opacity: 0; transform: translateY(26px); transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out); }
.js .s.in .big, .js .s.in .line, .js .s.in .btn, .js .s.in .game, .js .s.in .verdict { opacity: 1; transform: none; }
.js .s.in .line { transition-delay: 120ms; }
.js .s.in .btn, .js .s.in .game { transition-delay: 220ms; }
.js .s.in .verdict { transition-delay: 300ms; }
.s.end { min-height: 100svh; height: 100svh; justify-content: flex-end; padding-top: 0; padding-bottom: 7svh; }  /* the page ends here, words under the logo */
.end .big { max-width: 16ch; }
.game { display: flex; gap: 10px; }
.g { min-height: 3.4rem; padding: 0 2rem; border-radius: 999px; background: var(--ink); color: var(--space); font-weight: 500; font-size: 1.1rem; transition: transform 140ms var(--ease-out), background-color 180ms ease; }
.g:hover { background: var(--accent); }
.g:active { transform: scale(0.95); }
.verdict { max-width: 34ch; color: var(--muted); }

/* loading */
.loader { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--space); transition: opacity 900ms ease; }
.loader img { width: 120px; height: auto; }
.loader i { display: block; height: 3px; width: 160px; background: rgba(238, 238, 236, 0.14); position: relative; overflow: hidden; border-radius: 2px; }
.loader i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform 200ms ease; }
.loader.done { opacity: 0; pointer-events: none; }
.loader[hidden] { display: none; }
.nogl { position: fixed; z-index: 25; left: 50%; bottom: 20px; transform: translateX(-50%); color: var(--muted); font-size: 0.9rem; }
.nogl[hidden] { display: none; }

/* phone: same journey, the words low over the scene */
@media (max-width: 760px) {
  .brand img { height: 36px; }
  .brand { gap: 10px; }
  .top { padding: 12px 16px; }
  .top-actions { gap: 12px; }
  .brand span { display: none; }
  .sound { font-size: 0.8rem; }
  .top .btn { min-height: 2.6rem; padding: 0 1rem; font-size: 0.9rem; }
  .s, .s.right { align-items: flex-start; text-align: left; justify-content: flex-end; padding-bottom: 27svh; min-height: 140svh; }  /* the section overhangs the screen by 20svh */
  .s.center { align-items: center; text-align: center; justify-content: center; }
  .s.end { min-height: 100svh; justify-content: flex-end; padding-bottom: 9svh; }
  .big { font-size: clamp(1.5rem, 6.3vw, 2.4rem); max-width: none; }
  .big br.wide { display: none; }
  .timecode { font-size: 1.7rem; top: 74px; bottom: auto; left: 16px; }
  .rail { gap: 8px; right: 8px; }
  .rail a { width: 6px; height: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .s .big, .js .s .line, .js .s .btn, .js .s .game, .js .s .verdict { opacity: 1; transform: none; transition: none; }
}
