@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #fbf6ef;
  --surface: #fffdf9;
  --line: #eadfd2;
  --text: #4a3428;
  --muted: #86695a;
  --accent: #c8623f;
  --accent-soft: #f9c99c;
  --shadow: 0 1px 2px rgba(74, 52, 40, .06), 0 8px 24px rgba(74, 52, 40, .07);
  --radius: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #241c18;
    --surface: #2e2520;
    --line: #463830;
    --text: #f3e7da;
    --muted: #c4ab99;
    --accent: #f0a07f;
    --accent-soft: #6b4a37;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, .brand, .eyebrow { font-family: "Fredoka", system-ui, sans-serif; letter-spacing: -.01em; }
h1 { font-weight: 600; line-height: 1.1; }
h2 { font-weight: 600; line-height: 1.2; }
h3 { font-weight: 600; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }

/* Header / footer */
.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 600; color: var(--text); text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.lang { font-size: 15px; color: var(--muted); }
.lang a { color: inherit; }
.site-footer { margin-top: 72px; padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.site-footer nav a { color: var(--text); }
.site-footer p { margin: 4px 0; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px; padding: 24px 0 40px; }
.hero h1 { font-size: clamp(64px, 11vw, 120px); margin: 0; }
.tagline { font-family: "Fredoka", system-ui, sans-serif; font-size: clamp(24px, 3.4vw, 34px); font-weight: 500; margin: 4px 0 18px; }
.lead { font-size: 19px; color: var(--muted); max-width: 30em; margin: 0 0 26px; }
.soon { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.soon::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #8fbf6a; box-shadow: 0 0 0 4px rgba(143, 191, 106, .25); }
.hero-art { justify-self: center; width: min(420px, 100%); }
.hero-art.keyart { border-radius: 28px; box-shadow: var(--shadow); width: min(400px, 100%); aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 70%; }

/* the screens: three across in two rows; a strip scrolling sideways on a phone */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; max-width: 920px; margin-inline: auto; }
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery img { border-radius: 18px; box-shadow: var(--shadow); }
.gallery figcaption { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; margin-top: 8px; text-align: center; }

.section { padding: 48px 0; }
.section > h2, .section-head h2 { font-size: clamp(30px, 4vw, 40px); margin: 0 0 8px; }
.section-head p { color: var(--muted); margin: 0 0 28px; }

.howto { display: grid; grid-template-columns: minmax(0, 390px) minmax(0, 1fr); gap: 48px; align-items: center; }
.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; width: 100%; max-width: 390px; padding: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.cell { aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center; box-shadow: inset 0 -3px 0 rgba(74, 52, 40, .12); }
.cell img { width: 88%; }
/* cushion colours (tools/reskin/palette.py) */
.c0 { background: #f7a79a; } .c1 { background: #b5cc86; } .c2 { background: #adddf2; }
.c3 { background: #f3d47a; } .c4 { background: #cdb9ee; } .c5 { background: #f9c99c; }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.rules li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.rules .n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 20px; color: var(--text); }
.rules strong { display: block; font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 20px; }
.rules span { color: var(--muted); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1000px) and (min-width: 821px) { .features { grid-template-columns: repeat(2, 1fr); } }
.feature { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature img { height: 96px; width: auto; margin-bottom: 10px; }
.feature h3 { font-size: 22px; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); }

.contact { text-align: center; }
.contact img { width: 180px; margin: 0 auto 8px; }

/* Legal pages */
.doc { padding: 16px 0 24px; }
.doc h1 { font-size: clamp(36px, 6vw, 52px); margin: 8px 0 6px; }
.doc .updated { color: var(--muted); margin: 0 0 28px; }
.doc h2 { font-size: 26px; margin: 40px 0 10px; }
.doc h3 { font-size: 20px; margin: 26px 0 6px; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: 6px 0; }
.doc .card { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); margin: 20px 0; }
.doc .card p:first-child { margin-top: 0; }
.doc .card p:last-child { margin-bottom: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 16px 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; }
.table-scroll { overflow-x: auto; }
.toc { columns: 2; column-gap: 32px; padding-left: 1.3em; }
.doc .toc li { margin: 0 0 10px; break-inside: avoid; }

.notfound { text-align: center; padding: 40px 0; }
.notfound img { width: 220px; margin: 0 auto 12px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-art { order: -1; width: min(300px, 80%); }
  .lead { margin-inline: auto; }
  .howto { grid-template-columns: 1fr; justify-items: center; }
  .features { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; gap: 16px; overflow-x: auto;
             padding-bottom: 10px; scroll-snap-type: x mandatory; }
  .toc { columns: 1; }
}
