/* Plingles site: the game's Letterpress palette (Assets/Crossgrid/UI/Resources/Crossgrid.uss in the game repo).
   Light roast is the paper theme, dark roast the dark one. Young Serif for titles and keys, Nunito for text,
   Atkinson Hyperlegible Mono for clues and tiles, as in the app. */
:root {
  --paper: #ece3d3;
  --paper-2: #e4d8c4;
  --ink: #2a2420;
  --muted: #6e6255;
  --line: #d3c4aa;
  --well: #e4d7bf;
  --tile: #fbf5e7;
  --tile-ink: #2a2420;
  --tile-edge: #b8a37c;
  --tile-solved: #23406a;
  --inline: #dfe7f2;
  --inline-edge: #9fb3cf;
  --clue-on: #d6e0ee;
  --blank: #34291f;
  --blank-stripe: #6a5640;
  --accent: #23406a;
  --accent-ink: #fbf5e7;
  --accent-edge: #142843;
  --accent-soft: rgba(35, 64, 106, 0.12);
  --mug: #23406a;
  --mug-rim: #142843;
  --mug-steam: #b8a37c;
  --mug-letter: #fbf5e7;
  --err: #b3261e;
  --ok: #3b6b47;
  --key: #f6eedd;
  --key-edge: #c9b893;
  --card: #f7efdf;
  --card-edge: #d6c5a5;
  --caramel: #b8946a;
  --count: #c0501f;
  --struck: #b4a593;
  --shadow: 0 1px 2px rgb(42 36 32 / 0.10), 0 10px 30px rgb(42 36 32 / 0.10);
  --serif: "Young Serif", Georgia, serif;
  --sans: "Nunito", "Segoe UI", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1d1915; --paper-2: #26201a; --ink: #efe5d2; --muted: #a6988a; --line: #3a3128; --well: #3a3027;
    --tile: #e8dcc3; --tile-ink: #231d18; --tile-edge: #7f6c4d; --tile-solved: #23406a;
    --inline: #c9d6ea; --inline-edge: #5f7fae; --clue-on: rgba(157, 187, 230, 0.28);
    --blank: #050403; --blank-stripe: #5a4a36;
    --accent: #9dbbe6; --accent-ink: #14202f; --accent-edge: #5f7fae; --accent-soft: rgba(157, 187, 230, 0.14);
    --mug-rim: #3a5f94; --mug-steam: #efe5d2; --mug-letter: #efe5d2;
    --err: #f07a68; --ok: #8cc79a; --key: #2c251e; --key-edge: #120f0c; --card: #27211b; --card-edge: #0f0c0a;
    --count: #f2894a; --struck: #6b5e51;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1d1915; --paper-2: #26201a; --ink: #efe5d2; --muted: #a6988a; --line: #3a3128; --well: #3a3027;
  --tile: #e8dcc3; --tile-ink: #231d18; --tile-edge: #7f6c4d; --tile-solved: #23406a;
  --inline: #c9d6ea; --inline-edge: #5f7fae; --clue-on: rgba(157, 187, 230, 0.28);
  --blank: #050403; --blank-stripe: #5a4a36;
  --accent: #9dbbe6; --accent-ink: #14202f; --accent-edge: #5f7fae; --accent-soft: rgba(157, 187, 230, 0.14);
  --mug-rim: #3a5f94; --mug-steam: #efe5d2; --mug-letter: #efe5d2;
  --err: #f07a68; --ok: #8cc79a; --key: #2c251e; --key-edge: #120f0c; --card: #27211b; --card-edge: #0f0c0a;
  --count: #f2894a; --struck: #6b5e51;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 600 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.005em; }
p { text-wrap: pretty; }
.wrap {
  max-width: 70rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 46rem; }
.muted { color: var(--muted); }
.eyebrow { font: 800 0.75rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem; z-index: 10; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }

/* The mug: inline SVG in the theme's mug colours. The steam rises and fades unless motion is reduced. */
.mug { display: inline-block; height: 1em; width: auto; overflow: visible; vertical-align: baseline; }
.mug .body, .mug .handle { fill: var(--mug); stroke: var(--mug); }
.mug .handle { fill: none; }
.mug .rim { fill: var(--mug-rim); }
.mug .letter { fill: var(--mug-letter); }
.mug .wisp { fill: none; stroke: var(--mug-steam); stroke-width: 9; stroke-linecap: round; }
@media (prefers-reduced-motion: no-preference) {
  .mug.steaming .wisp { animation: steam 2.8s ease-in-out infinite; transform-box: fill-box; }
  .mug.steaming .wisp:nth-of-type(2) { animation-delay: -0.93s; }
  .mug.steaming .wisp:nth-of-type(3) { animation-delay: -1.87s; }
}
@keyframes steam {
  0% { opacity: 0; transform: translateY(10px) scaleX(0.9); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-26px) scaleX(1.1); }
}

/* Header */
.site-head { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; padding-block: 0.7rem; }
.brand { display: inline-flex; align-items: flex-end; gap: 0.2rem; color: var(--ink); text-decoration: none; font: 400 1.85rem/1 var(--serif); }
.brand .mug { height: 1.15em; margin-bottom: 0.12em; }
.site-nav { display: flex; align-items: center; gap: 0.3rem 1.2rem; flex-wrap: wrap; justify-content: flex-end; font-weight: 700; font-size: 0.98rem; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
.theme-toggle { display: inline-flex; align-items: center; gap: 0.35rem; font: 700 0.85rem/1 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--card-edge); border-bottom-width: 3px; border-radius: 999px; padding: 0.42rem 0.75rem; cursor: pointer; white-space: nowrap; }
.theme-toggle:hover { border-color: var(--tile-edge); }
.theme-toggle svg { width: 1rem; height: 1rem; }
@media (max-width: 640px) {
  .site-head .wrap { flex-wrap: wrap; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0.3rem 0.9rem; font-size: 0.92rem; }
  .site-nav .wide { display: none; }
  .theme-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .theme-toggle { padding: 0.45rem 0.55rem; }
}

/* Buttons and store badges */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.9rem; padding: 0.65rem 1.25rem; border-radius: 999px; font: 800 1rem/1 var(--sans); text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--card-edge); border-bottom-width: 3px; cursor: pointer; }
.btn:hover { border-color: var(--tile-edge); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); }
.btn.primary:hover { filter: brightness(1.08); }
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.store { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1.1rem 0.6rem 0.9rem; border-radius: 0.9rem; background: var(--ink); color: var(--paper); text-decoration: none; min-width: 11.5rem; }
.store svg { width: 1.6rem; height: 1.6rem; flex: none; fill: currentColor; }
.store span { display: flex; flex-direction: column; line-height: 1.1; }
.store small { font-size: 0.7rem; font-weight: 700; opacity: 0.8; letter-spacing: 0.02em; }
.store b { font-size: 1.08rem; font-weight: 800; }
.store[aria-disabled="true"] { cursor: default; }
.soon { font-size: 0.9rem; color: var(--muted); margin: 0.75rem 0 0; }

/* Sections */
section.block { padding-block: 4.5rem 0; }
.block-head { max-width: 40rem; margin-bottom: 2.25rem; }
.block-head h2 { font-size: clamp(2rem, 4.4vw, 3rem); }
.block-head p { color: var(--muted); margin: 0.85rem 0 0; font-size: 1.12rem; }
.card { background: var(--card); border: 1px solid var(--card-edge); border-bottom-width: 4px; border-radius: 1.25rem; padding: 1.5rem; }

/* Letter tiles, used on every page */
.tiles { display: inline-flex; gap: 0.18em; font: 700 1em/1 var(--mono); }
.tile { display: inline-grid; place-items: center; width: 1.55em; height: 1.55em; border-radius: 0.22em; background: var(--tile); color: var(--tile-ink); border-bottom: 0.12em solid var(--tile-edge); box-shadow: 0 0 0 1px color-mix(in srgb, var(--tile-edge) 45%, transparent); }
.tile.dot { background: repeating-linear-gradient(135deg, var(--blank) 0 0.16em, var(--blank-stripe) 0.16em 0.24em); border-bottom-color: #000; box-shadow: none; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 5.5rem; color: var(--muted); font-size: 0.93rem; }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px)); }
.site-foot nav { display: flex; gap: 0.5rem 1.25rem; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.site-foot .studio { display: inline-flex; align-items: center; gap: 0.5rem; }

/* Long-form pages (how to play, FAQ, privacy, press) */
.page-head { padding-block: 3.5rem 1rem; }
.page-head h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); }
.page-head p { font-size: 1.15rem; color: var(--muted); margin: 1rem 0 0; max-width: 40rem; }
.prose h2 { font-size: clamp(1.55rem, 3.4vw, 2.05rem); margin: 3rem 0 0.9rem; }
.prose h3 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }
.prose p, .prose li { max-width: 42rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-block: 0.35rem; }
.prose li::marker { color: var(--muted); }
.prose code { font: 700 0.92em var(--mono); background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 0.3em; }
.note { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 0.75rem 0.75rem 0; padding: 0.9rem 1.1rem; margin: 1.5rem 0; max-width: 42rem; }
.note p { margin: 0; }
