/* ---------------------------------------------------------------
   ASAP/ — the reel
   Tokens, strip, frames, HUD, cursor, motion. One file, no build.
   --------------------------------------------------------------- */
:root {
  --paper: #fafaf8;
  --ink: #141312;
  --ink-soft: #4a4744;
  --accent: #1a2cff;
  --acid: #d7ff3a;                            /* spot colours: solid blocks behind words only */
  --hot: #ff3fb4;

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.7, 0, .2, 1);

  --hud: 52px;                                /* edge print zone, top and bottom */
  --gutter: clamp(20px, 4vw, 48px);

  --mark: clamp(72px, 25vw, 200px);
  --stmt: clamp(34px, 9vw, 88px);
  --mail: clamp(34px, 14vw, 120px);

  /* reel pull, driven per frame by script */
  --skew: 0deg;
  --stretch: 1;
  --blur: 0px;
}

/* ---------------------------------------------------------------
   Base + browser surfaces
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); scrollbar-color: var(--ink) var(--paper); overflow-x: clip; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  cursor: crosshair;
  overflow-x: clip;
}
::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 14px; background: var(--accent); color: var(--paper);
  font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------------------------------------------------------------
   The strip (vertical by default: phones, no-JS, keyboard-only)
   --------------------------------------------------------------- */
.reel { position: relative; }
.gate { position: relative; }
.track {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.frame {
  position: relative;
  min-height: 100svh;
  display: flex;
}
.frame__in {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--hud) + var(--gutter) * .5) var(--gutter);
  min-width: 0;
}

/* reel pull: content smears along the direction of travel */
.stretch {
  transform: skewY(var(--skew)) scaleY(var(--stretch));
  transform-origin: 50% 50%;
  will-change: transform;
}

/* ---------------------------------------------------------------
   Type
   --------------------------------------------------------------- */
.mark {
  font-size: var(--mark);
  font-weight: 700;
  line-height: .82;
  letter-spacing: -.05em;
  text-transform: uppercase;
  white-space: nowrap;
  clip-path: inset(-.2em -.2em -.25em -.1em);
  user-select: none;
}
.mark .slash { color: var(--accent); }
.mark .ch {
  display: inline-block;
  transform: translateY(125%);
  transition: transform 1.1s var(--ease-out) calc(var(--i) * 70ms);
}
.is-ready .mark .ch { transform: none; }

.stmt {
  font-size: var(--stmt);
  font-weight: 700;
  line-height: .96;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.stmt .line { display: block; }
.stmt .dot { color: var(--accent); }

/* blocks: the look of selected text, made deliberate */
.stmt--blocks { line-height: 1.04; }
.blk, .hl {
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  padding: 0 .1em 0 .06em;
  margin-left: -.06em;
}
.blk { background: var(--accent); color: var(--paper); }
.blk .ini { color: var(--acid); font-weight: inherit; }
.stmt--blocks .dot { color: var(--acid); }
.hl--acid { background: var(--acid); color: var(--ink); }
.hl--hot { background: var(--hot); color: var(--ink); }

.small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* ---------------------------------------------------------------
   00 — the gate: the object, the mark, the hint
   --------------------------------------------------------------- */
.gate-frame { overflow: hidden; }
.gate__gl { position: absolute; inset: 0; z-index: 0; }
.gate__gl canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.gate-frame .frame__in {
  z-index: 1;
  pointer-events: none;
  justify-content: flex-end; align-items: flex-start;
  padding-bottom: calc(var(--hud) + 56px);
}
.gate__desc {
  margin-top: clamp(14px, 2vh, 24px);
  opacity: 0; transform: translateY(.6em);
  transition: opacity .8s var(--ease-out) .7s, transform .8s var(--ease-out) .7s;
}
.is-ready .gate__desc { opacity: 1; transform: none; }
.gate__hint {
  position: absolute; left: var(--gutter); bottom: calc(var(--hud) + 8px);
  display: flex; align-items: center; gap: .7em;
  font-size: 12px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase;
  opacity: 0; transition: opacity .8s var(--ease-out) 1.1s;
}
.is-ready .gate__hint { opacity: 1; }
.is-pulled .gate__hint { opacity: 0; transition-delay: 0s; }
.gate__hint .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.8); opacity: .4; } }

/* ---------------------------------------------------------------
   03 — the work: leader, footage, caption
   --------------------------------------------------------------- */
.frame--work .frame__in { padding-left: 0; padding-right: 0; }
.film {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--ink);
  border-left: 0; border-right: 0;
  background: var(--ink);
  overflow: hidden;
}
.film__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: var(--ink);
}
.leader { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.leader__bg { fill: var(--paper); }
.leader__lines { stroke: var(--ink); stroke-width: 3; fill: none; }
.leader text { font-family: var(--font); fill: var(--ink); }
.leader__num { font-size: 300px; font-weight: 700; letter-spacing: -.04em; }
.leader__edge { font-size: 18px; font-weight: 700; letter-spacing: .12em; }
.leader__sweep {
  fill: none; stroke: var(--ink); stroke-opacity: .1; stroke-width: 230;
  stroke-dasharray: 722.6;
  stroke-dashoffset: 722.6;
  animation: sweep 1s linear infinite;
  animation-play-state: paused;
}
.is-counting .leader__sweep { animation-play-state: running; }
@keyframes sweep { to { stroke-dashoffset: 0; } }
.leader__flash { fill: var(--ink); opacity: 0; transition: opacity .06s; }
.is-flash .leader__flash { opacity: 1; }
.work__meta {
  display: flex; justify-content: space-between; gap: var(--gutter);
  margin-top: 14px;
  padding: 0 var(--gutter);
}
.work__meta h2 { font-size: inherit; }
.work__note { color: var(--ink-soft); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
/* caption row: title and sound control first, the note on its own line on phones; one row on the reel */
.work__meta { display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 10px; }
.work__meta h2 { grid-column: 1; }
.work__meta .sound { grid-column: 2; grid-row: 1; }
.work__note { grid-column: 1 / -1; }
.sound {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 6px 10px; border: 2px solid var(--ink);
  transition: background .2s, color .2s;
}
.sound:hover, .sound:focus-visible { background: var(--ink); color: var(--paper); }
.sound svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.sound[aria-pressed="false"] .sound__wave { display: none; }

/* credits roll in after the picture: a column beside the film on the reel, below it on phones */
.work__row { display: flex; flex-direction: column; }
.credits {
  display: grid; gap: 20px var(--gutter);
  padding: clamp(24px, 4vh, 40px) var(--gutter) 0;
  font-size: 12px; line-height: 1.5;
}
.credits h3 { margin-bottom: 8px; }
.credit { display: flex; flex-wrap: wrap; gap: 0 .5em; }
.credit dt { color: var(--ink-soft); font-weight: 500; }
.credit dt::after { content: " —"; }
.credit dd { font-weight: 700; }

/* ---------------------------------------------------------------
   06 — the brief
   --------------------------------------------------------------- */
.brief-frame .frame__in { justify-content: center; }
.mail-h { font-size: var(--mail); line-height: 1; }
.mail {
  position: relative; display: inline-block;
  font-weight: 700;
  letter-spacing: -.045em;
  white-space: nowrap;
  transition: letter-spacing .7s var(--ease-out);
}
.mail:hover, .mail:focus-visible { letter-spacing: 0; }
.mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.06em; height: .07em;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease-io);
}
.mail:hover::after, .mail:focus-visible::after { transform: scaleX(1); }
.brief__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px;
  margin-top: clamp(18px, 4vh, 40px);
}
.copy {
  display: inline-flex; align-items: center; gap: .6em;
  padding: 10px 14px; border: 2px solid var(--ink);
  transition: background .2s, color .2s;
}
.copy:hover, .copy:focus-visible { background: var(--ink); color: var(--paper); }
.copy.is-done { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.copy svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.brief__foot { color: var(--ink-soft); }

/* ---------------------------------------------------------------
   HUD: edge print that never leaves the gate
   --------------------------------------------------------------- */
.hud { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.hud__row {
  position: absolute; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter);
  height: var(--hud);
}
.hud__row--top { top: 0; }
.hud__row--bottom { bottom: 0; }
.hud__item {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: .7em;
  color: var(--ink);
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hud__brand span { color: var(--ink-soft); display: none; opacity: 0; transition: opacity .6s var(--ease-out); }
.is-pulled .hud__brand span { opacity: 1; }
.hud__cta svg { width: 14px; height: 10px; stroke: var(--accent); fill: none; stroke-width: 2.2; transition: transform .3s var(--ease-out); }
.hud__cta:hover svg, .hud__cta:focus-visible svg { transform: translateX(3px); }
.hud__loc, .hud__fr { display: none; }
.prog {
  position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  z-index: 60;
}

/* ---------------------------------------------------------------
   Grain + cursor
   --------------------------------------------------------------- */
.grain {
  position: fixed; inset: -100px; z-index: 100; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .05;
  animation: grain .4s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-40px, 30px); }
  50% { transform: translate(30px, -50px); } 75% { transform: translate(-20px, -20px); }
  100% { transform: translate(0, 0); }
}
.cursor { display: none; }

/* ---------------------------------------------------------------
   The reel proper: wide screens with a real pointer
   --------------------------------------------------------------- */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .js {
    --hud: 64px;
    --gutter: clamp(28px, 3vw, 56px);
    --mark: clamp(120px, 18vw, 340px);
    --stmt: clamp(52px, 7.4vw, 150px);
    --mail: clamp(64px, 14vw, 280px);
    scrollbar-width: none;
  }
  .js body::-webkit-scrollbar { display: none; }
  .js body { cursor: none; }

  .js .reel { height: 700vh; }                 /* overwritten by script */
  .js .gate { position: sticky; top: 0; height: 100vh; overflow: hidden; }
  .js .track {
    flex-direction: row;
    width: max-content;
    height: 100%;
    will-change: transform;
  }
  .js .frame { min-height: 0; flex: 0 0 auto; width: var(--fw, 84vw); }
  .js .gate-frame { --fw: 100vw; }
  .js .frame--stories { --fw: 92vw; }
  .js .frame--a { --fw: 92vw; }
  .js .frame--b { --fw: 84vw; }
  .js .frame--work { width: auto; }
  .js .brief-frame { --fw: 100vw; }

  .js .stretch { transform: skewX(var(--skew)) scaleX(var(--stretch)); }
  .js .stretch--text { filter: blur(var(--blur)); }

  .js .gate-frame .frame__in {
    justify-content: center;
    padding-bottom: calc(var(--hud) + var(--gutter) * .5);
  }

  .js .frame--work .frame__in {
    align-items: center;
    padding: calc(var(--hud) + var(--gutter) * .5) var(--gutter);
  }
  .js .work__row { flex-direction: row; align-items: flex-end; gap: var(--gutter); }
  /* film + credits fit the gate together, so the frame lands whole */
  .js .work__film { width: min(70vw, calc((100vh - var(--hud) * 2 - var(--gutter) * 2 - 48px) * 16 / 9)); }
  .js .film { border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
  .js .work__meta { padding: 0; display: flex; }
  .js .work__note { flex: 1; text-align: right; }
  .js .credits { flex: 0 0 clamp(260px, 20vw, 360px); padding: 0; grid-template-columns: 1fr; gap: 28px; }

  .js .hud__loc, .js .hud__fr { display: inline-flex; }
  .js .hud__brand span { display: inline; }

  .js .cursor {
    display: block;
    position: fixed; top: 0; left: 0; z-index: 1000;
    pointer-events: none;
    mix-blend-mode: difference;
    color: #fff;
    will-change: transform;
  }
  .js .cursor__x {
    position: absolute; left: -12px; top: -12px; width: 24px; height: 24px;
    transition: transform .35s var(--ease-out);
  }
  .js .cursor__x::before, .js .cursor__x::after {
    content: ""; position: absolute; background: currentColor;
  }
  .js .cursor__x::before { left: 0; right: 0; top: 11.5px; height: 1px; }
  .js .cursor__x::after { top: 0; bottom: 0; left: 11.5px; width: 1px; }
  .js .cursor__ring {
    position: absolute; left: -3px; top: -3px; width: 6px; height: 6px;
    border: 1px solid currentColor; border-radius: 50%;
    transition: transform .4s var(--ease-out);
  }
  .js .cursor__label {
    position: absolute; left: 18px; top: -7px;
    font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    white-space: nowrap;
    opacity: 0; transform: translateX(-6px);
    transition: opacity .25s, transform .35s var(--ease-out);
  }
  .js .cursor.is-hot .cursor__x { transform: rotate(45deg); }
  .js .cursor.is-hot .cursor__ring { transform: scale(7); }
  .js .cursor.is-hot .cursor__label { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------
   No script: everything visible, nothing pulled
   --------------------------------------------------------------- */
.no-js .mark .ch, .no-js .gate__desc, .no-js .gate__hint {
  transform: none; opacity: 1; transition: none;
}
.no-js .gate__gl { display: none; }

/* ---------------------------------------------------------------
   Reduced motion: everything readable, nothing pulled
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .mark .ch, .gate__desc, .gate__hint {
    transform: none !important; opacity: 1 !important; transition: none !important;
  }
  .stretch, .js .stretch { transform: none !important; filter: none !important; }
  .grain, .gate__hint .pulse, .leader__sweep { animation: none !important; }
  .js body { cursor: crosshair; }
  .js .cursor { display: none; }
}

/* ---------------------------------------------------------------
   The leader: ASAP/ unfolds into ALL STORIES ARE POSSIBLE/ while the reel loads
   --------------------------------------------------------------- */
:root {
  --boot-expand: 1100ms;
  --boot-exit: 900ms;
  --boot-ease: cubic-bezier(.5, 0, .1, 1);     /* slower in, long settle: the words open, they do not snap */
}
.boot { display: none; }
.is-booting { overflow: hidden; }
.is-booting .boot {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 90;                                 /* under the grain, over the reel */
  background: var(--paper);
  padding: 0 var(--gutter);
}
.boot.is-out {
  clip-path: inset(0 0 100% 0);
  transition: clip-path var(--boot-exit) var(--boot-ease);
}
.boot__bar {
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0ms linear;                /* duration set by script to the leader's length */
}
.boot__line {
  display: flex;
  align-items: baseline;
  margin: 0;
  font-size: clamp(20px, 5.4vw, 108px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.05em;
  text-transform: uppercase;
  white-space: nowrap;
  clip-path: inset(-.15em -.1em -.22em -.1em);
  user-select: none;
}
.boot__w { display: inline-flex; align-items: baseline; }
.boot .ini, .boot .slash {
  display: inline-block;
  transform: translateY(125%);
  transition: transform 1.3s var(--ease-out) calc(var(--i) * 110ms), color .8s var(--boot-ease);
}
.boot .slash { color: var(--accent); }
.boot.is-in .ini, .boot.is-in .slash { transform: none; }
.boot.is-open .ini { color: var(--accent); }  /* the initials stay lit inside the line */
.boot .rest {
  display: inline-block;
  width: 0;
  overflow: hidden;
  white-space: pre;
  vertical-align: baseline;
  padding-right: .05em; margin-right: -.05em;  /* room for the last glyph under negative tracking */
  transition: width var(--boot-expand) var(--boot-ease);
}
