/* =====================================================================
   playmindy.com: same picture-book look as the Mindy app (src/styles.css).
   Warm paper, dark ink outlines, one colour per game, flat sticker shadows.
   Everything is local: no web fonts, images or scripts from other servers.
   ===================================================================== */

@font-face {
  font-family: 'Fredoka Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('fonts/fredoka-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Nunito Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('fonts/nunito-latin-wght-normal.woff2') format('woff2-variations');
}

/* Tokens copied from the app's :root in src/styles.css (paper, paper-2, card, ink, ink-soft,
   good, sun). Update both together. --c-deep / --c-tint are pre-mixed hex values of
   the app's color-mix() shades, so older browsers get the same colours. */
:root {
  --paper: #fff8ec;
  --paper-2: #f6ecda;
  --card: #fffdf8;
  --ink: #2a2742;
  --ink-soft: #5d5873;
  --line: #2a2742;
  --good: #2f9e5b;
  --sun: #f6b93b;
  --c: #8a63c9;          /* brand purple (Potion Lab / app icon) */
  --c-deep: #6b4f9e;     /* white text on this: 6.5:1 */
  --c-tint: #efe3e7;
  --radius: 20px;
  --shadow: 0 4px 0 var(--line);
  --focus: #3b82f6;
  --display: 'Fredoka Variable', 'Fredoka', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito Variable', 'Nunito', ui-rounded, system-ui, sans-serif;
  --measure: 68ch;
  --page: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  margin: 0;
  font-family: var(--body);
  font-size: 1.125rem;   /* 18px */
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(42, 39, 66, .07) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  overflow-wrap: break-word;
}
main { flex: 1 0 auto; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p, ul { margin: 0; }
svg { display: block; width: 100%; height: 100%; }
.owl, .ico, .tick { display: block; flex: none; }

a { color: var(--c-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 700; }
a:hover { color: var(--ink); text-decoration-thickness: 3px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 16px; }
@media (min-width: 40rem) { .wrap { padding: 0 32px; } }

/* ------------------------------------------------------------ Skip link */
.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--card); color: var(--ink); border: 3px solid var(--line); border-radius: 12px;
  padding: 8px 16px; box-shadow: var(--shadow);
}
.skip:focus { top: 16px; }

/* ------------------------------------------------------------ Header */
.site-head { border-bottom: 3px solid var(--line); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-family: var(--display); font-weight: 700; font-size: 1.625rem; color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand .owl { width: 44px; height: 44px; flex: none; }
.site-nav { display: flex; gap: 8px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--ink); text-decoration: none; border-radius: 12px;
}
.site-nav a:hover { background: var(--paper-2); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* ------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 12px 24px; border-radius: 18px;
  font-family: var(--display); font-weight: 600; font-size: 1.25rem; line-height: 1.2; text-decoration: none;
  background: var(--card); color: var(--ink); border: 3px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s ease-out, box-shadow .15s ease-out, background-color .15s ease-out;
}
.btn .ico { width: 24px; height: 24px; flex: none; }
.btn:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 6px 0 var(--line); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn.primary { background: var(--c-deep); color: #fff; }
.btn.primary:hover { color: #fff; background: #5d4489; }
.btn:focus-visible { outline-offset: 4px; border-radius: 18px; }

/* ------------------------------------------------------------ Hero */
.hero { padding: 48px 0 64px; text-align: center; }
.hero .owl { width: 144px; height: 144px; margin: 0 auto 8px; }
.hero h1 { font-size: clamp(3.5rem, 14vw, 5.5rem); font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.pitch {
  max-width: 30ch; margin: 16px auto 32px;
  font-size: clamp(1.25rem, 4.6vw, 1.625rem); font-weight: 700; line-height: 1.35;
}
.store-note { margin-top: 16px; color: var(--ink-soft); font-weight: 700; font-size: 1rem; }

/* ------------------------------------------------------------ Sections */
.section { padding: 48px 0; }
.section-head { max-width: var(--measure); margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 700; }
.section-head p { margin-top: 8px; color: var(--ink-soft); font-weight: 600; }

/* ------------------------------------------------------------ Game cards */
.games { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
.game {
  --c: #8a63c9;
  display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: start;
  background: var(--card); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px;
}
/* Per-game card colour. Must match src/games/meta.ts; `node --experimental-strip-types website/check.mjs` verifies it.
   Classes instead of inline style="--c:..." so the CSP can forbid inline styles. */
.game[data-game="potion"] { --c: #8a63c9; }
.game[data-game="syllable"] { --c: #d9567a; }
.game[data-game="sorter"] { --c: #3e9e66; }
.game[data-game="constellation"] { --c: #4060b0; }
.game[data-game="bridge"] { --c: #e3962f; }
.game[data-game="codebot"] { --c: #2b98b0; }
.game[data-game="detective"] { --c: #7d9a37; }
.game[data-game="market"] { --c: #e5713a; }
.game[data-game="color"] { --c: #c264ad; }
.game[data-game="chrono"] { --c: #b7563f; }
.game-art {
  display: grid; place-items: center; width: 88px; height: 88px; padding: 8px;
  background: var(--c); border: 3px solid var(--line); border-radius: 14px;
}
.game h3 { font-size: 1.25rem; font-weight: 600; }
.game .subject { font-size: 1rem; font-weight: 800; color: var(--ink-soft); margin-top: 4px; }
.game .how { font-size: 1rem; line-height: 1.45; margin-top: 8px; }

@media (min-width: 40rem) {
  .games { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (min-width: 60rem) {
  .game { grid-template-columns: 128px 1fr; gap: 24px; padding: 16px; }
  .game-art { width: 128px; height: 128px; padding: 16px; }
}

/* ------------------------------------------------------------ Parents panel */
.panel {
  background: var(--card); border: 3px solid var(--line); border-radius: 26px; box-shadow: 0 6px 0 var(--line);
  padding: 24px 16px;
}
@media (min-width: 40rem) { .panel { padding: 32px; } }
.facts { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(2, 1fr); gap: 24px 32px; } }
.facts li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.tick {
  width: 32px; height: 32px; padding: 4px; border-radius: 50%;
  background: var(--good); color: #fff; border: 2px solid var(--line);
}
.facts strong { display: block; font-family: var(--display); font-weight: 600; font-size: 1.25rem; line-height: 1.25; }
.facts p span { display: block; font-size: 1rem; color: var(--ink-soft); font-weight: 600; margin-top: 4px; }
.panel-foot { margin-top: 32px; padding-top: 24px; border-top: 2px dashed var(--paper-2); font-weight: 600; }

/* ------------------------------------------------------------ Closing call */
.cta { text-align: center; padding: 48px 0 64px; }
.cta .owl { width: 112px; height: 112px; margin: 0 auto 8px; }
.cta h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); font-weight: 700; margin-bottom: 24px; }

/* ------------------------------------------------------------ Footer */
.site-foot { border-top: 3px solid var(--line); background: var(--paper-2); padding: 32px 0; font-size: 1rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.foot-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
.site-foot small { font-size: 1rem; color: var(--ink-soft); font-weight: 700; }

/* ------------------------------------------------------------ Document pages (privacy) */
.doc { padding: 48px 0 64px; }
.doc-body {
  max-width: calc(var(--measure) + 64px); margin: 0 auto;
  background: var(--card); border: 3px solid var(--line); border-radius: 26px; box-shadow: 0 6px 0 var(--line);
  padding: 32px 20px;
}
@media (min-width: 40rem) { .doc-body { padding: 48px 32px; } }
.doc h1 { font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 700; }
.doc .updated { margin-top: 8px; color: var(--ink-soft); font-weight: 700; }
.doc h2 { font-size: 1.5rem; font-weight: 600; margin: 40px 0 12px; }
.doc p + p, .doc p + ul, .doc ul + p { margin-top: 16px; }
.doc ul { padding-left: 1.5em; }
.doc li { margin-top: 8px; }
.doc li::marker { color: var(--c-deep); }
.doc strong { font-weight: 800; }

/* ------------------------------------------------------------ 404 */
.lost { text-align: center; padding: 64px 0; }
.lost .owl { width: 144px; height: 144px; margin: 0 auto 16px; }
.lost h1 { font-size: clamp(2rem, 8vw, 3rem); font-weight: 700; }
.lost p { max-width: 36ch; margin: 16px auto 32px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}
@media (forced-colors: active) {
  .btn, .game, .panel, .doc-body { border-color: CanvasText; }
  .tick { forced-color-adjust: auto; }
}
