/* Tinwren site styles: fonts, tokens, base, layout and components, then each page.
   Every animation stops under prefers-reduced-motion. */

/* ---------------------------------------------------------------- Fonts (SIL OFL 1.1, /fonts/) */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Arial resized to Inter's metrics, so the swap doesn't move the layout. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 107.49%;
  ascent-override: 90.12%;
  descent-override: 22.44%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif Fallback";
  src: local("Georgia Italic"), local("Georgia-Italic");
  font-style: italic;
  size-adjust: 79.52%;
  ascent-override: 124.5%;
  descent-override: 38.99%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Menlo"), local("Menlo-Regular"), local("Consolas");
  size-adjust: 99.65%;
  ascent-override: 100.85%;
  descent-override: 29.6%;
  line-gap-override: 0%;
}

/* ---------------------------------------------------------------- Tokens */

:root {
  color-scheme: light dark;

  --font-sans: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Instrument Serif Fallback", Georgia, "Times New Roman", serif;
  --font-mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Fluid modular scale: 16px x 1.2 at a 360px viewport, 18px x 1.333 at 1440px. */
  --step-n1: clamp(0.8333rem, 0.8298rem + 0.0157vw, 0.844rem);
  --step-0: clamp(1rem, 0.9583rem + 0.1852vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1001rem + 0.4439vw, 1.4996rem);
  --step-2: clamp(1.44rem, 1.2537rem + 0.8281vw, 1.999rem);
  --step-3: clamp(1.728rem, 1.4158rem + 1.3877vw, 2.6647rem);
  --step-4: clamp(2.0736rem, 1.5808rem + 2.1902vw, 3.552rem);
  --step-5: clamp(2.4883rem, 1.7395rem + 3.3281vw, 4.7348rem);
  --step-6: clamp(2.986rem, 1.8775rem + 4.9267vw, 6.3115rem);
  --step-7: clamp(3.5832rem, 1.9732rem + 7.1557vw, 8.4132rem);

  /* Spacing on a 4px base, fluid from 360px to 1440px. */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: clamp(1rem, 0.9583rem + 0.1852vw, 1.125rem);
  --space-m: clamp(1.5rem, 1.4167rem + 0.3704vw, 1.75rem);
  --space-l: clamp(2rem, 1.8333rem + 0.7407vw, 2.5rem);
  --space-xl: clamp(3rem, 2.6667rem + 1.4815vw, 4rem);
  --space-2xl: clamp(4rem, 3.3333rem + 2.963vw, 6rem);
  --space-3xl: clamp(6rem, 5rem + 4.4444vw, 9rem);
  --space-4xl: clamp(8rem, 6.3333rem + 7.4074vw, 13rem);

  /* Layout: a 12-column grid inside an 82rem container; the stage is inset by --frame. */
  --max: 82rem;
  --gutter: clamp(1.25rem, 0.5rem + 3.3333vw, 3rem);
  --frame: clamp(0.5rem, 0.2667rem + 1.037vw, 1.25rem);
  --col-gap: clamp(1rem, 0.6667rem + 1.4815vw, 2rem);
  --radius-l: clamp(1.25rem, 0.9167rem + 1.4815vw, 2.25rem);
  --radius-m: 1rem;
  --header-h: 4rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Light: warm paper. */
  --bg: #f5f3ee;
  --bg-2: #eeebe4;
  --surface: #ffffff;
  --line: rgba(24, 20, 14, 0.1);
  --line-2: rgba(24, 20, 14, 0.18);
  --text: #131315;
  --text-2: #57534d;
  --text-3: #6b675f;
  --link: #8a4b00;
  --focus: #8a4b00;
  --accent: #ffb547;
  --mark-ink: #131315;
  --mark-light: #d97706;
  --dim: 0.5;
  --shadow-1: 0 1px 2px rgba(24, 20, 14, 0.06), 0 8px 24px -12px rgba(24, 20, 14, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark: ink. */
    --bg: #08080a;
    --bg-2: #0e0e11;
    --surface: #141418;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.14);
    --text: #f3f0ea;
    --text-2: #a9a59e;
    --text-3: #8b877f;
    --link: #ffc56b;
    --focus: #ffc56b;
    --mark-ink: #f3f0ea;
    --mark-light: #ffb547;
    --dim: 0.42;
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.8);
  }
}

/* The stage is always dark: light needs a dark room, in either theme. */
.stage {
  color-scheme: dark;
  --text: #f3f0ea;
  --text-2: #b3afa8;
  --text-3: #8f8b84;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --link: #ffc56b;
  --focus: #ffc56b;
  --mark-ink: #f3f0ea;
  --mark-light: #ffb547;
  --stage-bg: #0c0c0f;
  background: var(--stage-bg);
  color: var(--text);
}

/* Unlit pages use the studio's colours; the game's navy and yellow appear only on the board,
   the wordmark's light and the launch light. */
[data-product="unlit"] {
  --product: #facc15;
  --product-edge: #a16207;
}

/* The board sits on a dark tray in both themes. */
.tray {
  color-scheme: dark;
  --text: #f9fafb;
  --text-2: #9ca3af;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.2);
  --focus: #fde047;
  --tray: #111827;
  --cell-off: #1f2937;
  --cell-edge: #6b7280;
  --cell-on: #facc15;
  background: var(--tray);
  color: var(--text);
}

/* ---------------------------------------------------------------- Base */

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

html {
  background: var(--bg);
  color: var(--text);
  min-width: 320px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: var(--space-l);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

img, svg, canvas, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover { text-decoration-color: currentColor; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(255, 181, 71, 0.35); color: inherit; }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0.75rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}
.skip:focus-visible { transform: none; }

/* ---------------------------------------------------------------- Type */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.display {
  font-weight: 620;
  letter-spacing: -0.038em;
  line-height: 0.96;
  text-wrap: balance;
}

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.012em;
  font-size: 1.06em;
  line-height: 0;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Layout */

.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}
.stage .container {
  width: min(100% - 2 * (var(--gutter) - var(--frame)), var(--max));
}

@media (min-width: 120rem) {
  :root { --max: 92rem; }
}

/* ---------------------------------------------------------------- Identity */

.lockup { display: block; height: 1.3125rem; width: auto; aspect-ratio: 9992 / 1989; overflow: visible; }
.lockup .mark-bird, .lockup .mark-word { fill: var(--mark-ink); }
.lockup .mark-light { fill: var(--mark-light); }
@media (prefers-color-scheme: dark) {
  .lockup .mark-light { filter: drop-shadow(0 0 3px rgba(255, 181, 71, 0.75)); }
}
.stage .lockup .mark-light { filter: drop-shadow(0 0 3px rgba(255, 181, 71, 0.75)); }
/* Every Tinwren title carries one light. On a game's pages the studio steps back and the game's
   title carries it. */
[data-product] .lockup .mark-light { fill: var(--mark-ink); filter: none; }

/* ---------------------------------------------------------------- Header */

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
}
.brand--small .lockup { height: 1.125rem; }

/* Baseline-aligned, so the product name sits on the wordmark's baseline. */
.crumbs {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.crumbs li { display: flex; align-items: baseline; gap: 0.6rem; }
.crumbs li + li::before {
  content: "";
  width: 1px;
  height: 1.05rem;
  background: var(--line-2);
  transform: rotate(18deg);
}
.crumbs a:not(.brand) {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text-2);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.crumbs a:not(.brand):hover { color: var(--text); }
.crumbs [aria-current] {
  color: var(--text);
  font-weight: 560;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.crumbs a[aria-current]:hover { text-decoration: underline; text-decoration-color: var(--line-2); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 0.5rem + 2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav svg { width: 0.7rem; height: 0.7rem; opacity: 0.7; }

/* ---------------------------------------------------------------- Footer */

.site-footer {
  margin-top: var(--space-3xl);
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.9375rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s) var(--space-l);
  padding-block: var(--space-l) calc(var(--space-l) + env(safe-area-inset-bottom, 0px));
}
.footer__meta { display: flex; align-items: center; gap: var(--space-s); flex-wrap: wrap; }
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text-2);
  text-decoration: none;
}
.footer__links a:hover { color: var(--text); }
.footer__copy { color: var(--text-3); font-size: 0.875rem; }

/* ---------------------------------------------------------------- Buttons and switch */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 560;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}
@media (hover: hover) {
  .btn:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.28); }
  }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--cell-on, #facc15); border-color: transparent; color: #111827; }
.btn--primary:hover { background: #fde047; border-color: transparent; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.75rem;
  padding: 0 1rem 0 0.55rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(12, 12, 15, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
@media (hover: hover) {
  .switch:hover { border-color: rgba(255, 255, 255, 0.3); }
}
.switch__track {
  position: relative;
  width: 2.25rem;
  height: 1.375rem;
  border-radius: 999px;
  border: 1px solid #6f6b65;
  background: transparent;
  transition: background-color 0.3s var(--ease-out), border-color 0.3s;
}
.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.375rem - 6px);
  height: calc(1.375rem - 6px);
  border-radius: 50%;
  background: #b3afa8;
  transition: transform 0.35s var(--ease-out), background-color 0.3s;
}
.switch[aria-pressed="true"] .switch__track { background: #ffb547; border-color: #ffb547; box-shadow: 0 0 18px rgba(255, 181, 71, 0.45); }
.switch[aria-pressed="true"] .switch__thumb { transform: translateX(0.875rem); background: #1a1206; }
.switch__state { color: var(--text-3); min-width: 2.2em; }

/* ================================================================ Home */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-inline: var(--frame);
  border-radius: var(--radius-l);
  height: calc(100vh - var(--header-h) - var(--frame));
  height: clamp(36rem, calc(100svh - var(--header-h) - var(--frame)), 70rem);
  display: grid;
  grid-template-rows: 1fr auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  background:
    radial-gradient(60% 55% at 74% 26%, rgba(255, 170, 70, 0.09), transparent 70%),
    radial-gradient(90% 70% at 50% 120%, rgba(0, 0, 0, 0.6), transparent 70%),
    var(--stage-bg);
}
@media (prefers-color-scheme: dark) {
  .hero { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset; }
}

/* The field. Without the script it is a static tiled wall with one warm light. */
.field {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.field::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/img/field.svg") right top / cover no-repeat;
  -webkit-mask-image: radial-gradient(95% 95% at 72% 28%, #000 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0.12) 100%);
  mask-image: radial-gradient(95% 95% at 72% 28%, #000 0%, rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0.12) 100%);
  transition: opacity 0.8s;
}
.field canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
}
.hero.is-live .field::before { opacity: 0; }
.hero.is-live .field canvas { opacity: 1; }

/* Legibility: the text sits in a pool of shadow, whatever the light does. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(12, 12, 15, 0.92) 0%, rgba(12, 12, 15, 0.6) 26%, transparent 55%),
    radial-gradient(70% 55% at 18% 92%, rgba(12, 12, 15, 0.85), transparent 72%);
}

.hero__bottom {
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-l) var(--space-xl);
  padding-bottom: clamp(1.5rem, 0.5rem + 4.4vw, 4.5rem);
}
.hero__copy { max-width: 62rem; }
.hero__copy .eyebrow { margin-bottom: var(--space-m); }
.hero__title {
  font-size: clamp(2.875rem, 1.05rem + 7.6vw, 8.75rem);
  font-size: clamp(2.875rem, 1.05rem + 7.6vw, max(8.75rem, 6.2vw));
  font-weight: 620;
  letter-spacing: -0.042em;
  line-height: 0.94;
  text-wrap: balance;
}
.hero__title .serif { letter-spacing: -0.02em; padding-right: 0.04em; }
.hero__lede {
  margin-top: var(--space-m);
  max-width: 30rem;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--text-2);
  letter-spacing: -0.012em;
  text-wrap: pretty;
}
.hero:not(.is-live) .hero__controls { visibility: hidden; }
.hero__controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}
.hero__hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.hero__hint.is-shown { opacity: 1; transform: none; }
.hero__hint:not(.is-shown) { visibility: hidden; transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), visibility 0s 0.6s; }
.hint--touch { display: none; }
@media (hover: none) {
  .hint--pointer { display: none; }
  .hint--touch { display: inline; }
}

@media (max-width: 47.99rem) {
  .hero__bottom { grid-template-columns: 1fr; }
  .hero__controls { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* Statement */
.statement {
  padding-block: var(--space-3xl) var(--space-2xl);
}
.statement .container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--space-m);
}
.statement h2 { grid-column: 1 / -1; }
.statement__text {
  grid-column: 1 / -1;
  font-size: var(--step-4);
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: pretty;
  max-width: 22em;
}
.statement__text .serif { line-height: 1; }
@media (min-width: 60rem) {
  .statement h2 { grid-column: 1 / span 3; padding-top: 0.9em; }
  .statement__text { grid-column: 4 / -1; }
}
/* Lights up word by word as you read (with the script; otherwise fully lit). */
.statement__text.is-revealing .w {
  opacity: var(--dim);
  transition: opacity 0.45s var(--ease-out);
}
.statement__text.is-revealing .w.is-lit { opacity: 1; }

/* First light: on the page, not on a stage. One tile is lit. */
.first-light .container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--space-xl);
  align-items: center;
  padding-block: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--line);
}
.first-light__copy { grid-column: 1 / -1; }
.first-light__copy h2 {
  margin-top: var(--space-s);
  font-size: var(--step-5);
  font-weight: 620;
  line-height: 1;
  letter-spacing: -0.038em;
  text-wrap: balance;
  max-width: 12em;
}
.first-light__copy > p:not(.eyebrow) {
  margin-top: var(--space-m);
  max-width: 28rem;
  color: var(--text-2);
  font-size: var(--step-1);
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.first-light__copy > p.first-light__contact { margin-top: var(--space-s); font-size: var(--step-0); }
.first-light__art { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 48rem) {
  .first-light__copy { grid-column: 1 / span 8; }
  .first-light__art { grid-column: 9 / -1; justify-self: end; }
}

/* A small dark tray of nine glass tiles; the middle one is on. */
.pilot {
  --t: clamp(2.6rem, 1.9rem + 3vw, 4.25rem);
  display: grid;
  grid-template-columns: repeat(3, var(--t));
  gap: calc(var(--t) * 0.16);
  padding: calc(var(--t) * 0.3);
  border-radius: calc(var(--t) * 0.5);
  background: #0c0c0f;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 30px 60px -30px rgba(12, 12, 15, 0.55);
}
.pilot span {
  aspect-ratio: 1;
  border-radius: 20%;
  background: linear-gradient(180deg, rgba(246, 242, 236, 0.08), rgba(246, 242, 236, 0.035));
  box-shadow: 0 0 0 1px rgba(255, 244, 228, 0.07) inset;
}
.pilot span.on {
  background: radial-gradient(circle at 50% 40%, #fff8ea 0%, #ffd79a 42%, #ffb84f 100%);
  box-shadow: 0 0 0 1px rgba(255, 236, 200, 0.6) inset, 0 0 22px 2px rgba(255, 170, 70, 0.55), 0 0 70px 10px rgba(255, 150, 50, 0.22);
}
@media (prefers-reduced-motion: no-preference) {
  .pilot span.on { animation: breathe 5s var(--ease-in-out) infinite; }
}
@keyframes breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(0.86); }
}

.page-home .site-footer { margin-top: var(--space-l); }

/* ================================================================ Unlit */

/* The board's glow may spill past the card but never past the window (no sideways scrolling). */
.u-hero { overflow-x: hidden; overflow-x: clip; }

.u-hero .container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--space-xl);
  align-items: center;
  padding-block: var(--space-m) var(--space-3xl);
}
.u-hero__copy, .u-hero__play { grid-column: 1 / -1; }
@media (min-width: 45rem) {
  .u-hero__copy { grid-column: 1 / span 6; }
  .u-hero__play { grid-column: 7 / -1; }
}
@media (min-width: 60rem) {
  .u-hero .container { min-height: clamp(38rem, calc(100svh - var(--header-h)), 58rem); padding-block: var(--space-l) var(--space-2xl); }
}

.app-icon {
  width: clamp(4rem, 3.4rem + 2.6vw, 5.5rem);
  height: clamp(4rem, 3.4rem + 2.6vw, 5.5rem);
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px -12px rgba(17, 24, 39, 0.45);
}
.u-hero__title { margin-top: var(--space-l); line-height: 0; }
/* The Unlit wordmark: Inter outlines, the i's tittle a lit cell. */
.u-wordmark { display: block; height: clamp(3.75rem, 2rem + 7.4vw, 8.25rem); width: auto; aspect-ratio: 4142 / 1570; overflow: visible; }
.u-wordmark .word { fill: var(--text); }
.u-wordmark .light { fill: var(--product); stroke: var(--product-edge); stroke-width: 26; paint-order: stroke; }
@media (prefers-color-scheme: dark) {
  .u-wordmark .light { stroke: none; filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.55)); }
}
.u-hero__lede {
  margin-top: var(--space-m);
  font-size: var(--step-3);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}
.u-hero__body {
  margin-top: var(--space-s);
  max-width: 27rem;
  color: var(--text-2);
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.4996rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.launch {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: var(--space-l);
  font-size: 1rem;
  font-weight: 560;
  letter-spacing: -0.01em;
}
.launch__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--product);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18), 0 0 14px rgba(250, 204, 21, 0.6);
}

/* The playable board */
.board-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 27rem);
  margin-inline: auto;
  padding: clamp(1rem, 0.6rem + 1.6vw, 1.75rem);
  border-radius: var(--radius-l);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07) inset, 0 40px 80px -40px rgba(10, 14, 23, 0.7);
  --lit: 0.4;
}
.board-card::before {
  content: "";
  position: absolute;
  inset: -12% -10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(250, 204, 21, 0.28), transparent);
  opacity: calc(0.25 + var(--lit) * 1.6);
  transition: opacity 0.6s var(--ease-out);
  pointer-events: none;
}
.board-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--space-s);
}
.board-card__head .eyebrow { color: var(--text-2); }
.board-card__moves {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.4rem, 0.25rem + 0.7vw, 0.65rem);
}
.cell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  display: block;
  min-width: 2.75rem;
  padding: 0;
  border: 2px solid var(--cell-edge);
  border-radius: 18%;
  background: linear-gradient(180deg, #263244 0%, var(--cell-off) 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: border-color 0.14s, box-shadow 0.3s var(--ease-out), transform 0.18s var(--ease-out);
}
/* The light is a layer that switches on and off. */
.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, #fffbea 0%, #fde68a 36%, var(--cell-on) 78%);
  opacity: 0;
}
.cell.is-lit {
  border-color: var(--cell-on);
  box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.3), 0 0 28px -4px rgba(250, 204, 21, 0.6);
}
.cell.is-lit::before { opacity: 1; }
button.cell { cursor: pointer; }
@media (hover: hover) {
  button.cell:hover:not(.is-lit):not([aria-disabled]) { border-color: #9ca3af; }
}
button.cell:active { transform: scale(0.95); }
button.cell[aria-disabled="true"] { cursor: default; }
button.cell:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 18%; }
/* The message has its own line and the buttons sit below it, so nothing moves when it changes. */
.board-card__foot {
  display: grid;
  gap: 0.75rem;
  margin-top: var(--space-s);
}
.board-card__msg { min-height: 1.4em; }
.board-card__msg {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.board-card__msg.is-solved { color: var(--text); font-weight: 560; }
.board-card__msg .star { width: 1.1rem; height: 1.1rem; fill: #facc15; flex: none; }
.board-card__actions { display: flex; gap: 0.5rem; }
.board-card:not(.is-live) .board-card__actions { visibility: hidden; }
.board-card__noscript { margin-top: var(--space-xs); color: var(--text-2); font-size: 0.875rem; }

/* A light switches on at once; only its glow fades. Solving sends a wave of light across the
   board from the last move. */
@media (prefers-reduced-motion: no-preference) {
  .cell.is-flash { animation: chase-edge 0.7s step-end both, chase-glow 0.7s var(--ease-out) both; animation-delay: var(--d, 0ms); }
  .cell.is-flash::before { animation: chase 0.7s step-end both; animation-delay: var(--d, 0ms); }
  .board-card__msg.is-solved .star { animation: pop 0.35s var(--ease-out) both; }
}
@keyframes chase {
  0% { opacity: 1; }
  34%, 100% { opacity: 0; }
}
@keyframes chase-edge {
  0% { border-color: var(--cell-on); }
  34%, 100% { border-color: var(--cell-edge); }
}
@keyframes chase-glow {
  0% { box-shadow: 0 0 34px 0 rgba(250, 204, 21, 0.7); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* Section heads */
.section-head { max-width: 46rem; }
.section-head h2 {
  margin-top: var(--space-s);
  font-size: var(--step-5);
  font-weight: 620;
  letter-spacing: -0.038em;
  line-height: 1;
  text-wrap: balance;
}
.section-head p:last-child:not(.eyebrow) {
  margin-top: var(--space-m);
  color: var(--text-2);
  font-size: var(--step-1);
  line-height: 1.45;
  letter-spacing: -0.01em;
  max-width: 34rem;
}

/* Features: three equal cards; each phone rises from the bottom edge and is cropped by it. */
.u-features { padding-block: var(--space-xl) var(--space-2xl); }
.features {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--col-gap);
  margin: var(--space-xl) 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 52rem) {
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.feature {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-row: span 2;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.feature__text { padding: var(--space-l) var(--space-l) 0; }
/* The three phones start on one line, whatever the length of the text above them. */
@media (min-width: 52rem) {
  @supports (grid-template-rows: subgrid) {
    .features { grid-auto-rows: auto auto; row-gap: 0; }
    .feature { grid-template-rows: subgrid; }
  }
}
.feature__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.feature h3 {
  margin-top: var(--space-xs);
  font-size: var(--step-2);
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.12;
}
.feature p:last-child {
  margin-top: var(--space-xs);
  color: var(--text-2);
  line-height: 1.55;
  text-wrap: pretty;
}
.feature__shot {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: clamp(21rem, 17rem + 8vw, 25rem);
  margin-top: var(--space-l);
}
.feature__shot .phone { width: min(74%, 15rem); }

/* A drawn phone: rim, bezel, island and status bar. */
.phone {
  container-type: inline-size;
  flex: none;
  width: min(100%, 18.5rem);
  margin: 0;
  filter: drop-shadow(0 30px 40px rgba(10, 14, 23, 0.28)) drop-shadow(0 6px 10px rgba(10, 14, 23, 0.12));
}
@media (prefers-color-scheme: dark) {
  .phone { filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 60px rgba(250, 204, 21, 0.05)); }
}
.phone__body {
  position: relative;
  padding: 3.4cqw;
  border-radius: 16.5cqw;
  background: #0b0b0d;
  box-shadow:
    0 0 0 1.1cqw #2b2d31,
    0 0 0 1.5cqw #57595f,
    0 0 0 1.75cqw #1a1b1e;
}
.phone__body::before, .phone__body::after {
  content: "";
  position: absolute;
  width: 1.4cqw;
  border-radius: 1cqw;
  background: linear-gradient(90deg, #3a3c41, #6a6c72 60%, #2f3034);
}
.phone__body::before { left: -2.9cqw; top: 22%; height: 9%; box-shadow: 0 13cqw 0 #4a4c51, 0 26cqw 0 #4a4c51; }
.phone__body::after { right: -2.9cqw; top: 30%; height: 15%; }
.phone__screen {
  position: relative;
  overflow: hidden;
  border-radius: 13.2cqw;
  background: #111827;
  aspect-ratio: 402 / 874;
}
.phone__status {
  position: relative;
  height: 6.18%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7.5cqw 0 10cqw;
  color: #fff;
  font-size: 4.1cqw;
  font-weight: 620;
  letter-spacing: -0.01em;
}
.phone__island {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 30%;
  height: 52%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
}
.phone__icons { width: 17cqw; height: auto; }
.phone__screen img { width: 100%; height: auto; }

/* Trust strip */
.u-trust { padding-block: var(--space-2xl); }
.u-trust .container {
  display: grid;
  gap: var(--space-l);
  padding-block: var(--space-xl);
  border-block: 1px solid var(--line);
}
.u-trust h2 {
  font-size: var(--step-3);
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}
.u-trust p { color: var(--text-2); max-width: 32rem; }
.u-trust p a { font-weight: 560; }
@media (min-width: 52rem) {
  .u-trust .container { grid-template-columns: 1.1fr 1fr; align-items: end; }
}

/* Closing call */
.u-cta { padding-block: var(--space-3xl) var(--space-xl); text-align: center; }
.u-cta .container { display: grid; justify-items: center; gap: var(--space-m); }
.u-cta .app-icon { width: 4.5rem; height: 4.5rem; }
.u-cta h2 {
  font-size: var(--step-5);
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
  max-width: 14em;
}
.u-cta p { color: var(--text-2); }

.page-unlit .site-footer { margin-top: var(--space-xl); }

/* ================================================================ Documents (privacy, support) */

.doc { padding-bottom: var(--space-2xl); }
.doc__head {
  padding-block: var(--space-2xl) var(--space-xl);
  border-bottom: 1px solid var(--line);
}
.doc__head h1 {
  margin-top: var(--space-s);
  font-size: var(--step-5);
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}
.doc__meta {
  margin-top: var(--space-m);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
}
.doc__lead {
  margin-top: var(--space-m);
  max-width: 38rem;
  font-size: var(--step-1);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text-2);
}

.doc__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-l);
  padding-top: var(--space-xl);
}
@media (min-width: 64rem) {
  .doc__body { grid-template-columns: 14rem minmax(0, 44rem); column-gap: clamp(3rem, 1rem + 5vw, 7rem); }
}

/* Contents: a sticky list on wide screens, a disclosure on small ones. */
.toc { font-size: 0.875rem; }
.toc__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc a {
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0 0.4rem 0.9rem;
  border-left: 1px solid var(--line);
  color: var(--text-2);
  text-decoration: none;
  line-height: 1.35;
  transition: color 0.2s, border-color 0.2s;
}
.toc a:hover { color: var(--text); border-left-color: var(--line-2); }
.toc a[aria-current="true"] { color: var(--text); border-left-color: var(--text); }
.toc .n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-3); padding-top: 0.08rem; min-width: 1.4em; }
.toc--side { display: none; }
@media (min-width: 64rem) {
  .toc--side { display: block; position: sticky; top: var(--space-l); align-self: start; max-height: calc(100vh - 2 * var(--space-l)); overflow: auto; }
  .toc--side .toc__title { margin-bottom: var(--space-s); }
  .toc--inline { display: none; }
}
.toc--inline {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.toc--inline summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0 1rem;
  cursor: pointer;
  list-style: none;
}
.toc--inline summary::-webkit-details-marker { display: none; }
.toc--inline summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--text-2);
  border-bottom: 1.5px solid var(--text-2);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
}
.toc--inline[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.toc--inline ol { padding: 0 1rem 1rem; }

/* Prose */
.prose { font-size: var(--step-0); line-height: 1.7; }
.prose section > * + * { margin-top: 1.1em; }
.prose section { scroll-margin-top: var(--space-l); }
.prose section + section { margin-top: var(--space-xl); }
.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  font-size: var(--step-2);
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.7em;
}
.prose h2 .n {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-3);
  transform: translateY(-0.2em);
}
.prose h3 {
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-top: 2em;
}
.prose h3 + p { margin-top: 0.5em; }
.prose p, .prose li { color: var(--text-2); text-wrap: pretty; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul { padding-left: 1.4em; }
.prose li + li { margin-top: 0.55em; }
.prose ul > li::marker { content: ""; }
.prose ul > li { position: relative; list-style: none; }
.prose ul > li::before {
  content: "";
  position: absolute;
  left: -1.2em;
  top: 0.68em;
  width: 0.4em;
  height: 0.4em;
  border-radius: 1.5px;
  background: var(--text-3);
}
.prose .muted { color: var(--text-3); }

/* At a glance */
.glance {
  margin-top: var(--space-xl);
  padding: var(--space-m);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.glance h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.glance ul {
  display: grid;
  gap: var(--space-s) var(--space-l);
  margin: var(--space-s) 0 0;
  padding: 0;
  list-style: none;
}
.glance li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.6rem;
  font-size: 0.9875rem;
  line-height: 1.5;
}
.glance li svg { width: 1.25rem; height: 1.25rem; margin-top: 0.08rem; color: var(--text); }
@media (min-width: 40rem) {
  .glance ul { grid-template-columns: 1fr 1fr; }
}

/* Support: how-to diagram and Q&A */
.howto {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  flex-wrap: wrap;
  margin-block: var(--space-m);
  padding: var(--space-m);
  border-radius: var(--radius-m);
}
.howto__grid { display: grid; grid-template-columns: repeat(3, 1.6rem); gap: 0.3rem; }
.howto__grid span { aspect-ratio: 1; border-radius: 22%; border: 1.5px solid var(--cell-edge); background: var(--cell-off); }
.howto__grid span.on { background: var(--cell-on); border-color: var(--cell-on); box-shadow: 0 0 14px -2px rgba(250, 204, 21, 0.6); }
.howto__grid span.tap { outline: 2px solid #f9fafb; outline-offset: 2px; }
.howto__arrow { width: 1.75rem; height: 1.75rem; color: var(--text-2); }
.howto figcaption { flex: 1 1 14rem; color: var(--text-2); font-size: 0.9375rem; line-height: 1.5; }

.qa h3 { padding-top: 1.6em; border-top: 1px solid var(--line); margin-top: 1.6em; }
.qa h3:first-of-type { border-top: 0; padding-top: 0; }

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  margin-top: var(--space-l);
  padding: var(--space-m);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.contact-card p { margin: 0; color: var(--text-2); }
.contact-card a { font-weight: 600; }

/* ================================================================ 404 */

.lost { padding-block: var(--space-3xl) var(--space-2xl); }
.lost .container { display: grid; gap: var(--space-m); justify-items: start; }
.lost h1 {
  font-size: var(--step-6);
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.lost p { color: var(--text-2); max-width: 30rem; font-size: var(--step-1); line-height: 1.45; }
.lost .btn { margin-top: var(--space-s); border-color: var(--line-2); }
.lost .pilot { margin-bottom: var(--space-m); --t: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); }
@media (hover: hover) {
  .lost .btn:hover { background: var(--bg-2); border-color: var(--text-3); }
}

/* ================================================================ Motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================================ Print (the legal pages print cleanly) */

@media print {
  .site-header nav, .toc, .site-footer, .skip { display: none !important; }
  html, body { background: #fff; color: #000; }
  .prose p, .prose li { color: #000; }
  .doc__body { display: block; }
  a { color: #000; }
}
