@font-face {
  font-family: "DM Sans";
  src: url("assets/fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  /* The site keeps its own fixed colors in light and dark: each part of the walk sets its own field. */
  color-scheme: light;
  --ink: #111111;
  --cream: #F8F4EB;
  --cobalt: #3455FF;

  /* The walk: daylight cream, dusk, festival night, then a lantern-lit glow. */
  --peach: #EBC3A5;
  --dusk: #5B4C8C;
  --night: #0B1140;
  --night-deep: #0A0E33;
  --glow: #24132F;
  --glow-deep: #170B1F;
  --line-night: rgba(248, 244, 235, 0.34);

  /* The day part (the logo, "Why the eyes", the numbers) follows the system: cream with ink by default,
     ink with cream in dark mode, as the brand guide pairs them. Everything from dusk on keeps its own colours. */
  --day: var(--cream);
  --day-ink: var(--ink);
  --day-mid: var(--peach);

  /* Palette colors, used by the drifting lanterns, the walkthrough and the tiny level. */
  --p1: #ff7a1a;
  --p2: #ffc21a;
  --p3: #b8123c;
  --p4: #2ee0f0;
  --accent: #ffc21a;

  --gutter: clamp(16px, 4vw, 64px);
  /* Half an O of the wordmark is about 9.5% of its width, so 84vw leaves that clear space each side. */
  --mark-width: 84vw;
  --section-y: clamp(80px, 11vw, 176px);

  --text-body: clamp(1.0625rem, 0.98rem + 0.35vw, 1.3125rem);
  --text-small: clamp(0.9375rem, 0.9rem + 0.15vw, 1.0625rem);
  --text-h2: clamp(2.5rem, 1.5rem + 4.6vw, 6.25rem);
  --text-lede: clamp(1.5rem, 1.15rem + 1.6vw, 2.75rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --day: #111111; --day-ink: #F8F4EB; --day-mid: #3b2a44; }
  /* The ink nav pill would vanish on the ink page, so it gets a faint cream edge. */
  .dock { box-shadow: inset 0 0 0 1px rgba(248, 244, 235, 0.2); }
}
html[data-palette="redgreen"] { --p1: #fd791b; --p2: #c2af9a; --p3: #810565; --p4: #0adbf8; --accent: #0adbf8; }
html[data-palette="blueyellow"] { --p1: #ff7d24; --p2: #ffc21a; --p3: #ae193a; --p4: #13e1f2; --accent: #c5a4d8; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 84px;
}
/* Smooth jumps only without scripts. With scripts, Lenis glides instead, and ScrollTrigger must be able to jump
   instantly when it measures: if it ever sees "smooth" here, it writes it back onto the page and every pin lands off. */
html:not(.js) { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--day);
  color: var(--day-ink);
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: break-word;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

h2, h3, .lede, dt { font-weight: 500; }

h2 {
  font-size: var(--text-h2);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 30;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--cream);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.wrap {
  max-width: 1560px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.label {
  font-size: var(--text-small);
  font-weight: 500;
  margin-bottom: 20px;
}

/* Logo poses: stacked pieces of artwork, one showing at a time. */
.poses { display: grid; }
/* Each pose is a <picture> with the cream art for dark mode; the img inside is what stacks. */
.poses picture,
.dusk-eyes picture { display: contents; }
.poses img {
  grid-area: 1 / 1;
  width: 100%;
  visibility: hidden;
}
.poses[data-pose="left"] .is-left,
.poses[data-pose="closed"] .is-closed,
.poses[data-pose="rest"] .is-rest { visibility: visible; }

/* The dock: a quiet nav that stays, with a thin lantern-light line for how far you are. */
.dock {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100vw - 24px);
  padding: 2px 6px 2px 4px;
  background: rgba(17, 17, 17, 0.9);
  color: var(--cream);
  border-radius: 999px;
  transform: translateX(-50%);
  font-size: 0.9375rem;
  font-weight: 500;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.dock a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; border-radius: 999px; }
.dock a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.dock :focus-visible { outline-color: var(--cream); outline-offset: -3px; }
.dock-home { flex: none; padding-inline: 8px; }
.dock-home img { width: 34px; max-width: none; }
.dock ul { display: flex; }
.dock li a { padding-inline: clamp(8px, 1.4vw, 14px); }
.dock-progress {
  position: absolute;
  left: 18px; right: 18px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Part 1. The poster, in daylight cream */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 84px var(--gutter) 0;
}
.hero-kicker { font-size: var(--text-small); font-weight: 500; }

.hero-mark {
  width: var(--mark-width);
  max-width: 100%;
  margin: 6vw auto;
  align-self: center;
  justify-self: center;
  font-size: inherit;
}

.hero-stage { display: grid; align-items: center; }

/* The sky drop (intro.js): the first screen is only the logo, front and center.
   The kicker, lede and sound button wait below the fold and rise in on scroll. */
.drop .hero { display: flex; flex-direction: column; min-height: 0; padding-top: 0; }
.drop .hero-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  place-items: center;
}
.drop .hero-mark { margin: 0 auto; }
.drop .hero-kicker { order: 2; margin: 0; padding-top: clamp(24px, 4vw, 56px); }
.drop .hero-foot { order: 3; }
.drop .hero-mark:not(.is-live) img { visibility: hidden; }
.hero-mark.is-live img { display: none; }
.drop-svg { display: block; width: 100%; height: auto; overflow: visible; }
.drop-svg .dm-lid { opacity: 0; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 5svh, 48px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--day-ink);
  font-size: var(--text-small);
  font-weight: 500;
  text-decoration: none;
  transform: translateX(-50%);
}
.scroll-cue svg {
  width: 16px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: cue-bob 1.6s ease-in-out infinite;
}
.scroll-cue:hover span { text-decoration: underline; text-decoration-thickness: 2px; }
@keyframes cue-bob { 50% { transform: translateY(6px); } }

/* The dock waits until the eyes have looked down at the cue; keyboard focus always shows it. */
.drop:not(.drop-docked) .dock:not(:focus-within) { opacity: 0; transform: translate(-50%, -140%); }
.dock { transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out); }

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px clamp(24px, 6vw, 96px);
  padding-block-end: clamp(24px, 4vw, 56px);
}
.lede {
  max-width: 27em;
  font-size: var(--text-lede);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}

.cue {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px 10px 16px;
  background: var(--day-ink);
  color: var(--day);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: var(--text-small);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease-out;
}
.cue:hover { background: var(--cobalt); color: var(--cream); }   /* cream on cobalt, never ink (3.5:1) */
.cue:focus-visible { outline-color: var(--day-ink); }
.cue svg { flex: none; width: 18px; height: 18px; fill: currentColor; }

.numbers { padding-block: var(--section-y) 0; }
.numbers h2 { max-width: 12em; }
.big-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 64px);
  margin-top: clamp(48px, 7vw, 112px);
}
.big-stats > div {
  padding-block: clamp(20px, 2.4vw, 36px);
  border-top: 2px solid currentColor;
}
.big-stats dt {
  font-size: clamp(4.25rem, 1.6rem + 11vw, 13rem);
  line-height: 0.86;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: -0.04em;
}
.big-stats dd {
  max-width: 24em;
  margin-top: clamp(12px, 1.4vw, 20px);
  font-size: var(--text-small);
}

.studio { padding-block: var(--section-y); }
.studio-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: center;
}
.studio-eyes { grid-column: 1 / span 7; width: 100%; cursor: pointer; }
.studio-copy { grid-column: 8 / span 5; }
.studio-copy h2 { font-size: clamp(2rem, 1.3rem + 3vw, 4rem); margin-bottom: 20px; }
.studio-copy .short { margin-top: 1em; font-weight: 500; }

/* Part 2. Dusk falls over the game's own loading screen. */
.dusk { position: relative; background: var(--night); }
.dusk-stage {
  position: relative;
  height: max(118vh, 680px);
  overflow: hidden;
  background: var(--night);
}
.dusk-art,
.dusk-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.dusk-art img { object-fit: cover; object-position: 50% 78%; }
/* Without motion this gradient is the whole sunset: cream, peach, dusk, into the art's night sky,
   then out of the lawn into the night below. */
.dusk-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      var(--day) 0%,
      var(--day-mid) 9%,
      var(--dusk) 20%,
      rgba(11, 17, 64, 0.6) 32%,
      rgba(11, 17, 64, 0) 46%,
      rgba(11, 17, 64, 0) 74%,
      var(--night) 100%);
}
.dusk-veil { display: none; }
.lamps { position: absolute; inset: 0; pointer-events: none; }
.lamps .lamp { position: absolute; left: var(--x); top: var(--y); }
.lamps .twin { display: none; }
.dusk-logo {
  position: absolute;
  top: 24%;
  left: 50%;
  width: clamp(260px, 30vw, 560px);
  transform: translate(-50%, -50%);
}
.dusk-logo img { position: relative; }
.dusk-glow {
  position: absolute;
  inset: -30% -20%;
  background: radial-gradient(closest-side, rgba(255, 214, 140, 0.55), rgba(255, 170, 70, 0.18) 55%, transparent 75%);
}

/* The lantern: the game's own paper lantern sprite, tinted the way the game tints it.
   The sprite's shape is filled with the lantern color, then the grey sprite multiplies on top for its ribs and shading. */
.lamp {
  --c: var(--p1);
  --s: 56px;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--s);
  aspect-ratio: 1;
  isolation: isolate;
}
.lamp::before,
.lamp::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}
.lamp::before {
  background: var(--c);
  -webkit-mask: url("assets/game/sprites/lantern.webp") center / contain no-repeat;
  mask: url("assets/game/sprites/lantern.webp") center / contain no-repeat;
}
.lamp::after {
  background: url("assets/game/sprites/lantern.webp") center / contain no-repeat;
  mix-blend-mode: multiply;
  filter: brightness(1.45) contrast(1.15);
}
/* The count sits low on the body, as in the game, on a dark pill so it reads on every color. */
.lamp b {
  position: relative;
  z-index: 1;
  margin-top: 36%;
  padding: 0.06em 0.32em;
  border-radius: 0.6em;
  background: rgba(17, 17, 17, 0.8);
  color: #fff;
  font-weight: 600;
  font-size: calc(var(--s) * 0.24);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
/* Lanterns in the sky glow with their own color. */
.lamps .lamp,
.twin,
.statement-lamps .lamp {
  filter: drop-shadow(0 0 calc(var(--s) * 0.22) rgba(255, 190, 90, 0.75));
  filter: drop-shadow(0 0 calc(var(--s) * 0.22) color-mix(in srgb, var(--c) 80%, #fff3c0));
}

/* The night: cream text on the game's own sky */
.night {
  position: relative;
  background-color: var(--night);
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(248, 244, 235, 0.75), transparent),
    radial-gradient(1px 1px at 68% 8%, rgba(248, 244, 235, 0.6), transparent),
    radial-gradient(1.4px 1.4px at 38% 64%, rgba(248, 244, 235, 0.5), transparent),
    radial-gradient(1px 1px at 86% 46%, rgba(248, 244, 235, 0.65), transparent),
    radial-gradient(1px 1px at 24% 88%, rgba(248, 244, 235, 0.45), transparent),
    radial-gradient(1.2px 1.2px at 56% 34%, rgba(248, 244, 235, 0.4), transparent);
  background-size: 380px 420px;
  color: var(--cream);
}
.night > .wrap { position: relative; z-index: 1; }
/* Lantern light out of focus, layered behind the text. */
.bokeh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bokeh i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 1;
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 190, 110, 0.16), transparent);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 22%, transparent), transparent);
}

/* One big moment between the colors and the features */
.statement { padding-block: clamp(64px, 10vw, 160px); text-align: center; overflow: hidden; }
.statement-text {
  max-width: 11em;
  margin-inline: auto;
  font-size: clamp(2.5rem, 0.9rem + 6.6vw, 8rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.statement-lamps {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 5vw, 80px);
  margin-top: clamp(40px, 6vw, 88px);
}
.statement-lamps .lamp { --s: clamp(48px, 7vw, 104px); }
.statement-lamps li:nth-child(odd) { transform: translateY(-18%); }
.night :focus-visible { outline-color: var(--cream); }

.game { padding-block: clamp(24px, 4vw, 64px) var(--section-y); }
.game-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: start;
}
.game-copy { grid-column: 1 / span 6; padding-top: clamp(24px, 4vw, 64px); }
.game-copy h2 { margin-block: 20px clamp(24px, 3vw, 40px); }
.game-copy .body { max-width: 34em; }
.game-copy .body p + p { margin-top: 1em; }
.game-links { font-size: var(--text-small); }
.game-links a { display: inline-block; padding-block: 11px; }
.game-lead { grid-column: 8 / span 4; margin-top: calc(-1 * clamp(40px, 6vw, 120px)); position: relative; }

.shot {
  border-radius: clamp(26px, 3vw, 44px);
  border: clamp(6px, 0.7vw, 10px) solid var(--ink);
  background: var(--ink);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
}
.shot { aspect-ratio: 860 / 1864; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
figcaption {
  margin-top: 12px;
  font-size: var(--text-small);
}

/* How a level plays */
.how { padding-block: var(--section-y) clamp(40px, 6vw, 96px); }
.how-title { margin-bottom: clamp(32px, 5vw, 64px); }
.how-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "board board board board board board . shots shots shots shots shots"
    "steps steps steps steps steps steps steps steps steps steps steps steps";
  column-gap: clamp(16px, 2vw, 32px);
  align-items: center;
}
.how .board { grid-area: board; }
.steps { grid-area: steps; }
.how-shots { width: 100%; grid-area: shots; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px clamp(16px, 2vw, 32px);
  margin-top: clamp(40px, 5vw, 72px);
  counter-reset: none;
}
.steps li { border-top: 2px solid var(--line-night); padding-top: 16px; }
.step-n {
  display: block;
  font-size: var(--text-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-bottom: 8px;
}
.steps h3 { font-size: clamp(1.25rem, 1rem + 1vw, 2rem); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 10px; }
.steps p { font-size: var(--text-small); max-width: 30em; }

/* The board: a small picture in the game's frame, the moon pool, pads and the lanterns waiting. */
.board {
  position: relative;
  container-type: inline-size;
  width: 100%;
  max-width: 480px;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 3cqw;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 0.8cqw;
  width: 100%;
  padding: 1cqw;
  background: #f3d9a8;
  border-style: solid;
  border-width: 5.6cqw 4.4cqw 5.2cqw;
  border-color: #f5b95f;
  border-image: url("assets/game/sprites/frame.webp") 81 63 75 63 fill stretch;
  border-radius: 4cqw;
  filter: drop-shadow(0 2cqw 3cqw rgba(0, 0, 0, 0.35));
}
/* Tiles: the game's glossy cubes. */
.t {
  aspect-ratio: 1;
  border-radius: 1.3cqw;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.5) 0 14%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.24)),
    var(--tc);
  box-shadow: 0 0.5cqw 0.5cqw rgba(0, 0, 0, 0.28);
}
.t.o { --tc: var(--p1); }
.t.g { --tc: var(--p2); }
.t.c { --tc: var(--p3); }
.t.y { --tc: var(--p4); }
.t.gone, .t.x { visibility: hidden; }
/* With scripts, the game's own cube art: the tinted cube over its shadow, every shadow below every cube, no gaps. */
.board.cubes .tiles { gap: 0; padding: 2cqw; }
/* One tile with the cube art: the board is 100cqw, less the frame (8.8) and the tray (4). Spirits are sized from it. */
.board { --pitch: calc((100cqw - 12.8cqw) / var(--cols, 7)); }
.board.cubes .t { position: relative; background: none; box-shadow: none; border-radius: 0; }
.board.cubes .t::before,
.board.cubes .t::after { content: ""; position: absolute; inset: -50%; background-size: 100% 100%; background-repeat: no-repeat; pointer-events: none; }
.board.cubes .t::before { background-image: url("assets/game/level/cube-shadow.webp"); z-index: 0; }
.board.cubes .t::after { z-index: 1; }
.board.cubes .t.o::after { background-image: var(--cube-o); }
.board.cubes .t.g::after { background-image: var(--cube-g); }
.board.cubes .t.c::after { background-image: var(--cube-c); }
.pool {
  position: relative;
  width: 20cqw;
  aspect-ratio: 1;
  background: url("assets/game/sprites/pool.webp") center / contain no-repeat;
}
.pool-fill {
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 140, 0.6), transparent);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 70%, transparent), transparent);
  opacity: 0;
  z-index: -1;
}
.pads { display: flex; justify-content: center; gap: 4cqw; }
.pad {
  display: grid;
  place-items: center;
  width: 21cqw;
  aspect-ratio: 1;
  background: url("assets/game/sprites/slot.webp") center / contain no-repeat;
}
.queue { display: flex; justify-content: center; gap: 7cqw; }
.board .lamp { --s: 19cqw; }
/* The board's lantern numbers in the game's own style (as Level 1's .ln): the game's display font, white with a dark outline, low on the belly. */
.board .lamp b {
  position: absolute;
  left: 0;
  right: 0;
  top: 72.09%;
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  transform: translateY(-50%);
  text-align: center;
  font: 400 calc(var(--s) * 0.37)/1 "LS Display", var(--font, sans-serif);
  color: #fff;
  -webkit-text-stroke: calc(var(--s) * 0.045) #3a2140;
  paint-order: stroke fill;
}
.zz {
  position: absolute;
  font-weight: 600;
  font-size: 4.4cqw;
  letter-spacing: 0.1em;
  color: var(--cream);
  opacity: 0;
  pointer-events: none;
  left: 0; top: 0;
}
/* Spirits in "How a level plays": made by motion.js, one per trip, on the game's climb and walk art in each lantern's color. */
.how-spirits { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; pointer-events: none; opacity: 0; }
.how-spirits.is-ready { opacity: 1; }
.hs { position: absolute; left: 0; top: 0; visibility: hidden; will-change: transform; }
.hs-clb {   /* scaled to the walking spirit (in the game a walking spirit is 0.53 of the climb art's width), around where its feet land */
  position: absolute;
  width: calc(var(--pitch) * 1.6 / 0.53);
  height: calc(var(--pitch) * 1.6 / 0.53 * 92 / 57);
  left: calc(var(--pitch) * -0.8 / 0.53);
  top: calc(var(--pitch) * 1.6 / 0.53 * 92 / 57 * -0.3557);
  background-size: 1600% 100%;
  background-repeat: no-repeat;
}
/* A spirit is 1.6 tiles across, as in the game. */
.hs-sp { position: absolute; width: calc(var(--pitch) * 1.6); height: calc(var(--pitch) * 1.6); left: calc(var(--pitch) * -0.8); top: calc(var(--pitch) * -1.312); transform-origin: 50% 82%; }
.hs-shd { position: absolute; inset: -30%; top: 10%; background: url("assets/game/level/spirit-shadow.webp") center / contain no-repeat; }
.hs-bd { position: absolute; inset: 0; background-size: 4800% 100%; background-repeat: no-repeat; }
.hs-cargo { position: absolute; left: 50%; top: calc(var(--pitch) * -1.28); width: calc(var(--pitch) * 2); height: calc(var(--pitch) * 2); margin-left: calc(var(--pitch) * -1);   /* the cube fills half its art, so this carries exactly one tile */
  background-position: center; background-size: contain; background-repeat: no-repeat; opacity: 0; }
.hs[data-k="o"] .hs-bd { background-image: var(--hs-walk-o); }
.hs[data-k="g"] .hs-bd { background-image: var(--hs-walk-g); }
.hs[data-k="c"] .hs-bd { background-image: var(--hs-walk-c); }
.hs[data-k="o"] .hs-clb { background-image: var(--hs-climb-o); }
.hs[data-k="g"] .hs-clb { background-image: var(--hs-climb-g); }
.hs[data-k="c"] .hs-clb { background-image: var(--hs-climb-c); }
.hs[data-k="o"] .hs-cargo { background-image: var(--cube-o); }
.hs[data-k="g"] .hs-cargo { background-image: var(--cube-g); }
.hs[data-k="c"] .hs-cargo { background-image: var(--cube-c); }

/* Color vision */
.color { padding-block: var(--section-y); }
.color-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
}
.color-head { grid-column: 1 / -1; margin-bottom: clamp(40px, 6vw, 88px); }
.color-head h2 { margin-bottom: clamp(24px, 3vw, 40px); max-width: 13em; }
.color-head .body { max-width: 34em; }
.color-copy { grid-column: 1 / span 6; }

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}
.picker-head h3 { font-size: var(--text-body); }
.picker-eyes { flex: none; width: 72px; }
.swatch-option {
  appearance: none;
  position: relative;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 16px 56px 16px 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 2px solid var(--line-night);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 160ms ease-out;
}
.swatch-option + .swatch-option { margin-top: 10px; }
.swatch-option:hover { border-color: var(--cream); }
/* The chosen palette shows by shape and weight, never by color alone: a filled ring and a heavier border. */
.swatch-option::after {
  content: "";
  position: absolute;
  top: 16px; right: 16px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--cream);
}
.swatch-option[aria-pressed="true"] {
  border-color: var(--cream);
  box-shadow: inset 0 0 0 2px var(--cream);
}
.swatch-option[aria-pressed="true"]::after { background: radial-gradient(circle, var(--cream) 0 5px, transparent 6px); }
.swatch-name { display: block; font-weight: 500; }
.swatch-note { display: block; margin-top: 2px; font-size: var(--text-small); }
.swatches {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 26px));
  gap: 4px;
  margin-top: 10px;
}
.swatches i { display: block; aspect-ratio: 1; border-radius: 5px; }
.picker-note { margin-top: 12px; font-size: var(--text-small); }

.aids { margin-top: clamp(28px, 3vw, 40px); }
.aids li { padding-block: 10px; border-top: 1px solid var(--line-night); }
.aids li:last-child { border-bottom: 1px solid var(--line-night); }

/* Without JS all three palettes sit side by side. With JS one shows at a time and the buttons pick it. */
.palette-views {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
  margin-top: clamp(40px, 5vw, 72px);
}
.js .palette-views {
  grid-column: 8 / span 5;
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr);
  align-self: start;
  margin-top: 0;
}
.js .palette-views figure {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms var(--ease-out), visibility 0s 320ms;
}
.js .palette-views figure.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms var(--ease-out), visibility 0s;
}

.proof {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  margin-top: var(--section-y);
  padding-top: clamp(24px, 3vw, 40px);
  border-top: 2px solid var(--line-night);
}
.proof-copy { grid-column: 8 / span 5; grid-row: 1; }
.proof-copy h3 {
  font-size: var(--text-lede);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
  text-wrap: balance;
}
.proof-note { margin-top: 1.5em; font-weight: 500; }

.scores { margin-top: clamp(28px, 3vw, 40px); }
.scores > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 16px;
  padding-block: 12px;
}
.scores dt {
  font-size: clamp(3rem, 2rem + 4vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  min-width: 2.2em;
}
.scores dd { font-size: var(--text-small); font-weight: 500; }
.scores .bar {
  grid-column: 1 / -1;
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: rgba(248, 244, 235, 0.16);
}
.scores .bar > span {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: var(--cream);
  transform: scaleX(var(--v));
  transform-origin: left center;
}
/* The build's floor, 15 out of a scale of 20 */
.scores .bar::after {
  content: "";
  position: absolute;
  left: 75%;
  top: -6px; bottom: -6px;
  width: 2px;
  background: var(--accent);
}
.scores-key { margin-top: 8px; font-size: var(--text-small); }

.compare {
  grid-column: 1 / span 6;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}
/* The slider is never wider than its picture, so the split line and the clip always sit on the picture. */
.compare.is-slider {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: calc(72vh * 430 / 540 + 20px);
  justify-self: center;
}
/* One crop for the switcher and the slider, so the picture, the choice and the split fit one screen. */
.js .palette-views .shot,
.compare.is-slider .shot { aspect-ratio: 430 / 540; max-height: 72vh; }
.compare.is-slider figure { grid-area: 1 / 1; }
.compare.is-slider .cmp-b { clip-path: inset(0 0 0 var(--pos, 50%)); }
.cmp-tag { display: none; }
.compare.is-slider figcaption {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.compare.is-slider .cmp-tag {
  display: block;
  position: absolute;
  bottom: 16px;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.86);
  color: var(--cream);
  font-weight: 500;
}
.compare.is-slider figure { position: relative; }
.compare.is-slider .cmp-a .cmp-tag { left: 16px; }
.compare.is-slider .cmp-b .cmp-tag { right: 16px; }
.compare.is-slider::after {
  content: "";
  grid-area: 1 / 1;
  justify-self: start;
  width: 3px;
  height: 100%;
  margin-left: calc(var(--pos, 50%) - 1.5px);
  background: var(--cream);
  pointer-events: none;
}
.cmp-control { grid-column: 1 / -1; margin-top: 16px; }
.cmp-control label { display: block; font-size: var(--text-small); margin-bottom: 6px; }
.cmp-control input {
  width: 100%;
  height: 44px;
  margin: 0;
  accent-color: var(--cream);
  cursor: ew-resize;
}

/* What's in the game */
.features {
  position: relative;
  padding-block: var(--section-y);
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(248, 244, 235, 0.75), transparent),
    radial-gradient(1px 1px at 68% 8%, rgba(248, 244, 235, 0.6), transparent),
    radial-gradient(1.4px 1.4px at 38% 64%, rgba(248, 244, 235, 0.5), transparent),
    radial-gradient(1px 1px at 86% 46%, rgba(248, 244, 235, 0.65), transparent),
    radial-gradient(1px 1px at 24% 88%, rgba(248, 244, 235, 0.45), transparent),
    radial-gradient(1.2px 1.2px at 56% 34%, rgba(248, 244, 235, 0.4), transparent),
    linear-gradient(to bottom, var(--night) 0%, var(--night) 55%, var(--glow) 100%);
  background-size: 380px 420px, 380px 420px, 380px 420px, 380px 420px, 380px 420px, 380px 420px, 100% 100%;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: start;
}
.features-head { grid-column: 9 / span 4; grid-row: 1; }
.features-head h2 { margin-bottom: clamp(32px, 4vw, 56px); }
.features-shot { width: 100%; max-width: 300px; }
.features-list {
  grid-column: 1 / span 7;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 3vw, 48px);
}
.features-list li { padding-block: 20px 28px; border-top: 2px solid var(--line-night); }
.features-list h3 {
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.875rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.features-list p { font-size: var(--text-small); }

/* Part 3. Your turn, in a lantern-lit glow */
.toy {
  position: relative;
  padding-block: clamp(40px, 6vw, 96px) var(--section-y);
  background:
    radial-gradient(60% 45% at 70% 40%, rgba(255, 170, 70, 0.16), transparent 70%),
    var(--glow);
  color: var(--cream);
}
.toy :focus-visible { outline-color: var(--cream); }
.toy-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  align-items: start;
}
.toy-copy { grid-column: 1 / span 5; }
.toy-copy h2 { margin-bottom: clamp(24px, 3vw, 40px); }
.toy-copy p + p { margin-top: 1em; }
.toy-small { font-size: var(--text-small); }
.toy-box { grid-column: 7 / span 6; }
.toy-fallback { font-size: var(--text-small); padding: 24px; border: 2px dashed var(--line-night); border-radius: 16px; }
.toy-cta { grid-column: 1 / -1; margin-top: clamp(48px, 6vw, 96px); padding-top: 24px; border-top: 2px solid var(--line-night); }
.toy-more { font-size: var(--text-lede); line-height: 1.12; letter-spacing: -0.025em; max-width: 22em; text-wrap: balance; }

/* The tiny level (play.js) */
.toy-game { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.toy-box { min-width: 0; }
.toy-lamps { z-index: 0; }
.toy-grid { position: relative; z-index: 1; }

/* Level 1 (play.js), drawn with the game's own art. --t is a tile, --sp a spirit, both set from the board's width. */
@font-face { font-family: "LS Display"; src: url("assets/game/level/display.woff2") format("woff2"); font-display: swap; }
.lv {
  --outline: #3a2140;
  position: relative;
  width: 100%;
  max-width: min(460px, calc((100svh - 150px) / 1.72));
  min-width: min(100%, 280px);
  margin-inline: auto;
  padding: 12px 10px 16px;
  container-type: inline-size;
  border-radius: 22px;
  background:
    radial-gradient(70% 40% at 50% 30%, rgba(255, 238, 190, 0.35), transparent 70%),
    linear-gradient(#d6bc92, #c9a979);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.lv-scene {
  position: relative;
  width: max-content;
  margin-inline: auto;
  border-style: solid;
  border-width: 18px 16px 14px;
  border-image: url("assets/game/level/frame.webp") 72 63 70 63 fill / 18px 16px 14px stretch;
  border-radius: 14px;
  line-height: 0;
}
.lv-pic { display: block; }
.lv-pool {
  position: relative;
  width: 17cqw;
  aspect-ratio: 1;
  margin: 4cqw auto 3cqw;
  background: url("assets/game/level/pool.webp") center / contain no-repeat;
}
.lv-ripple { position: absolute; inset: 18%; border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 50%; pointer-events: none; }
.lv-pads {
  display: grid;
  grid-template-columns: repeat(5, 14.6cqw);
  justify-content: center;
  gap: 1.8cqw;
  margin: 0 0 7cqw;
  padding: 0;
  list-style: none;
}
.lv-pad { position: relative; aspect-ratio: 1; }
.lv-pad::before {
  content: "";
  position: absolute;
  inset: -30% 0 -30% -30%;
  background:
    url("assets/game/level/slot.webp") 100% 50% / calc(100% / 1.3) no-repeat,
    url("assets/game/level/slot-shadow.webp") 0 50% / calc(100% * 16 / 13) no-repeat;
  pointer-events: none;
}
.lv-cols { display: grid; grid-template-columns: repeat(3, 14.6cqw); justify-content: center; column-gap: 6cqw; }
.lv-col { display: grid; grid-auto-rows: 12.5cqw; justify-items: center; align-content: start; min-height: calc(12.5cqw * 4 + 8cqw); }
.lv-more { font: 400 5cqw/1 "LS Display", var(--font, sans-serif); color: #fff; -webkit-text-stroke: 0.8cqw var(--outline); paint-order: stroke fill; padding-top: 3cqw; }

/* A lantern: the game's tinted body, door, shadow and number */
.lan {
  position: relative;
  display: block;
  width: 14.6cqw;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  container-type: inline-size;
}
button.lan { cursor: pointer; }
/* iOS draws a grey square over a tapped button; the lanterns have their own press feedback, and keyboard focus keeps its round ring. */
.lv button, .toy button { -webkit-tap-highlight-color: transparent; }
button.lan::before { content: ""; position: absolute; inset: -8%; border-radius: 50%; }   /* a 44 px target on small boards */
.lv-pad .lan { position: absolute; inset: -20.6% 0 20.6%; width: auto; aspect-ratio: auto; }
.lsh { position: absolute; inset: -30% -12% -30% -30%; background: url("assets/game/level/lantern-shadow.webp") 0 50% / calc(100% * 160 / 142) no-repeat; pointer-events: none; }
.lv-pad .lsh { opacity: 0.55; }
.lgl { position: absolute; inset: 0; }
.lbody {
  position: absolute;
  inset: 0;
  background-color: var(--lc, var(--c));
  background-image: var(--lan, url("assets/game/level/lantern.webp"));
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: hard-light;
  -webkit-mask: url("assets/game/level/lantern.webp") center / contain no-repeat;
  mask: url("assets/game/level/lantern.webp") center / contain no-repeat;
  transform-origin: 50% 71%;
}
.door { position: absolute; inset: 0; background: url("assets/game/level/lantern-door.webp") center / contain no-repeat; opacity: 0.25; pointer-events: none; transform-origin: 50% 71%; }
.lv-pad .door { opacity: 1; }
.lan.front .door { opacity: 0.8; }
.lan.wait .door { opacity: 0.1; }
.ln {
  position: absolute;
  left: 0;
  right: 0;
  top: 72.09%;
  transform: translateY(-50%);
  text-align: center;
  font: 400 37cqw/1 "LS Display", var(--font, sans-serif);
  color: #fff;
  -webkit-text-stroke: 4.5cqw var(--outline);
  paint-order: stroke fill;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.lan.back .lbody { filter: saturate(0.72) brightness(0.86); }
.lan.back .ln { opacity: 0.85; }
button.lan:hover .lbody { filter: brightness(1.08); }
button.lan:active .lgl { transform: translateY(1px) scale(0.97); }
button.lan:focus-visible { outline: 3px solid var(--cream); outline-offset: 4px; border-radius: 50%; }
.lan.wait::after {
  content: "z";
  position: absolute;
  right: 2%;
  top: -6%;
  font: 400 28cqw/1 "LS Display", var(--font, sans-serif);
  color: #fff;
  -webkit-text-stroke: 3cqw var(--outline);
  paint-order: stroke fill;
  animation: lv-z 1.6s ease-in-out infinite;
}
@keyframes lv-z { 50% { transform: translateY(-14%); } }
.lan > .clf { position: absolute; pointer-events: none; overflow: hidden; z-index: 2; }
.lan > .clf > i { position: absolute; left: 0; top: 0; height: 100%; background-image: var(--climb); background-size: 100% 100%; background-repeat: no-repeat; }

/* Spirits, on the game's 8-frame walk sheet: walk, carry, side walk, side carry, back walk, back carry */
.lv-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; pointer-events: none; }
.lv-sp { position: absolute; left: 0; top: 0; width: var(--sp); height: var(--sp); margin: calc(var(--sp) * -0.82) 0 0 calc(var(--sp) * -0.5); will-change: transform; }
.lv-sp .bob { position: absolute; inset: 0; }
.lv-sp .shd { position: absolute; inset: -30%; top: 10%; background: url("assets/game/level/spirit-shadow.webp") center / contain no-repeat; }
.lv-sp .bd { position: absolute; inset: 0; overflow: hidden; }
.lv-sp .bd::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 800%;
  height: 100%;
  background-image: var(--walk8);
  background-size: 600% 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
}
.lv-sp.flip .bd { transform: scaleX(-1); }
.lv-sp.walking .bd::before { animation: lv-walk 0.545s steps(8) infinite; }
.lv-sp.walking .bob { animation: lv-bob 0.545s ease-in-out infinite; }
.lv-sp.carry .bd::before { background-position: 20% 0; }
.lv-sp.f-side .bd::before { background-position: 40% 0; }
.lv-sp.carry.f-side .bd::before { background-position: 60% 0; }
.lv-sp.f-back .bd::before { background-position: 80% 0; }
.lv-sp.carry.f-back .bd::before { background-position: 100% 0; }
@keyframes lv-walk { to { transform: translateX(-100%); } }
@keyframes lv-bob { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.lv-sp .cargo { position: absolute; left: 50%; top: -18%; width: calc(var(--t) * 1.6); height: calc(var(--t) * 1.6); margin-left: calc(var(--t) * -0.8); background: var(--cube) center / contain no-repeat; opacity: 0; }
.lv-sp.carry .cargo { opacity: 1; animation: lv-lift 0.2s ease-out; }
@keyframes lv-lift { from { transform: translateY(40%); } }
.lv .toy-result { border-radius: 22px; color: var(--cream); z-index: 4; }
@media (prefers-reduced-motion: reduce) {
  .lan.wait::after { animation: none; }
}
.toy-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.toy-status { font-weight: 500; min-height: 1.5em; }
.toy-btn {
  appearance: none;
  min-height: 44px;
  padding: 10px 20px;
  border: 2px solid var(--cream);
  border-radius: 999px;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 500;
  cursor: pointer;
}
.toy-btn.is-primary { background: var(--cream); color: var(--ink); }
.toy-btn:hover { background: var(--cream); color: var(--ink); }
.toy-result {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(23, 11, 31, 0.86);
  border-radius: 4cqw;
}
.toy-result[hidden] { display: none; }
.toy-result h3 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); letter-spacing: -0.03em; line-height: 1; }

/* Contact and legal, in the last of the glow */
.foot {
  background: linear-gradient(to bottom, var(--glow) 0%, var(--glow-deep) 60%);
  color: var(--cream);
  padding: var(--section-y) 0 clamp(24px, 3vw, 40px);
}
.foot :focus-visible { outline-color: var(--cream); }
.foot-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
}
.foot h2 { grid-column: 1 / span 5; }
.contact-list { grid-column: 7 / -1; align-self: end; }
.contact-list > div {
  display: grid;
  grid-template-columns: minmax(6.5em, 1fr) 3fr;
  gap: 16px;
  align-items: center;
  min-height: 60px;
  padding-block: 10px;
  border-top: 2px solid currentColor;
}
.contact-list > div:last-child { border-bottom: 2px solid currentColor; }
.contact-list dt { font-size: var(--text-small); }
.contact-list a { display: inline-block; padding-block: 11px; }

.foot-mark {
  width: var(--mark-width);
  max-width: 100%;
  margin: clamp(64px, 11vw, 176px) auto;
}
.legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-size: var(--text-small);
}
.legal a { display: inline-block; padding-block: 11px; }

/* ---------- Motion (html.anim is set by motion.js only when motion is allowed and GSAP loaded) ---------- */
.anim .dusk-stage { height: 100vh; height: 100lvh; min-height: 560px; }
.anim .dusk-veil {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--day) 0%, var(--day-mid) 45%, var(--dusk) 100%);
}
.dusk-eyes { display: none; }
.anim .dusk-eyes {
  display: block;
  position: absolute;
  left: 0; right: 0;
  top: 30%;
  width: min(56vw, 480px);
  margin-inline: auto;
}
.dusk-eyes img { width: 100%; }
.dusk-eyes .eyes-shut { position: absolute; inset: 0; opacity: 0; }
.dusk-eyes .twin {
  --s: calc(min(56vw, 480px) * 0.3);
  position: absolute;
  top: calc(50% - var(--s) / 2);
  opacity: 0;
}
.dusk-eyes .twin:nth-of-type(1) { left: calc(25% - var(--s) / 2); }
.dusk-eyes .twin:nth-of-type(2) { left: calc(75% - var(--s) / 2); }
.anim .dusk-fade {
  background: linear-gradient(to bottom, rgba(11, 17, 64, 0) 70%, var(--night) 100%);
}
.anim .split .w { display: inline-block; white-space: nowrap; }
.anim .split .ch { display: inline-block; }

.how-pinned .how-stage { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding-block: 84px 24px; }
.how-pinned .how-grid {
  grid-template-areas: "board board board board board steps steps steps steps shots shots shots";
}
.how-pinned .board { max-width: min(480px, calc((100svh - 124px) / 1.62)); }
.how-pinned .how-shots { max-width: calc((100svh - 150px) * 0.43); justify-self: center; }
.how-pinned .steps { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.how-pinned .steps li { grid-area: 1 / 1; }
.how-pinned .how-shots { grid-template-columns: minmax(0, 1fr); }
.how-pinned .how-shot { grid-area: 1 / 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Narrower screens ---------- */
@media (max-width: 1100px) {
  .how-grid {
    grid-template-areas:
      "board board board board board board board shots shots shots shots shots"
      "steps steps steps steps steps steps steps steps steps steps steps steps";
  }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-pinned .how-grid {
    grid-template-areas:
      "board board board board board board board shots shots shots shots shots"
      "steps steps steps steps steps steps steps steps steps steps steps steps";
    row-gap: 24px;
  }
  .how-pinned .how-shots { grid-template-columns: minmax(0, 1fr); max-width: 260px; justify-self: center; }
}

@media (max-width: 860px) {
  .big-stats { grid-template-columns: minmax(0, 1fr); }
  .studio-eyes, .studio-copy, .game-copy, .color-copy, .proof-copy, .compare,
  .features-head, .features-list, .toy-copy, .toy-box, .foot h2, .contact-list { grid-column: 1 / -1; }
  .studio-eyes { width: 80%; }
  .studio-copy { margin-top: 40px; }

  .hero-foot { grid-template-columns: minmax(0, 1fr); }
  .cue { justify-self: start; }

  .game-lead { grid-column: 2 / span 10; width: 100%; margin-top: 56px; max-width: 360px; justify-self: center; }

  /* On a phone the picture and the choices share one screen, so the change is visible on tap. */
  .js .palette-views {
    grid-column: 1 / -1;
    grid-row: 2;
    position: static;
    margin-bottom: 24px;
  }
  .palette-views { grid-template-columns: minmax(0, 1fr); max-width: 420px; }

  .compare { margin-top: 40px; }

  .features-list { grid-template-columns: minmax(0, 1fr); margin-top: 40px; grid-row: 2; }
  .features-head, .proof-copy { grid-row: auto; }
  .compare { grid-row: 2; }
  .features-shot { max-width: 220px; }
  .toy-box { margin-top: 32px; }
  .foot h2 { margin-bottom: 32px; }
  .dusk-logo { top: 24%; width: min(72vw, 340px); }
}

@media (max-width: 640px) {
  .dusk-art img { object-position: 50% 60%; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .how-grid { grid-template-areas: "board" "shots" "steps"; grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .how-shots { max-width: 420px; justify-self: center; }
  .how-pinned .how-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas:
      "board board board board board board board shots shots shots shots shots"
      "steps steps steps steps steps steps steps steps steps steps steps steps";
    row-gap: 20px;
  }
  .how-pinned .how-shots { max-width: none; align-self: center; }
  .how-pinned .how-stage { padding-block: 72px 16px; }
  .how-pinned .steps h3 { font-size: 1.25rem; }
  .how-pinned .steps p { font-size: 0.9375rem; }
  .swatches { grid-template-columns: repeat(7, minmax(0, 28px)); }
  .lamps .lamp { --s: 28px !important; }
}

/* Tiny level: a pointer to the Red-green friendly palette, and a dimmed sleeping lantern */
.toy-hint { font-size: var(--text-small); }
.toy-link {
  appearance: none;
  min-height: 44px;
  padding: 11px 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.toy-link:hover { text-decoration-thickness: 3px; }
