@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka.woff") format("woff"); font-weight: 300 700; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #eef1fb;
  --surface: #ffffff;
  --ink: #1f2547;
  --muted: #545b85;
  --line: #d5dbf2;
  --sky: #4766e8;
  --sky-deep: #3149b8;
  --sun: #ffc83d;
  --sun-deep: #d99a00;
  --leaf: #2f9e6c;
  --leaf-deep: #1f7550;
  --berry: #e0577a;
  --berry-deep: #b03a5a;
  --tile: #ffffff;
  --tile-edge: #b9c2ea;
  --focus: #4766e8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161a31;
    --surface: #1f2442;
    --ink: #eceefb;
    --muted: #aab1d8;
    --line: #333a63;
    --sky: #8ea2ff;
    --sky-deep: #5d73d9;
    --tile: #262c52;
    --tile-edge: #12152a;
    --focus: #b6c3ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161a31; --surface: #1f2442; --ink: #eceefb; --muted: #aab1d8; --line: #333a63;
  --sky: #8ea2ff; --sky-deep: #5d73d9; --tile: #262c52; --tile-edge: #12152a; --focus: #b6c3ff; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}
a { color: var(--sky); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--sky-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
img, svg { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 42rem; }

/* ---------- header ---------- */
.site-head { padding: 1.5rem 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.15rem; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 2.25rem; height: 2.25rem; }
.site-nav { display: flex; gap: 0.35rem 1.4rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; padding: 0.35rem 0; border-bottom: 3px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--sun); }

/* ---------- hero: the tile wordmark ---------- */
.hero { padding: 3.5rem 0 4.5rem; }
.wordmark { margin: 0; font-family: "Fredoka", sans-serif; font-weight: 650; line-height: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.wordmark .row { display: flex; gap: clamp(0.3rem, 1vw, 0.45rem); flex-wrap: nowrap; }
.wordmark .t {
  --w: clamp(2rem, calc((100vw - 2.5rem - 7 * 0.3rem) / 8), 5.4rem);
  display: inline-grid; place-items: center; flex: none;
  width: var(--w); height: calc(var(--w) * 1.1);
  font-size: calc(var(--w) * 0.72);
  background: var(--tile); color: var(--ink);
  border-radius: clamp(0.5rem, 1.4vw, 0.95rem);
  box-shadow: 0 clamp(4px, 0.8vw, 8px) 0 var(--tile-edge);
}
.wordmark .row-2 .t { background: #4766e8; color: #fff; box-shadow: 0 clamp(4px, 0.8vw, 8px) 0 #3149b8; }
.wordmark .t.odd {
  background: var(--sun); color: #3a2a00; box-shadow: 0 clamp(4px, 0.8vw, 8px) 0 var(--sun-deep);
  transform: rotate(-9deg) translateY(-0.35rem);
  animation: tumble 900ms cubic-bezier(.2, 1.4, .4, 1) 300ms both;
}
@keyframes tumble {
  0% { transform: translateY(-3.5rem) rotate(18deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: rotate(-9deg) translateY(-0.35rem); }
}
@media (prefers-reduced-motion: reduce) { .wordmark .t.odd { animation: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-text { margin-top: 2.5rem; max-width: 36rem; font-size: 1.25rem; line-height: 1.55; }
.hero-text p { margin: 0 0 0.75rem; }
.hero-text .small { font-size: 1rem; color: var(--muted); }

/* ---------- games shelf ---------- */
.section { padding: 3rem 0 4rem; }
.section h2, .page h1, .page h2, .page h3 { font-family: "Fredoka", sans-serif; font-weight: 600; line-height: 1.15; letter-spacing: -0.005em; }
.section h2 { font-size: 2rem; margin: 0 0 1.5rem; }
.shelf { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 1.4rem; border: 2px solid var(--line); }
.game { display: grid; grid-template-columns: 4rem 1fr auto; gap: 0.25rem 1.25rem; align-items: center; padding: 1.4rem 1.5rem; border-top: 2px solid var(--line); }
.game:first-child { border-top: 0; }
.game-glyph { width: 3.6rem; height: 3.6rem; border-radius: 0.9rem; display: grid; place-items: center; grid-row: span 2; }
.game-glyph svg { width: 2.2rem; height: 2.2rem; }
.g-sky { background: var(--sky); box-shadow: 0 5px 0 var(--sky-deep); }
.g-sun { background: var(--sun); box-shadow: 0 5px 0 var(--sun-deep); }
.g-leaf { background: var(--leaf); box-shadow: 0 5px 0 var(--leaf-deep); }
.g-berry { background: var(--berry); box-shadow: 0 5px 0 var(--berry-deep); }
.g-ink { background: #2b3160; box-shadow: 0 5px 0 #151938; }
.game h3 { margin: 0; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.game p { margin: 0; color: var(--muted); grid-column: 2; }
.status { grid-row: 1 / span 2; grid-column: 3; font-weight: 700; font-size: 0.92rem; padding: 0.3rem 0.8rem; border-radius: 999px; border: 2px solid var(--line); white-space: nowrap; }
.status.beta { border-color: var(--leaf); color: var(--leaf); }
@media (max-width: 38rem) {
  .game { grid-template-columns: 3.6rem 1fr; padding: 1.2rem; }
  .status { grid-row: auto; grid-column: 2; justify-self: start; margin-top: 0.5rem; }
}

.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem 2.5rem; }
.help-grid h3 { margin: 0 0 0.35rem; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.2rem; }
.help-grid p { margin: 0; color: var(--muted); }

/* ---------- text pages ---------- */
.page { padding: 1.5rem 0 4rem; }
.page h1 { font-size: clamp(2.1rem, 6vw, 3rem); margin: 1rem 0 0.5rem; }
.page .lede { font-size: 1.2rem; color: var(--muted); margin: 0 0 2rem; }
.page h2 { font-size: 1.55rem; margin: 2.75rem 0 0.6rem; scroll-margin-top: 1rem; }
.page h3 { font-size: 1.2rem; margin: 1.75rem 0 0.4rem; }
.page p, .page li { max-width: 42rem; }
.page ul, .page ol { padding-left: 1.3rem; }
.page li { margin: 0.35rem 0; }
.page li::marker { color: var(--sky); }
.toc { background: var(--surface); border: 2px solid var(--line); border-radius: 1.1rem; padding: 1.1rem 1.4rem; max-width: 42rem; }
.toc h2 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.toc ol { margin: 0; columns: 2 14rem; column-gap: 2rem; }
.note { background: var(--surface); border-left: 6px solid var(--sun); border-radius: 0.6rem; padding: 1rem 1.25rem; max-width: 42rem; }
.note p { margin: 0.3rem 0; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 3rem; margin: 1rem 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -0.1rem; width: 2.1rem; height: 2.1rem; border-radius: 0.6rem;
  display: grid; place-items: center; background: var(--sky); color: #fff; font-family: "Fredoka", sans-serif; font-weight: 600; box-shadow: 0 3px 0 var(--sky-deep);
}
.mail-button {
  display: inline-block; margin: 0.5rem 0 1rem; padding: 0.8rem 1.4rem; border-radius: 0.9rem;
  background: var(--sky); color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 5px 0 var(--sky-deep);
}
.mail-button:hover { color: #fff; transform: translateY(2px); box-shadow: 0 3px 0 var(--sky-deep); }
.mail-button:active { transform: translateY(5px); box-shadow: none; }
details { background: var(--surface); border: 2px solid var(--line); border-radius: 1rem; padding: 0.9rem 1.2rem; margin: 0.8rem 0; max-width: 42rem; }
summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: 0.4rem; }
details p { margin: 0.5rem 0; }
.updated { color: var(--muted); }

/* ---------- footer ---------- */
.site-foot { padding: 2.5rem 0 3rem; border-top: 2px solid var(--line); color: var(--muted); font-size: 0.97rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.site-foot nav { display: flex; gap: 0.5rem 1.4rem; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
