/* Strawberry Guava Labs - shared stylesheet.
   Theme: bare :root is light; a dark browser re-defines the tokens unless light
   was chosen explicitly; [data-theme="dark"] wins on a light browser. Same
   three-state shape on purpose: a colour defined only inside the media query
   would never apply in the un-stamped "system" state. */
:root {
  --bg: #fbfaf7; --surface: #f2f0ea; --ink: #2b302f; --ink-muted: #5f6866; --ink-faint: #8b9391;
  --link: #3a5a54; --accent: #3f5b56; --accent-ink: #ffffff; --berry: #b3626c;
  --rule: #dcd9d0; --chip: #ebe8e0; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17191a; --surface: #202324; --ink: #e5e8e6; --ink-muted: #a4aca9; --ink-faint: #7d8582;
    --link: #8dc3b6; --accent: #7fb3a5; --accent-ink: #12201c; --berry: #d58f98;
    --rule: #333837; --chip: #272b2b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17191a; --surface: #202324; --ink: #e5e8e6; --ink-muted: #a4aca9; --ink-faint: #7d8582;
  --link: #8dc3b6; --accent: #7fb3a5; --accent-ink: #12201c; --berry: #d58f98;
  --rule: #333837; --chip: #272b2b; color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.65; color: var(--ink); background: var(--bg);
  max-width: 980px; margin: 0 auto; padding: 20px;
}
a { color: var(--link); }
p { margin-bottom: 15px; }
h1 { font-size: 2.4rem; line-height: 1.2; margin-bottom: 16px; }
h2 { font-size: 1.6rem; line-height: 1.25; margin-bottom: 14px; }
h3 { font-size: 1.2rem; margin-bottom: 8px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; background: var(--surface); padding: 8px 12px; z-index: 9; }

/* Header */
header.site { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-bottom: 18px; margin-bottom: 40px; border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; }
header.site nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
header.site nav a { color: var(--ink-muted); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--ink); }
header.site nav a[aria-current="page"] { border-bottom: 2px solid var(--berry); }
.theme-toggle { width: 34px; height: 34px; font: inherit; font-size: 1rem; color: var(--ink-muted); background: var(--chip); border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; }
.theme-toggle:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Hero */
.hero { padding: 36px 0 28px; max-width: 720px; }
.hero p.lead { font-size: 1.2rem; color: var(--ink-muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--berry); font-weight: 700; margin-bottom: 10px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; margin-right: 10px; margin-top: 6px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn:hover { filter: brightness(1.08); }

/* Sections and cards */
section.block { margin: 48px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; }
.card p { color: var(--ink-muted); flex: 1; }
.card .tag { align-self: flex-start; font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink-muted); margin-bottom: 12px; }
.card a.more { font-weight: 600; text-decoration: none; }
.card a.more:hover { text-decoration: underline; }
.thumb { height: 120px; border-radius: 8px; margin-bottom: 14px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: 800; }
.thumb.t2048 { background: #edc22e; color: #f9f6f2; }
.thumb.tunjam { background: #c8b18d; color: #8b3a3a; }

/* Prose pages */
.prose { max-width: 680px; }
.prose h2 { margin-top: 34px; }
.prose ul { margin: 0 0 15px 22px; }
.prose li { margin-bottom: 6px; }
.note { background: var(--surface); border-left: 3px solid var(--berry); padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 20px 0; }

/* Footer */
footer.site { margin-top: 70px; padding-top: 22px; border-top: 1px solid var(--rule); color: var(--ink-muted); font-size: .9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
footer.site a { color: var(--ink-muted); }
footer.site nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* Games: back button (same markup and shape in every game) */
.game-back { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 5px 10px 5px 8px; border-radius: 8px; font: inherit; font-size: .8rem; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; color: var(--game-back-ink, var(--ink-muted)); background: var(--game-back-bg, transparent); border: 1px solid var(--game-back-edge, transparent); }
.game-back:hover { color: var(--game-back-ink-hover, var(--ink)); background: var(--game-back-bg-hover, var(--chip)); }
.game-back .game-back-arrow { font-size: 1.05em; line-height: 1; }

@media (max-width: 600px) {
  body { padding: 15px; }
  h1 { font-size: 1.9rem; }
  header.site { margin-bottom: 24px; }
  header.site nav { gap: 14px; }
}
