/* Box Brain Sudoku site. Colours follow the app's Studio skin (light) and
   Night Lab (dark). Headings use the app's Fraunces, cut down to Latin and
   weights 600–900 (fonts/, OFL). */
@font-face { font-family: Fraunces; src: url(/fonts/fraunces.woff2) format("woff2"); font-weight: 600 900; font-display: swap; }

:root {
  --bg: #f3eee5; --card: #fbf8f2; --tint: #e7e1ef; --ink: #14110f; --muted: #6b655b; --accent: #5b47e0; --on-accent: #fff;
  --line: #14110f; --thin: #cfc8bb; --soft: #e2dccf; --good: #2f7d4f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16151a; --card: #201f26; --tint: #24222d; --ink: #ece9f2; --muted: #a29fae; --accent: #8f84ff; --on-accent: #16151a;
    --line: #ece9f2; --thin: #4a4756; --soft: #34323e; --good: #6fcf97;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16151a; --card: #201f26; --tint: #24222d; --ink: #ece9f2; --muted: #a29fae; --accent: #8f84ff; --on-accent: #16151a;
  --line: #ece9f2; --thin: #4a4756; --soft: #34323e; --good: #6fcf97;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); }
h1, h2, h3, .serif { font-family: Fraunces, Georgia, serif; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { display: flex; align-items: center; gap: 12px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 19px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.top nav { margin-left: auto; display: flex; gap: 20px; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.top nav a:hover { color: var(--accent); }
@media (max-width: 640px) { .top nav .opt { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 14px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 700; line-height: 1.15; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn small { display: block; font-size: 11px; font-weight: 500; opacity: 0.8; }
.btn:hover { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding-top: 32px; padding-bottom: 64px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 72px); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 20px; color: var(--muted); margin: 20px 0 28px; max-width: 34em; }
.hero .meta { margin-top: 18px; font-size: 14px; color: var(--muted); }
.devices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.devices li { padding: 4px 12px; border-radius: 999px; background: var(--tint); font-size: 14px; font-weight: 600; }

/* Phone and tablet frames around the preview videos */
.phone { position: relative; margin: 0 auto; width: min(320px, 78vw); border: 10px solid #14110f; border-radius: 46px; overflow: hidden; background: #14110f; box-shadow: 0 30px 60px -20px rgba(20, 17, 15, 0.45); }
.phone video, .phone img { width: 100%; aspect-ratio: 886 / 1920; object-fit: cover; }
.tablet { margin: 0 auto; width: min(560px, 100%); border: 12px solid #14110f; border-radius: 32px; overflow: hidden; background: #14110f; box-shadow: 0 30px 60px -20px rgba(20, 17, 15, 0.45); }
.tablet video { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

/* Sections */
section { padding: 72px 0; }
section.tinted { background: var(--tint); }
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 10px; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); }
.section-head p { font-size: 19px; color: var(--muted); margin-top: 14px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.flip > :first-child { order: 2; }
.split h2 { font-size: clamp(30px, 4.4vw, 46px); margin-bottom: 16px; }
.split .copy p { font-size: 18px; color: var(--muted); }
.shot { border-radius: 28px; box-shadow: 0 24px 48px -24px rgba(20, 17, 15, 0.35); }
.split > .shot { width: 100%; max-width: 360px; justify-self: center; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: 520px; justify-self: center; }
.screens .shot { max-width: 440px; margin: 0 auto; }
.screens .tablet { width: min(480px, 100%); }
.ticks { list-style: none; padding: 0; margin: 0 0 16px; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 0.45em; width: 14px; height: 8px; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }

/* The twelve modes */
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.modes li { background: var(--card); border: 1px solid var(--soft); border-radius: 16px; padding: 16px 18px; }
.modes h3 { font-size: 21px; margin-bottom: 4px; }
.modes p { margin: 0; font-size: 15px; color: var(--muted); }

/* Devices */
.screens { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: end; }
.screens figure { margin: 0; }
.screens figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); text-align: center; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan { background: var(--card); border: 1px solid var(--soft); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; }
.plan.best { border: 2px solid var(--accent); }
.plan h3 { font-size: 26px; }
.plan .price { font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 34px; margin: 12px 0 2px; }
.plan .note { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.plan .ticks { font-size: 15px; }
.tag { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 12px/1.6 -apple-system, BlinkMacSystemFont, sans-serif; vertical-align: middle; }

/* Feature tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { background: var(--card); border: 1px solid var(--soft); border-radius: 18px; padding: 22px; }
.tile h3 { font-size: 21px; margin-bottom: 8px; }
.tile p { margin: 0; color: var(--muted); font-size: 16px; }

/* Call to action and footer */
.cta { text-align: center; }
.cta h2 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 14px; }
.cta p { color: var(--muted); font-size: 19px; margin-bottom: 26px; }
footer { border-top: 1px solid var(--soft); padding: 28px 0 40px; font-size: 15px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
footer nav { display: flex; gap: 20px; margin-left: auto; }
footer a { color: var(--muted); }

/* Text pages: support, privacy, 404 */
.page { max-width: 720px; margin: 0 auto; padding: 24px 16px 72px; }
.page h1 { font-size: clamp(34px, 6vw, 52px); margin-bottom: 12px; }
.page h2 { font-size: 26px; margin: 40px 0 12px; }
.page h3 { font-size: 19px; margin: 24px 0 8px; font-family: inherit; font-weight: 700; letter-spacing: 0; }
.page p, .page li { color: var(--ink); }
.page .lede { font-size: 19px; color: var(--muted); }
.page details { background: var(--card); border: 1px solid var(--soft); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
.page summary { cursor: pointer; font-weight: 700; }
.page details p:last-child { margin-bottom: 0; }
.page details[open] summary { margin-bottom: 10px; }
.contact { background: var(--tint); border-radius: 18px; padding: 22px; margin-top: 32px; }

@media (max-width: 860px) {
  .hero, .split, .screens { grid-template-columns: 1fr; gap: 36px; }
  .split.flip > :first-child { order: 0; }
  .plans, .tiles { grid-template-columns: 1fr; }
  section { padding: 56px 0; }
  .hero { padding-top: 8px; }
}
@media (max-width: 860px) and (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* Challenge link page (c/index.html) */
.challenge { max-width: 440px; margin: 0 auto; padding: 32px 16px 48px; text-align: center; }
.challenge h1 { font-size: 30px; margin: 0 0 8px; }
.challenge p { color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(9, 1fr); aspect-ratio: 1; width: 100%; margin: 20px 0; background: var(--card); border: 3px solid var(--line); }
.board div { display: flex; align-items: center; justify-content: center; font-family: Fraunces, Georgia, serif; font-size: clamp(14px, 5vw, 24px); font-weight: 700; border-right: 1px solid var(--thin); border-bottom: 1px solid var(--thin); }
.board div:nth-child(9n) { border-right: 0; }
.board div:nth-child(9n+3), .board div:nth-child(9n+6) { border-right: 2px solid var(--line); }
.board div:nth-child(n+19):nth-child(-n+27), .board div:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--line); }
.board div:nth-child(n+73) { border-bottom: 0; }
.open { display: block; padding: 14px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; margin-bottom: 20px; }
.stores { display: flex; gap: 12px; justify-content: center; }
.note { font-size: 14px; }

/* ---- Bolder home page ---- */
.hero-card { position: relative; overflow: hidden; border-radius: 32px; color: #fff; background: radial-gradient(120% 90% at 85% 10%, #8a6cff 0%, rgba(138, 108, 255, 0) 55%), linear-gradient(140deg, #6d55f0 0%, #5b47e0 40%, #3a29b0 100%); box-shadow: 0 40px 80px -40px rgba(58, 41, 176, 0.65); }
.hero-card .hero { position: relative; padding: 56px 56px 0; gap: 40px; align-items: end; }
.hero-card .hero-copy { padding-bottom: 64px; }
.hero-card h1 { color: #fff; font-size: clamp(40px, 6vw, 70px); }
.hero-card h1 em { color: #ffd166; }
.hero-card .lede { color: rgba(255, 255, 255, 0.86); }
.hero-card .lede strong { color: #fff; }
.kicker { display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.btn.light { background: #fff; color: #14110f; }
.btn.light:hover { background: #ffd166; color: #14110f; }
.text-link { color: #fff; font-weight: 700; text-decoration: none; border-bottom: 2px solid rgba(255, 255, 255, 0.4); }
.text-link:hover { border-color: #fff; }
.hero-card .devices li { background: rgba(255, 255, 255, 0.16); color: #fff; }
.hero-card .phone { margin-bottom: -60px; transform: rotate(4deg); border-color: #120f2e; box-shadow: 0 40px 70px -20px rgba(10, 6, 40, 0.7); }
.hero-digits { position: absolute; inset: 0; pointer-events: none; }
.hero-digits span { position: absolute; font: 900 120px/1 Fraunces, Georgia, serif; color: rgba(255, 255, 255, 0.07); animation: drift 14s ease-in-out infinite alternate; }
.hero-digits span:nth-child(1) { left: 4%; top: 8%; }
.hero-digits span:nth-child(2) { left: 38%; top: -4%; font-size: 180px; animation-delay: -3s; }
.hero-digits span:nth-child(3) { right: 6%; top: 18%; animation-delay: -6s; }
.hero-digits span:nth-child(4) { left: 46%; bottom: 6%; font-size: 90px; animation-delay: -2s; }
.hero-digits span:nth-child(5) { left: 2%; bottom: 2%; font-size: 160px; animation-delay: -8s; }
.hero-digits span:nth-child(6) { right: 32%; top: 40%; font-size: 70px; animation-delay: -5s; }
.hero-digits span:nth-child(7) { right: 2%; bottom: 10%; font-size: 150px; animation-delay: -1s; }
.hero-digits span:nth-child(8) { left: 28%; top: 46%; font-size: 60px; animation-delay: -9s; }
.hero-digits span:nth-child(9) { left: 60%; top: 10%; font-size: 80px; animation-delay: -4s; }
@keyframes drift { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-24px) rotate(4deg); } }

.stats { list-style: none; margin: 96px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stats li { text-align: center; padding: 18px 8px; border-radius: 20px; background: var(--card); border: 1px solid var(--soft); }
.stats b { display: block; font: 900 46px/1 Fraunces, Georgia, serif; color: var(--accent); }
.stats span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }

/* Playable board */
.play-section { margin-top: 72px; background: var(--b-bg); color: var(--b-ink); transition: background 0.4s, color 0.4s; }
.play { display: grid; grid-template-columns: 1fr 440px; gap: 56px; align-items: center; }
.play h2 { font-size: clamp(30px, 4.4vw, 46px); margin-bottom: 16px; }
.play-copy p { font-size: 18px; opacity: 0.85; }
.play .eyebrow { color: var(--b-acc); }
.skin-picker { margin-top: 28px; }
.picker-label { font-weight: 700; font-size: 15px; margin-bottom: 10px !important; opacity: 1 !important; }
.picker-label span { margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--b-acc); color: var(--b-surf); font-size: 13px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 14px; border: 2px solid transparent; padding: 0; cursor: pointer; position: relative; overflow: hidden; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); }
.swatch i { position: absolute; right: 6px; bottom: 6px; width: 14px; height: 14px; border-radius: 50%; }
.swatch[aria-checked="true"] { border-color: var(--b-ink); transform: scale(1.08); }
.picker-note { font-size: 14px !important; margin-top: 12px; opacity: 0.7 !important; }
.play-board { background: var(--b-surf); border-radius: 28px; padding: 18px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45); transition: background 0.4s; }
.mini-head { display: flex; justify-content: space-between; font: 800 17px Fraunces, Georgia, serif; padding: 2px 4px 12px; }
.mini-head #play-clock { font: 600 15px -apple-system, BlinkMacSystemFont, sans-serif; opacity: 0.7; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(9, 1fr); aspect-ratio: 1; border: 3px solid var(--b-box); background: var(--b-surf); user-select: none; -webkit-user-select: none; }
.grid button { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; font: 700 clamp(16px, 5vw, 26px)/1 Fraunces, Georgia, serif; color: var(--b-ink); border-right: 1px solid var(--b-cell); border-bottom: 1px solid var(--b-cell); cursor: pointer; transition: background 0.15s; }
.grid button:nth-child(9n) { border-right: 0; }
.grid button:nth-child(9n+3), .grid button:nth-child(9n+6) { border-right: 2px solid var(--b-box); }
.grid button:nth-child(n+19):nth-child(-n+27), .grid button:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--b-box); }
.grid button:nth-child(n+73) { border-bottom: 0; }
.grid button.given { cursor: default; }
.grid button.peer { background: color-mix(in srgb, var(--b-acc) 10%, var(--b-surf)); }
.grid button.same { background: color-mix(in srgb, var(--b-acc) 22%, var(--b-surf)); }
.grid button.sel { background: var(--b-sel); color: var(--b-seltext); }
.grid button.entry { color: var(--b-entry); }
.grid button.sel.entry { color: var(--b-seltext); }
.grid button.wrong { color: #e5484d; background: color-mix(in srgb, #e5484d 16%, var(--b-surf)); }
.grid button.hinted { box-shadow: inset 0 0 0 3px var(--b-acc); }
.grid button.unit { background: color-mix(in srgb, var(--b-acc) 16%, var(--b-surf)); }
.grid button.pop { animation: pop 0.35s ease; }
.grid button:focus-visible { outline: 3px solid var(--b-acc); outline-offset: -3px; }
@keyframes pop { 40% { transform: scale(1.25); } }
.grid.solved button { animation: wave 0.6s ease both; }
@keyframes wave { 50% { transform: scale(0.85); background: var(--b-acc); color: var(--b-surf); } }
.hint-box { min-height: 3.2em; margin: 14px 4px 10px !important; font-size: 15px; line-height: 1.45; }
.hint-box b { color: var(--b-acc); }
.pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.pad button { all: unset; box-sizing: border-box; text-align: center; padding: 10px 0; border-radius: 12px; background: color-mix(in srgb, var(--b-ink) 7%, var(--b-surf)); font: 700 20px/1 Fraunces, Georgia, serif; color: var(--b-ink); cursor: pointer; }
.pad button:hover { background: color-mix(in srgb, var(--b-acc) 22%, var(--b-surf)); }
.pad button:focus-visible { outline: 3px solid var(--b-acc); }
.pad .pad-hint, .pad .pad-erase { grid-column: span 9; order: 2; font: 700 15px/1 -apple-system, BlinkMacSystemFont, sans-serif; padding: 12px 0; }
.pad .pad-hint { grid-column: span 5; background: var(--b-acc); color: var(--b-surf); }
.pad .pad-erase { grid-column: span 4; }
.pad .pad-hint:hover { background: var(--b-acc); opacity: 0.9; }

/* Mode diagrams */
.modes li { display: grid; grid-template-columns: 76px 1fr; gap: 4px 16px; align-items: center; transition: transform 0.2s, box-shadow 0.2s; }
.modes li:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(20, 17, 15, 0.35); }
.modes svg { grid-row: span 2; width: 76px; height: 76px; color: var(--ink); }
.modes h3 { align-self: end; }
.modes p { align-self: start; }

/* Screenshot tour */

/* Challenge chat */
.challenge-card { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 28px; background: var(--card); border: 1px solid var(--soft); max-width: 420px; justify-self: center; width: 100%; }
.bubble { max-width: 82%; padding: 11px 15px; border-radius: 20px; font-size: 16px; line-height: 1.35; }
.bubble.in { align-self: flex-start; background: var(--tint); border-bottom-left-radius: 6px; }
.bubble.out { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.bubble.small { font-size: 13px; color: var(--muted); }
.bubble .link { display: block; margin-top: 6px; font-size: 13px; color: var(--accent); text-decoration: underline; }

/* Dark band */
.dark-section { background: #15131f; color: #ece9f2; }
.dark-section .section-head p, .dark-section figcaption { color: #a29fae; }
.dark-section .eyebrow { color: #a99cff; }

/* Final call to action with a turning cube */
.cta-card { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: center; padding: 48px 56px; border-radius: 32px; color: #fff; background: linear-gradient(140deg, #6d55f0 0%, #3a29b0 100%); }
.cta-card h2 { color: #fff; font-size: clamp(34px, 5vw, 56px); margin-bottom: 12px; }
.cta-card p { color: rgba(255, 255, 255, 0.85); font-size: 19px; margin-bottom: 24px; }
.cube-stage { width: 220px; height: 220px; perspective: 900px; margin: 0 auto; }
.cube { position: relative; width: 140px; height: 140px; margin: 40px; transform-style: preserve-3d; animation: spin 18s linear infinite; }
.face { position: absolute; inset: 0; background: #fbf8f2; border: 4px solid #1f1a4d; display: grid; grid-template-columns: repeat(3, 1fr); font: 800 28px/1 Fraunces, Georgia, serif; color: #1f1a4d; }
.face::before { content: ""; position: absolute; inset: 0; background: linear-gradient(#1f1a4d33, #1f1a4d33) 33.3% 0 / 1px 100% no-repeat, linear-gradient(#1f1a4d33, #1f1a4d33) 66.6% 0 / 1px 100% no-repeat, linear-gradient(#1f1a4d33, #1f1a4d33) 0 33.3% / 100% 1px no-repeat, linear-gradient(#1f1a4d33, #1f1a4d33) 0 66.6% / 100% 1px no-repeat; }
.face span { display: flex; align-items: center; justify-content: center; }
.face span.hot { background: #ffb02e; }
.f1 { transform: rotateY(0deg) translateZ(70px); }
.f2 { transform: rotateY(90deg) translateZ(70px); background: #ebe3d3; }
.f3 { transform: rotateY(180deg) translateZ(70px); }
.f4 { transform: rotateY(-90deg) translateZ(70px); background: #ebe3d3; }
.f5 { transform: rotateX(90deg) translateZ(70px); }
.f6 { transform: rotateX(-90deg) translateZ(70px); background: #d9cdb5; }
@keyframes spin { from { transform: rotateX(-24deg) rotateY(0deg); } to { transform: rotateX(-24deg) rotateY(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .hero-digits span, .cube, .grid button.pop, .grid.solved button { animation: none; }
  .modes li:hover { transform: none; }
}
@media (max-width: 960px) {
  .play { grid-template-columns: 1fr; gap: 32px; }
  .play-board { max-width: 480px; width: 100%; justify-self: center; }
}
@media (max-width: 860px) {
  .hero-card .hero { padding: 36px 24px 0; }
  .hero-card .hero-copy { padding-bottom: 8px; }
  .hero-card .phone { margin-bottom: -80px; transform: rotate(3deg); width: min(280px, 70vw); }
  .stats { grid-template-columns: repeat(3, 1fr); margin-top: 104px; }
  .stats li:nth-child(n+4) { grid-column: span 1; }
  .cta-card { grid-template-columns: 1fr; text-align: center; padding: 36px 24px; gap: 8px; }
  .challenge-card { margin-top: 8px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:last-child { grid-column: span 2; }
  .stats b { font-size: 38px; }
  .play-board { padding: 12px; border-radius: 22px; }
  .pad { gap: 4px; }
  .pad button { padding: 9px 0; font-size: 18px; }
}

/* ---- Refinements ---- */
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.site-head.scrolled { border-bottom-color: var(--soft); }
.site-head .top { padding-top: 12px; padding-bottom: 12px; }
.top nav { align-items: center; }
.head-cta { padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--bg) !important; font-size: 14px !important; }
.head-cta:hover { background: var(--accent); color: var(--on-accent) !important; }
.hero-card { margin-top: 8px; }
.assure { margin: 18px 0 0; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.75); letter-spacing: 0.01em; }
.section-head h2, .split h2 { letter-spacing: -0.02em; }
.eyebrow { letter-spacing: 0.12em; font-size: 12px; }
section { padding: 88px 0; }
.modes li { border-radius: 18px; }
.plan { box-shadow: 0 1px 0 rgba(20, 17, 15, 0.04); }
.plan.best { box-shadow: 0 24px 48px -28px rgba(91, 71, 224, 0.55); transform: translateY(-6px); }

/* Feature groups */
.feature-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.fgroup { background: var(--card); border: 1px solid var(--soft); border-radius: 22px; padding: 26px 28px; }
.fgroup h3 { display: flex; align-items: center; gap: 12px; font-size: 23px; margin-bottom: 14px; }
.ico { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); flex: none; }
.fgroup ul { list-style: none; margin: 0; padding: 0; }
.fgroup li { position: relative; padding: 9px 0 9px 20px; border-top: 1px solid var(--soft); font-size: 15.5px; color: var(--muted); line-height: 1.5; }
.fgroup li:first-child { border-top: 0; }
.fgroup li::before { content: ""; position: absolute; left: 2px; top: 1.05em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); opacity: 0.7; }
.fgroup li b { color: var(--ink); font-weight: 650; }

/* Print, braille, share */
.print-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.print-card { position: relative; background: var(--card); border: 1px solid var(--soft); border-radius: 24px; padding: 22px 22px 26px; display: flex; flex-direction: column; }
.print-card h3 { font-size: 22px; margin: 22px 0 8px; }
.print-card p { color: var(--muted); font-size: 15.5px; margin: 0 0 16px; }
.pill { align-self: flex-start; margin-top: auto; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: var(--accent); color: var(--on-accent); }
.pill.free { background: color-mix(in srgb, var(--good) 16%, var(--card)); color: var(--good); }
.paper, .braille, .share-mock { height: 250px; border-radius: 16px; overflow: hidden; }
.paper { background: #fff; color: #111; padding: 16px 18px; box-shadow: 0 18px 30px -22px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.06); transform: rotate(-1.5deg); display: flex; flex-direction: column; }
.paper-head { display: flex; justify-content: space-between; font-size: 10px; border-bottom: 1px solid #111; padding-bottom: 6px; }
.paper-head b { font-family: Fraunces, Georgia, serif; }
.paper-grids { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 6px; align-content: center; }
.pg { display: grid; grid-template-columns: repeat(9, 1fr); aspect-ratio: 1; border: 1.5px solid #111; font: 700 7px/1 Fraunces, Georgia, serif; }
.pg i { display: flex; align-items: center; justify-content: center; font-style: normal; border-right: 0.5px solid #bbb; border-bottom: 0.5px solid #bbb; }
.pg i:nth-child(9n+3), .pg i:nth-child(9n+6) { border-right: 1px solid #111; }
.pg i:nth-child(n+19):nth-child(-n+27), .pg i:nth-child(n+46):nth-child(-n+54) { border-bottom: 1px solid #111; }
.paper-foot { font-size: 9px; color: #666; text-align: right; }
.braille { position: relative; background: #f4f1ea; color: #2a2620; padding: 18px; font-size: 19px; line-height: 1.5; letter-spacing: 0.06em; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.braille-head { font-size: 17px; opacity: 0.8; margin-bottom: 4px; }
.braille-rows div { white-space: nowrap; }
.braille-dots { position: absolute; right: 16px; bottom: 16px; display: grid; grid-template-columns: repeat(2, 14px); gap: 7px 9px; padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.4); }
.braille-dots span { width: 14px; height: 14px; border-radius: 50%; background: #2a2620; box-shadow: inset -2px -2px 3px rgba(255, 255, 255, 0.35), 0 2px 2px rgba(0, 0, 0, 0.25); }
.braille-dots span:nth-child(2), .braille-dots span:nth-child(6) { background: #e2ddd2; box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.15); }
.share-mock { display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, #070a14, #1c1240); }
.share-card { width: 72%; padding: 20px; border-radius: 18px; background: #0f1424; border: 1px solid #22d3ee55; color: #e6f1ff; text-align: center; box-shadow: 0 0 40px -10px #f472b6aa; }
.share-title { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: #22d3ee; font-weight: 700; }
.share-time { font: 900 54px/1.1 Fraunces, Georgia, serif; color: #f472b6; margin: 8px 0 4px; }
.share-meta { font-size: 13px; opacity: 0.8; }
.share-brand { margin-top: 14px; font-size: 10px; letter-spacing: 0.24em; opacity: 0.6; }

/* Footer */
.site-foot { border-top: 1px solid var(--soft); padding: 48px 0 28px; font-size: 15px; color: var(--muted); }
.site-foot .foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-foot nav { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.site-foot h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot .brand { color: var(--ink); margin-bottom: 12px; }
.foot-brand p { max-width: 30em; margin: 0; }
.foot-base { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--soft); font-size: 13px; }

/* Gentle reveal on scroll (app.js adds .in) */
.js .reveal .section-head, .js .reveal .split > *, .js .reveal .modes li, .js .reveal .fgroup, .js .reveal .print-card, .js .reveal .plan { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in .section-head, .js .reveal.in .split > *, .js .reveal.in .modes li, .js .reveal.in .fgroup, .js .reveal.in .print-card, .js .reveal.in .plan { opacity: 1; transform: none; }
.js .reveal.in .plan.best { transform: translateY(-6px); }
.js .reveal.in .modes li:nth-child(3n+2), .js .reveal.in .fgroup:nth-child(2), .js .reveal.in .print-card:nth-child(2), .js .reveal.in .plan:nth-child(2) { transition-delay: 0.08s; }
.js .reveal.in .modes li:nth-child(3n), .js .reveal.in .print-card:nth-child(3), .js .reveal.in .plan:nth-child(3) { transition-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal * { opacity: 1 !important; transform: none !important; transition: none !important; }
}

@media (max-width: 960px) {
  .print-grid { grid-template-columns: 1fr; max-width: 520px; }
}
@media (max-width: 860px) {
  .feature-groups { grid-template-columns: 1fr; }
  .site-foot .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: span 2; }
  .plan.best, .js .reveal.in .plan.best { transform: none; }
  section { padding: 64px 0; }
}
@media (max-width: 640px) {
  .head-cta { padding: 7px 14px; }
}
.paper-grids { grid-template-columns: repeat(2, minmax(0, 92px)); justify-content: center; gap: 12px 18px; padding: 10px 0; }
.braille { font-size: 23px; line-height: 1.45; }
.braille-head { font-size: 19px; }
.screens > figure { min-width: 0; }
.screens .shot { width: 100%; height: auto; }
.site-foot .foot-grid { align-items: start; }

/* Rules pages */
.crumbs { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.rule-card { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: center; margin: 28px 0 8px; padding: 26px; border-radius: 24px; background: var(--card); border: 1px solid var(--soft); }
.rule-fig svg { width: 100%; height: auto; color: var(--ink); }
.rule-tag { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.rule-card h2 { margin: 4px 0 10px; }
.rule-list { margin: 0; padding-left: 20px; }
.rule-list li { margin: 6px 0; font-size: 17px; }
.tips { list-style: none; padding: 0; margin: 0; counter-reset: tip; }
.tips li { position: relative; padding: 12px 0 12px 44px; border-top: 1px solid var(--soft); counter-increment: tip; }
.tips li:first-child { border-top: 0; }
.tips li::before { content: counter(tip); position: absolute; left: 0; top: 10px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--card)); color: var(--accent); font-weight: 800; font-size: 14px; }
.rule-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.rule-pager a { display: block; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--soft); background: var(--card); color: var(--ink); text-decoration: none; font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 20px; }
.rule-pager a:last-child { text-align: right; }
.rule-pager a:hover { border-color: var(--accent); }
.rule-pager span { display: block; font: 600 12px/1.6 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rules-index { max-width: 1040px; }
.rule-grid { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.rule-grid a { display: grid; grid-template-columns: 64px 1fr; gap: 2px 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--soft); color: var(--ink); text-decoration: none; transition: transform 0.2s, border-color 0.2s; }
.rule-grid a:hover { transform: translateY(-2px); border-color: var(--accent); }
.rule-grid svg { grid-row: span 2; width: 64px; height: 64px; color: var(--ink); }
.rule-grid h2 { margin: 0; font-size: 21px; align-self: end; }
.rule-grid p { margin: 0; font-size: 14px; color: var(--muted); align-self: start; }
.modes li { position: relative; }
.modes h3 a { color: inherit; text-decoration: none; }
.modes h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.modes h3 a:focus-visible { outline: none; }
.modes li:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.more-link { margin-top: 20px; font-weight: 700; }
@media (max-width: 560px) {
  .rule-card { grid-template-columns: 1fr; padding: 20px; }
  .rule-fig { width: 140px; }
  .rule-pager a { font-size: 17px; }
  .rules-page .btn { display: block; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .rule-grid a:hover { transform: none; } }

/* ---- Shared device frame ---- */
.device { position: relative; padding: 9px; border-radius: 46px; background: #121216; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 40px 80px -40px rgba(20, 17, 15, 0.55), 0 18px 36px -24px rgba(20, 17, 15, 0.4); }
.device-screen { position: relative; overflow: hidden; border-radius: 37px; aspect-ratio: 600 / 1298; background: #f3eee5; }
.device-screen img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---- Story: pinned phone, steps scroll past ---- */
.story { padding-bottom: 40px; }
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.story-stage { position: sticky; top: calc(50vh - min(330px, 38vh)); display: flex; justify-content: center; }
.story-stage .device { width: min(320px, 34vh); }
.story-stage img { position: absolute; inset: 0; opacity: 0; transform: scale(1.02); transition: opacity 0.55s ease, transform 0.8s ease; }
.story-stage img.on { opacity: 1; transform: none; }
.story-steps { list-style: none; margin: 0; padding: 0; }
.story-steps li { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; opacity: 0.28; transition: opacity 0.45s ease; }
.story-steps li.active, .no-story .story-steps li { opacity: 1; }
.story-steps li:first-child { min-height: 52vh; justify-content: flex-start; padding-top: 40px; }
.step-no { font: 800 13px/1 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: 0.14em; color: var(--accent); }
.story-steps h3 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.02em; margin: 14px 0 14px; }
.story-steps p { font-size: 19px; color: var(--muted); max-width: 30em; margin: 0; }
.step-shot { display: none; }
.skin-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.skin-chips span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--soft); font-size: 14px; font-weight: 600; }
.skin-chips span::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--d) 0 34%, var(--c) 36%); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); }

/* ---- Bento ---- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.bt { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 26px; border-radius: 26px; background: var(--card); border: 1px solid var(--soft); }
.bt h3 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 8px; }
.bt p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.viz { display: flex; align-items: center; justify-content: center; min-height: 150px; margin: -4px 0 20px; }
.t-learn { grid-column: span 4; flex-direction: row; gap: 32px; align-items: center; }
.t-learn .viz { flex: none; width: 210px; margin: 0; }
.t-learn h3 { font-size: 30px; }
.t-notes, .t-ways, .t-streak, .t-widget { grid-column: span 2; }
.t-times, .t-sync { grid-column: span 3; }
.t-pro { grid-column: span 6; display: grid; grid-template-columns: auto auto 1fr; gap: 20px 28px; align-items: center; background: linear-gradient(120deg, #5b47e0, #3b2bb0); color: #fff; border: 0; }
.t-pro h3 { margin: 0; font-size: 24px; color: #fff; }
.t-pro .pill { margin: 0; background: #fff; color: #3b2bb0; }
.pro-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pro-list li { padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 14px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.chips span { padding: 5px 11px; border-radius: 999px; background: var(--tint); font-size: 13px; font-weight: 600; color: var(--ink); }
#xwing { width: 100%; height: auto; color: var(--ink); }
#xwing .g { fill: none; stroke: var(--thin); stroke-width: 0.6; }
#xwing .b { fill: none; stroke: currentColor; stroke-width: 1.6; }
#xwing .hl { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
#xwing .c { fill: var(--accent); }
#xwing .x { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 3; fill: none; }
#xwing .z { stroke: #e5484d; stroke-width: 2; stroke-linecap: round; }
.viz-notes { gap: 10px; }
.ncell { width: 76px; height: 76px; border-radius: 12px; background: var(--bg); border: 1.5px solid var(--line); display: grid; place-items: center; font-family: Fraunces, Georgia, serif; }
.ncell.corner { grid-template-columns: repeat(3, 1fr); padding: 6px; font: 600 14px/1 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--muted); }
.ncell.corner i { font-style: normal; display: grid; place-items: center; }
.ncell.centre b { font: 600 15px/1 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--muted); letter-spacing: 0.04em; }
.ncell.big { font-size: 44px; font-weight: 800; color: var(--accent); }
.viz-seg { flex-direction: column; gap: 18px; }
.seg { display: flex; padding: 4px; border-radius: 12px; background: var(--tint); font-size: 13px; font-weight: 600; }
.seg span { padding: 8px 12px; border-radius: 9px; color: var(--muted); }
.seg .on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.hearts { display: flex; gap: 10px; }
.hearts i { width: 22px; height: 20px; background: #e5484d; clip-path: path("M11 20L1.8 10.8A5.6 5.6 0 0 1 11 3.2a5.6 5.6 0 0 1 9.2 7.6z"); }
.hearts i.lost { background: var(--soft); }
.viz-week { flex-direction: column; gap: 16px; }
.streak-n { display: flex; align-items: center; gap: 6px; font: 800 48px/1 Fraunces, Georgia, serif; color: var(--ink); }
.streak-n svg { width: 36px; height: 36px; color: #f97b4a; }
.week { display: flex; gap: 6px; }
.week i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 11px/1 -apple-system, BlinkMacSystemFont, sans-serif; font-style: normal; background: var(--accent); color: var(--on-accent); }
.week i.saved { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.week i.today { background: #f97b4a; color: #fff; }
.widget { width: 150px; height: 150px; border-radius: 30px; padding: 18px; background: linear-gradient(160deg, #6d5bf0, #3b2bb0); color: #fff; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 34px -20px rgba(59, 43, 176, 0.8); }
.w-day { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; margin-bottom: auto; }
.w-row { display: flex; align-items: center; gap: 8px; font: 700 17px/1 Fraunces, Georgia, serif; }
.w-row b { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7); }
.w-row b.done { background: #fff; box-shadow: none; }
.viz-chart { position: relative; align-items: stretch; height: 150px; border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.viz-chart svg { width: 100%; height: 100%; }
.viz-chart .area { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.viz-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.viz-chart circle { fill: var(--accent); }
.pb { position: absolute; top: 14px; left: 16px; font-size: 13px; color: var(--muted); }
.pb b { display: block; font: 800 30px/1.1 Fraunces, Georgia, serif; color: var(--ink); }
.viz-sync { position: relative; gap: 14px; align-items: flex-end; }
.dev { display: block; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--bg); }
.dev.phone { width: 46px; height: 92px; }
.dev.tablet { width: 104px; height: 134px; border-radius: 14px; }
.dev.open { width: 84px; height: 100px; background: linear-gradient(90deg, var(--bg) 49%, var(--soft) 49% 51%, var(--bg) 51%); }
.tick { position: absolute; top: 4px; left: 50%; margin-left: 30px; width: 34px; height: 34px; border-radius: 50%; background: var(--good); display: grid; place-items: center; box-shadow: 0 0 0 4px var(--card); }
.tick svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.js .reveal .bt { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in .bt { opacity: 1; transform: none; }
.js .reveal.in .bt:nth-child(3n+2) { transition-delay: 0.08s; }
.js .reveal.in .bt:nth-child(3n) { transition-delay: 0.16s; }

/* ---- Devices ---- */
.devices-section { padding-bottom: 0; overflow: hidden; background: radial-gradient(120% 70% at 50% 100%, #2b2160 0%, #15131f 60%); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.device-row { position: relative; display: flex; justify-content: center; align-items: flex-end; margin-top: 12px; height: clamp(360px, 52vw, 560px); }
.tablet-frame { width: min(560px, 74vw); border-radius: 34px 34px 0 0; padding: 12px 12px 0; align-self: flex-end; height: 100%; }
.tablet-frame .device-screen { aspect-ratio: auto; height: 100%; border-radius: 24px 24px 0 0; }
.phone-front { position: absolute; bottom: -60px; left: 50%; margin-left: min(200px, 26vw); width: min(220px, 28vw); }
.device-facts { list-style: none; margin: 0; padding: 32px 0 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); position: relative; background: #15131f; }
.device-facts li { text-align: center; }
.device-facts b { display: block; font: 800 22px/1.2 Fraunces, Georgia, serif; color: #fff; }
.device-facts span { font-size: 15px; color: #a29fae; }

/* ---- VoiceOver demo ---- */
.vo-demo { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 32px 24px; border-radius: 28px; background: var(--card); border: 1px solid var(--soft); }
.vo-board { display: grid; grid-template-columns: repeat(5, 1fr); width: min(320px, 100%); aspect-ratio: 1; border: 2.5px solid var(--line); background: var(--bg); }
.vo-board i { position: relative; display: grid; place-items: center; font: 800 clamp(22px, 3vw, 30px)/1 Fraunces, Georgia, serif; font-style: normal; border-right: 1px solid var(--thin); border-bottom: 1px solid var(--thin); color: var(--accent); }
.vo-board i.g { color: var(--ink); }
.vo-board i small { position: absolute; inset: 4px; display: grid; grid-template-columns: repeat(3, 1fr); font: 600 10px/1 -apple-system, BlinkMacSystemFont, sans-serif; color: var(--muted); }
.vo-board i.focus { z-index: 1; outline: 3px solid #111; outline-offset: -1px; box-shadow: 0 0 0 6px rgba(17, 17, 17, 0.12); border-radius: 4px; }
.vo-caption { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 12px 18px; border-radius: 14px; background: #1c1c1e; color: #fff; font-size: 15px; font-weight: 500; min-height: 48px; box-shadow: 0 14px 28px -18px rgba(0, 0, 0, 0.6); }
.vo-caption svg { flex: none; width: 20px; height: 20px; fill: #fff; opacity: 0.8; }
.vo-setups { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.vo-setups span { padding: 6px 12px; border-radius: 999px; background: var(--tint); font-size: 13px; font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vo-board i.focus { outline-color: #fff; } }

@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .t-learn, .t-pro, .t-times, .t-sync { grid-column: span 2; }
  .t-notes, .t-ways, .t-streak, .t-widget { grid-column: span 1; }
  .t-pro { grid-template-columns: auto 1fr; }
  .pro-list { grid-column: span 2; justify-content: flex-start; }
}
@media (max-width: 860px) {
  .story-grid { grid-template-columns: 1fr; gap: 0; }
  .story-stage { display: none; }
  .story-steps li, .story-steps li:first-child { min-height: 0; opacity: 1; padding: 28px 0; }
  .step-shot { display: block; width: min(280px, 76%); height: auto; margin: 26px auto 0; border-radius: 34px; border: 8px solid #121216; box-shadow: 0 30px 60px -34px rgba(20, 17, 15, 0.55); }
  .device-facts { grid-template-columns: 1fr; gap: 14px; }
  .phone-front { bottom: -30px; }
}
@media (max-width: 620px) {
  .bento { grid-template-columns: 1fr; }
  .bt, .t-learn, .t-pro, .t-times, .t-sync, .t-notes, .t-ways, .t-streak, .t-widget { grid-column: auto; }
  .t-learn { flex-direction: column; align-items: stretch; gap: 8px; }
  .t-learn .viz { width: 180px; margin: 0 auto 12px; }
  .t-learn h3 { font-size: 24px; }
  .t-pro { grid-template-columns: 1fr; }
  .pro-list { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .story-stage img, .story-steps li { transition: none; }
}
.devices-section { background: #15131f; }
.device-row::before { content: ""; position: absolute; left: 50%; bottom: 0; width: 900px; height: 520px; margin-left: -450px; background: radial-gradient(closest-side, rgba(110, 90, 255, 0.45), transparent); pointer-events: none; }
.device-row::after { content: ""; position: absolute; left: -16px; right: -16px; bottom: 0; height: 120px; background: linear-gradient(transparent, #15131f); z-index: 3; pointer-events: none; }
.tablet-frame, .phone-front { z-index: 1; }
.phone-front { bottom: 24px; z-index: 2; }
.device-facts { background: none; border-top: 0; padding-top: 8px; z-index: 4; }
@media (max-width: 860px) {
  .phone-front { left: auto; right: 0; margin-left: 0; width: min(150px, 34vw); bottom: 16px; }
  .tablet-frame { width: min(560px, 78vw); margin-right: 12vw; }
  #access .split > .vo-demo { order: 2; }
}

/* Store buttons and the app icon */
.head-cta { display: inline-flex; align-items: center; gap: 6px; }
.head-cta .apple { width: 15px; height: 15px; margin-top: -2px; }
.btn .apple { margin-top: -3px; }
.cta-icon { display: block; width: 200px; height: 200px; margin: 0 auto; border-radius: 22.5%; box-shadow: 0 30px 50px -24px rgba(10, 6, 40, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.18); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(-1deg); } }
@media (max-width: 860px) { .cta-icon { width: 140px; height: 140px; margin-bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { .cta-icon { animation: none; transform: rotate(-4deg); } }

/* ---- Mode explorer: pick a mode, see a real board ---- */
.mode-explorer.live { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: start; }
.mode-explorer.live .modes { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mode-explorer.live .modes li { cursor: pointer; grid-template-columns: 52px 1fr; padding: 12px 14px; gap: 2px 12px; }
.mode-explorer.live .modes svg { width: 52px; height: 52px; }
.mode-explorer.live .modes h3 { font-size: 17px; }
.mode-explorer.live .modes p { font-size: 13px; line-height: 1.35; }
.mode-explorer.live .modes li:hover { transform: none; box-shadow: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--soft)); }
.modes li.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--card)); box-shadow: 0 0 0 1px var(--accent) inset; }
.mode-preview { position: sticky; top: 88px; margin: 0; padding: 22px; border-radius: 28px; background: var(--card); border: 1px solid var(--soft); box-shadow: 0 30px 60px -40px rgba(20, 17, 15, 0.45); }
#mode-board { display: block; width: 100%; height: auto; }
.mode-preview figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 14px; }
.mp-tag { width: 100%; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
#mp-name { font: 800 24px/1.2 Fraunces, Georgia, serif; }
#mp-rule { color: var(--muted); font-size: 15px; flex: 1 1 200px; }
#mp-link { width: 100%; font-weight: 700; font-size: 15px; }
.mb-bg { fill: var(--card); }
.mb-thin { stroke: var(--thin); stroke-width: 1; fill: none; }
.mb-thick { stroke: var(--line); stroke-width: 2.6; fill: none; stroke-linecap: square; }
.mb-digit { font: 700 24px Fraunces, Georgia, serif; fill: var(--ink); }
.mb-shade { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.mb-diag { stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-width: 2.5; }
.mb-even { fill: color-mix(in srgb, var(--ink) 13%, transparent); }
.mb-odd { fill: none; stroke: color-mix(in srgb, var(--ink) 40%, transparent); stroke-width: 1.6; }
.mb-thermo, .mb-thermo-line { fill: color-mix(in srgb, var(--ink) 16%, var(--card)); stroke: color-mix(in srgb, var(--ink) 16%, var(--card)); }
.mb-thermo-line { fill: none; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }
.mb-arrow { fill: none; stroke: color-mix(in srgb, var(--ink) 45%, transparent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mb-arrow-circle { fill: var(--card); stroke: color-mix(in srgb, var(--ink) 55%, transparent); stroke-width: 2; }
.mb-cage { fill: none; stroke: color-mix(in srgb, var(--ink) 60%, transparent); stroke-width: 1.2; stroke-dasharray: 3 2.5; }
.mb-sum { font: 700 9.5px -apple-system, BlinkMacSystemFont, sans-serif; fill: var(--ink); }
.mb-clue { font: 800 17px -apple-system, BlinkMacSystemFont, sans-serif; fill: var(--accent); }
.mb-dot { stroke: var(--ink); stroke-width: 1.6; }
.mb-dot.white { fill: var(--card); }
.mb-dot.black { fill: var(--ink); }
.mb-sign { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mb-knight { fill: none; stroke: #e5484d; stroke-width: 1.8; stroke-dasharray: 3 3; }
.mb-knight-at { fill: color-mix(in srgb, var(--accent) 18%, transparent); stroke: var(--accent); stroke-width: 2; }
.mb-thermo, .mb-thermo-line, .mb-arrow, .mb-cage, .mb-shade, .mb-even { transition: opacity 0.3s; }
#mode-board { animation: board-in 0.35s ease; }
@keyframes board-in { from { opacity: 0.4; } to { opacity: 1; } }
@media (max-width: 960px) {
  .mode-explorer.live { grid-template-columns: 1fr; }
  .mode-explorer.live .modes { display: flex; overflow-x: auto; gap: 8px; padding: 2px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: none; order: 2; }
  .mode-explorer.live .modes li { flex: none; width: 168px; grid-template-columns: 40px 1fr; scroll-snap-align: start; }
  .mode-explorer.live .modes svg { width: 40px; height: 40px; }
  .mode-explorer.live .modes p { display: none; }
  .mode-explorer.live .modes h3 { align-self: center; grid-row: span 2; }
  .mode-preview { position: static; padding: 14px; }
}
.site-head .brand, .head-cta { white-space: nowrap; }
@media (max-width: 420px) {
  .site-head .brand { font-size: 17px; gap: 8px; }
  .site-head .brand img { width: 30px; height: 30px; }
  .head-cta { padding: 7px 12px; font-size: 13px !important; }
}
@media (max-width: 960px) { .mode-explorer.live .modes li { width: 142px; } }

/* ---- Pro tile ---- */
.t-pro { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 32px; align-items: center; padding: 36px; background: radial-gradient(120% 140% at 0% 0%, #7a66ff 0%, #4a37d6 45%, #2a1d8f 100%); }
.pro-copy h3 { font-size: clamp(28px, 3vw, 38px); margin: 14px 0 10px; color: #fff; }
.pro-copy p { color: rgba(255, 255, 255, 0.82); font-size: 16px; }
.pro-link { display: inline-block; margin-top: 16px; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; border-bottom: 1.5px solid rgba(255, 255, 255, 0.45); }
.pro-link:hover { border-color: #fff; }
.pro-demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pd { padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pd b { display: block; margin-top: 12px; font: 800 17px/1.2 Fraunces, Georgia, serif; color: #fff; }
.pd > span { font-size: 13.5px; color: rgba(255, 255, 255, 0.75); }
.pd-viz { height: 96px; border-radius: 12px; background: #fbf8f2; color: #14110f; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.pd-mistake { gap: 0; align-items: flex-start; padding-top: 12px; }
.pd-mistake .mc { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #cfc8bb; margin-left: -1px; font: 800 18px/1 Fraunces, Georgia, serif; color: #5b47e0; }
.pd-mistake .mc.given { color: #14110f; background: #fde2e1; }
.pd-mistake .mc.bad { color: #e5484d; background: #fde2e1; box-shadow: inset 0 0 0 2px #e5484d; }
.pd-mistake em { position: absolute; left: 10px; right: 10px; bottom: 8px; padding: 6px 8px; border-radius: 8px; background: #14110f; color: #fff; font: 600 12px/1.25 -apple-system, BlinkMacSystemFont, sans-serif; font-style: normal; text-align: center; }
.pd-notes, .pd-marks { display: grid; grid-template-columns: repeat(3, 34px); grid-auto-rows: 34px; align-content: center; justify-content: center; gap: 0; }
.pd-notes i, .pd-marks i { display: grid; place-items: center; border: 1px solid #cfc8bb; margin: 0 -1px -1px 0; font-style: normal; }
.pd-notes i { font: 600 9px/1.2 -apple-system, BlinkMacSystemFont, sans-serif; color: #6b655b; text-align: center; animation: notes-in 3.2s ease-in-out infinite; }
.pd-notes i:nth-child(2) { animation-delay: 0.1s; } .pd-notes i:nth-child(3) { animation-delay: 0.2s; } .pd-notes i:nth-child(4) { animation-delay: 0.3s; } .pd-notes i:nth-child(5) { animation-delay: 0.4s; } .pd-notes i:nth-child(6) { animation-delay: 0.5s; }
@keyframes notes-in { 0%, 12% { opacity: 0; } 24%, 88% { opacity: 1; } 100% { opacity: 0; } }
.pd-marks i { font-size: 11px; }
.pd-marks .m1 { background: #ffd9b8; color: #c2581b; }
.pd-marks .m2 { background: #cfe8ff; color: #1f6fb8; }
.pd-marks .m3 { background: #d8f1d9; color: #2f7d4f; }
.pd-csv { justify-content: flex-start; padding: 10px 14px; background: #14110f; }
.pd-csv code { font: 500 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: #b9f6ca; }
@media (max-width: 960px) { .t-pro { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .t-pro { padding: 24px 18px; } .pro-demos { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .pd-notes i { animation: none; } }
.pd-notes, .pd-marks { grid-template-columns: repeat(3, 42px); grid-auto-rows: 42px; }
.pd-notes i { font-size: 10.5px; }
.pd-marks i { font-size: 15px; }
.pd-notes i { animation-name: notes-ink; }
@keyframes notes-ink { 0%, 12% { color: transparent; } 24%, 88% { color: #6b655b; } 100% { color: transparent; } }
.pd-marks i { background-clip: padding-box; }
.pd-notes, .pd-marks { align-items: stretch; justify-items: stretch; }
