/* ==========================================================================
   Cool Sudoku landing page
   Tokens mirror AppAssets/Assets.xcassets (light / dark) and AppMetrics.swift.
   Direction: the sentence is the layout. Each section is a short statement with
   its proof beside it; the proof is always a working piece of the app.
   ========================================================================== */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("assets/fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("assets/fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("assets/fonts/Inter-Bold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 900; font-display: swap; src: url("assets/fonts/Inter-Black.woff2") format("woff2"); }

:root {
  color-scheme: light dark;

  /* App palette */
  --bg: light-dark(#F4F6FA, #1A1E32);            /* AppBackground */
  --bg-alt: light-dark(#EAEDF5, #151929);
  --field-2: light-dark(#DCE1F0, #10131F);       /* the second field of a split */
  --card: light-dark(#FFFFFF, #25305A);          /* CardBackground */
  --board: light-dark(#FFFFFF, #222E5D);         /* BoardBackground */
  --text: light-dark(#0F172A, #FFFFFF);          /* TextPrimary */
  --text-2: light-dark(#5A5F78, rgb(255 255 255 / 0.74)); /* TextSecondary */
  --on-accent: #FFFFFF;                          /* TextOnAccent */
  --accent: light-dark(#4F46E5, #3A20D8);        /* PrimaryAccent · taste-skill-ignore: the app's accent */
  --accent-2: light-dark(#4F46E5, #5740FD);      /* SecondaryAccent · taste-skill-ignore: the app's accent */
  --accent-text: light-dark(#4F46E5, #9AA5FF);   /* DigitUser: accent that reads as text · taste-skill-ignore: the app's accent */
  --border: light-dark(#C7CBDD, rgb(255 255 255 / 0.08)); /* IconStroke */
  --grid-thin: light-dark(#D8DBE8, #1A1E32);     /* GridLineThin */
  --grid-thick: light-dark(#A9AEC7, #1A1E32);    /* GridLineThick */
  --unit: light-dark(rgb(0 0 0 / 0.08), rgb(255 255 255 / 0.12));
  --hint-bg: light-dark(#E4E7FB, #2D8C6A);       /* HighlightBackground / BoardHint */
  --target: light-dark(#C7D2FE, #2D8C6A);        /* BoardHint */
  --err-bg: light-dark(#FFE4E6, #8B0000);        /* CellErrorBackground / BoardError */
  --err: light-dark(#E5484D, #FFFFFF);           /* DigitError (white on dark red) */
  --given: light-dark(#1C1F33, #FFFFFF);         /* DigitGiven */
  --user: light-dark(#4F46E5, #9AA5FF);          /* DigitUser · taste-skill-ignore: the app's accent */

  /* Brand (logo + app icon). The logo's blue gradient is flattened to its lower stop on the page. */
  --brand-ink: #1A1E32;
  --brand-navy: #232F5C;
  --brand-blue: #1638FF;
  --brand-green: #2D8C6A;

  /* Metrics (AppRadius) */
  --r-surface: 16px;
  --r-control: 12px;
  --r-large: 28px;

  /* Type: five steps */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-display: clamp(2.5rem, 0.5rem + 7.6vw, 7.5rem);
  --fs-heading: clamp(2.25rem, 1.4rem + 3vw, 4.25rem);
  --fs-statement: clamp(1.5rem, 1.15rem + 1.1vw, 2.25rem);
  --fs-body: 1.125rem;
  --fs-small: 0.875rem;

  /* Frame: one pair of margins everywhere */
  --max: 1320px;
  --margin: 20px;
  --edge: max(var(--margin), calc((100vw - var(--max)) / 2));
  --gap-section: 104px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}
@media (min-width: 760px) { :root { --margin: 32px; --gap-section: 168px; } }

:root[data-theme="light"],
[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"],
[data-theme="dark"] { color-scheme: dark; }

/* Safari < 17.5 (iOS 17.0–17.4) has no light-dark(): every token above would be invalid there.
   Resolve the same pairs with plain selectors instead. */
@supports not (color: light-dark(#000, #fff)) {
  :root,
  [data-theme="light"] {
    --bg: #F4F6FA;
    --bg-alt: #EAEDF5;
    --field-2: #DCE1F0;
    --card: #FFFFFF;
    --board: #FFFFFF;
    --text: #0F172A;
    --text-2: #5A5F78;
    --accent: #4F46E5; /* taste-skill-ignore: the app's own accent (Assets.xcassets) */
    --accent-2: #4F46E5; /* taste-skill-ignore: the app's own accent (Assets.xcassets) */
    --accent-text: #4F46E5; /* taste-skill-ignore: the app's own accent (Assets.xcassets) */
    --border: #C7CBDD;
    --grid-thin: #D8DBE8;
    --grid-thick: #A9AEC7;
    --unit: rgb(0 0 0 / 0.08);
    --hint-bg: #E4E7FB;
    --target: #C7D2FE;
    --err-bg: #FFE4E6;
    --err: #E5484D;
    --given: #1C1F33;
    --user: #4F46E5; /* taste-skill-ignore: the app's own accent (Assets.xcassets) */
  }
  [data-theme="dark"] {
    --bg: #1A1E32;
    --bg-alt: #151929;
    --field-2: #10131F;
    --card: #25305A;
    --board: #222E5D;
    --text: #FFFFFF;
    --text-2: rgb(255 255 255 / 0.74);
    --accent: #3A20D8; /* taste-skill-ignore: the app's own accent (Assets.xcassets) */
    --accent-2: #5740FD; /* taste-skill-ignore: the app's own accent (Assets.xcassets) */
    --accent-text: #9AA5FF;
    --border: rgb(255 255 255 / 0.08);
    --grid-thin: #1A1E32;
    --grid-thick: #1A1E32;
    --unit: rgb(255 255 255 / 0.12);
    --hint-bg: #2D8C6A;
    --target: #2D8C6A;
    --err-bg: #8B0000;
    --err: #FFFFFF;
    --given: #FFFFFF;
    --user: #9AA5FF;
  }
}
@supports not (color: light-dark(#000, #fff)) {
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #1A1E32;
      --bg-alt: #151929;
      --field-2: #10131F;
      --card: #25305A;
      --board: #222E5D;
      --text: #FFFFFF;
      --text-2: rgb(255 255 255 / 0.74);
      --accent: #3A20D8; /* taste-skill-ignore: the app's own accent (Assets.xcassets) */
      --accent-2: #5740FD; /* taste-skill-ignore: the app's own accent (Assets.xcassets) */
      --accent-text: #9AA5FF;
      --border: rgb(255 255 255 / 0.08);
      --grid-thin: #1A1E32;
      --grid-thick: #1A1E32;
      --unit: rgb(255 255 255 / 0.12);
      --hint-bg: #2D8C6A;
      --target: #2D8C6A;
      --err-bg: #8B0000;
      --err: #FFFFFF;
      --given: #FFFFFF;
      --user: #9AA5FF;
    }
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: var(--accent-text); text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 3px solid #7C8CFF;
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-control);
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

.frame { width: min(100% - 2 * var(--margin), var(--max)); margin-inline: auto; }
.nowrap { white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
[hidden] { display: none !important; }

/* Type steps */
.display { font-size: var(--fs-display); font-weight: 700; line-height: 0.96; letter-spacing: -0.045em; }
.display > .nowrap { display: block; }
.heading { font-size: var(--fs-heading); font-weight: 700; line-height: 1.02; letter-spacing: -0.04em; }
.statement { font-size: var(--fs-statement); font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
.body-lg { font-size: var(--fs-body); line-height: 1.55; }
@media (min-width: 980px) { .body-lg, .facts-list, .plus-free { max-width: 34em; } }
.small { font-size: var(--fs-small); line-height: 1.5; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--r-control);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.15s;
}
.button:hover { background: var(--accent-2); }
.button:active { transform: scale(0.97); }
.button-small { min-height: 44px; padding: 0 18px; font-size: 1rem; }
.button-tiny { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }
.button-block { width: 100%; }
.button:disabled { opacity: 0.4; cursor: default; transform: none; }

.link-button {
  border: 0;
  background: none;
  padding: 8px;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.link-button:hover { color: var(--text); }

.icon-button {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: #FFFFFF;
  cursor: pointer;
  transition: background-color 0.15s;
}
.icon-button:hover { background: rgb(255 255 255 / 0.08); }
.icon-button:active { transform: scale(0.94); }
.icon-button .icon { width: 22px; height: 22px; }

/* Show the icon of the theme you would switch to. */
.theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-icon-sun { display: block; }
}

/* ---------- Store buttons (also used by open.html and 404.html) ---------- */

.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 22px 0 18px;
  border-radius: var(--r-control);
  background: #000000;
  color: #FFFFFF;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background-color 0.15s;
}
.store-button:hover { background: #20242F; transform: translateY(-2px); }
.store-button:active { transform: scale(0.98); }
.store-button span { display: flex; flex-direction: column; font-size: 1.25rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
.store-button small { font-size: 0.875rem; font-weight: 400; }
.store-logo { width: 26px; height: 26px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--brand-ink);
  color: #FFFFFF;
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 100%; white-space: nowrap; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand img { border-radius: 8px; }
.site-nav { display: none; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 8px 14px;
  border-radius: var(--r-control);
  color: rgb(255 255 255 / 0.8);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.site-nav a:hover { color: #FFFFFF; background: rgb(255 255 255 / 0.08); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 900px) {
  .site-nav { display: flex; }
  .header-actions { margin-left: 0; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 40px 0 var(--gap-section);
  background: var(--brand-ink);
  color: #FFFFFF;
}
@media (min-width: 760px) { .hero { padding-top: 72px; } }

.hero-grid { display: grid; gap: 32px; align-items: start; }
.hero-grid > * { min-width: 0; }
.hero-copy { display: grid; gap: 28px; align-content: start; }
.hero-copy .body-lg { max-width: 536px; color: #FFFFFF; }
.hero-facts { color: rgb(255 255 255 / 0.74); }
.hero-demo { display: grid; justify-items: center; gap: 14px; }
.demo-caption { color: rgb(255 255 255 / 0.74); text-align: center; }
@media (min-width: 980px) {
  .hero { padding-bottom: 64px; }
  .hero-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .hero-copy { grid-column: 1 / span 7; }
  .hero-title { font-size: clamp(48px, 6.2vw, 88px); }
  .hero-demo { grid-column: 8 / -1; justify-items: end; }
  .demo-caption { justify-self: end; text-align: right; width: min(100%, 460px); }
}

/* ---------- The game (GameScreen), shown as a plain rounded panel ---------- */

.game {
  display: grid;
  gap: 14px;
  width: min(100%, 460px);
  padding: 18px 16px 16px;
  border-radius: var(--r-large);
  background: var(--bg);
  color: var(--text);
}
[data-ui] .game-stats { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
[data-ui] .stat { display: flex; flex-direction: column; color: var(--text-2); font-size: 0.8125rem; font-weight: 600; line-height: 1.3; }
[data-ui] .stat strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
[data-ui] .stat-gear { display: grid; place-items: center; width: 32px; height: 32px; color: var(--text-2); }
[data-ui] .stat-gear .icon { width: 20px; height: 20px; }

[data-ui] .board-wrap { position: relative; }
[data-ui] .controls { position: relative; display: grid; gap: 14px; }
[data-ui] .toolbar { display: flex; justify-content: space-between; padding: 0 8px; }
[data-ui] .tool {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 4px 0;
  border: 0;
  border-radius: var(--r-control);
  background: none;
  color: var(--text-2);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, transform 0.12s var(--ease);
}
[data-ui] .tool .icon { width: 22px; height: 22px; }
[data-ui] .tool:hover { color: var(--text); }
[data-ui] .tool:active { transform: scale(0.94); }
[data-ui] .tool[aria-pressed="true"] { color: var(--accent-text); }
[data-ui] .badge {
  position: absolute;
  top: -2px;
  left: calc(50% + 6px);
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--text-2);
  color: var(--bg);
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1.4;
}
[data-ui] .tool[aria-pressed="true"] .badge,
[data-ui] .badge-round { background: var(--accent); color: var(--on-accent); }
[data-ui] .badge-round { min-width: 16px; text-align: center; }

[data-ui] .keypad { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
[data-ui] .key {
  aspect-ratio: 0.72;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s var(--ease), background-color 0.15s;
}
[data-ui] .key:hover { background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
[data-ui] .key:active { transform: scale(0.94); }
[data-ui] .key:disabled { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--text-2); cursor: default; }
[data-ui] .keypad[data-mode="notes"] .key:not(:disabled) { background: var(--accent); color: var(--on-accent); }

[data-ui] .demo-hint,
[data-ui] .demo-result {
  position: absolute;
  z-index: 2;
  border-radius: var(--r-surface);
  background: var(--card);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.22), 0 0 0 1px var(--border);
}
[data-ui] .demo-hint {
  inset: -4px 0;
  display: grid;
  align-content: center;
  padding: 14px 14px 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  animation: rise 0.25s var(--ease);
}
[data-ui] .demo-hint-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 8px; }
[data-ui] .demo-result {
  inset: 12% 8%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  animation: rise 0.3s var(--ease);
}
[data-ui] .demo-result-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
[data-ui] .demo-result-text { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 6px; }

/* ---------- Board (SudokuBoard + SudokuTileBackground) ---------- */

[data-ui] .board {
  --size: 9;
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(var(--size), minmax(0, 1fr));
  aspect-ratio: 1;
  border-radius: var(--r-surface);
  background: var(--board);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
[data-ui] .cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--grid-thin);
  border-bottom: 1px solid var(--grid-thin);
  background: var(--card);
  color: var(--user);
  font-size: calc(100cqi / var(--size) * 0.5);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.12s;
}
[data-ui] button.cell { cursor: pointer; }
[data-ui] .cell.box-r { border-right: 2px solid var(--grid-thick); }
[data-ui] .cell.box-b { border-bottom: 2px solid var(--grid-thick); }
[data-ui] .cell.last-c { border-right: 0; }
[data-ui] .cell.last-r { border-bottom: 0; }

[data-ui] .cell.given { color: var(--given); font-weight: 400; }
[data-ui] .cell.given .v { opacity: 0.85; }
[data-ui] .cell.unit { background: var(--unit); }
[data-ui] .cell.match { background: color-mix(in srgb, var(--accent) 25%, var(--card)); }
[data-ui] .cell.hint { background: var(--hint-bg); }
[data-ui] .cell.target { background: var(--target); box-shadow: inset 0 0 0 3px var(--accent-text); }
[data-ui] .cell.selected { background: var(--accent); color: var(--on-accent); }
[data-ui] .cell.selected.given .v { opacity: 1; }
[data-ui] .cell.wrong { background: var(--err-bg); color: var(--err); }
[data-ui] .cell.wrong .v::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 28%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translateX(-50%);
}
[data-ui] .cell.pop .v { animation: pop 0.25s var(--ease); }

[data-ui] .notes {
  position: absolute;
  inset: 6%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
  color: var(--text-2);
  font-size: calc(100cqi / var(--size) * 0.24);
  font-weight: 600;
}
[data-ui] .cell.selected .notes { color: var(--on-accent); }

/* ---------- Hints: two fields and one slider ---------- */

.hints { display: grid; }
.hints-copy { background: var(--bg-alt); }
.hints-copy-inner { display: grid; gap: 24px; padding: 72px var(--margin) 40px; }
.hint-clause { min-height: 2.3em; margin-top: 16px; }
.hints-visual { display: grid; place-items: center; padding: 48px var(--margin) 28px; background: var(--field-2); }
.hint-panel {
  width: min(100%, 440px);
  padding: 14px;
  border-radius: var(--r-large);
  background: var(--card);
}
[data-ui] .hint-bubble {
  display: grid;
  place-items: center;
  min-height: 3.4em;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-control);
  background: var(--bg);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.hints-track { display: grid; gap: 14px; padding: 28px var(--margin) 40px; background: var(--field-2); }

.stage-range {
  --p: 0%;
  width: 100%;
  height: 40px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.stage-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: var(--border); /* taste-skill-ignore: the slider's track */
  background-image: linear-gradient(90deg, var(--text) var(--p), transparent var(--p)); /* taste-skill-ignore: passed part of the track, hard stop */
}
.stage-range::-moz-range-track { height: 8px; border-radius: 4px; background: var(--border); }
.stage-range::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--text); }
.stage-range::-webkit-slider-thumb {
  width: 40px;
  height: 40px;
  margin-top: -16px;
  border: 0;
  border-radius: var(--r-control);
  background: var(--accent);
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.15s var(--ease);
}
.stage-range::-moz-range-thumb { width: 40px; height: 40px; border: 0; border-radius: var(--r-control); background: var(--accent); }
.stage-range:active::-webkit-slider-thumb { transform: scale(0.92); }
.stage-names { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; font-weight: 600; }
.stage-names li { color: var(--text-2); cursor: pointer; transition: color 0.2s; }
.stage-names li:nth-child(2) { text-align: center; }
.stage-names li:last-child { text-align: right; }
.stage-names li:hover { color: var(--text); }
.stage-names li[aria-current="step"] { color: var(--text); }

@media (min-width: 980px) {
  .hints {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    min-height: min(92svh, 960px);
  }
  .hints-copy { grid-area: 1 / 1 / 3 / 2; }
  .hints-visual { grid-area: 1 / 2 / 3 / 3; padding: 96px var(--margin) 168px; }
  .hints-track { grid-area: 2 / 1 / 3 / 3; z-index: 1; padding: 0 var(--edge) 48px; background: transparent; }
  .hints-copy-inner { padding: 120px 48px 168px var(--edge); max-width: calc(var(--edge) + 640px); }
  .hints-visual,
  .hints-track { order: 0; }
  .hint-clause { margin-top: 32px; }
}

/* ---------- Daily Puzzle ---------- */

.section { padding: var(--gap-section) 0; }
.split { display: grid; gap: 48px; align-items: center; }
.split > * { min-width: 0; }
.split-copy { display: grid; gap: 24px; align-content: start; }
.facts-list { display: grid; gap: 14px; margin-top: 8px; }
.facts-list li { padding-left: 28px; position: relative; }
.facts-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
}
.daily-visual { display: grid; gap: 16px; width: min(100%, 460px); justify-self: center; }
@media (min-width: 980px) {
  .split { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .split-copy { grid-column: 1 / span 6; }
  .daily-visual { grid-column: 8 / -1; justify-self: end; }
}

[data-ui] .streak-card { padding: 20px; border-radius: var(--r-surface); background: var(--card); }
[data-ui] .streak-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
[data-ui] .streak-head strong { display: block; }
[data-ui] .streak-head small { color: var(--text-2); font-size: 0.875rem; }
[data-ui] .streak-flame { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-control); background: color-mix(in srgb, #FF8A3D 16%, transparent); color: #FF8A3D; }
[data-ui] .streak-flame .icon { width: 24px; height: 24px; }
[data-ui] .streak-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
[data-ui] .streak-day { display: grid; justify-items: center; gap: 6px; color: var(--text-2); font-size: 0.8125rem; font-weight: 600; }
[data-ui] .streak-day span { display: grid; place-items: center; width: 100%; aspect-ratio: 1; max-width: 44px; border-radius: 10px; background: var(--bg); color: var(--text-2); }
[data-ui] .streak-day.done span { background: var(--brand-blue); color: #FFFFFF; }
[data-ui] .streak-day.today span { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-text); }
[data-ui] .streak-day .icon { width: 16px; height: 16px; }
[data-ui] .share-card { display: grid; gap: 6px; justify-self: end; width: min(100%, 360px); padding: 14px 18px; border-radius: 22px 22px 6px 22px; background: var(--accent); color: var(--on-accent); font-size: 0.9375rem; }
[data-ui] .share-title { font-weight: 700; }
[data-ui] .share-meta { opacity: 0.85; }
[data-ui] .notification {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 22px;
  background: var(--card);
  font-size: 0.875rem;
}
[data-ui] .notification img { border-radius: 9px; }
[data-ui] .notification strong { display: block; }
[data-ui] .notification span { color: var(--text-2); }
[data-ui] .notification time { align-self: start; color: var(--text-2); font-size: 0.8125rem; }

/* ---------- Settings: sentences with switches ---------- */

.settings-head { display: grid; gap: 20px; padding-bottom: 48px; }
.bands { display: grid; }
.band {
  display: grid;
  align-items: center;
  min-height: clamp(140px, 20vh, 220px);
  padding: 24px 0;
  background: var(--bg);
  transition: background-color 0.4s var(--ease);
}
.band.is-on { background: var(--band); color: #FFFFFF; }
.band-inner { display: grid; grid-template-columns: auto 1fr; align-items: start; column-gap: 0.7em; font-size: var(--fs-statement); }
.band-inner .switch { margin-top: 0.03em; }
.band-inner .band-more { font-size: var(--fs-body); }
.band .statement { color: var(--text-2); transition: color 0.3s; }
.band.is-on .statement { color: #FFFFFF; }
.band-more { margin-top: 8px; color: var(--text-2); transition: color 0.3s; }
.band.is-on .band-more { color: #FFFFFF; }
@media (min-width: 980px) {
  .band-inner { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
  .band-inner .switch { grid-column: 1; justify-self: start; }
  .band-inner > div { display: grid; grid-template-columns: subgrid; grid-column: 2 / -1; align-items: center; }
  .band-inner .statement { grid-column: 1 / span 6; }
  .band-inner .band-more { grid-column: 8 / -1; margin: 0; }
}

/* The app's switch, sized in em so it matches the sentence. */
.switch {
  font-size: var(--fs-statement);
  position: relative;
  width: 1.9em;
  height: 1.1em;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-2) 40%, transparent);
  cursor: pointer;
  transition: background-color 0.25s var(--ease);
}
.switch::before { content: ""; position: absolute; inset: -8px; }
[data-ui].switch span {
  position: absolute;
  top: 0.12em;
  left: 0.12em;
  width: 0.86em;
  height: 0.86em;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.25s var(--ease), background-color 0.25s;
}
.switch[aria-checked="true"] { background: #FFFFFF; }
[data-ui].switch[aria-checked="true"] span { transform: translateX(0.8em); background: var(--band); }
.switch:active span { width: 1em; }

/* ---------- Plus: the offer as one sentence ---------- */

.plus { padding: var(--gap-section) 0; background: var(--bg-alt); }
.plus-title { font-size: min(var(--fs-display), 8.4vw); }
.price {
  display: inline-block;
  padding: 0 0.12em;
  border-radius: 0.08em;
  background: var(--accent);
  color: var(--on-accent);
  line-height: 1;
}
.plus-grid { display: grid; gap: 32px; margin-top: 56px; }
.plus-free { margin-top: 16px; color: var(--text-2); }
.plus-action { display: grid; gap: 14px; align-content: start; width: min(100%, 420px); }
[data-ui].plan-picker { display: grid; gap: 8px; margin-bottom: 6px; }
[data-ui] .plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: var(--r-control); background: var(--card); text-align: left; }
[data-ui] .plan span { display: grid; }
[data-ui] .plan strong { font-weight: 700; }
[data-ui] .plan small { color: var(--text-2); font-size: 0.875rem; }
[data-ui] .plan b { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
[data-ui] .plan.is-selected { box-shadow: inset 0 0 0 2px var(--accent-2); }
.plus-action .small { color: var(--text-2); max-width: 30em; }
@media (min-width: 980px) {
  .plus-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; margin-top: 72px; }
  .plus-grid > :first-child { grid-column: 1 / span 6; }
  .plus-action { grid-column: 8 / -1; justify-self: end; }
}

/* ---------- FAQ: large questions, answers beside ---------- */

.faq-table { display: grid; gap: 56px; }
.faq-head { margin-bottom: 56px; }
.faq-row { display: grid; gap: 12px; }
.faq-heading { color: var(--text-2); }
@media (min-width: 860px) {
  .faq-table { gap: 80px; }
  .faq-head { margin-bottom: 80px; }
  .faq-row { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: baseline; }
  .faq-row dt,
  .faq-row > h2 { grid-column: 1 / span 6; }
  .faq-row dd { grid-column: 8 / -1; max-width: 40ch; }
}

/* ---------- Close: the page's colours turned over ---------- */

.cta,
.site-footer { background: var(--text); color: var(--bg); }
.cta { display: grid; padding: 96px 0 0; }
@media (min-width: 760px) { .cta { min-height: min(76svh, 760px); padding-top: 120px; } }
.cta-inner { display: grid; align-content: space-between; gap: 64px; }
.cta-foot { display: grid; gap: 24px; align-items: end; }
@media (min-width: 980px) {
  .cta-foot { grid-template-columns: 1fr auto; }
}

.site-footer { overflow: hidden; padding-top: 72px; }
.footer-social { display: grid; margin-top: -8px; padding-bottom: 12px; font-weight: 600; }
.footer-social p { display: flex; align-items: center; min-height: 44px; margin: 0; }
.footer-social .footer-nav { align-items: center; column-gap: 32px; }
.footer-social a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 760px) {
  .footer-social { grid-template-columns: 214px 1fr; gap: 24px; padding-bottom: 32px; }
}
.footer-row { display: grid; gap: 12px; align-items: baseline; padding-bottom: 32px; }
.footer-row .small { opacity: 0.8; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-nav a { color: inherit; font-weight: 600; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
@media (min-width: 860px) {
  .footer-row { grid-template-columns: 1fr auto; }
}

/* The logo's tiles, as wide as the page and cut by its bottom edge. */
.footer-name {
  --g: 0.6vw;
  --t: calc((min(100vw - 2 * var(--margin), var(--max)) - 10 * var(--g)) / 11);
  display: flex;
  gap: var(--g);
  width: min(100% - 2 * var(--margin), var(--max));
  margin-inline: auto;
  transform: translateY(30%);
}
.footer-name span,
.footer-name b {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--t);
  height: var(--t);
  border-radius: calc(var(--t) * 0.14);
  background: var(--brand-navy);
  color: #FFFFFF;
  font-size: calc(var(--t) * 0.5);
  font-weight: 900;
  line-height: 1;
}
.footer-name b { background: none; }
.footer-name .accent { background: var(--brand-blue); }
/* On a phone the tiles stack as in the logo, COOL over SUDOKU, and the edge cuts the second row. */
@media (max-width: 759px) {
  .footer-name {
    --g: 2vw;
    --t: calc((100vw - 2 * var(--margin) - 5 * var(--g)) / 6);
    flex-wrap: wrap;
    row-gap: var(--g);
    transform: translateY(22%);
  }
  .footer-name b { flex-basis: 100%; height: 0; }
}
.cta-title { font-size: max(var(--fs-display), 11.4vw); }

/* ---------- Motion ---------- */

@keyframes pop { 50% { transform: scale(1.25); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes line-in { from { opacity: 0; transform: translateY(0.25em); } }

@media (prefers-reduced-motion: no-preference) {
  /* The headline arrives a line at a time. */
  .hero-title > .nowrap { animation: line-in 0.8s var(--ease) both; }
  .hero-title > .nowrap + .nowrap { animation-delay: 0.12s; }

  /* Signature move: the live board opens from the bottom edge and settles. */
  .js .shutter { clip-path: inset(100% 0 0 0 round var(--r-large)); transition: clip-path 1.1s var(--ease-in-out) 0.25s; }
  .js .shutter > * { transform: scale(1.06); transform-origin: 50% 100%; transition: transform 1.5s var(--ease) 0.25s; }
  .js .is-in .shutter { clip-path: inset(0 round var(--r-large)); }
  .js .is-in .shutter > * { transform: none; }

  /* Each section's parts rise in order as the section enters. */
  .js [data-reveal-group] > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js [data-reveal-group].is-visible > * { opacity: 1; transform: none; }
  .js .daily-visual > *,
  .js .hint-panel { opacity: 0; transform: translateY(32px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms + 120ms); }
  .js .is-visible.daily-visual > *,
  .js .hint-panel.is-visible { opacity: 1; transform: none; }
}

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

@media (max-width: 420px) {
  .store-button { flex: 1 1 100%; justify-content: center; }
}

/* Keep all header controls inside the frame on small phones. */
@media (max-width: 389px) {
  .header-inner { gap: 8px; }
  .brand { flex-shrink: 0; }
}
@media (max-width: 359px) {
  .site-header .header-inner { width: calc(100% - 32px); }
  .site-header .brand { gap: 8px; font-size: 14px; }
  .site-header .brand img { width: 28px; height: 28px; }
  .header-actions .button-small { padding-inline: 14px; font-size: 14px; }
}
