/* COOK — pre-launch
   One continuous shot that never ends: the camera drifts through a dark kitchen,
   up to the dial, through the oven glass into the glow, and back out to where it
   began. The headline rolls to a new beat with each shot. --heat (0–1) is the
   film's measured glow, so the type is lit by the same light. */

:root {
  --bg: #070504;
  --ink: #f5efe8;
  --ink-2: rgba(245, 239, 232, .68);
  --ink-3: rgba(245, 239, 232, .42);
  --line: rgba(255, 232, 214, .15);
  --flame: #ff7a1a;
  --ember: #b8521d;

  --heat: 0;
  --focus: 58% 50%;
  --pad-x: clamp(24px, 6.6vw, 124px);
  --pad-y: clamp(22px, 4.6vh, 48px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

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

/* One screen, never scrolls. (100vh on phones includes the area behind the address
   bar, which made the page taller than the screen and exposed a black strip.) */
html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  height: 100dvh; /* the visible screen, tracking the address bar */
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg) url(../media/poster-landscape.jpg?v=65a8cef8c2) var(--focus) / cover no-repeat;
  animation: appear 2.4s var(--ease-out) both;
}

.scene__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus);
  opacity: 0;
  transition: opacity .8s ease;
}
.scene__video.is-live { opacity: 1; }

.scene__shade,
.scene__warmth,
.scene__grain { position: absolute; pointer-events: none; }

.scene__shade {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 5, 4, .86) 0%, rgba(7, 5, 4, .6) 26%, rgba(7, 5, 4, .14) 47%, rgba(7, 5, 4, 0) 60%),
    linear-gradient(0deg, rgba(7, 5, 4, .7) 0%, rgba(7, 5, 4, 0) 24%),
    radial-gradient(130% 95% at 62% 46%, transparent 58%, rgba(7, 5, 4, .55) 100%);
}

/* Film light reaching the type. */
.scene__warmth {
  inset: 0;
  background: radial-gradient(36% 44% at 18% 48%, rgba(255, 110, 24, .16), transparent 72%);
  opacity: var(--heat);
  mix-blend-mode: screen;
}

.scene__grain {
  inset: -100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .055;
  animation: grain 1.1s steps(6) infinite;
  will-change: transform;
}

/* ---------- copy ---------- */

.copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: min(50rem, 58vw);
  padding: var(--pad-y) var(--pad-x);
  transform: translateY(-4vh);
}

/* ---------- beats: words dissolve out, then resolve in one by one ---------- */

.beats { display: grid; }
.beats:not(.is-ready) { visibility: hidden; } /* until main.js has split the words */

/* Every beat is exactly two unbroken lines, so the slot never grows. Size is set by
   the longest line (13 characters) so it always fits beside the oven. */
.beat {
  grid-area: 1 / 1;
  font-weight: 800;
  font-size: clamp(2.5rem, min(4.7vw, 9.6vh), 6.4rem);
  line-height: .98;
  letter-spacing: -.038em;
  white-space: nowrap;
  pointer-events: none;
}
.beat__line { display: block; font-style: normal; }

/* main.js wraps each word in .w with --i, its order across the beat. */
.w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.38em);
  filter: blur(12px);
}
.beat.is-on .w {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition: opacity .9s ease, transform 1.3s var(--ease-out), filter 1.1s var(--ease-out);
  transition-delay: calc(.5s + var(--i, 0) * 75ms);
}
.beat.is-off .w {
  opacity: 0;
  transform: translateY(-.22em);
  filter: blur(10px);
  transition: opacity .45s ease, transform .6s var(--ease-in), filter .5s ease;
  transition-delay: calc(var(--i, 0) * 35ms);
}

/* Accent words are three layers: ember base, glow, and a bright fill that rise with
   --heat. A glint of light sweeps across them as each beat lands. */
.beat__hot { color: var(--ember); }
.beat__hot .w {
  position: relative;
  z-index: 0;
  padding-right: .03em;
}
.beat__hot .w::before,
.beat__hot .w::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.beat__hot .w::before {
  z-index: -1;
  color: transparent;
  text-shadow: 0 0 .32em rgba(255, 100, 14, .62), 0 0 .08em rgba(255, 150, 60, .5);
  opacity: var(--heat);
}
.beat__hot .w::after {
  inset: 0 0 auto;
  padding-bottom: .3em; /* room for descenders: background-clip only paints inside the box */
  background:
    linear-gradient(100deg, transparent 40%, rgba(255, 244, 228, .9) 50%, transparent 60%) 150% 0 / 250% 100% no-repeat,
    linear-gradient(180deg, #ffc47e 0%, #ff8b2b 36%, #f05d0c 76%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: calc(.3 + var(--heat) * .7);
}
.beat.is-on .beat__hot .w::after {
  animation: glint 1.3s cubic-bezier(.45, 0, .2, 1) calc(1.25s + var(--i, 0) * 110ms) both;
}

/* ---------- section sidebar ---------- */

.sections {
  position: absolute;
  z-index: 3;
  left: clamp(18px, 2.3vw, 38px);
  top: 0;
  bottom: 0;
  height: max-content;
  margin-block: auto;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.sections__ticks { display: flex; flex-direction: column; }

.section {
  display: flex;
  align-items: center;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.section:focus-visible { outline: 1px solid rgba(255, 176, 110, .7); outline-offset: 2px; }

.section__tick {
  position: relative;
  width: 10px;
  height: 1px;
  overflow: hidden;
  background: rgba(255, 232, 214, .4);
  transition: width .7s var(--ease-out), background-color .4s ease;
}
.section:hover .section__tick { background: rgba(255, 232, 214, .78); }
.section[aria-current] .section__tick { width: 30px; background: rgba(255, 232, 214, .2); }
.section__fill {
  position: absolute;
  inset: 0;
  background: var(--flame);
  transform-origin: left;
  transform: scaleX(0);
}
.section[aria-current] .section__fill { transform: scaleX(var(--p, 0)); }

/* Section name, set vertically so it never meets the headline. */
.sections__label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: .56rem;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-2);
  transition: opacity .35s ease, translate .5s var(--ease-out);
}
.sections__num { color: var(--flame); margin-inline-end: .9em; }
.sections__label.is-swapping { opacity: 0; translate: 0 -8px; }

/* "Be first in line." labels the sign-up, so it sits with the field (tight) and the
   space goes above it, separating the headline from the sign-up block. */
.kicker {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  font-size: clamp(.68rem, .6rem + .22vw, .82rem);
  font-weight: 500;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-wrap: balance;
}

/* ---------- waitlist ---------- */

.waitlist {
  position: relative;
  margin-top: clamp(.8rem, 1.6vh, 1.1rem);
  width: min(100%, 23.5rem);
}

.waitlist__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist__field {
  position: relative;
  display: flex;
  align-items: center;
  height: 3.25rem;
  padding: .3rem .3rem .3rem 1.35rem;
  border-radius: 999px;
  background: rgba(18, 12, 9, .55);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 12px 40px -14px rgba(0, 0, 0, .7);
  transition: border-color .8s ease, box-shadow .8s ease;
}
.waitlist__field:focus-within,
.waitlist.is-called .waitlist__field {
  border-color: rgba(255, 140, 50, .55);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, .12), 0 12px 40px -14px rgba(0, 0, 0, .7);
}

.waitlist input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: 500 .95rem/1 var(--font);
  letter-spacing: .01em;
}
.waitlist input::placeholder { color: var(--ink-3); }
.waitlist input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  transition: background-color 9999s;
}

.waitlist__submit {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  color: #1c0d04;
  background: radial-gradient(circle at 35% 28%, #ffb46a, #ff7a1a 56%, #e5580c);
  box-shadow: 0 0 calc(8px + var(--heat) * 22px) rgba(255, 108, 18, calc(.22 + var(--heat) * .38));
  cursor: pointer;
  transition: transform .45s var(--ease-out);
}
.waitlist__submit:hover { transform: translateX(2px) scale(1.04); }
.waitlist__submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.waitlist__submit svg,
.waitlist__done svg,
.motion-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.waitlist__submit svg { width: 1.1rem; height: 1.1rem; }

.waitlist__done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s ease .15s;
}
.waitlist__done svg { width: 1.05rem; height: 1.05rem; color: var(--flame); }

.waitlist__note {
  margin-top: .85rem;
  padding-left: .15rem;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-wrap: balance;
  transition: color .3s ease;
}

.waitlist.is-sending .waitlist__submit { animation: simmer 1s ease-in-out infinite; }
.waitlist.is-error .waitlist__field { border-color: rgba(255, 96, 70, .6); }
.waitlist.is-error .waitlist__note { color: #ffb19c; }
.waitlist.is-done input,
.waitlist.is-done .waitlist__submit { visibility: hidden; }
.waitlist.is-done .waitlist__done { opacity: 1; }
.waitlist.is-done .waitlist__field { border-color: rgba(255, 140, 50, .35); box-shadow: none; }

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--pad-x) calc(var(--pad-y) + env(safe-area-inset-bottom));
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.foot__controls { display: flex; align-items: center; gap: .9rem; }
.foot__brand { display: flex; align-items: center; gap: .15rem; }

/* X sits beside the name, as quiet as the controls until you reach for it. */
.foot__x {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  color: var(--ink-3);
  transition: color .3s ease;
}
.foot__x:hover,
.foot__x:focus-visible { color: var(--ink); }
.foot__x:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.foot__x svg { width: .72rem; height: .72rem; fill: currentColor; }

/* Sound is opt-in: the film's soundtrack fades in only when asked for. */
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: .75em;
  padding: .45rem .2rem;
  border: 0;
  background: none;
  color: var(--ink-3);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color .3s ease;
}
.sound-toggle[hidden] { display: none; }
.sound-toggle:hover,
.sound-toggle[aria-pressed="true"] { color: var(--ink); }
.sound-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sound-toggle__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.sound-toggle__bars i { width: 2px; height: 3px; border-radius: 1px; background: currentColor; transition: height .3s ease; }
.sound-toggle[aria-pressed="true"] .sound-toggle__bars i { background: var(--flame); animation: eq 1.1s ease-in-out infinite; }
.sound-toggle[aria-pressed="true"] .sound-toggle__bars i:nth-child(2) { animation-delay: -.45s; }
.sound-toggle[aria-pressed="true"] .sound-toggle__bars i:nth-child(3) { animation-delay: -.8s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }

/* Pause stays available (motion longer than 5s) but recedes until you look for it. */
.motion-toggle {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: var(--ink-3);
  opacity: .7;
  cursor: pointer;
  transition: color .3s ease, border-color .3s ease, opacity .3s ease;
}
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover,
.motion-toggle:focus-visible { color: var(--ink); border-color: var(--line); opacity: 1; }
.motion-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.motion-toggle svg { width: .8rem; height: .8rem; }
.motion-toggle__play { display: none; fill: currentColor !important; stroke-width: 1.5; }
.motion-toggle.is-paused .motion-toggle__pause { display: none; }
.motion-toggle.is-paused .motion-toggle__play { display: block; }

/* ---------- gate: one tap in, with sound ---------- */

/* Browsers only allow sound after a tap. The gate sits over the film's own first frame
   (the poster) while the film buffers, then lifts straight into it as it starts. */
.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 0 24px;
  border: 0;
  background: radial-gradient(90% 70% at 50% 50%, rgba(7, 5, 4, .15), rgba(7, 5, 4, .72));
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gate:focus { outline: none; }
.is-open .gate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.1s ease .2s, visibility 0s linear 1.3s;
}

.gate__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity .6s ease, filter .6s ease, translate .8s var(--ease-in);
}
.is-open .gate__inner { opacity: 0; filter: blur(8px); translate: 0 -12px; }

/* Tracking adds space after the last letter, so each tracked line is pulled back by it. */
.gate__mark {
  font-weight: 800;
  font-size: clamp(1.1rem, .95rem + .5vw, 1.4rem);
  letter-spacing: .62em;
  margin-right: -.62em;
  animation: rise 1.6s var(--ease-out) .1s both;
}

/* The pilot light: fills as the film buffers, then breathes while it waits. */
.gate__line {
  position: relative;
  width: 7.5rem;
  height: 1px;
  margin-top: 1.5rem;
  background: rgba(255, 232, 214, .16);
  animation: rise 1.6s var(--ease-out) .25s both;
}
.gate__fill {
  position: absolute;
  inset: 0;
  background: var(--flame);
  box-shadow: 0 0 12px rgba(255, 110, 24, .7);
  transform-origin: left;
  transform: scaleX(var(--load, 0));
}
.gate.is-ready .gate__fill { animation: pilot 2.6s ease-in-out infinite; }

.gate__cue {
  display: grid;
  margin-top: 1.3rem;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--ink-2);
  animation: rise 1.6s var(--ease-out) .4s both;
}
.gate__state {
  grid-area: 1 / 1;
  margin-right: -.42em;
  transition: opacity .6s ease, filter .6s ease, translate .8s var(--ease-out), color .3s ease;
}
.gate__ready { opacity: 0; filter: blur(6px); translate: 0 .5em; }
.gate.is-ready .gate__state:first-child { opacity: 0; filter: blur(6px); translate: 0 -.5em; }
.gate.is-ready .gate__ready { opacity: 1; filter: none; translate: none; }
.gate:hover .gate__ready,
.gate:focus-visible .gate__ready { color: var(--ink); }

.gate__sound {
  display: inline-flex;
  align-items: center;
  gap: .75em;
  margin-top: .85rem;
  margin-right: -.34em;
  font-size: .54rem;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity .8s ease .3s;
}
.gate.is-ready .gate__sound { opacity: 1; }
.gate.is-ready .sound-toggle__bars i { background: var(--flame); animation: eq 1.1s ease-in-out infinite; }
.gate.is-ready .sound-toggle__bars i:nth-child(2) { animation-delay: -.45s; }
.gate.is-ready .sound-toggle__bars i:nth-child(3) { animation-delay: -.8s; }

/* ---------- entrance ---------- */

.reveal { animation: rise 1.7s var(--ease-out) var(--d, 0s) both; }
/* Behind the gate the page holds; its entrance plays as the visitor steps in. */
html:not(.is-open) .reveal { animation-play-state: paused; }

@keyframes appear { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(10px); } }
@keyframes glint { from { background-position: 150% 0, 0 0; } to { background-position: -50% 0, 0 0; } }
@keyframes simmer { 50% { transform: scale(.92); opacity: .75; } }
@keyframes pilot { 50% { box-shadow: 0 0 22px 2px rgba(255, 122, 30, .95); } }
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  17% { transform: translate(-4%, 3%); }
  33% { transform: translate(3%, -5%); }
  50% { transform: translate(-6%, -2%); }
  67% { transform: translate(5%, 4%); }
  83% { transform: translate(-2%, 6%); }
}

/* ---------- still mode (reduced motion, data saver, autoplay blocked) ---------- */

.is-still .scene { background-image: url(../media/still-landscape.jpg?v=3470c732ca); }
.is-still .scene__video { display: none; }
.is-still .scene__grain { animation: none; }
.is-still .sections,
.is-still .gate { display: none; }

/* ---------- portrait / phones: film on top, words below ---------- */

@media (max-aspect-ratio: 9/10) {
  :root { --focus: 50% 42%; }

  .scene { background-image: url(../media/poster-portrait.jpg?v=2a64eb33a8); }
  .is-still .scene { background-image: url(../media/still-portrait.jpg?v=c6a3c1ced8); }

  .scene__shade {
    background:
      linear-gradient(0deg, rgba(7, 5, 4, .97) 0%, rgba(7, 5, 4, .86) 24%, rgba(7, 5, 4, .4) 40%, rgba(7, 5, 4, 0) 54%),
      linear-gradient(180deg, rgba(7, 5, 4, .5) 0%, rgba(7, 5, 4, 0) 16%);
  }
  .scene__warmth { background: radial-gradient(70% 26% at 30% 74%, rgba(255, 110, 24, .16), transparent 72%); }

  /* Left-aligned, on the same 24px edge as COOK.BEST below. */
  .copy {
    align-self: end;
    justify-self: start;
    width: 100%;
    max-width: 34rem;
    padding: 0 24px clamp(1rem, 3.2vh, 2rem);
    text-align: left;
    transform: none;
  }
  .beat { font-size: clamp(2.1rem, 11vw, 4.4rem); }
  .sections { left: 12px; top: 24%; bottom: auto; margin: 0; gap: 1rem; }
  .section { width: 36px; height: 18px; }
  .section[aria-current] .section__tick { width: 22px; }
  .kicker { letter-spacing: .34em; }
  .waitlist { width: min(100%, 19.5rem); }
  .foot { font-size: .58rem; padding-inline: 24px; }
}

@media (max-aspect-ratio: 9/10) and (max-width: 360px) {
  .kicker { letter-spacing: .26em; }
}

/* Short landscape screens (phones on their side). */
@media (min-aspect-ratio: 9/10) and (max-height: 520px) {
  .copy { transform: none; }
  .sections { display: none; }
  .kicker { margin-top: 1.1rem; letter-spacing: .3em; }
  .waitlist { margin-top: .6rem; width: min(100%, 17rem); }
  .waitlist__field { height: 2.9rem; }
  .waitlist__submit { width: 2.3rem; height: 2.3rem; }
  .waitlist__note { margin-top: .7rem; }
}

/* Reduced motion: a still and the first beat, no word motion, glint, grain or sidebar. */
@media (prefers-reduced-motion: reduce) {
  :root { --heat: .7; }
  .scene,
  .reveal { animation: none; }
  .scene { background-image: url(../media/still-landscape.jpg?v=3470c732ca); }
  .scene__grain { animation: none; }
  .sections,
  .gate { display: none; }
  .beat .w,
  .beat.is-off .w { transform: none; filter: none; transition: opacity .5s ease; }
  .beat.is-on .beat__hot .w::after { animation: none; }
}
@media (prefers-reduced-motion: reduce) and (max-aspect-ratio: 9/10) {
  .scene { background-image: url(../media/still-portrait.jpg?v=c6a3c1ced8); }
}
