/* Daily-puzzle website design tokens, v0.2 "Pond" (28 Nov 2026). Rules: DESIGN.md.
   Three layers: primitive (raw values) -> semantic (what a value is for) -> context (ground or paper).
   Parts read semantic and context tokens only. Day, night and large print swap tokens; the layout never changes. */

/* ---------- 1. Primitive ---------- */
:root {
  /* water */
  --tide-900: #0b3a43; --tide-800: #124b56; --tide-700: #1c6370; --tide-500: #3d8a85; --tide-200: #bfe3df; --tide-100: #d2e4e2; --tide-50: #f0f7f6;
  /* moss */
  --moss-950: #0f251f; --moss-900: #16332c; --moss-700: #2c5245; --moss-600: #34693f; --moss-500: #4e8a5c; --moss-300: #bcd9b3; --moss-200: #cfe3c8; --moss-100: #c3d2c6; --moss-50: #e8eee6;
  /* paper and ink */
  --paper-day: #fbf8ef; --paper-day-soft: #f1ede0; --paper-day-rule: #ddd8c8;
  --paper-night: #d6cdb4; --paper-night-soft: #c9bfa4; --paper-night-rule: #ada388; /* dimmed 28 Nov: lit, not glaring */
  --ink-day: #10272b; --ink-night: #14251f; --ink-soft: #46585a; --ink-edge: #6b7c7d; --ink-soft-night: #34443f; --ink-edge-night: #52625c;
  /* ember: the one warm colour */
  --koi-400: #ff9466; --koi-700: #b8431b; --koi-950: #2a1206;
  --apricot-300: #ffb27a; --apricot-700: #8f4312; --apricot-950: #33190a;
  --red-700: #a8321f; --red-800: #8a2314;

  --size-14: .875rem; --size-16: 1rem; --size-17: 1.0625rem; --size-18: 1.125rem; --size-21: 1.3125rem;
  --size-24: 1.5rem; --size-28: 1.75rem; --size-36: 2.25rem; --size-60: 3.75rem;

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-14: 3.5rem; --space-20: 5rem;

  --ms-fast: 120ms; --ms-base: 200ms; --ms-slow: 360ms; --ms-draw: 480ms; --ms-ring: 1400ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1); /* arrives fast, settles slowly, like something coming to rest on water */
}

/* ---------- 2. Semantic: day ("Tide") ---------- */
:root {
  color-scheme: light;
  --ground: var(--tide-700); --on-ground: var(--tide-50); --on-ground-soft: var(--tide-100); --ground-line: var(--tide-500);
  --pebble: var(--tide-800); --ground-deep: var(--tide-900);
  --paper: var(--paper-day); --paper-soft: var(--paper-day-soft); --paper-rule: var(--paper-day-rule);
  --ink: var(--ink-day); --ink-quiet: var(--ink-soft); --paper-edge: var(--ink-edge);
  --ember: var(--koi-400); --on-ember: var(--koi-950); --ember-edge: var(--koi-700);
  --found: var(--tide-200); --found-edge: var(--tide-500);
  --danger: var(--red-700);
  --sheet-shadow: 0 1px 0 rgb(0 0 0 / .08);

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-text: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;

  --t-cap: var(--size-14); --t-ui: var(--size-16); --t-btn: var(--size-17); --t-body: var(--size-18); --t-lead: var(--size-21);
  --t-h3: var(--size-24); --t-h3b: var(--size-28); --t-h2: var(--size-36); --t-h1: var(--size-60);
  --glyph: .58; /* puzzle letter size as a share of its cell */

  --radius-pill: 999px; --radius-sheet: 24px; --radius-box: 12px;
  --radius-pebble: 40px 46px 42px 48px / 46px 40px 48px 42px; /* slightly uneven, like a stone */
  --line: 2px; --target: 3rem; --gutter: var(--space-5); --measure: 66ch;
}

/* night ("Moss"): follows the device unless the player chose day */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: var(--moss-900); --on-ground: var(--moss-50); --on-ground-soft: var(--moss-100); --ground-line: var(--moss-700);
    --pebble: var(--moss-950); --ground-deep: var(--moss-950);
    --paper: var(--paper-night); --paper-soft: var(--paper-night-soft); --paper-rule: var(--paper-night-rule);
    --ink: var(--ink-night); --ink-quiet: var(--ink-soft-night); --paper-edge: var(--ink-edge-night); --danger: var(--red-800);
    --ember: var(--apricot-300); --on-ember: var(--apricot-950); --ember-edge: var(--apricot-700);
    --found: var(--moss-300); --found-edge: var(--moss-600);
    --sheet-shadow: 0 16px 44px rgb(0 0 0 / .42);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: var(--moss-900); --on-ground: var(--moss-50); --on-ground-soft: var(--moss-100); --ground-line: var(--moss-700);
  --pebble: var(--moss-950); --ground-deep: var(--moss-950);
  --paper: var(--paper-night); --paper-soft: var(--paper-night-soft); --paper-rule: var(--paper-night-rule);
  --ink: var(--ink-night); --ink-quiet: var(--ink-soft-night); --paper-edge: var(--ink-edge-night); --danger: var(--red-800);
  --ember: var(--apricot-300); --on-ember: var(--apricot-950); --ember-edge: var(--apricot-700);
  --found: var(--moss-300); --found-edge: var(--moss-600);
  --sheet-shadow: 0 16px 44px rgb(0 0 0 / .42);
}

/* large print: text and puzzle letters grow, nothing else moves */
:root[data-size="large"] { --t-cap: var(--size-16); --t-ui: var(--size-18); --t-btn: 1.1875rem; --t-body: var(--size-21); --t-lead: var(--size-24); --glyph: .66; }
/* phones, upright or sideways: no text under 16px */
@media (max-width: 47.99rem), (max-height: 31.24rem) {
  :root { --t-cap: var(--size-16); --t-h1: 2.5rem; --t-h2: var(--size-28); --gutter: var(--space-4); }
  :root[data-size="large"] { --t-cap: var(--size-18); }
}
@media (min-width: 62rem) { :root { --radius-sheet: 32px; } }

/* ---------- 3. Context: what the nearest surface is ---------- */
/* on the ground (the page itself) */
:root { --bg: var(--ground); --fg: var(--on-ground); --fg-quiet: var(--on-ground-soft); --rule: var(--ground-line); --edge: var(--on-ground-soft); --btn-edge: var(--ember); --quiet-fill: var(--pebble); }
/* on paper: anything read at length, and every puzzle */
.paper { --bg: var(--paper); --fg: var(--ink); --fg-quiet: var(--ink-quiet); --rule: var(--paper-rule); --edge: var(--paper-edge); --btn-edge: var(--ember-edge); --quiet-fill: var(--paper-soft); }
@media (prefers-contrast: more) { :root, .paper { --fg-quiet: var(--fg); --rule: var(--edge); } }

/* Daily-puzzle website components, v0.2 "Pond". Plain CSS on tokens.css. Rules: DESIGN.md.
   Every part reads --bg, --fg, --fg-quiet, --rule, --edge from where it sits (the ground, or a .paper). */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; scrollbar-color: var(--ground-line) var(--ground-deep); }
body { margin: 0; background: var(--ground); color: var(--fg); font: 400 var(--t-ui)/1.5 var(--font-text); overflow-wrap: break-word; caret-color: var(--ember); }
::selection { background: var(--ember); color: var(--on-ember); }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .22em; transition: text-decoration-thickness var(--ms-fast); }
a:hover { text-decoration-thickness: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; } /* a press shows in the button's own shape (:active), never the browser's square */
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }
svg.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- type roles ---------- */
.display, .h2, .h3 { font-family: var(--font-display); font-variation-settings: "SOFT" 100; font-weight: 600; letter-spacing: -.012em; text-wrap: balance; }
.display { font-size: var(--t-h1); line-height: 1.03; }
.display i { font-weight: 400; } /* the soft half of the home headline, and nowhere else */
.h2 { font-size: var(--t-h2); line-height: 1.08; }
.h3 { font-size: var(--t-h3b); line-height: 1.15; }
.h4 { font: 700 var(--t-lead)/1.25 var(--font-text); }
.lead { font-size: var(--t-lead); line-height: 1.45; max-width: 34ch; }
.body { font-size: var(--t-body); line-height: 1.6; max-width: var(--measure); }
.cap { font-size: var(--t-cap); color: var(--fg-quiet); }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* paper: the lit sheet. Flat by day; by night it glows. */
.paper { background: var(--bg); color: var(--fg); border-radius: var(--radius-sheet); box-shadow: var(--sheet-shadow); }
.paper ::selection { background: var(--found); color: var(--ink); }
.sheet { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); }
@media (min-width: 48rem) { .sheet { padding: var(--space-8); } }

/* ---------- the name ---------- */
.wordmark { display: inline-flex; align-items: center; gap: .45em; min-height: 2.75rem; font: 600 var(--size-24)/1 var(--font-display); font-variation-settings: "SOFT" 100; letter-spacing: -.01em; text-decoration: none; }
.wordmark::before { content: ""; width: .62em; height: .5em; border-radius: var(--radius-pebble); background: var(--ember); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; min-height: var(--target); align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-2) var(--space-6); border: var(--line) solid var(--btn-edge); border-radius: var(--radius-pill); background: var(--ember); color: var(--on-ember); font: 700 var(--t-btn)/1.2 var(--font-text); text-decoration: none; transition: transform var(--ms-base) var(--ease-out), box-shadow var(--ms-base) var(--ease-out); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgb(0 0 0 / .22); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition-duration: var(--ms-fast); }
.btn svg.i { transition: transform var(--ms-base) var(--ease-out); }
.btn:hover svg.i.go { transform: translateX(3px); }
.btn-plain { border-color: var(--fg); background: transparent; color: var(--fg); }
.btn-danger { border-color: var(--danger); background: transparent; color: var(--danger); }
.btn[disabled], .btn[aria-disabled="true"] { border-color: var(--rule); background: var(--quiet-fill); color: var(--fg-quiet); box-shadow: none; transform: none; cursor: not-allowed; }
.btn-wide { width: 100%; }

/* puzzle toolbar button: icon with its word; pressed = filled */
.tool { display: inline-flex; min-height: var(--target); flex: none; align-items: center; justify-content: center; gap: var(--space-2); padding: 0 var(--space-4); border: var(--line) solid var(--edge); border-radius: var(--radius-pill); color: var(--fg); font: 600 var(--t-ui)/1.2 var(--font-text); transition: border-color var(--ms-base), background var(--ms-base), color var(--ms-base); }
/* hover only for a real pointer: after a touch, :hover stays on the last thing pressed */
@media (hover: hover) and (pointer: fine) { .tool:hover { border-color: var(--fg); background: var(--quiet-fill); } }
.tool:active { border-color: var(--fg); background: var(--quiet-fill); }
.tool svg.i { transition: transform var(--ms-fast); }
.tool:active svg.i { transform: scale(.86); }
.tool[aria-pressed="true"] { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.toolbar { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-1); margin: calc(-1 * var(--space-1)); scrollbar-width: thin; }

/* pebble tabs: which of today's puzzles the sheet shows */
.pebbles { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pebble { display: inline-flex; min-height: var(--target); align-items: center; gap: var(--space-2); padding: 0 var(--space-5); border-radius: var(--radius-pebble); background: var(--pebble); color: var(--on-ground); font: 600 var(--t-ui)/1.2 var(--font-text); text-decoration: none; transition: transform var(--ms-base) var(--ease-out), background var(--ms-base), color var(--ms-base); }
.pebble:hover { transform: translateY(-2px); }
.pebble:active { transform: scale(.96); }
.pebble[aria-selected="true"], .pebble[aria-current="true"] { background: var(--paper); color: var(--ink); }

/* ---------- difficulty and state: shape, never colour alone ---------- */
.bars { display: inline-flex; align-items: flex-end; gap: .16em; height: .9em; flex: none; }
.bars i { width: .3em; border: 1.5px solid currentColor; border-radius: 2px; }
.bars i:nth-child(1) { height: 42%; } .bars i:nth-child(2) { height: 71%; } .bars i:nth-child(3) { height: 100%; }
.bars[data-n="1"] i:nth-child(-n+1), .bars[data-n="2"] i:nth-child(-n+2), .bars[data-n="3"] i { background: currentColor; }
.level { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; line-height: 1.2; }

.state { display: inline-flex; width: 1.125rem; height: 1.125rem; flex: none; align-items: center; justify-content: center; border: 2px solid currentColor; border-radius: 50%; }
.state[data-s="progress"] { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.state[data-s="done"] { background: currentColor; }
.state[data-s="later"] { border-style: dashed; } /* a day still to come */
.state svg { display: none; width: .75rem; height: .75rem; fill: none; stroke: var(--bg); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.state[data-s="done"] svg { display: block; }

.meter { height: 10px; border-radius: 10px; background: var(--rule); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 10px; background: var(--fg); transform-origin: left; transition: transform var(--ms-slow) var(--ease-out); }

/* ---------- word search grid (always on paper) ---------- */
.wsgrid { position: relative; container-type: inline-size; width: 100%; aspect-ratio: 1; user-select: none; -webkit-user-select: none; }
.wsgrid svg.bands { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wsgrid line { stroke-linecap: round; }
.wsgrid line.edge { stroke-width: .76; stroke: var(--found-edge); }   /* the thin darker outline: a band is never fill alone */
.wsgrid line.fill { stroke-width: .66; stroke: var(--found); } /* a diagonal's neighbours are .71 of a cell away: wider than this and the band runs into their letters (owner, on a phone, 29 Nov) */
.wsgrid g.live line.edge { stroke: var(--ember-edge); }
.wsgrid g.live line.fill { stroke: var(--ember); }
.wsgrid .cells { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(var(--n), 1fr); }
.wsgrid .r { display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.wsgrid .c { position: relative; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--ink); font: 700 calc(100cqw / var(--n) * var(--glyph))/1 var(--font-text); transition: background var(--ms-fast); }
@media (hover: hover) and (pointer: fine) { .wsgrid .c:hover { background: var(--paper-soft); } }
.wsgrid .c.on, .wsgrid .c.live { background: none; }
.wsgrid .c:focus-visible { outline-color: var(--ink); outline-offset: -3px; z-index: 1; }

/* word chips: found = tint, outline and a line through */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { position: relative; display: inline-flex; min-height: 2.25rem; align-items: center; padding: 0 var(--space-3); border: 1.5px solid var(--edge); border-radius: var(--radius-pill); color: var(--fg); font: 600 var(--t-ui)/1 var(--font-text); letter-spacing: .03em; transition: background var(--ms-slow), border-color var(--ms-slow); }
.chip::after { content: ""; position: absolute; left: .6em; right: .6em; top: calc(50% - 1px); height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform var(--ms-slow) var(--ease-out); }
.chip.found { border-color: var(--found-edge); background: var(--found); color: var(--ink); }
.chip.found::after { transform: scaleX(1); }

/* ---------- letter boxes (scramble, missing vowels) ---------- */
.boxes { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.box { display: flex; width: var(--bx, 2.75rem); height: var(--bx, 2.75rem); flex: none; align-items: center; justify-content: center; border: var(--line) solid transparent; border-radius: var(--radius-box); font: 700 calc(var(--bx, 2.75rem) * .5)/1 var(--font-text); color: var(--ink); }
.box.given { background: var(--paper-soft); border-color: var(--paper-rule); }
.box.typed { border-color: var(--ink); }
.box.blank { border: var(--line) dashed var(--paper-edge); }
.box.now { border: 3px solid var(--ink); background: var(--found); }
.box.vowel { background: var(--found); border-color: var(--found-edge); }
.box.tile { border-color: var(--found-edge); background: var(--found); transition: transform var(--ms-base) var(--ease-out), box-shadow var(--ms-base) var(--ease-out); }
.box.tile:hover { transform: translateY(-3px); box-shadow: 0 5px 10px rgb(0 0 0 / .16); }
.box.tile:active { transform: scale(.94); box-shadow: none; }

/* ---------- switch ---------- */
.switch-row { display: flex; min-height: var(--target); align-items: center; justify-content: space-between; gap: var(--space-4); font-size: var(--t-body); cursor: pointer; }
.switch { position: relative; width: 3.5rem; height: 2rem; flex: none; border: var(--line) solid var(--fg); border-radius: 1rem; transition: background var(--ms-base); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--fg); transition: transform var(--ms-base) var(--ease-out), background var(--ms-base); }
input:checked + .switch { background: var(--fg); }
input:checked + .switch::after { background: var(--bg); transform: translateX(1.5rem); }
input:focus-visible + .switch { outline: 3px solid var(--fg); outline-offset: 3px; }

/* ---------- small parts ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-2); text-align: center; font-size: var(--t-cap); }
.week li { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); }
.countdown { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--fg-quiet); }
.toast { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target); padding: 0 var(--space-5); border-radius: var(--radius-pill); background: var(--fg); color: var(--bg); font-weight: 600; }
.ad { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 100%; border: var(--line) dashed var(--rule); border-radius: var(--radius-box); color: var(--fg-quiet); font-size: var(--t-cap); text-align: center; }
.sharetext { margin: 0; padding: var(--space-4); border-radius: var(--radius-box); background: var(--paper-soft); color: var(--ink); font: 400 var(--t-ui)/1.5 var(--font-text); white-space: pre-wrap; }
.saying { font: 700 var(--t-h3)/1.3 var(--font-text); letter-spacing: .1em; }
.rule { height: 1px; border: 0; margin: 0; background: var(--rule); }

/* ---------- the one load sequence: the sheet comes to rest on the water ---------- */
.ringbox { position: relative; }
[data-play] { overflow-x: clip; } /* the ring spreads wider than a phone */
.ring { position: absolute; inset: 8% 4%; border: 2px solid var(--on-ground); border-radius: 50%; opacity: 0; pointer-events: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes land { from { opacity: 0; transform: translateY(34px) scale(.97); } }
@keyframes ring { 0% { opacity: .5; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes letter { from { opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 1; opacity: 0; } 12% { opacity: 1; } }
@keyframes strike { from { transform: scaleX(0); } }
[data-play] .in { animation: rise var(--ms-draw) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }
[data-play] .land { animation: land 700ms var(--ease-out) both; animation-delay: 240ms; }
[data-play] .ring { animation: ring var(--ms-ring) var(--ease-out) both; animation-delay: 620ms; }
[data-play] .wsgrid .c { animation: letter 300ms ease-out both; animation-delay: calc(520ms + var(--d, 0) * 20ms); }
[data-play] .wsgrid line { stroke-dasharray: 1; animation: draw var(--ms-draw) var(--ease-out) both; animation-delay: calc(1150ms + var(--k, 0) * 300ms); }
[data-play] .chip.found::after { animation: strike var(--ms-slow) var(--ease-out) both; animation-delay: calc(1450ms + var(--k, 0) * 300ms); }

/* less motion: by the device, or the player's own switch in Settings */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
:root[data-motion="less"] *, :root[data-motion="less"] *::before, :root[data-motion="less"] *::after { animation: none !important; transition: none !important; }

/* The website's own page styles, on top of the design system (tokens.css, components.css, v0.2 "Pond"). */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/atkinson-hyperlegible-next.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

.skip { position: absolute; left: var(--space-3); top: -5rem; z-index: 5; padding: var(--space-3) var(--space-5); border-radius: var(--radius-pill); background: var(--paper); color: var(--ink); font-weight: 700; }
.skip:focus { top: var(--space-3); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-5); padding-block: var(--space-3); }
/* the alpha's mark (owner, 2 Dec; sketches 108 and 111): a ring beside the site's name, the same on every page. It opens a
   small box with the alpha's words, which is the browser's own pop-up part and needs no script. A browser with no such
   part shows the words as a plain note in the footer, and neither the mark nor Close: nothing is dead, nothing stuck open */
.top .about { flex: none; place-items: center; width: 2.75rem; height: 2.75rem; margin: 0 auto 0 calc(-1 * var(--space-5)); padding: 0; border: 0; border-radius: 50%; background: none; color: var(--fg); cursor: pointer; }
.top .about span { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: var(--line) solid var(--edge); border-radius: 50%; transition: border-color var(--ms-base), background var(--ms-base); }
.top .about svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .top .about:hover span { border-color: var(--fg); background: var(--quiet-fill); } }
.top .about:active span { border-color: var(--fg); background: var(--quiet-fill); }
@media (max-width: 22.49rem) { .top:has(.about) .wordmark { font-size: 1.25rem; } } /* 320 wide: the name a little smaller, so name, mark and night button keep one row */
#about { max-width: 22rem; padding: var(--space-5); }
#about .body { margin-top: var(--space-2); text-wrap: pretty; }
.top .about, #about .btn { display: none; }
@supports selector(:popover-open) {
  .top .about { display: inline-grid; }
  #about { position: fixed; inset: 4.5rem var(--space-4) auto; width: auto; margin: 0 auto; border: 0; box-shadow: 0 16px 44px rgb(0 0 0 / .4); }
  #about:popover-open { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
  #about .body { margin-top: 0; }
  #about::backdrop { background: rgb(0 0 0 / .4); }
  #about .btn { display: inline-flex; }
}
.top nav, .foot nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.top nav a, .foot a, .days a { display: inline-flex; min-height: 2.75rem; align-items: center; }
/* the header's round buttons: night colours now; full screen and "?" join it (design section 16). The night button shows the
   moon by day and the sun by night and is never filled: at night a filled disc would be the brightest thing on the page */
.top .icons { display: flex; gap: var(--space-2); min-height: var(--target); margin: -2px 0 -2px auto; } /* 48px buttons in the 44px row: the header is no taller */
.top nav { margin-left: auto; } .top nav + .icons { margin-left: 0; } /* the links stay beside the buttons, at the right */
@media (max-width: 47.99rem) { .top nav { order: 1; flex-basis: 100%; } } /* phone: the round buttons keep the top right on every page; day links go under them */
.tool.icon { width: var(--target); padding: 0; }
#night[aria-pressed="true"] { border-color: var(--edge); background: none; color: var(--fg); }
#night[aria-pressed="true"]:active { border-color: var(--fg); background: var(--quiet-fill); }
@media (hover: hover) and (pointer: fine) { #night[aria-pressed="true"]:hover { border-color: var(--fg); background: var(--quiet-fill); } }
#night .sun, :root[data-theme="dark"] #night .moon { display: none; }
:root[data-theme="dark"] #night .sun { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #night .moon { display: none; } :root:not([data-theme="light"]) #night .sun { display: block; } }
main .wrap { display: flex; flex-direction: column; gap: var(--space-6); padding-block: var(--space-4) var(--space-14); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); font-size: var(--t-body); }
#full .shrink, #full[aria-pressed="true"] .grow { display: none; }
#full[aria-pressed="true"] .shrink { display: block; }

/* the puzzle page (design section 19, sketch 118; owner, 2 Dec): the sheet is one frame, the same for every kind of puzzle.
   Four places: the top bar (the way back, the title with its kind and level, every button), the board, what there is to
   find under it (the result once solved), and the kind's own place at the bottom (a word search has none). Where the
   browser can (the @supports below), the site's header and the frame share the first screen exactly, and nothing in the
   frame scrolls as a page; How to play and the footer come after. Elsewhere the sheet is an ordinary page */
.play { position: relative; display: flex; flex-direction: column; margin-inline: calc(-1 * var(--space-2)); }
.play > * { min-width: 0; }
.fbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--rule); }
.fback { margin-left: calc(-1 * var(--space-1)); border-color: transparent; }
.ftitle { flex: 1; min-width: 0; }
.ftitle h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font: 600 1.25rem/1.15 var(--font-display); font-variation-settings: "SOFT" 100; letter-spacing: -.012em; }
.ftitle .meta { flex-wrap: nowrap; gap: var(--space-2); margin-top: 2px; font-size: var(--t-cap); color: var(--fg-quiet); white-space: nowrap; }
.fbtns { flex: none; display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
/* the rarer buttons are one group: a row here, and on a phone or tablet the same group is the menu "more" opens (below).
   These undo the browser's own pop-up look, so where it has none, or the menu is not used, the group is a plain row */
#more { position: static; inset: auto; display: flex; gap: var(--space-2); width: auto; height: auto; margin: 0; padding: 0; overflow: visible; border: 0; background: none; color: inherit; }
.fmore, .w { display: none; } /* .w: a button's words, shown only in the menu */
svg.i.dots { stroke-width: 3.6; }
@supports selector(:popover-open) {
  @media (max-width: 61.99rem), (max-height: 31.24rem) {
    .fmore { display: inline-flex; }
    #more:not(:popover-open) { display: none; }
    /* it opens under its button (play.js sets its top; this is where it opens without the script) */
    #more:popover-open { position: fixed; inset: 4rem var(--space-3) auto auto; flex-direction: column; gap: 0; min-width: 15rem; padding: var(--space-2);
      border: var(--line) solid var(--paper-edge); border-radius: var(--radius-box); background: var(--paper); color: var(--ink); box-shadow: 0 14px 28px rgb(0 0 0 / .28); }
    #more::backdrop { background: rgb(0 0 0 / .18); }
    /* each choice named in words beside its icon; a choice that is on is ticked */
    #more .tool, #more .tool[aria-pressed="true"] { width: auto; min-height: 3rem; justify-content: flex-start; gap: var(--space-3); padding: 0 var(--space-3); border: 0; border-radius: 8px; background: none; color: var(--fg); font: 600 var(--t-body)/1.2 var(--font-text); text-decoration: none; }
    #more .w { display: inline; }
    #more [aria-pressed="true"]::after { content: ""; width: .75em; height: .4em; margin: -.3em 0 0 auto; border: solid currentColor; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); }
    @media (hover: hover) and (pointer: fine) { #more .tool:hover { background: var(--quiet-fill); } }
    #more .tool:active { background: var(--quiet-fill); }
  }
}
/* the board, and the whole word list: first in the page for screen readers, over the board's foot on a narrow screen */
.stage { position: relative; margin: var(--space-2); }
.board { display: grid; place-items: start center; }
.wsframe { position: relative; width: 100%; max-width: 44rem; margin-inline: auto; }
.side { display: flex; flex-direction: column; gap: var(--space-3); }
.tally { display: flex; flex-direction: column; gap: var(--space-2); }
.tally p { font-size: var(--t-ui); color: var(--fg-quiet); }
/* under the board: what happened, then the next words to find with the count that opens the whole list */
.bar { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-3) var(--space-2); }
/* what happened is said to screen readers (#live, out of sight); the eye is shown only what it can't see for itself (design 19.7) */
.seen { font-size: var(--t-ui); line-height: 1.5; }
.seen:empty, .said:empty { display: none; }
.said { font-size: var(--t-ui); }
/* the words still to find and the count are one run of pills in rows 44px apart; play.js hides the words that don't fit (127) */
.peek { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 0 var(--space-2); overflow: hidden; }
#next { display: contents; }
.peek .chip, .peek .tool { flex: none; margin-block: .25rem; }
/* the count looks like a pill and is pressed like a button: its press area is the whole 44px row */
.peek .tool { position: relative; min-height: 2.25rem; border-color: transparent; background: var(--quiet-fill); }
.peek .tool::before { content: ""; position: absolute; inset: calc(-.25rem - 2px) -2px; }
/* the count and "Close" share one place, so opening the list moves nothing; the arrow says it opens upwards */
.peek .tool { display: grid; grid-template-columns: auto auto; align-items: center; padding: 0 var(--space-3); }
.peek .shut, .peek .open { grid-area: 1 / 1; text-align: center; }
.peek .open, .list-open .peek .shut { visibility: hidden; }
.list-open .peek .open { visibility: visible; }
.peek .tool::after { content: ""; width: .45em; height: .45em; margin-top: .25em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(225deg); }
.list-open .peek .tool::after { margin-top: -.25em; transform: rotate(45deg); }
.play .side { display: none; position: absolute; z-index: 5; inset: auto 0 0; max-height: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--paper-edge) transparent;
  padding: var(--space-4); border: var(--line) solid var(--paper-edge); border-radius: var(--radius-box); background: var(--paper); box-shadow: 0 -10px 28px rgb(0 0 0 / .28); }
.play.list-open .side { display: flex; }
.play .side .chip.found { order: 1; } /* words still to find come first */
.play.over .bar { flex: none; min-height: 0; }
.play.over .peek { display: none; } /* solved: nothing left to look for */
/* solved: the panel and the fact take the words' place, and the grid stays where it is */
.fresult { flex: none; display: flex; flex-direction: column; gap: var(--space-3); padding: 0 var(--space-2); }
.play .solved { gap: var(--space-2); padding: var(--space-4); }
.play .solved .h2 { font-size: var(--t-h3b); }
.play .fact { padding: var(--space-4); }
/* Restart asks first, in a box at the frame's foot */
.play .confirm { position: absolute; z-index: 6; inset: auto var(--space-2) var(--space-2); border: var(--line) solid var(--paper-edge); }
.wsgrid { touch-action: none; }
.wsgrid .c { cursor: pointer; }
/* the first letter is a filled dot; keyboard focus stays an ink ring, so the two are never confused */
.wsgrid .c.anchor { background: var(--ember); box-shadow: inset 0 0 0 2px var(--ember-edge); color: var(--on-ember); }
.wsgrid g.miss line.edge { stroke: var(--paper-edge); }
.wsgrid g.miss line.fill { stroke: var(--paper-soft); }
.wsgrid g.miss { animation: miss 900ms ease-out both; }
@keyframes miss { 0%, 45% { opacity: 1; } 100% { opacity: 0; } }
@media (hover: hover) and (pointer: fine) { .wsgrid.done .c:hover { background: none; } }
.wsgrid.done .c { color: var(--ink-quiet); cursor: default; }
.wsgrid.done .c.msg { color: var(--ink); font-weight: 800; }
/* bigger letters: cells of about 34px or more (owner, 29 Nov: so a phone shows about ten columns). Only when that is wider
   than its place does the grid sit in a box the player slides; there a finger marks a word by pressing both ends. On an
   ordinary page the box slides sideways only; in the frame (below) it slides both ways */
.wsframe.zoom { max-width: none; }
.wsbox.zoom .wsgrid { width: max(100%, calc(var(--n) * var(--cell, 2.125rem))); --glyph: .7; } /* play.js widens --cell a little so the box always ends on half a column */
.wsbox.slide { overflow-x: auto; border: var(--line) solid var(--paper-edge); border-radius: var(--radius-box); overscroll-behavior-x: contain; }
.wsbox.slide .wsgrid { touch-action: pan-x pan-y; }
/* when the first letter has slid out of the box, a copy of it waits at the nearest edge and points the way back */
.pin { position: absolute; z-index: 2; display: flex; width: 2rem; height: 2rem; margin: -1rem 0 0 -1rem; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--ember); box-shadow: inset 0 0 0 2px var(--ember-edge), 0 2px 6px rgb(0 0 0 / .3); color: var(--on-ember); font: 700 1rem/1 var(--font-text); pointer-events: none; }
.pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: .6rem; height: .6rem; margin: -.3rem; background: var(--ember-edge); transform: rotate(var(--a, 0rad)) translateX(1.2rem) rotate(45deg); }
.wsframe::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: var(--radius-box);
  box-shadow: inset 16px 0 14px -14px rgb(0 0 0 / calc(var(--fl, 0) * .5)), inset -16px 0 14px -14px rgb(0 0 0 / calc(var(--fr, 0) * .5)),
              inset 0 16px 14px -14px rgb(0 0 0 / calc(var(--ft, 0) * .5)), inset 0 -16px 14px -14px rgb(0 0 0 / calc(var(--fb, 0) * .5)); }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-box); background: var(--paper-soft); }
.solved { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); border: var(--line) solid var(--found-edge); border-radius: var(--radius-box); background: var(--found); color: var(--ink); }
.solved:focus-visible { outline-color: var(--ink); }
/* a fact, shown once solved: its own box, so any fact can sit in it (sketch 31, owner, 29 Nov) */
.fact { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5); border: var(--line) solid var(--paper-edge); border-radius: var(--radius-box); }
.fact .source { font-size: var(--t-ui); }
.after { padding-block: var(--space-6) var(--space-14); }
.how { max-width: 46rem; }
.how .body { max-width: 46ch; text-wrap: pretty; } /* ch is the zero's width, wider than most letters: about 70 a line */
.days { display: flex; flex-direction: column; }
/* a day: its state mark, then the title (the alpha's row: its kind under it); level and word count stand apart (owner, 29 Nov) */
.days li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 var(--space-3); padding-block: var(--space-2); border-top: 1px solid var(--rule); }
.days li:first-child { border-top: 0; }
/* the title's first line sits at one height whether or not it wraps, and the mark is pinned beside that line */
.days a { grid-column: 2; justify-self: start; align-items: flex-start; padding-block: calc((2.75rem - 1.25em) / 2); font: 700 var(--t-lead)/1.25 var(--font-text); }
.days .state { align-self: start; margin-top: calc((2.75rem - 1.125rem) / 2); }
.days .kind, .days .meta { grid-column: 2; }
.days .meta { display: grid; grid-template-columns: 6.75rem 5.25rem; gap: 0 var(--space-4); margin-top: var(--space-1); } /* two columns of fixed width at every size, so the counts line up on a phone too */
/* room for both: level and word count sit beside the title, each in a column of its own fixed width, so they line up down the page */
@media (min-width: 40rem) {
  .days li { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--space-4); }
  .days .meta { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
}
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-5); padding-block: var(--space-6) var(--space-10); border-top: 1px solid var(--rule); }
/* How it works: its own page. The key sets each day mark beside its meaning; no line of words under 16px or over 34rem */
.primer { max-width: 44rem; gap: var(--space-3); }
.primer .body, .primer .key { max-width: 34rem; }
.primer .key { font-size: var(--t-body); line-height: 1.4; display: grid; gap: var(--space-3); margin: 0 0 var(--space-2); padding: 0; list-style: none; }
.primer .key li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; }
.primer .key .state { margin-top: calc((1.4em - 1.125rem) / 2); }
.primer h2 { margin-top: var(--space-5); }
.primer h2:first-child { margin-top: 0; }
.primer .body { text-wrap: pretty; }
#when { white-space: nowrap; }
@media (max-width: 47.99rem) { .top .wk, .top nav:not(:has(a:not(.wk))) { display: none; } } /* phone: the site name and the footer already go there */
/* a phone, upright or on its side: 44px buttons in the bar */
@media (max-width: 47.99rem), (max-height: 31.24rem) { .fbar .tool.icon { width: 2.75rem; min-height: 2.75rem; } }
/* room for a bigger title, beside its kind and level */
@media (min-width: 48rem) and (min-height: 31.25rem) {
  .play { margin-inline: 0; }
  .fbar { padding: var(--space-2) var(--space-4); }
  .ftitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-4); }
  .ftitle h1 { font-size: var(--size-28); }
  .ftitle .meta { margin: 0; font-size: var(--t-body); }
  .stage { margin: var(--space-3); }
}
/* a phone on its side (owner, "lets go with 122"): before full screen too, the site's header is not shown, so the frame fills the screen
   and the night button joins "more" (play.js). The one shape where the header is not the same on every page */
@media (orientation: landscape) and (max-height: 31.24rem) {
  .first .top { display: none; }
  .first main .wrap { max-width: none; padding: 0; }
  .first .play { margin: 0; border-radius: 0; box-shadow: none; }
}
/* full screen (design sections 8, 16 and 19): the same frame, with the rest of the page gone and the sheet filling the screen */
.fs .top, .fs .after, .fs .foot, .fs .skip { display: none; }
.fs main .wrap { max-width: none; padding: 0; }
.fs .play { margin: 0; border-radius: 0; box-shadow: none; }

/* the frame fits the first screen: where the browser has the units for it (from 2023), and on screen only */
@supports (width: 1cqw) and (height: 1dvh) {
  @media screen {
    /* the header takes what it needs and the frame the rest, whatever the header holds; main is the box the board sizes against */
    .first { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 100dvh; }
    .first main { grid-row: 2; container-type: size; }
    .first main .wrap { height: 100%; padding-bottom: 0; }
    .first .play { flex: 1 1 0; min-height: 0; overflow: clip; }
    /* phone and tablet upright: bar, board, words in a column. The board is a square that fits the width and the height it is given */
    .stage { flex: 0 1 auto; aspect-ratio: 1; min-height: 8rem; }
    .board { height: 100%; container-type: size; }
    .play .wsframe { width: min(100cqw, 100cqh); max-width: none; margin: 0; }
    .play .wsframe.zoom { width: 100cqw; }
    .play .wsbox.zoom { max-height: 100cqh; }
    .play .wsbox.zoom .wsgrid { width: max(min(100%, 100cqh), calc(var(--n) * var(--cell, 2.125rem))); margin-inline: auto; }
    .play .wsbox.slide { overflow: auto; overscroll-behavior: contain; } /* every page is one screen now: the box slides both ways */
    /* Bigger letters: the board's place is as tall as the grid's rows (play.js puts the cell it works out on the sheet), so no row is cut */
    .play.zoomed .stage { aspect-ratio: auto; height: calc(var(--n) * var(--cell, 2.125rem) + 4px); }
    .play.over .stage { max-height: 52dvh; }
    .play .bar { flex: 1 1 0; min-height: 3.25rem; gap: 0; padding-top: var(--space-1); }
    .peek { flex: 0 1 auto; min-height: 0; }
    .seen { flex: none; } /* a message takes its room from the words: the last row steps aside while it shows (design 19.7) */
    /* solved: the panel scrolls in its own room, and fades at its foot when there is more */
    .play.over .fresult { flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: var(--space-8);
      -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--space-8)), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - var(--space-8)), transparent); }
    /* a phone on its side: the board takes the height at the left; the bar, the words and Solved are a column at the right */
    @media (orientation: landscape) and (max-height: 31.24rem) {
      .play { display: grid; grid-template-columns: 100cqh minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "stage fbar" "stage bar" "stage result"; }
      .play.over { grid-template-rows: auto auto minmax(0, 1fr); }
      .fbar { grid-area: fbar; }
      .stage, .play.zoomed .stage, .play.over .stage { grid-area: stage; aspect-ratio: auto; height: auto; max-height: none; }
      .board { place-items: center; }
      .play .bar { grid-area: bar; padding-top: var(--space-2); }
      .fresult { grid-area: result; }
    }
    /* a computer, or a tablet on its side: the bar across the top, the board at the left sized to the height, the whole list
       beside it, with Solved and the fact above the list. A hard grid on a small laptop (owner, "lets go with 120"): the frame
       grows rather than let a letter fall under 20px, and the page scrolls a little and settles with the frame's foot at the screen's */
    @media (min-width: 62rem) and (min-height: 31.25rem) {
      .first { grid-template-rows: auto minmax(calc(var(--n) * 2.2rem + 7.25rem), 1fr); }
      :root:has(.first) { scroll-snap-type: y proximity; }
      .first .top { scroll-snap-align: start; }
      .first main { scroll-snap-align: end; }
      /* the list's row is only as tall as its words, so a message sits right under them, not at the frame's foot */
      .play { display: grid; grid-template-columns: min(calc(100cqh - var(--space-4) - 4.5rem), 58vw) minmax(18rem, 1fr); grid-template-rows: auto auto minmax(0, max-content) minmax(min-content, 1fr);
        grid-template-areas: "fbar fbar" "board result" "board side" "board bar"; column-gap: var(--space-4); }
      .play.over { grid-template-rows: auto auto minmax(0, 1fr) auto; } /* solved: no more messages, and the result comes first */
      .play.zoomed { grid-template-columns: minmax(0, 1fr) 18rem; }
      .fbar { grid-area: fbar; }
      .stage { display: contents; }
      .board { grid-area: board; height: auto; margin: var(--space-3); }
      .play .side, .play.list-open .side { grid-area: side; display: flex; position: static; max-height: none; overscroll-behavior: auto; padding: var(--space-4) var(--space-5) 0 0; border: 0; border-radius: 0; box-shadow: none; } /* a wheel over the list moves the page once the list is at its end */
      .play .side .chip.found { order: 0; }
      .peek { display: none; }
      .play .bar { grid-area: bar; flex: none; min-height: 0; padding: var(--space-3) var(--space-5) var(--space-4) 0; }
      .seen { font-size: var(--t-body); }
      .fresult, .play.over .fresult { grid-area: result; padding: var(--space-4) var(--space-5) 0 0; -webkit-mask-image: none; mask-image: none; }
      .play .confirm { inset: 4.75rem var(--space-4) auto auto; width: 22rem; }
    }
  }
}
/* print: the ground is white paper, so what is written on it turns to ink (a pale heading on white could not be read).
   :root twice, to outrank the night colours whichever way they were chosen */
@media print { .top, .foot, .fbtns, .fback, .after, .skip, .bar { display: none; }
  .play .side { position: static; display: flex; box-shadow: none; }
  :root:root { --ground: #fff; --on-ground: var(--ink); --on-ground-soft: var(--ink-quiet); --ground-line: var(--paper-edge); --pebble: var(--paper-soft); --ground-deep: #fff; } }
