/* Reset, body, the page tile field, text helpers, icons, focus (docs/design/language.md 3 to 6).
   Logical properties only. No colour values here: tokens.css has them. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 400 16px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased; min-block-size: 100vh; min-block-size: 100dvh;
  position: relative; overflow-x: clip;
}
/* the tile field (6.4): spinnekop quarters at every join, very faint, behind page and room surfaces */
body::before {
  content: ""; position: fixed; inset: 0; z-index: var(--z-field); pointer-events: none;
  background: var(--field-col); opacity: var(--field-op);
  -webkit-mask: url(../img/c/field.webp) 0 0 / 120px 120px repeat; mask: url(../img/c/field.webp) 0 0 / 120px 120px repeat;
}
body[data-surface="exam"]::before, body[data-surface="wall"]::before, body[data-cover]::before { display: none; }
#app { position: relative; z-index: var(--z-content); }

h1, h2, h3, h4 { font-family: var(--f-d); margin: 0; line-height: 1.08; letter-spacing: -.01em; font-weight: 700; }
p, ol, ul, figure, blockquote { margin: 0; }
ol, ul { padding: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { max-inline-size: 100%; }
img { display: block; block-size: auto; }   /* width and height attributes give the aspect; CSS sizes the box (#187) */
[hidden] { display: none !important; }
input, textarea, select { font: inherit; color: inherit; }

/* ---- text helpers (7.1) ---- */
.nl, [lang="nl"] { font-family: var(--f-nl); }
.en { color: var(--text-2); font-style: italic; }
.muted { color: var(--text-2); }
.small { font-size: 14px; line-height: 1.4; }
.meta { font: 700 14px/1.2 var(--f-ui); color: var(--text-3); }
.num, .tabular { font-variant-numeric: tabular-nums; }
/* a label: Figtree 600 14 px in sentence case, never capitals (language.md 1.4 v2; Dutch is never in capitals) */
.eyebrow { font: 600 14px/1.05 var(--f-ui); color: var(--text-3); }   /* a one-line label: its line box stays the 14.4 px of v1, so no game card grows */
.link {
  font-family: var(--f-ui); font-weight: 700; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.link.small { font-size: 14px; }
/* A link that is a control (a button, or a link on its own, not inside a sentence) is a 44 px tap target. */
button.link, a.link:not(p *, li *, td *, span *), p > a.link:only-child, p > button.link:only-child { display: inline-flex; align-items: center; justify-content: center; min-block-size: 44px; min-inline-size: 44px; }
.link.plain { text-decoration: none; }
.link[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-block-start: 4px; }
@media (min-width: 900px) { .h1 { font-size: 46px; } }
.lede { font-size: 18px; line-height: 1.55; color: var(--text-2); }
.visually-hidden {
  position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* ---- icons (5): 24 x 24, stroke currentColor ---- */
.ico { inline-size: 24px; block-size: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { inline-size: 18px; block-size: 18px; }
.ico.fill { fill: currentColor; stroke: none; }
[dir="rtl"] .ico.mirror { transform: scaleX(-1); }
/* an arrow inside a Dutch line on an Arabic page points along the Dutch (#740) */
[dir="rtl"] [lang="nl"] .ico.mirror, [dir="rtl"] [dir="ltr"] .ico.mirror { transform: none; }

/* ---- right to left (#740): Dutch and English inside an Arabic page keep their own order (a Dutch
   sentence's full stop at its end, word tiles left to right); a line in the screen's language inside
   them turns back to right to left. ---- */
[dir="rtl"] [lang="nl"], [dir="rtl"] [lang="en"] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] [lang="ar"] { direction: rtl; unicode-bidi: isolate; }

/* ---- focus (6.5) ---- */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
body[data-surface="wall"] :focus-visible { outline-color: var(--on-wall); }
h1[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }

/* ---- layout helpers ---- */
.stack { display: grid; gap: 12px; }
.row-flex { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.phone-only { display: initial; }
.laptop-only { display: none !important; }
@media (min-width: 900px) {
  .phone-only { display: none !important; }
  .laptop-only { display: initial !important; }
}

/* ---- reduced motion (16): the device setting or "Less movement"; the exam surface always. Every state
   change is instant: durations and delays go to zero and the end state shows at once (#329;
   check-motion.mjs checks all three guards) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important;
  }
}
html[data-less-motion] *, html[data-less-motion] *::before, html[data-less-motion] *::after,
body[data-surface="exam"] *, body[data-surface="exam"] *::before, body[data-surface="exam"] *::after {
  animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
  transition-duration: 1ms !important; transition-delay: 0ms !important;
}

/* screen enter, the Enter tier of language.md 1.7.1 (as .mo-enter): 380 ms rise 12 px and fade */
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.enter { animation: rise-in 380ms var(--ease-paper) both; }
