/* Keuvel -- base: reset, fonts, palette, typography.

   The shared house style: flieks' paper/ink token block
   (src/flieks/web/static/base.css) ported here the way lekkerp ported it
   (#1800), with the deltas keuvel's own register asks for.

   Deltas from flieks:

   - The accent is brass, not flieks' editorial yellow/red pair. The
     product spec (#462) puts keuvel in the calm B&O/Braun register, and
     brass echoes the enclosure's warm LEDs and knurled controls. It is
     one token, so the pick stays a one-line decision.
   - There is a dark remap. flieks is a paper-only daytime site; the
     keuvel listen page is used in cars at night, so dark mode is
     load-bearing rather than polish. Every rule below the semantic
     layer paints with the semantic tokens (--bg, --text, --accent,
     --border-subtle, ...), never with a primitive, so the remap block
     is the whole of dark mode.
   - --gray is darker than flieks' #8a8a87. It carries muted body text
     here (station metadata, table headers, the signed-in address, the
     inactive admin tabs), which flieks' value only clears at 3.26:1 on
     paper. The value is set so it clears AA on the sunken ground too --
     4.74:1 on --paper-3, the darkest of the three light surfaces --
     because that is where the admin nav and the search dropdown's hover
     row put it.

   Dropped from the previous keuvel stylesheet: the Utopia fluid type and
   space clamps, and the Every Layout primitives that had no caller
   (.auto-grid), plus the @layer cascade -- three stylesheets linked in
   order carry the same intent with nothing to look up. */

@font-face { font-family: 'Inter'; src: url('/static/fonts/inter-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/static/fonts/inter-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/static/fonts/inter-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/static/fonts/inter-bolditalic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
img, picture, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul[class], ol[class] { list-style: none; }

:root {
  /* -- Primitives: flieks' paper/ink set, brass in place of the
        yellow/red accent pair -------------------------------------- */
  --ink: #0d0d0d;
  --paper: #fbf8f0;
  --paper-2: #f3efe2;
  --paper-3: #ebe6d4;
  --gray: #66645c;
  --rule: #d6d2c4;
  /* Brass, on paper, at 5.10:1 -- WCAG 1.4.3 AA for link and label text
     without leaving the warm-metal hue the enclosure is finished in. */
  --brass: #9a5b12;
  --brass-deep: #7d4a0d;
  /* The same hue lifted for a dark ground: 7.58:1 on --night. */
  --brass-glow: #d99b3a;
  --brass-glow-hover: #e8b25c;
  --red: #c1272d;
  --red-lift: #e2635f;
  --green: #24783f;
  --green-lift: #4fbf7a;
  /* Warm near-blacks rather than neutral greys: dark mode is the same
     room at night, not a different product. */
  --night: #15140f;
  --night-2: #1f1d16;
  --night-3: #2a2720;
  --night-rule: #3a362d;
  --night-text: #ece7d8;
  --night-gray: #a8a396;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* -- Semantic layer: what every rule in components.css and pages.css
        is allowed to paint with ------------------------------------ */
  --bg: var(--paper);
  --bg-surface: var(--paper-2);
  --bg-sunken: var(--paper-3);
  --text: var(--ink);
  --text-muted: var(--gray);
  --accent: var(--brass);
  --accent-hover: var(--brass-deep);
  --accent-fg: var(--paper);
  --border-subtle: var(--rule);
  --danger: var(--red);
  --success: var(--green);
  --font-stack: var(--sans);

  /* -- Space scale. Six fixed steps replacing the fluid clamps: the
        pages are dense forms and tables, where a step that grows with
        the viewport just moves the rows apart on the widest screen. */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;

  --font-sm: 0.85rem;
  --font-lg: 1.15rem;

  --radius: 4px;
  --container-max: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night);
    --bg-surface: var(--night-2);
    --bg-sunken: var(--night-3);
    --text: var(--night-text);
    --text-muted: var(--night-gray);
    --accent: var(--brass-glow);
    --accent-hover: var(--brass-glow-hover);
    --accent-fg: var(--night);
    --border-subtle: var(--night-rule);
    --danger: var(--red-lift);
    --success: var(--green-lift);
  }
}

html { font-size: 15px; line-height: 1.4; color-scheme: light dark; }
body { font-family: var(--font-stack); color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
a[aria-current="page"] { font-weight: 600; }
h1, h2, h3 { font-weight: 500; line-height: 1.2; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

/* Page shell: sticky footer. Column flex, not grid rows -- the admin
   sub-nav is present on /admin/* and absent elsewhere, so a fixed row
   list puts the growing row under the wrong element. */
body { display: flex; flex-direction: column; min-block-size: 100dvh; }

.container { max-width: var(--container-max); width: 100%; margin: 0 auto; padding: 0 1rem; }
/* The station list is a wide data table; 960px cramps it. */
.wide { --container-max: 1180px; }

/* Stack and cluster, the two layout primitives the templates name. */
.stack > * + * { margin-block-start: var(--stack-space, var(--space-m)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }

/* Mobile-first up to 720px, then a wider centred column -- the header
   band still bleeds full width via its own background. */
@media (min-width: 720px) {
  :root { --container-max: 960px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
