/* =========================================================================
   GOAT Lifestyle — "Brand Journey" attract loop
   One component, two layouts. Base styles = mobile/portrait (container-query
   units against .screen). Landscape/desktop overrides live in the media query
   at the bottom. Every value is a token or comes straight from the spec (§4/§5).
   ========================================================================= */

:root {
  /* --- 4.1 Colour --- */
  --blue-072: #000F9F;
  --periwinkle: #9EADE5;
  --bronze: #8B7547;
  --gold: #C7A868;
  --neutral-black: #222222;
  --ink: #F5F6F8;
  --ink-muted: #C6CAD2;
  --ink-faint: #8A8F9B;
  --stage-a: #0E1A4A;
  --stage-b: #070C20;
  --stage-c: #050608;
  --grid-line: rgba(158, 173, 229, 0.05);
  --track: rgba(255, 255, 255, 0.18);        /* mobile progress track */
  --move-grad: linear-gradient(92deg, #6E80FF, #9EADE5);

  /* --- 4.3 Type families --- */
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* --- 4.4 Motion distances (mobile defaults; landscape overrides below) --- */
  --rise-in: 14px;     /* jIn translateY */
  --rise-up: 30px;     /* jUp translateY */
  --slam-scale: 1.18;  /* jSlam start scale */
  --burns-from: 1.04;
  --burns-to: 1.15;

  /* --- per-beat dynamic values, written by journey.js --- */
  --accent: var(--periwinkle);
  --wash-color: var(--blue-072);
  --heroOp: 0;
  --bgOp: 0;
  --photoScrim: 0;
  --washOp: 0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--stage-c);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
img { display: block; }
::selection { background: var(--blue-072); color: #fff; }

/* --- 4.4 Keyframes (transform/opacity only; no layout-affecting props) --- */
@keyframes jIn   { from { opacity: 0; transform: translateY(var(--rise-in)); } to { opacity: 1; transform: none; } }
@keyframes jUp   { from { opacity: 0; transform: translateY(var(--rise-up)); } to { opacity: 1; transform: none; } }
@keyframes jSlam { 0% { opacity: 0; transform: scale(var(--slam-scale)); } 55% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
@keyframes jLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes jBurns { from { transform: scale(var(--burns-from)); } to { transform: scale(var(--burns-to)); } }
@keyframes jDot  { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes goatFill { from { width: 0; } to { width: 100%; } }

/* =========================== Stage / screen ============================== */
.stage {
  position: relative;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}
.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: pointer;
  container-type: size;                 /* makes cqw/cqh resolve to viewport */
  background: radial-gradient(135% 80% at 60% 24%, var(--stage-a) 0%, var(--stage-b) 52%, var(--stage-c) 100%);
  color: var(--ink);
}

/* =========================== Background layers =========================== */
.photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1s ease;
  animation: jBurns 20s ease-in-out infinite alternate;
}
.photo--hero { object-position: 46% 30%; opacity: var(--heroOp); }
.photo--bg   { object-position: 62% 30%; opacity: var(--bgOp); }

.grid {
  position: absolute;
  inset: -2px;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 11cqw 11cqw;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 28%, transparent 76%);
  mask-image: radial-gradient(circle at 50% 46%, #000 28%, transparent 76%);
  opacity: 0.5;
}

.scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--photoScrim);
  transition: opacity 1s ease;
}
/* mobile: single bottom scrim on layer A; layer B unused (desktop only) */
.scrim--a { background: linear-gradient(to top, rgba(5,6,8,0.94) 6%, rgba(5,6,8,0.4) 38%, rgba(5,6,8,0.05) 72%); }
.scrim--b { background: none; }

.wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--washOp);
  transition: opacity 0.8s ease;
  background: radial-gradient(circle at 50% 42%, var(--wash-color) 0%, transparent 60%);
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, transparent 52%, rgba(0,0,0,0.52) 100%);
}

/* =========================== Persistent chrome =========================== */
.progress {
  position: absolute;
  top: 7cqh;
  left: 5cqw;
  right: 5cqw;
  z-index: 6;
  display: flex;
  gap: 1.4cqw;
}
.seg {
  flex: 1;
  height: 2.4px;
  background: var(--track);
  overflow: hidden;
  border-radius: 2px;
}
.seg-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
}

.chrome--logo {
  position: absolute;
  top: 10.5cqh;
  left: 5cqw;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  opacity: 0.94;
}
.chrome--logo .mark { height: 5.4cqw; width: auto; }
.chrome--logo .word { height: 3.7cqw; width: auto; }

.readout {
  position: absolute;
  z-index: 6;
  font-family: var(--font-mono);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1;
}
.chrome--est  { top: 10.9cqh; right: 5cqw; font-size: 2.7cqw; letter-spacing: 0.22em; color: rgba(158,173,229,0.55); }
.chrome--move { display: none; }                                   /* desktop only */
.chrome--skip { bottom: 4.4cqh; left: 0; right: 0; text-align: center; font-size: 2.7cqw; letter-spacing: 0.26em; color: rgba(245,246,248,0.34); }

/* =========================== Beat content ================================ */
.beat {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
}
.beat--center { align-items: center; justify-content: center; text-align: center; padding: 8cqw; }
.beat--editorial {
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  padding: 0 7cqw 13cqh;
}

/* Desktop-only forced break (manifesto). Hidden on mobile so the line wraps
   naturally; the preceding space keeps the words separated when collapsed. */
.brk { display: none; }

/* accent-word helpers (tokens, not raw literals) */
.t-peri { color: var(--periwinkle); }
.t-gold { color: var(--gold); }
.move-grad {
  background: var(--move-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--periwinkle);            /* fallback if clip unsupported */
}

/* ---- Beat 0: logo open (single stacked lockup) ---- */
.open-stacked { height: 38cqw; width: auto; animation: jIn 0.85s ease 0.1s both; }
.open-rule {
  width: 16cqw; height: 1px;
  background: rgba(158,173,229,0.5);
  margin: 6cqw 0 4cqw;
  transform-origin: center;
  animation: jLine 0.7s ease 0.4s both;
}
.open-label {
  font-family: var(--font-body); font-weight: 600;
  font-size: 3.1cqw; letter-spacing: 0.42em; text-transform: uppercase; line-height: 1;
  color: var(--periwinkle);
  animation: jIn 0.8s ease 0.5s both;
}

/* ---- Kicker (editorial + tagline) ---- */
.kicker {
  display: inline-flex; align-items: center; gap: 2cqw;
  font-family: var(--font-body); font-weight: 700;
  font-size: 3.1cqw; letter-spacing: 0.3em; text-transform: uppercase; line-height: 1;
  margin-bottom: 5cqw;
  animation: jIn 0.7s ease 0.05s both;
}
.kicker--peri { color: var(--periwinkle); }
.kicker--gold { color: var(--gold); }
.kicker-rule { width: 6cqw; height: 1px; background: currentColor; }

/* ---- Editorial headline (beats 1,2) ---- */
.hl-editorial {
  font-family: var(--font-display); font-weight: 800; font-stretch: 96%;
  font-size: 8.2cqw; line-height: 1.05; letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 0 4px 22px rgba(0,0,0,0.55);
  /* Cap to the container's content box so the line wraps inside the padding
     instead of being shrink-wrapped to content and overflowing (a flex-start
     column item is content-sized otherwise; % and cqw both mis-resolve here, so
     use vw — equivalent since the screen is full-bleed = viewport). 86vw =
     100vw − 2×7vw padding. Enforces §1.7 (no overflow). Desktop → 18ch/20ch. */
  max-width: 86vw;
  animation: jUp 0.9s ease 0.2s both;
}

/* ---- Tagline kicker (centered, above headline) ---- */
.tag-kicker {
  font-family: var(--font-body); font-weight: 600;
  font-size: 3cqw; text-transform: uppercase; line-height: 1;
  margin-bottom: 4cqw;
  animation: jIn 0.6s ease 0.05s both;
}
.tag-kicker--wide { letter-spacing: 0.34em; }
.tag-kicker--wide5 { letter-spacing: 0.32em; }

/* ---- Tagline headline (beats 3,4,5) ---- */
.hl-tag {
  font-family: var(--font-display); font-weight: 900; font-stretch: 120%;
  text-transform: uppercase; line-height: 0.9; letter-spacing: -0.01em;
  white-space: nowrap; /* break only at <br>; fitText scales each line to fit */
  animation: jSlam 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hl-tag--big { font-size: 18cqw; }   /* beats 3 & 4 */
.hl-tag--long { font-size: 15cqw; }  /* beat 5 (longer line) */

/* ---- Manifesto (beat 6) ---- */
.hl-manifesto {
  font-family: var(--font-display); font-weight: 900; font-stretch: 106%;
  text-transform: uppercase; font-size: 11.5cqw; line-height: 0.98; letter-spacing: -0.01em;
  animation: jUp 0.9s ease 0.05s both;
}
.subline {
  font-family: var(--font-body); font-weight: 500;
  font-size: 3.5cqw; letter-spacing: 0.03em; line-height: 1.6;
  color: var(--ink-muted);
  margin-top: 5cqw;
  animation: jIn 0.8s ease 0.55s both;
}

/* ---- Finale (beat 7) ---- */
.finale-logo {
  display: flex; align-items: center; gap: 3cqw;
  margin-bottom: 6cqw;
  animation: jIn 0.8s ease 0.05s both;
}
.finale-logo .mark { height: 11cqw; width: auto; }
.finale-logo .word { height: 7.6cqw; width: auto; }
.hl-finale {
  font-family: var(--font-display); font-weight: 900; font-stretch: 122%;
  text-transform: uppercase; font-size: 16.5cqw; line-height: 0.9; letter-spacing: -0.012em;
  white-space: nowrap; /* break only at <br>; fitText scales to fit */
  animation: jUp 0.9s ease 0.2s both;
}
.chip {
  display: inline-flex; align-items: center; gap: 2.4cqw;
  padding: 2.4cqw 4.6cqw;
  border: 1px solid rgba(158,173,229,0.3);
  border-radius: 999px;
  background: rgba(8,11,22,0.5);
  margin-top: 6.5cqw;
  animation: jIn 0.8s ease 0.6s both;
}

/* Inline finale email signup (no navigation) */
.signup {
  display: flex; flex-direction: column; align-items: center;
  gap: 3.5cqw;
  width: 100%; max-width: 440px;
  margin-top: 6cqw;
  animation: jIn 0.8s ease 0.78s both;
}
.signup__row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px;
  width: 100%;
}
.signup__input {
  flex: 1 1 220px; min-width: 0;
  padding: 0.95rem 1.1rem;
  font-family: var(--font-body); font-size: 1rem; font-weight: 500;
  color: var(--ink);
  background: rgba(8, 11, 22, 0.6);
  border: 1px solid rgba(158, 173, 229, 0.3);
  border-radius: 12px;
}
.signup__input::placeholder { color: var(--ink-faint); }
.signup__input:focus-visible {
  outline: none;
  border-color: var(--periwinkle);
}
.signup__btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.95rem 1.5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--stage-c);
  background: var(--periwinkle);
  border: 0; border-radius: 12px; cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.signup__btn:hover:not(:disabled),
.signup__btn:focus-visible { background: #B6C2EE; transform: translateY(-1px); }
.signup__btn:disabled { opacity: 0.6; cursor: progress; }
.notify-cta__arrow { font-size: 1.15em; transition: transform 0.2s ease; }
.signup__btn:hover:not(:disabled) .notify-cta__arrow { transform: translateX(2px); }
/* Turnstile renders interaction-only (hidden unless a challenge is needed),
   so no reserved space — it expands only if a challenge actually appears. */
.signup__turnstile { display: flex; justify-content: center; }
.signup__turnstile:empty { display: none; }
.signup__status {
  min-height: 1.2em;
  font-family: var(--font-body); font-size: 0.9rem; letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.signup__status.is-error { color: #E57373; }
.signup__status.is-success { color: var(--periwinkle); }
/* Honeypot — hidden from humans, tempting to bots. */
.signup__hp {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.chip-dot {
  width: 1.8cqw; height: 1.8cqw; min-width: 6px; min-height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: jDot 1.8s ease-in-out infinite;
}
.chip-label {
  font-family: var(--font-body); font-weight: 600;
  font-size: 3cqw; letter-spacing: 0.24em; text-transform: uppercase; line-height: 1;
  color: var(--periwinkle);
  white-space: nowrap;
}

/* ============================================================ *
 *  Landscape / desktop layout (one component, switch on form)  *
 * ============================================================ */
@media (orientation: landscape) and (min-width: 768px) {
  :root {
    --track: rgba(255, 255, 255, 0.16);
    --rise-in: 22px;
    --rise-up: 44px;
    --slam-scale: 1.2;
    --burns-from: 1.03;
    --burns-to: 1.13;
  }

  .screen {
    background: radial-gradient(130% 105% at 66% 26%, var(--stage-a) 0%, var(--stage-b) 52%, var(--stage-c) 100%);
  }

  .photo--hero { object-position: center 26%; }
  .photo--bg   { object-position: 30% center; }

  .grid {
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
    mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
  }
  .scrim--a { background: linear-gradient(95deg, rgba(5,6,8,0.86) 12%, rgba(5,6,8,0.42) 50%, rgba(5,6,8,0.12) 84%); }
  .scrim--b { background: linear-gradient(to top, rgba(5,6,8,0.9) 2%, rgba(5,6,8,0.28) 30%, transparent 60%); }
  .wash { background: radial-gradient(circle at 50% 44%, var(--wash-color) 0%, transparent 62%); }
  .vignette { background: radial-gradient(125% 100% at 50% 50%, transparent 54%, rgba(0,0,0,0.5) 100%); }

  /* chrome */
  .progress { top: 0; left: 0; right: 0; padding: 14px 16px; gap: 5px; }
  .seg { height: 3px; }
  .chrome--logo { top: 34px; left: 32px; gap: 11px; opacity: 0.92; }
  .chrome--logo .mark { height: 26px; }
  .chrome--logo .word { height: 18px; }
  .chrome--est  { top: 40px; right: 32px; font-size: 10px; letter-spacing: 0.24em; }
  .chrome--move { display: block; bottom: 30px; left: 32px; font-size: 10px; letter-spacing: 0.26em; color: rgba(245,246,248,0.4); }
  .chrome--skip { bottom: 30px; right: 32px; left: auto; text-align: right; font-size: 10px; letter-spacing: 0.24em; color: rgba(245,246,248,0.3); }

  /* beat containers */
  .beat--center { padding: 40px; }
  .beat--editorial { padding: 0 6vw 12vh; max-width: 1100px; }
  .beat--manifesto { max-width: 1000px; margin: 0 auto; }
  .brk { display: initial; }

  /* beat 0 */
  .open-stacked { height: clamp(112px, 16vw, 188px); }
  .open-rule { width: 64px; margin: 26px 0 18px; }
  .open-label { font-size: clamp(11px, 1.5vw, 13px); }

  /* kicker */
  .kicker { gap: 9px; font-size: 12px; letter-spacing: 0.32em; margin-bottom: 24px; }
  .kicker-rule { width: 24px; }

  /* editorial headline */
  .hl-editorial { font-stretch: 92%; font-size: clamp(30px, 4.8vw, 64px); line-height: 1.04; text-shadow: 0 6px 30px rgba(0,0,0,0.5); }
  .hl-editorial--b1 { max-width: 18ch; }
  .hl-editorial--b2 { max-width: 20ch; }

  /* tagline */
  .tag-kicker { font-size: clamp(11px, 1.5vw, 13px); margin-bottom: 18px; }
  .tag-kicker--wide { letter-spacing: 0.4em; }
  .tag-kicker--wide5 { letter-spacing: 0.4em; }
  .hl-tag { font-stretch: 125%; }
  .hl-tag--big { font-size: clamp(52px, 11vw, 140px); }
  .hl-tag--long { font-size: clamp(44px, 9.5vw, 124px); }

  /* manifesto */
  .hl-manifesto { font-stretch: 108%; font-size: clamp(32px, 6vw, 82px); }
  .subline { font-size: clamp(14px, 1.8vw, 18px); margin-top: 24px; }

  /* finale */
  .finale-logo { gap: 15px; margin-bottom: 30px; }
  .finale-logo .mark { height: 46px; }
  .finale-logo .word { height: 32px; }
  .hl-finale { font-stretch: 125%; font-size: clamp(50px, 10vw, 128px); line-height: 0.88; }
  .chip { gap: 10px; padding: 8px 18px; border-color: rgba(158,173,229,0.28); margin-top: 30px; }
  .chip-dot { width: 7px; height: 7px; }
  .chip-label { font-size: 11px; letter-spacing: 0.26em; }
  .signup { gap: 14px; margin-top: 24px; }
}

/* ===================== Reduced motion (§7/§10) ====================== *
 * Disable all motion; content rests fully visible; sequence still advances
 * (the timer in journey.js keeps running, it just cuts between beats).      */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
