/* Spoken Spelling Bee website. The tokens are the app's own (src/theme/bee.ts,
   src/theme/modernPalette.ts): the paper canvas, ink blue for actions, honey,
   and key-cap tiles - a face sitting on a darker edge. */

@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("fonts/nunito-800.woff") format("woff"); }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url("fonts/nunito-900.woff") format("woff"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url("fonts/nunito-sans-400.woff") format("woff"); }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url("fonts/nunito-sans-700.woff") format("woff"); }

:root {
  --paper: #fdfcf7;
  --paper-sunk: #f3f1ea;
  --cap: #ffffff;
  --cap-edge: #e4dfd1;
  --ink: #2b4acb;
  --ink-edge: #1d348f;
  --ink-tint: #e8edff;
  --on-ink: #ffffff;
  --honey: #ffc83d;
  --honey-edge: #d9980b;
  --on-honey: #4a3300;
  --honey-tint: #fff3d1;
  --ok: #21a052;
  --ok-edge: #167a3c;
  --ok-tint: #e3f5e9;
  --bad: #ef4868;
  --bad-edge: #b8304d;
  --bad-tint: #fde6eb;
  --bad-text: #b8304d;
  --text-strong: #3c3c3c;
  --text: #4b4b4b;
  --muted: #696969;
  --rule: #e9e5d9;

  --display: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --measure: 68ch;
  --page: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16181a;
    --paper-sunk: #1e2124;
    --cap: #2a2e35;
    --cap-edge: #101215;
    --ink: #8ea6ff;
    --ink-edge: #5a74d6;
    --ink-tint: #1b2340;
    --on-ink: #0d1530;
    --honey-tint: #3a3015;
    --ok: #2fb862;
    --ok-edge: #1c7a40;
    --ok-tint: #15301f;
    --bad: #ff6680;
    --bad-edge: #b03a52;
    --bad-tint: #3a1a22;
    --bad-text: #ff8fa2;
    --text-strong: #f2f2f2;
    --text: #d0d0d0;
    --muted: #a3a3a3;
    --rule: #2c3036;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); color: var(--text-strong); line-height: 1.15; margin: 0; }
h2 { font-weight: 900; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-weight: 800; font-size: 1.2rem; }
p { margin: 0; }
strong { color: var(--text-strong); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: 10px; z-index: 10; font-weight: 700; }
.skip:focus { top: 8px; }

/* ---------- Header and footer ---------- */

.site-header {
  max-width: var(--page);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-strong); font: 900 1.15rem/1 var(--display); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.site-nav a { color: var(--text-strong); text-decoration: none; font: 800 1rem/1 var(--display); padding: 8px 2px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2.5px; text-underline-offset: 6px; }

.site-footer { background: var(--paper-sunk); margin-top: 96px; }
.site-footer .inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
}
.site-footer p { color: var(--muted); font-size: 0.95rem; }
.site-footer .brand { margin-bottom: 12px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.footer-links a { font-weight: 700; }
@media (max-width: 640px) { .site-footer .inner { grid-template-columns: 1fr; } }

/* ---------- Key-cap tiles (the app's letter tiles) ---------- */

.tile {
  --face: var(--cap);
  --rim: var(--cap-edge);
  --fg: var(--text-strong);
  --size: 56px;
  --edge: max(3px, calc(var(--size) * 0.09));
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: calc(var(--size) * 0.2);
  background: var(--face);
  color: var(--fg);
  box-shadow: 0 var(--edge) 0 var(--rim), inset 0 0 0 1.5px var(--rim);
  font: 900 calc(var(--size) * 0.5)/1 var(--display);
  text-transform: none;
  margin-bottom: var(--edge);
}
.tile.honey { --face: var(--honey); --rim: var(--honey-edge); --fg: var(--on-honey); box-shadow: 0 var(--edge) 0 var(--rim); }
.tile.ink { --face: var(--ink); --rim: var(--ink-edge); --fg: var(--on-ink); box-shadow: 0 var(--edge) 0 var(--rim); }
.tile.ok { --face: var(--ok); --rim: var(--ok-edge); --fg: #fff; box-shadow: 0 var(--edge) 0 var(--rim); }
.tile.bad { --face: var(--bad); --rim: var(--bad-edge); --fg: #fff; box-shadow: 0 var(--edge) 0 var(--rim); }
.tile.gap { background: transparent; box-shadow: none; border: 2px dashed var(--cap-edge); color: transparent; }

.tile-row { display: flex; justify-content: center; gap: calc(var(--size, 56px) * 0.1); }

/* ---------- Home: hero ---------- */

.hero { text-align: center; padding: 12px var(--gutter) 24px; }
/* The mascot art sits on the app's paper; on the dark canvas it reads as a card. */
.hero .mascot { width: clamp(132px, 22vw, 184px); margin: 0 auto 14px; border-radius: 22%; }
.wordmark { margin: 0; display: grid; gap: 6px; justify-content: center; --size: min(10vw, 62px); }
.wordmark .tile-row { --size: min(10vw, 62px); gap: min(1vw, 7px); }
.wordmark .tile { --size: min(10vw, 62px); }
.hero .lead {
  max-width: 34ch;
  margin: 26px auto 0;
  font: 800 clamp(1.25rem, 1rem + 1vw, 1.6rem)/1.35 var(--display);
  color: var(--text-strong);
}
.availability { margin-top: 14px; color: var(--muted); }
.store-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

@media (prefers-reduced-motion: no-preference) {
  .wordmark .tile { animation: drop 520ms cubic-bezier(.2, .9, .3, 1.25) both; animation-delay: calc(var(--i) * 45ms + 120ms); }
  .hero .mascot { animation: bob 3.2s ease-in-out 1s infinite; }
}
/* Movement only: a tile whose animation never runs still shows. */
@keyframes drop { from { transform: translateY(-22px) scale(.8); } to { transform: none; } }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* ---------- Home: sections ---------- */

.section { max-width: var(--page); margin: 0 auto; padding: 88px var(--gutter) 0; }
.section-head { max-width: 40rem; }
.section-head p { margin-top: 12px; font-size: 1.125rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Try a word: a small bee in the page. */
.try {
  margin: 36px auto 0;
  max-width: 640px;
  background: var(--paper-sunk);
  border-radius: 28px;
  padding: clamp(24px, 5vw, 40px) clamp(16px, 4vw, 40px);
  text-align: center;
}
.speaker {
  width: 88px; height: 88px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: var(--on-ink);
  box-shadow: 0 6px 0 var(--ink-edge);
  display: inline-grid; place-items: center;
  margin-bottom: 6px;
}
.speaker:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink-edge); }
.speaker svg { width: 38px; height: 38px; }
.try .prompt { color: var(--muted); margin-top: 10px; }
.chip {
  border: 0; cursor: pointer; font: 800 0.95rem/1 var(--display); color: var(--text-strong);
  background: var(--cap); border-radius: 999px; padding: 11px 18px;
  box-shadow: 0 3px 0 var(--cap-edge), inset 0 0 0 1.5px var(--cap-edge);
}
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cap-edge), inset 0 0 0 1.5px var(--cap-edge); }
.try form { display: flex; gap: 10px; margin-top: 18px; }
.try input {
  flex: 1; min-width: 0; font: 900 1.4rem/1 var(--display); color: var(--text-strong); text-align: center;
  background: var(--cap); border: 0; border-radius: 16px; padding: 14px 12px;
  box-shadow: 0 4px 0 var(--cap-edge), inset 0 0 0 1.5px var(--cap-edge);
}
.try input:focus-visible { outline-offset: 2px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; text-decoration: none;
  font: 900 1.05rem/1 var(--display); color: var(--on-ink); background: var(--ink);
  border-radius: 16px; padding: 16px 24px;
  box-shadow: 0 5px 0 var(--ink-edge);
}
.button:hover { text-decoration: none; }
.button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink-edge); }
.text-button { border: 0; background: none; cursor: pointer; font: 900 1.05rem/1 var(--display); color: var(--ink); padding: 14px 8px; }
.try .tiles { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; --size: clamp(34px, 9vw, 48px); }
.try .tiles:empty { display: none; }
.try .cell { display: grid; justify-items: center; gap: 4px; }
.try .cell .tile { --size: clamp(34px, 9vw, 48px); }
.try .cell .fix { font: 900 0.95rem/1 var(--display); color: var(--ok); min-height: 1em; }
@media (prefers-reduced-motion: no-preference) {
  .try .cell .tile { animation: flip 380ms ease both; animation-delay: calc(var(--i) * 70ms); }
}
@keyframes flip { from { transform: rotateX(90deg); } to { transform: none; } }
.verdict { margin-top: 22px; border-radius: 20px; padding: 18px 20px; text-align: left; }
.verdict[hidden] { display: none; }
.verdict.right { background: var(--ok-tint); color: var(--ok-edge); }
.verdict.wrong { background: var(--bad-tint); color: var(--bad-text); }
.verdict h3 { color: inherit; font-size: 1.5rem; font-weight: 900; }
.verdict ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-weight: 700; }
.verdict .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.verdict.right .button { background: var(--ok); box-shadow: 0 5px 0 var(--ok-edge); color: #fff; }
.verdict.wrong .button { background: var(--bad); box-shadow: 0 5px 0 var(--bad-edge); color: #fff; }
.try .note { margin-top: 18px; font-size: 0.9rem; color: var(--muted); }

/* How a bee goes: real screens from the app. */
.screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 3vw, 36px); margin-top: 40px; list-style: none; padding: 0; }
.screens li { display: grid; gap: 14px; align-content: start; }
.screens img {
  width: 100%; max-width: 280px; margin: 0 auto; border-radius: 26px;
  box-shadow: 0 0 0 8px var(--cap), 0 0 0 9.5px var(--cap-edge), 0 8px 0 9.5px var(--cap-edge);
}
.screens h3 { margin-top: 18px; text-align: center; }
.screens p { text-align: center; max-width: 30ch; margin: 0 auto; }
@media (max-width: 760px) {
  .screens { grid-template-columns: 1fr; gap: 48px; }
  .screens img { max-width: 240px; }
}

/* Where words come from. */
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sources li { padding: 18px 0; border-top: 2px solid var(--rule); }
.sources li:last-child { border-bottom: 2px solid var(--rule); }
.sources h3 { font-size: 1.1rem; margin-bottom: 4px; }

/* Languages. */
.languages { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 10px; }
.languages li {
  background: var(--cap); color: var(--text-strong);
  border-radius: 12px; padding: 8px 13px;
  box-shadow: 0 3px 0 var(--cap-edge), inset 0 0 0 1.5px var(--cap-edge);
  font: 800 1rem/1.2 var(--display);
}

/* Families. */
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: 36px; }
.points h3 { margin-bottom: 8px; }
@media (max-width: 860px) { .points { grid-template-columns: 1fr; } }

/* Prices. */
.prices { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 36px; border-top: 2px solid var(--rule); }
.price { padding: 28px clamp(0px, 2.5vw, 28px) 8px; border-left: 2px solid var(--rule); display: grid; align-content: start; gap: 10px; }
.price:first-child { border-left: 0; padding-left: 0; }
.price .amount { font: 900 2.4rem/1 var(--display); color: var(--text-strong); }
.price .amount small { font-size: 1rem; font-weight: 800; color: var(--muted); }
.price ul { margin: 6px 0 0; padding-left: 1.1em; display: grid; gap: 6px; }
.price .tag { justify-self: start; }
.price.featured .amount { color: var(--ink); }
.small-print { margin-top: 22px; color: var(--muted); font-size: 0.95rem; max-width: var(--measure); }
@media (max-width: 860px) {
  .prices { grid-template-columns: 1fr; }
  .price { border-left: 0; border-bottom: 2px solid var(--rule); padding: 24px 0; }
}

/* ---------- Text pages: support, privacy, terms ---------- */

.doc { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 32px var(--gutter) 0; }
.doc h1 { font-weight: 900; font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3rem); letter-spacing: -0.015em; }
.doc .updated { color: var(--muted); margin-top: 10px; }
.doc h2 { font-size: 1.55rem; margin-top: 52px; scroll-margin-top: 20px; }
.doc h3 { margin-top: 28px; }
.doc p, .doc ul, .doc ol, .doc table { margin-top: 14px; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li + li { margin-top: 6px; }
.doc .intro { font-size: 1.15rem; margin-top: 18px; }
.in-short { background: var(--honey-tint); border-radius: 22px; padding: 22px 24px 24px; margin-top: 28px; }
.in-short h2 { margin-top: 0; font-size: 1.25rem; }
.in-short ul { margin-top: 10px; }
.toc { margin-top: 28px; }
.toc ol { columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; }
@media (max-width: 560px) { .toc ol { columns: 1; } }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-top: 2px solid var(--rule); }
.doc th { font: 800 1rem/1.3 var(--display); color: var(--text-strong); }
.doc thead th { border-top: 0; }
@media (max-width: 640px) {
  .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc tr { border-top: 2px solid var(--rule); padding: 12px 0; }
  .doc td, .doc tbody th { border: 0; padding: 4px 0; }
  .doc td::before { content: attr(data-label); display: block; font: 800 0.85rem/1.3 var(--display); color: var(--muted); }
}

/* Licences: a notice reproduced in full, and the collapsed per-package notices. */
.doc pre.licence {
  white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 14px;
  font: 0.88rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--honey-tint); border-radius: 18px; padding: 18px 20px;
}
.doc details.notice { border-top: 2px solid var(--rule); padding: 12px 0; }
.doc details.notice:last-of-type { border-bottom: 2px solid var(--rule); }
.doc details.notice summary { cursor: pointer; font-weight: 800; }
.doc details.notice summary .muted { font-weight: 400; color: var(--muted); }
.doc details.notice p { margin-top: 8px; }

/* Support. */
.contact-card {
  margin-top: 28px; background: var(--ink-tint); border-radius: 24px; padding: 24px;
  display: grid; gap: 10px;
}
.contact-card .email { font: 900 clamp(1.2rem, 0.9rem + 1.6vw, 1.7rem)/1.2 var(--display); overflow-wrap: anywhere; }
.faq-group { margin-top: 44px; }
.faq-group h2 { margin-top: 0; }
.faq details { border-top: 2px solid var(--rule); }
.faq details:last-child { border-bottom: 2px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 40px 16px 0; position: relative;
  font: 800 1.1rem/1.35 var(--display); color: var(--text-strong);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -9px;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg);
  transition: transform 160ms ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq .answer { padding: 0 0 20px; }
.faq .answer > * + * { margin-top: 10px; }
.faq .answer ol, .faq .answer ul { padding-left: 1.3em; margin-top: 10px; }

/* 404. */
.lost { text-align: center; padding: 48px var(--gutter) 0; }
.lost .tile-row { --size: 64px; margin: 24px 0; }
.lost .tile { --size: 64px; }
.lost p { max-width: 36ch; margin: 0 auto 24px; }
