/* BEAM · home page.
   "A lamp in a dark room": almost everything is the dark of the board, and the
   beam is the only bright thing. Legal pages keep using /style.css. */

@font-face {
  font-family: Fredoka;
  src: url('/fonts/fredoka.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: Nunito;
  src: url('/fonts/nunito.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  /* palette: the game's own */
  --bg: #14100d;          /* the well behind the board */
  --surface: #1e1814;     /* one step up */
  --surface-2: #29211b;   /* two steps up (hover, open) */
  --ink: #f3ece1;         /* cream text, 16.6:1 on --bg */
  --muted: #b6a892;       /* secondary text, 8.1:1 on --bg, 6.9:1 on --surface-2 */
  --gold: #ffc861;        /* the beam, and the one action */
  --gold-press: #f0b444;
  --on-gold: #1a130d;
  /* beam colours, sampled from the game; used only where light appears */
  --pink: #ff7fae;
  --cyan: #8ff5e8;
  --blue: #86c8ff;

  --disp: Fredoka, ui-rounded, -apple-system, BlinkMacSystemFont, sans-serif;
  --text: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* five type steps */
  --t-display: clamp(40px, 5.6vw, 92px);
  --t-h2: clamp(34px, 4.2vw, 64px);
  --t-h3: clamp(24px, 2.2vw, 32px);
  --t-statement: clamp(20px, 1.9vw, 27px);
  --t-body: clamp(17px, 1.2vw, 19px);
  --t-small: 15px;

  --max: 1280px;
  --edge: clamp(20px, 5vw, 72px);
  --inset: max(var(--edge), calc((100vw - var(--max)) / 2));
  --trace-x: calc(var(--inset) - var(--edge) * 0.5);
  --gap-section: clamp(112px, 14vw, 200px);
  --r-media: 22px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; scrollbar-color: #4a3d31 var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--disp); font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--gold); text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--ink); }
strong { font-weight: 800; color: var(--ink); }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--gold); color: var(--on-gold); padding: 12px 18px;
  border-radius: 999px; font-weight: 800; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- bar ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--inset) 0;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--ink); text-decoration: none;
}
.wordmark img { width: 30px; height: 30px; border-radius: 8px; }
.wordmark span { font-family: var(--disp); font-weight: 600; font-size: 22px; letter-spacing: .01em; }
.bar-links { display: flex; align-items: center; gap: 4px; }
.bar-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--muted); text-decoration: none; font-size: var(--t-small); font-weight: 700;
  border-radius: 999px; transition: color .2s, background-color .2s;
}
.bar-links a:hover, .bar-links a:focus-visible { color: var(--ink); background: var(--surface); }
.bar-links .bar-get { color: var(--gold); }
.bar-links .bar-get:hover, .bar-links .bar-get:focus-visible { color: var(--on-gold); background: var(--gold); }

/* ---------- shared ---------- */
main { position: relative; }
main > section { position: relative; padding-inline: var(--inset); }
.display { font-size: var(--t-display); line-height: .98; letter-spacing: -.025em; }
.h2 { font-size: var(--t-h2); line-height: 1.02; letter-spacing: -.02em; }

/* Each section heading carries a gem that sits on the page beam (see .trace)
   and lights when the beam reaches it. */
.h2, .final-title { position: relative; }
.gem {
  position: absolute; z-index: 2;
  left: calc(var(--trace-x) - var(--inset) - 7px); top: .55em;
  width: 14px; height: 14px; margin-top: -7px;
  background: var(--surface-2);
  transform: rotate(45deg) scale(.8);
  border-radius: 2px;
  transition: background-color .5s, transform .6s var(--ease-out), box-shadow .6s;
}
.gem.is-lit {
  background: var(--gold);
  transform: rotate(45deg) scale(1);
  box-shadow: 0 0 0 4px rgba(255, 200, 97, .16), 0 0 18px rgba(255, 200, 97, .55); /* taste-skill-ignore: a lit gem is a light source */
}

/* The page beam. A 3px line of light that grows down the left edge as you
   read. Only transform changes on scroll. */
.trace {
  position: absolute; z-index: 1; pointer-events: none;
  left: calc(var(--trace-x) - 1.5px);
  top: var(--trace-top, 70vh); height: var(--trace-h, 0px); width: 3px;
}
.trace-lit {
  position: absolute; inset: 0;
  background: var(--gold);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(255, 200, 97, .45); /* taste-skill-ignore: the beam is light */
  transform-origin: top;
  transform: scaleY(var(--trace-p, 0));
}
html:not(.js) .trace { display: none; }

/* ---------- 1. hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center; gap: clamp(32px, 4vw, 72px);
  min-height: min(calc(100svh - 58px), 860px);
  padding-block: clamp(24px, 3vw, 48px) clamp(32px, 4vw, 64px);
}
.hero h1 { color: var(--ink); }
.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.line > span { display: block; white-space: nowrap; }
.lede { margin-top: 28px; max-width: 30ch; font-size: var(--t-statement); line-height: 1.38; color: var(--ink); }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 36px; }
.badge {
  display: inline-block; border-radius: 12px; line-height: 0;
  transition: transform .2s var(--ease-out), filter .2s;
}
.badge img { width: 168px; height: 56px; }
.badge:hover { transform: translateY(-2px); filter: brightness(1.15); }
.badge:active { transform: translateY(0) scale(.98); }
.badge:focus-visible { outline-offset: 5px; border-radius: 12px; }
.soon {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--surface);
  color: var(--muted); font-size: var(--t-small); font-weight: 700;
}
.fine { margin-top: 20px; max-width: 40ch; color: var(--muted); font-size: var(--t-small); }

.hero-shot { margin: 0; position: relative; }
.hero-shot img {
  width: 100%; border-radius: var(--r-media);
  aspect-ratio: 1040 / 940; object-fit: cover;
}

/* ---------- intro ---------- */
.intro { padding-block: clamp(48px, 6vw, 96px) 0; }
.statement { font-size: var(--t-statement); line-height: 1.4; max-width: 44ch; }
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  margin: 64px 0 0;
}
.facts dt { font-family: var(--disp); font-weight: 600; font-size: var(--t-h3); color: var(--gold); line-height: 1.1; }
.facts dd { margin: 10px 0 0; color: var(--muted); font-size: var(--t-small); max-width: 26ch; }

/* ---------- 2. one shot ---------- */
.shot {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center; gap: clamp(32px, 5vw, 96px);
  padding-top: var(--gap-section);
}
.shot-copy p:not(.shot-status) { color: var(--muted); max-width: 42ch; margin-top: 18px; }
.shot-copy .h2 { max-width: 12ch; }
.shot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 32px; }
.fire {
  appearance: none; border: 0; cursor: pointer;
  min-height: 56px; min-width: 168px; padding: 0 36px;
  border-radius: 999px; background: var(--gold); color: var(--on-gold);
  font: 600 22px/1 var(--disp); letter-spacing: .01em;
  transition: transform .18s var(--ease-out), background-color .2s;
}
.fire:hover { background: #ffd47f; transform: translateY(-2px); }
.fire:active { transform: translateY(1px) scale(.97); background: var(--gold-press); }
.fire:disabled { cursor: default; background: var(--surface-2); color: var(--muted); transform: none; }
.reset {
  appearance: none; border: 0; cursor: pointer; background: none;
  min-height: 44px; padding: 0 4px;
  color: var(--gold); font: 700 var(--t-small)/1 var(--text);
  text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1.5px;
}
.reset:hover { color: var(--ink); }
.shot-status { min-height: 1.6em; margin-top: 14px; color: var(--ink); font-weight: 700; }
html:not(.js) .shot-actions { display: none; }

.board { position: relative; aspect-ratio: 1; width: 100%; max-width: 640px; justify-self: end; }
.board img, .board svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.board-lit { opacity: 0; transition: opacity .7s ease; }
html:not(.js) .board-lit,
.board[data-state="lit"] .board-lit { opacity: 1; }
.board-beam { overflow: visible; pointer-events: none; transition: opacity .6s ease; }
.ray {
  fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.ray-gold { stroke: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 200, 97, .9)); } /* taste-skill-ignore: beam glow matches the game */
.ray-pink { stroke: var(--pink); filter: drop-shadow(0 0 6px rgba(255, 127, 174, .9)); } /* taste-skill-ignore */
.ray-blue { stroke: var(--blue); filter: drop-shadow(0 0 6px rgba(134, 200, 255, .9)); } /* taste-skill-ignore */
.board[data-state="firing"] .ray,
.board[data-state="lit"] .ray { animation: draw var(--dur) linear var(--delay) forwards; }
.ray-gold { --dur: .38s; --delay: 0s; }
.ray-pink { --dur: 1.3s; --delay: .38s; }
.ray-blue { --dur: .22s; --delay: 1.68s; }
.board[data-state="lit"] .board-beam { opacity: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- 3. how it plays ---------- */
.how {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 96px);
  padding-top: var(--gap-section);
}
.steps { list-style: none; margin: 0; padding: 0; }
.step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; padding-block: 24px; }
.step:first-child { min-height: 48vh; justify-content: flex-start; padding-top: 56px; }
.step h3 {
  font-size: var(--t-h3); line-height: 1.05; color: var(--muted);
  transition: color .4s;
}
.step p { margin-top: 12px; max-width: 34ch; color: var(--muted); font-size: var(--t-statement); line-height: 1.4; transition: color .4s; }
.step.is-active h3 { color: var(--gold); }
.step.is-active p { color: var(--ink); }
.how-stage { position: relative; }
.step-img { display: none; border-radius: var(--r-media); }
.stage-frame {
  position: sticky; top: 12vh;
  aspect-ratio: 1; width: 100%; max-width: 600px; margin-left: auto;
}
.stage-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transform: scale(.985);
  transition: opacity .5s ease, transform .7s var(--ease-out);
}
.stage-frame[data-show="tilt"] img[data-for="tilt"],
.stage-frame[data-show="fire"] img[data-for="fire"],
.stage-frame[data-show="collect"] img[data-for="collect"] { opacity: 1; transform: none; }

/* ---------- 4. showcase ---------- */
.show { padding-top: var(--gap-section); }
.show-head .h2 { max-width: 16ch; }
.shots {
  list-style: none; margin: 56px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 40px);
}
.card img {
  width: 100%; aspect-ratio: 600 / 1304; object-fit: cover; object-position: top;
  border-radius: var(--r-media); background: var(--surface);
  transition: transform .5s var(--ease-out);
}
.card:hover img { transform: translateY(-6px); }
.card h3 { margin-top: 28px; font-size: var(--t-h3); line-height: 1.1; max-width: 16ch; }
.card p { margin-top: 10px; color: var(--muted); max-width: 38ch; }
.also {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 40px);
  margin: 72px 0 0; padding: 32px 0 0;
}
.also div { background: var(--surface); border-radius: 18px; padding: 24px 26px; }
.also dt { font-weight: 800; color: var(--ink); }
.also dd { margin: 6px 0 0; color: var(--muted); font-size: var(--t-small); }

/* ---------- 5. calm ---------- */
.calm {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(32px, 5vw, 96px);
  padding-top: var(--gap-section);
}
.calm .h2 { grid-column: 1; grid-row: 1; align-self: start; }
.promises { grid-column: 2; grid-row: 1; list-style: none; margin: 0; padding: 0; }
.promises li {
  padding: 22px 0; color: var(--muted);
}
.promises h3 { font-size: var(--t-h3); line-height: 1.1; color: var(--ink); }
.promises p { margin-top: 6px; font-size: var(--t-statement); line-height: 1.4; max-width: 34ch; }
.promises li:first-child { padding-top: 0; }

/* ---------- 6. faq ---------- */
.faq {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 96px);
  padding-top: var(--gap-section);
}
.faq-head { align-self: start; position: sticky; top: 40px; }
.faq-note { margin-top: 24px; color: var(--muted); font-size: var(--t-small); }
.faq-note a { display: inline-flex; align-items: center; min-height: 44px; }
.faq-list { display: grid; gap: 8px; }
.faq details { background: var(--surface); border-radius: 18px; transition: background-color .25s; }
.faq details[open] { background: var(--surface-2); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 72px; padding: 18px 24px;
  font-weight: 800; font-size: var(--t-body); line-height: 1.3; color: var(--ink);
  border-radius: 18px;
  transition: color .2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 6.5h16v3H0zM6.5 0h3v16h-3z' fill='%23ffc861'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  transition: transform .3s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--gold); }
.faq summary:focus-visible { outline-offset: -3px; }
.answer { padding: 0 24px 24px; color: var(--muted); max-width: 62ch; }
.answer p + p { margin-top: 12px; }
.controls { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }

/* ---------- 7. final ---------- */
.final {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 48px;
  padding-top: var(--gap-section); padding-bottom: clamp(96px, 10vw, 160px);
}
.final-title { position: relative; }
.final-copy > p { margin-top: 22px; max-width: 40ch; color: var(--muted); font-size: var(--t-statement); line-height: 1.4; }
.qr { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 220px; }
.qr-card {
  display: block; padding: 18px; border-radius: 22px; background: #fff;
  transition: transform .25s var(--ease-out);
}
.qr-card:hover { transform: translateY(-3px); }
.qr-card img { width: 160px; height: 160px; }
.qr p { color: var(--muted); font-size: var(--t-small); text-align: center; }

/* ---------- 8. footer ---------- */
.foot {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px 32px;
  padding: 0 var(--inset) 40px;
}
.foot-mark {
  grid-column: 1 / -1;
  font-family: var(--disp); font-weight: 600; line-height: .8; letter-spacing: -.04em;
  font-size: clamp(96px, 24vw, 340px); color: #3a2f26; user-select: none;
  margin-bottom: 24px;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 0 8px; margin-left: -12px; }
.foot-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--ink); font-weight: 700; font-size: var(--t-small); text-decoration: none; border-radius: 999px;
  transition: background-color .2s, color .2s;
}
.foot-links a:hover, .foot-links a:focus-visible { background: var(--surface); color: var(--gold); }
.foot-credit { color: var(--muted); font-size: var(--t-small); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .line > span { animation: rise .95s var(--ease-out) both; }
  .hero .line:nth-child(2) > span { animation-delay: .11s; }
  .hero .lede, .hero .stores, .hero .fine { animation: fade-up .8s var(--ease-out) .45s both; }
  .hero-shot { animation: fade-in 1.2s ease .2s both; }
  .hero-shot img { animation: drift 18s ease-in-out 1.4s infinite alternate; }

  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .9s var(--ease-out); transition-delay: var(--d, 0s); }
  .js .reveal.in { opacity: 1; transform: none; }
}
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.035); } }
.hero-shot { overflow: hidden; border-radius: var(--r-media); }

@media (prefers-reduced-motion: reduce) {
  /* Keep state changes (fades, colour), drop travel. */
  html { scroll-behavior: auto; }
  .badge:hover, .fire:hover, .fire:active, .qr-card:hover, .card:hover img,
  .stage-frame img, .gem, .gem.is-lit { transform: none; }
  .gem { transform: rotate(45deg); }
  .ray { animation: none !important; }
}

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
}

/* ---------- phone and small tablet ---------- */
@media (max-width: 959px) {
  :root { --edge: 24px; --trace-x: calc(var(--inset) - 15px); }
  .bar-links a:not(.bar-get) { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 28px; padding-top: 20px; }
  .hero .display { font-size: clamp(38px, 10.6vw, 72px); }
  .lede { margin-top: 18px; }
  .stores { gap: 10px 12px; }
  .stores { margin-top: 24px; }
  .fine { margin-top: 14px; }
  .hero-shot { max-width: 720px; }

  .facts { margin-top: 44px; gap: 28px 20px; }

  .shot, .how, .calm, .faq { grid-template-columns: 1fr; }
  .board { justify-self: start; }

  /* pinned stage sits above the steps on phones */
  .how { gap: 0; }
  .how-stage { display: none; }
  .step-img { display: block; width: 100%; max-width: 420px; margin-bottom: 8px; }
  .step h3 { color: var(--gold); }
  .step p { color: var(--ink); }
  .step, .step:first-child { min-height: 0; justify-content: flex-start; padding-top: 32px; }

  .shots {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: calc(var(--inset) * -1); padding: 0 var(--inset) 12px;
    scroll-padding-inline: var(--inset); scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .shots::-webkit-scrollbar { display: none; }
  .card { flex: 0 0 72%; max-width: 320px; scroll-snap-align: start; }
  .also { grid-template-columns: 1fr; gap: 10px; margin-top: 40px; padding-top: 0; }

  .calm .h2, .promises { grid-column: 1; grid-row: auto; }
  .promises { margin-top: 40px; }
  .faq-head { position: static; }
  .final { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .badge img { width: 150px; height: 50px; }
}
