/* Nine: marketing site.
   Tokens mirror App/ThemeCatalogue.swift (Classic day and night).
   Springs mirror NineMotion in docs/DESIGN_DIRECTION.md, written as CSS linear() curves. */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-opsz.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-opsz-italic.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter Nine";
  src: url("../fonts/inter-wght.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f5ed;
  --paper-deep: #efeadc;
  --surface: #fefdf9;
  --key: #f0ece4;
  --ink: #24211f;
  --quiet: #736b61;
  --player: #2e6185;
  --navy: #1c2848;
  --wash: rgba(46, 97, 133, 0.1);
  --match: rgba(184, 133, 71, 0.18);
  --glow: #dba85c;
  --hair: rgba(36, 33, 31, 0.16);
  --box: rgba(36, 33, 31, 0.5);
  --conflict: #b82e29;
  --shadow: rgba(77, 61, 41, 0.12);
  --good: #4f8a5b;

  --serif: "Newsreader", "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter Nine", "Segoe UI", Roboto, sans-serif;

  /* settle: 0.62 s response, no overshoot */
  --settle: cubic-bezier(0.22, 0.8, 0.26, 1);
  --settle-t: 0.65s;
  /* press: quick with a whisper of overshoot */
  --press: cubic-bezier(0.3, 1.4, 0.5, 1);
  --press-t: 0.46s;
  --linger: cubic-bezier(0.2, 0.7, 0.2, 1);
  --linger-t: 1.3s;

  --gutter: clamp(20px, 5vw, 64px);
  --maxw: 1180px;
  --radius: 22px;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --settle: linear(0, 0.0122, 0.0441, 0.0899, 0.1449, 0.2054, 0.2686, 0.3322, 0.3948, 0.4551, 0.5123, 0.566, 0.6157, 0.6614, 0.703, 0.7407, 0.7745, 0.8048, 0.8317, 0.8555, 0.8765, 0.8948, 0.9108, 0.9247, 0.9368, 0.9471, 0.956, 0.9636, 0.97, 0.9755, 0.9801, 0.984, 0.9872, 0.9899, 0.9921, 0.994, 0.9954, 0.9967, 0.9976, 0.9984, 1);
    --press: linear(0, 0.0295, 0.1039, 0.2056, 0.3207, 0.4386, 0.5519, 0.6558, 0.7473, 0.8251, 0.8891, 0.9398, 0.9785, 1.0066, 1.0259, 1.0379, 1.0441, 1.046, 1.0447, 1.0414, 1.0368, 1.0315, 1.0261, 1.0208, 1.016, 1.0118, 1.0082, 1.0052, 1.0029, 1.0011, 0.9997, 0.9988, 0.9983, 0.998, 0.9979, 0.9979, 0.9981, 0.9983, 0.9985, 0.9988, 1);
    --linger: linear(0, 0.0229, 0.079, 0.1535, 0.2364, 0.3212, 0.4035, 0.4807, 0.5515, 0.6151, 0.6716, 0.7212, 0.7643, 0.8015, 0.8333, 0.8605, 0.8836, 0.903, 0.9194, 0.9332, 0.9447, 0.9543, 0.9623, 0.9689, 0.9744, 0.979, 0.9828, 0.9859, 0.9884, 0.9905, 0.9923, 0.9937, 0.9948, 0.9958, 0.9966, 0.9972, 0.9977, 0.9982, 0.9985, 0.9988, 1);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #1a1c21;
    --paper-deep: #15171b;
    --surface: #22252a;
    --key: #2e3037;
    --ink: #ebe8e0;
    --quiet: #a3a198;
    --player: #b8d1e6;
    --navy: #b8d1e6;
    --wash: rgba(184, 209, 230, 0.14);
    --match: rgba(209, 163, 92, 0.24);
    --glow: #e6b86b;
    --hair: rgba(235, 232, 224, 0.15);
    --box: rgba(235, 232, 224, 0.44);
    --conflict: #eb6157;
    --shadow: rgba(0, 0, 0, 0.38);
    --good: #7fbf8c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color var(--linger-t) var(--linger), color var(--linger-t) var(--linger);
}
/* A whisper of paper grain, drawn in CSS so there is nothing to download. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 85% -10%, color-mix(in srgb, var(--glow) 10%, transparent), transparent 70%),
    radial-gradient(900px 600px at -10% 30%, color-mix(in srgb, var(--player) 6%, transparent), transparent 70%);
}
main, .footer, .nav { position: relative; z-index: 1; }
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--player) 25%, transparent); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--player); outline-offset: 3px; border-radius: 8px; }
/* On the board the selection square is the focus ring, kept inside the cell. */
.cell:focus-visible { outline: none; }

/* ---------- Type ---------- */
.display, .title, .subtitle, .finish-title, .coach, .count-num, .privacy-big, h3 {
  font-family: var(--serif);
  font-weight: 450;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}
.display {
  font-size: clamp(44px, 5.7vw, 86px);
  line-height: 0.98;
  margin: 0 0 24px;
  letter-spacing: -0.03em;
  font-weight: 400;
}
.title {
  font-size: clamp(36px, 5.6vw, 68px);
  line-height: 1.02;
  margin: 0 0 18px;
  letter-spacing: -0.025em;
  font-weight: 400;
}
.subtitle { font-size: clamp(26px, 3vw, 34px); line-height: 1.1; margin: 0 0 18px; }
h3 { font-size: 26px; line-height: 1.15; margin: 0 0 8px; }
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--quiet);
  margin: 0 0 18px;
  font-weight: 560;
}
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--quiet); margin: 0 0 28px; max-width: 34em; line-height: 1.55; }
.body-large { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5; margin: 0 0 14px; }
.quiet { color: var(--quiet); }
p { margin: 0 0 14px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.4s ease, background-color var(--linger-t) var(--linger);
}
.nav.is-scrolled { border-bottom-color: var(--hair); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 22px; }
.brand-mark { width: 30px; height: 30px; border-radius: 22.37%; box-shadow: 0 0 0 0.5px var(--hair), 0 2px 6px -2px var(--shadow); }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--quiet); font-size: 15px; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }

.sound-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px 0 10px;
  border-radius: 999px; border: 0.5px solid var(--hair);
  background: var(--surface); cursor: pointer;
  font-size: 14px; color: var(--quiet);
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform var(--press-t) var(--press), color 0.3s ease, background-color 0.3s ease;
}
.sound-toggle:active { transform: scale(0.92); }
.sound-toggle[aria-pressed="true"] { color: var(--player); }
.sound-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound-icon .spk { fill: currentColor; stroke: none; }
.sound-icon .wave { opacity: 0; transform: scale(0.6); transform-origin: 12px 12px; transition: opacity 0.4s ease, transform var(--settle-t) var(--settle); }
.sound-icon .w2 { transition-delay: 0.06s; }
.sound-icon .mute { opacity: 1; transition: opacity 0.3s ease; }
.sound-toggle[aria-pressed="true"] .wave { opacity: 1; transform: none; }
.sound-toggle[aria-pressed="true"] .mute { opacity: 0; }

/* ---------- App Store pill (placeholder until the official badge) ---------- */
.store-pill {
  display: inline-flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 26px 0 20px;
  border-radius: 16px;
  background: var(--ink); color: var(--paper);
  text-decoration: none;
  box-shadow: 0 10px 30px -10px var(--shadow), 0 2px 6px var(--shadow);
  transition: transform var(--press-t) var(--press), box-shadow 0.4s ease;
}
.store-pill:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px var(--shadow), 0 2px 6px var(--shadow); }
.store-pill:active { transform: scale(0.96); }
.store-glyph { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.store-pill-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.store-pill-text small { font-size: 11px; font-weight: 500; opacity: 0.75; letter-spacing: 0.02em; }
.store-badge { display: inline-block; border-radius: 12px; transition: transform var(--press-t) var(--press), filter 0.4s ease; filter: drop-shadow(0 10px 18px var(--shadow)); }
.store-badge img { height: 56px; width: auto; }
.store-badge:hover { transform: translateY(-2px); }
.store-badge:active { transform: scale(0.96); }
.store-pill--small { height: 38px; padding: 0 16px; border-radius: 999px; }
.store-pill--small .store-pill-text { font-size: 14px; }

.ghost-button {
  appearance: none; border: 0.5px solid var(--hair); background: var(--surface);
  border-radius: 999px; padding: 11px 20px; cursor: pointer; font-size: 15px;
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform var(--press-t) var(--press), background-color 0.3s ease;
}
.ghost-button:hover { background: var(--key); }
.ghost-button:active { transform: scale(0.92); }
.link-button { appearance: none; background: none; border: 0; padding: 0; color: var(--player); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.text-link { color: var(--player); text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.9s ease, transform 1.1s var(--settle);
  transition-delay: var(--d, 0s);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(56px, 10vh, 120px);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center;
  min-height: min(100svh - 64px, 980px);
}
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.hero-note { color: var(--quiet); font-size: 14px; }
.hero-play { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.coach {
  font-size: 21px; margin: 0; min-height: 1.5em; text-align: center;
  font-style: italic; color: var(--quiet);
  transition: opacity 0.35s ease, transform 0.6s var(--settle);
}
.coach.is-changing { opacity: 0; transform: translateY(6px); }
.sound-hint { font-size: 14px; color: var(--quiet); margin: 0; text-align: center; transition: opacity 0.5s ease; }
.sound-hint.is-hidden { opacity: 0; pointer-events: none; }

.board-card {
  position: relative; width: 100%; max-width: 500px; overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(10px, 2.2vw, 18px);
  box-shadow: 0 0 0 0.5px var(--hair), 0 30px 60px -30px var(--shadow), 0 12px 24px -12px var(--shadow);
}

/* The board */
.board {
  --n: 9;
  position: relative; aspect-ratio: 1; width: 100%;
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); grid-template-rows: repeat(9, minmax(0, 1fr));
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  border-radius: 6px;
  container-type: inline-size;
}
.board .lines { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.board .lines i { position: absolute; background: var(--hair); }
.board .lines i.v { top: 0; bottom: 0; width: 1px; left: calc(var(--k) / 9 * 100%); transform: translateX(-50%); transform-origin: top; }
.board .lines i.h { left: 0; right: 0; height: 1px; top: calc(var(--k) / 9 * 100%); transform: translateY(-50%); transform-origin: left; }
.board .lines i.b { background: var(--box); }
.board .lines i.v.b { width: 1.5px; }
.board .lines i.h.b { height: 1.5px; }
.board .lines .frame { position: absolute; inset: 0; border: 1.5px solid var(--box); border-radius: 4px; }
.board.is-drawing .lines i.v { animation: drawV 0.9s var(--settle) both; animation-delay: var(--ld, 0s); }
.board.is-drawing .lines i.h { animation: drawH 0.9s var(--settle) both; animation-delay: var(--ld, 0s); }
.board.is-drawing .lines .frame { animation: fadeIn 0.8s ease both; }
@keyframes drawV { from { transform: translateX(-50%) scaleY(0); } to { transform: translateX(-50%) scaleY(1); } }
@keyframes drawH { from { transform: translateY(-50%) scaleX(0); } to { transform: translateY(-50%) scaleX(1); } }

.cell {
  position: relative; display: grid; place-items: center; min-width: 0; min-height: 0;
  font-family: var(--serif); font-size: clamp(16px, 7.2cqi, 40px); line-height: 1;
  cursor: default; border: 0; background: transparent; padding: 0; color: var(--ink);
  font-weight: 430;
}
.cell::before { /* wash */
  content: ""; position: absolute; inset: 0; background: var(--wash); opacity: 0;
  transition: opacity 0.35s ease;
}
.cell.is-peer::before { opacity: 0.55; }
.cell.is-match::before { background: var(--match); opacity: 1; }
.cell.is-open { cursor: pointer; }
.cell.is-open::after { /* breathing target ring */
  content: ""; position: absolute; inset: 14%; border-radius: 30%;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--player) 55%, transparent), 0 0 18px color-mix(in srgb, var(--player) 30%, transparent);
  animation: breathe 2.8s ease-in-out infinite; animation-delay: var(--bd, 0s);
  pointer-events: none;
}
.cell.is-open.is-selected::after, .cell.is-open.has-digit::after { opacity: 0; animation: none; }
@keyframes breathe { 0%, 100% { opacity: 0.25; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1); } }

/* Newsreader's figures sit high in their line box (cap height ~0.70em above a
   0.73em ascent), so nudge them down to centre the ink, not the box. */
.digit { position: relative; top: 0.1em; z-index: 2; display: block; pointer-events: none; }
.digit.player { color: var(--player); }
.digit.wrong { color: var(--conflict); }
.digit.deal { animation: inkIn var(--settle-t) var(--settle) both; animation-delay: var(--dd, 0s); }
.digit.ink { animation: inkIn var(--settle-t) var(--settle) both; }
.digit.out { animation: inkOut 0.45s var(--settle) both; }
@keyframes inkIn { from { opacity: 0; transform: scale(0.72); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes inkOut { to { opacity: 0; transform: translateY(-3px) scale(1.04); filter: blur(2px); } }

.cell.shiver .digit { animation: shiver 0.32s linear; }
@keyframes shiver { 0%,100% { transform: none; } 16% { transform: translateX(-3px); } 33% { transform: translateX(3px); } 50% { transform: translateX(-2px); } 66% { transform: translateX(2px); } 83% { transform: translateX(-1px); } }

.cell .rip { position: absolute; inset: 0; background: var(--player); opacity: 0; pointer-events: none; z-index: 1; }
.cell.ripple .rip { animation: ripple 0.86s ease-out both; animation-delay: var(--rd, 0s); }
@keyframes ripple { 0% { opacity: 0; } 19% { opacity: 0.16; } 100% { opacity: 0; } }

.cell.bloom .digit { animation: lift 1s both; animation-delay: var(--bl, 0s); }
@keyframes lift {
  0% { transform: none; animation-timing-function: cubic-bezier(0.3, 0, 0.4, 1); }
  35% { transform: translateY(-4px) scale(1.18); color: var(--glow); animation-timing-function: cubic-bezier(0.5, 0, 0.6, 1); }
  70% { transform: translateY(1px) scale(0.97); }
  100% { transform: none; }
}
.board .glow {
  position: absolute; inset: -12%; pointer-events: none; z-index: 0; opacity: 0;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), color-mix(in srgb, var(--glow) 38%, transparent), transparent 62%);
  transition: opacity 1.2s ease;
}
.board.is-glowing .glow { opacity: 1; }

.selection {
  position: absolute; z-index: 2; pointer-events: none;
  width: calc(100% / 9); height: calc(100% / 9); left: 0; top: 0;
  opacity: 0;
  transition: transform var(--settle-t) var(--settle), opacity 0.3s ease;
}
.selection::before {
  content: ""; position: absolute; inset: 6%; border-radius: 20%;
  background: var(--wash); box-shadow: inset 0 0 0 1.5px var(--player);
}
.selection.is-on { opacity: 1; }

.finish {
  position: absolute; left: 50%; bottom: 8%; z-index: 5;
  transform: translate(-50%, 16px); opacity: 0;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 18px; padding: 16px 20px; text-align: center;
  box-shadow: 0 0 0 0.5px var(--hair), 0 20px 40px -16px var(--shadow);
  transition: opacity 0.6s ease, transform 0.9s var(--settle);
  min-width: 220px;
}
.finish.is-on { opacity: 1; transform: translate(-50%, 0); }
.finish-title { font-size: 26px; margin: 0 0 10px; }

/* Keypad: keycaps on paper */
.keypad {
  width: 100%; max-width: 500px;
  display: grid; grid-template-columns: repeat(9, 1fr); gap: clamp(4px, 1vw, 8px);
  padding: 10px; background: var(--surface); border-radius: 18px;
  box-shadow: 0 0 0 0.5px var(--hair), 0 10px 24px -14px var(--shadow);
}
.key {
  position: relative; appearance: none; border: 0; cursor: pointer;
  aspect-ratio: 0.82; border-radius: 12px; background: var(--key);
  display: grid; place-items: center; align-content: center; gap: 0;
  font-family: var(--serif); font-size: clamp(20px, 3vw, 28px); line-height: 1;
  box-shadow: inset 0 -1px 0 var(--hair);
  transition: transform var(--press-t) var(--press), opacity 0.5s ease, background-color 0.3s ease;
}
.key small { font-family: var(--sans); font-size: 10px; color: var(--quiet); margin-top: 4px; letter-spacing: 0.02em; }
.key:active, .key.is-pressed { transform: scale(0.92); }
.key.is-done { opacity: 0.38; }
.key.is-done small { color: var(--good); }
.key.is-active { background: color-mix(in srgb, var(--player) 18%, var(--key)); }

/* ---------- Ink on paper: scroll moment ---------- */
section.ink { position: relative; height: 240vh; }
.ink-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(24px, 5vw, 80px);
  max-width: var(--maxw); margin: 0 auto; padding: 72px var(--gutter) 24px;
  overflow: hidden;
}
.ink-art { width: 100%; max-height: 74vh; overflow: visible; }
.ink-tile { fill: var(--surface); stroke: var(--hair); stroke-width: 1; filter: drop-shadow(0 24px 30px var(--shadow)); }
.ink-rot { transform-origin: 150px 150px; transform-box: view-box; will-change: transform; }
.ink-fine line { stroke: var(--hair); stroke-width: 0.9; }
.ink-bold line, .ink-bold rect { stroke: var(--box); stroke-width: 2.4; fill: none; stroke-linecap: round; }
.ink-nine { font-family: var(--serif); font-size: 74px; fill: var(--navy); font-weight: 520; }
.ink-copy [data-ink-line] { will-change: opacity, transform; }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 14vh, 160px) var(--gutter); }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }

.card {
  background: var(--surface); border-radius: var(--radius); padding: 26px 26px 22px;
  box-shadow: 0 0 0 0.5px var(--hair), 0 24px 48px -32px var(--shadow);
}
.card p { color: var(--quiet); font-size: 16px; margin: 0; }
.card-art { height: 170px; margin: -6px -6px 22px; border-radius: 14px; background: var(--paper); position: relative; overflow: hidden; }
.feel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* motion card: a digit inking in, then a row rippling */
.motion-art { display: grid; place-items: center; align-content: center; gap: 18px; }
.motion-cell { width: 64px; height: 64px; border-radius: 10px; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--player); background: var(--wash); }
.motion-digit { font-family: var(--serif); font-size: 40px; color: var(--player); }
.motion-row { display: grid; grid-template-columns: repeat(9, 18px); gap: 3px; }
.motion-row i { height: 18px; border-radius: 3px; background: var(--hair); }
.is-in .motion-digit { animation: inkLoop 3.6s var(--settle) infinite; }
.is-in .motion-row i { animation: rowLoop 3.6s ease-out infinite; animation-delay: calc(var(--i) * 45ms + 0.5s); }
@keyframes inkLoop { 0%, 8% { opacity: 0; transform: scale(0.72); filter: blur(6px); } 26%, 88% { opacity: 1; transform: none; filter: blur(0); } 100% { opacity: 0; } }
@keyframes rowLoop { 0%, 4% { background: var(--hair); } 10% { background: var(--player); } 40%, 100% { background: var(--hair); } }

.haptic-art { display: grid; align-content: center; gap: 4px; padding: 10px 18px; }
.haptic-art figure { margin: 0; display: grid; grid-template-columns: 1fr 96px; align-items: center; gap: 10px; }
.haptic-art svg { width: 100%; height: 36px; }
.haptic-art path { fill: none; stroke: var(--player); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; }
.haptic-art figcaption { font-size: 12px; color: var(--quiet); letter-spacing: 0.04em; }
.is-in .haptic-art path { animation: draw2 1.6s var(--settle) forwards; animation-delay: calc(0.3s + var(--i) * 0.25s); }
@keyframes draw2 { to { stroke-dashoffset: 0; } }

.sound-art { display: grid; place-items: center; padding: 16px; }
.scale-keys { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; width: 100%; align-items: end; height: 100%; }
.scale-key {
  appearance: none; border: 0; cursor: pointer; border-radius: 9px;
  background: var(--key); box-shadow: inset 0 -1px 0 var(--hair);
  height: calc(52% + var(--i) * 5.5%);
  font-family: var(--serif); font-size: 17px; color: var(--player);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
  transition: transform var(--press-t) var(--press), background-color 0.6s ease;
  transform-origin: bottom;
}
.scale-key:active, .scale-key.is-ringing { transform: scaleY(0.94); background: color-mix(in srgb, var(--player) 22%, var(--key)); transition-duration: 0.08s, 0.08s; }

/* Tiers */
.count { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 40px; }
.count-num { font-size: clamp(64px, 11vw, 140px); line-height: 0.9; letter-spacing: -0.04em; color: var(--player); font-variant-numeric: lining-nums tabular-nums; }
.count-label { color: var(--quiet); font-size: 17px; }
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tier {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  box-shadow: 0 0 0 0.5px var(--hair), 0 24px 48px -32px var(--shadow);
  transition: transform 0.7s var(--settle), box-shadow 0.5s ease;
}
.tier:hover { transform: translateY(-4px); box-shadow: 0 0 0 0.5px var(--hair), 0 30px 60px -30px var(--shadow); }
.tier p { color: var(--quiet); font-size: 15.5px; min-height: 3em; }
.tier-dots { display: flex; gap: 5px; margin-bottom: 18px; }
.tier-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--hair); }
.tier[style*="--tier:1"] .tier-dots i:nth-child(-n+1),
.tier[style*="--tier:2"] .tier-dots i:nth-child(-n+2),
.tier[style*="--tier:3"] .tier-dots i:nth-child(-n+3),
.tier[style*="--tier:4"] .tier-dots i:nth-child(-n+4) { background: var(--player); }

/* Hint demo */
.hint-demo {
  margin-top: clamp(48px, 8vw, 96px);
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: center;
  background: var(--surface); border-radius: calc(var(--radius) + 6px); padding: clamp(18px, 3.5vw, 44px);
  box-shadow: 0 0 0 0.5px var(--hair), 0 30px 60px -40px var(--shadow);
}
.hint-board .board { max-width: 440px; margin: 0 auto; }
.hint-steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 4px; counter-reset: s; }
.hint-steps li {
  padding: 12px 14px; border-radius: 14px; color: var(--quiet); font-size: 16px;
  opacity: 0.45; transition: opacity 0.5s ease, background-color 0.5s ease, transform 0.7s var(--settle);
}
.hint-steps li b { color: var(--ink); font-weight: 600; }
.hint-steps li.is-on { opacity: 1; }
.hint-steps li.is-current { background: var(--wash); transform: translateX(4px); }
.hint-title { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 22px; margin: 0 0 10px; }
.hint-title svg { width: 18px; height: 18px; fill: var(--glow); stroke: var(--glow); stroke-width: 1.4; stroke-linejoin: round; }
.digit.pencilled { color: var(--player); opacity: 0.55; transform: scale(0.62); }
.cell.is-target::before { opacity: 1; background: var(--wash); box-shadow: inset 0 0 0 1.5px var(--player); }

/* Daily */
.daily { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.streak { display: flex; gap: 10px; }
.streak span {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 13px; color: var(--quiet); background: var(--surface); box-shadow: inset 0 0 0 0.5px var(--hair);
  transition: background-color 0.6s ease, color 0.6s ease, transform 0.8s var(--settle);
}
.streak span.is-lit { background: var(--player); color: var(--paper); transform: translateY(-2px); }
.share { margin: 0; }
.bubble {
  position: relative; background: var(--surface); border-radius: 26px 26px 26px 8px; padding: 22px 26px;
  box-shadow: 0 0 0 0.5px var(--hair), 0 30px 60px -30px var(--shadow);
  font-size: 17px; max-width: 400px;
}
.bubble p { margin: 0 0 4px; }
.share-head { font-weight: 600; }
.share-grid { margin-top: 12px !important; font-size: 30px; line-height: 1.15; letter-spacing: 2px; }
.share figcaption { color: var(--quiet); font-size: 14.5px; margin-top: 16px; max-width: 360px; }

/* Hexadoku: a quieter aside, the iPad beside a few words. */
.bigger { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.bigger .device { --row-h: min(420px, calc((min(100vw, var(--maxw)) - 2 * var(--gutter)) * 0.52 / 1.3)); justify-self: center; }
.bigger .device-body { height: var(--row-h); }
.bigger .title { font-size: clamp(36px, 4.6vw, 60px); }

/* Devices: Apple's device frames, with live boards drawn underneath the transparent screen. */
.devices { --row-h: min(440px, calc((min(100vw, var(--maxw)) - 2 * var(--gutter) - 32px) / 2.15)); display: grid; gap: clamp(28px, 5vw, 64px); }
.device-row { display: flex; justify-content: center; align-items: flex-end; gap: clamp(16px, 3vw, 40px); }
.device { margin: 0; text-align: center; }
.device figcaption { color: var(--quiet); font-size: 14px; margin-top: 14px; }
.device-body { position: relative; height: var(--row-h); aspect-ratio: var(--ar); container-type: inline-size; filter: drop-shadow(0 30px 40px var(--shadow)); }
.device-body .frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.screen {
  position: absolute; background: var(--paper); overflow: hidden; z-index: 1;
  left: var(--sl); top: var(--st); width: var(--sw); height: var(--sh);
  border-radius: calc(var(--sr) * 1cqw);
}
/* Screen rectangles measured from each frame's transparent area. */
.device--phone { --ar: 1350 / 2760; --sl: 5.1%; --st: 2.35%; --sw: 89.8%; --sh: 95.3%; --sr: 13.6; }
.device--tablet { --ar: 3000 / 2300; --sl: 4%; --st: 5.1%; --sw: 92%; --sh: 89.8%; --sr: 2.2; }
.device--duo-closed { --ar: 1574 / 2194; --sl: 5.45%; --st: 3.5%; --sw: 89.1%; --sh: 93%; --sr: 2; }
.device--duo-closed .screen { border-radius: calc(2 * 1cqw) calc(17 * 1cqw) calc(17 * 1cqw) calc(2 * 1cqw); }
.device--duo { --ar: 3093 / 2247; --sl: 3.75%; --st: 5.2%; --sw: 92.5%; --sh: 89.6%; --sr: 5; }
.screen .shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* Privacy */
.privacy-band { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.privacy-label {
  background: var(--surface); border-radius: 28px; padding: 36px 28px; text-align: center;
  box-shadow: 0 0 0 0.5px var(--hair), 0 30px 60px -36px var(--shadow);
}
.privacy-mark { width: 64px; height: 64px; margin: 0 auto 16px; fill: none; stroke: var(--player); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.privacy-mark path { stroke-dasharray: 30; stroke-dashoffset: 30; }
.is-in .privacy-mark path { transition: stroke-dashoffset 1s var(--settle) 0.5s; stroke-dashoffset: 0; }
.privacy-kicker { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet); margin: 0 0 6px; }
.privacy-big { font-size: clamp(30px, 3.4vw, 40px); margin: 0; line-height: 1.05; }
.nots { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.nots li { padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 0.5px var(--hair); font-size: 15px; }

/* Closing */
.closing { position: relative; overflow: hidden; padding: clamp(120px, 22vh, 220px) var(--gutter); text-align: center; }
.closing-art { position: absolute; inset: -30%; opacity: 0.9; pointer-events: none; will-change: transform; }
.closing-art svg { width: 100%; height: 100%; }
.closing-copy { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.closing-copy .display { margin-bottom: 18px; }
.closing::after { content: ""; position: absolute; inset: 0; background: radial-gradient(closest-side, var(--paper) 30%, color-mix(in srgb, var(--paper) 40%, transparent) 75%, transparent); pointer-events: none; }
.closing-copy { z-index: 1; }

/* Footer */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 32px var(--gutter) max(40px, env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--quiet); font-size: 14px; border-top: 0.5px solid var(--hair);
}
.footer nav { display: flex; gap: 22px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Privacy policy page ---------- */
.policy { max-width: 720px; margin: 0 auto; padding: clamp(48px, 10vh, 110px) var(--gutter) 80px; }
.policy h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 6vw, 64px); letter-spacing: -0.025em; line-height: 1.02; margin: 0 0 12px; }
.policy h2 { font-family: var(--serif); font-weight: 450; font-size: 26px; margin: 44px 0 10px; letter-spacing: -0.01em; }
.policy p, .policy li { color: var(--ink); font-size: 17px; }
.policy .meta { color: var(--quiet); margin-bottom: 36px; }
.policy .summary { background: var(--surface); border-radius: 20px; padding: 22px 24px; box-shadow: 0 0 0 0.5px var(--hair); font-size: 19px; }
.policy .todo { background: var(--match); border-radius: 4px; padding: 0 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .nav-links { display: none; }
  .nav-links + .nav-actions { margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-cta { justify-content: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .feel-grid { grid-template-columns: 1fr 1fr; }
  .feel-grid .card:last-child { grid-column: 1 / -1; }
  .tiers { grid-template-columns: 1fr 1fr; }
  .daily, .bigger, .privacy-band { grid-template-columns: 1fr; }
  .bigger .bigger-copy { order: -1; }
  .bigger .device { --row-h: min(420px, calc((100vw - 2 * var(--gutter)) * 0.92 / 1.3)); }
  .ink-stage { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; text-align: center; padding-top: 80px; }
  .ink-art { max-height: 48vh; margin: 0 auto; width: auto; height: 48vh; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav { gap: 12px; }
  .sound-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sound-toggle { width: 38px; padding: 0; justify-content: center; }
  .hero { padding-top: 28px; }
  .feel-grid, .tiers { grid-template-columns: 1fr; }
  .tier p { min-height: 0; }
  .hint-demo { grid-template-columns: 1fr; }
  .device-row { gap: 12px; }
  .device figcaption { font-size: 12.5px; }
  .count { gap: 10px; }
  .ink-art { height: 42vh; max-height: 42vh; }
  .store-pill { height: 54px; }
}
@media (max-width: 400px) {
  .store-pill--small { display: none; }
}

/* ---------- Reduce Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; }
  .js .reveal.is-in { transition: opacity 0.6s ease; }
  .digit.deal, .digit.ink { animation-name: fadeIn; }
  .digit.out { animation-name: fadeOut; }
  .cell.shiver .digit { animation: none; }
  .cell.bloom .digit { animation-name: glowOnly; }
  .cell.is-open::after { animation: none; opacity: 0.7; }
  .board.is-drawing .lines i { animation: none; }
  .is-in .motion-digit, .is-in .motion-row i { animation: none; }
  .is-in .haptic-art path { animation: none; stroke-dashoffset: 0; }
  .tier:hover, .store-pill:hover, .store-badge:hover { transform: none; }
  .hint-steps li.is-current { transform: none; }
  .finish { transition: opacity 0.6s ease; transform: translate(-50%, 0); }
  section.ink { height: auto; }
  .ink-stage { position: relative; height: auto; min-height: 0; padding: 96px var(--gutter); }
  .closing-art { will-change: auto; }
  .coach.is-changing { transform: none; }
  * { scroll-behavior: auto !important; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes glowOnly { 0%, 100% { color: inherit; } 40% { color: var(--glow); } }

.hero .display { font-size: clamp(40px, 4.5vw, 72px); }
