/*
 * BTRT base kit (Sean, 2026-09-20). The invisible floor, never a look.
 *
 * Copied into a demo by `npm run builder:base -- --id=<lead id>` and linked BEFORE the demo's own
 * style.css, which defines the tokens below and every colour, font and composition. Nothing here can
 * be seen on a page: it removes the bugs the Builder kept solving again (no reset, [hidden] ignored on
 * a flex item, focus rings missing, motion that can't be switched off, a skip link, display type
 * sitting too high). Narrowed on 2026-09-24 (header, navigation, footer, form rows) and again on
 * 2026-09-26 (Sean): the page container, card grid, heading stack and buttons went too, since every
 * demo built on them shared one look. Each demo now writes its own, from its design card.
 *
 * Tokens the demo defines on :root — the kit falls back to a neutral value for each:
 *   --ink, --ground, --accent        colours (body text, page ground, focus ring)
 *   --radius                         the focus ring's corners
 *   --gutter                         where the skip link appears
 *   --head-h                         a sticky header's height, for anchors
 *   --font-body, --font-heading      families, declared with @font-face
 */

*,
*::before,
*::after { box-sizing: border-box; }

:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol) { margin: 0; }
:where(ul, ol) { padding-left: 0; list-style: none; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground, #fff);
  color: var(--ink, #16181a);
  font-family: var(--font-body, system-ui, sans-serif);
  line-height: 1.6;
}

/* A media element never overflows its column, and never sits on the text baseline. */
:where(img, picture, video, canvas, svg, iframe) { display: block; max-width: 100%; }
:where(img, video) { height: auto; }

:where(a) { color: inherit; }

:where(input, button, textarea, select) { font: inherit; color: inherit; }
:where(button) { background: none; border: 0; }

/* A dropdown takes the same box as the text fields beside it (2026-10-05): the browser's own
   drawing is switched off, which is what kept it smaller and rounder than an input, and an arrow
   in the text colour is drawn at its right. The demo's own border, padding and ground still apply. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.4em !important;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%) !important;
  background-position: right 1.06em center, right 0.7em center !important;
  background-size: 0.36em 0.36em !important;
  background-repeat: no-repeat !important;
}

/* Ignored on a flex or grid item without this, which cost a run every time (2026-09-19). */
[hidden] { display: none !important; }

/* Keyboard focus is always visible, and never on a mouse click. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent, #2a6f6a);
  outline-offset: 2px;
  border-radius: var(--radius, 6px);
}

/* Anyone who asked their system for less motion gets none. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* A sticky header offsets the anchor it scrolls to, and a form's confirmation. */
:where([id]) { scroll-margin-top: var(--head-h, 72px); }

/* ---- type --------------------------------------------------------------- */

:where(h1, h2, h3) {
  font-family: var(--font-heading, var(--font-body, system-ui, sans-serif));
  line-height: 1.15;
  text-wrap-style: balance;   /* the shorthand would reset text-wrap-mode and break .nowrap names */
}

/* Display type centred on its letters, not on its box: a deep descender space otherwise reads high. */
.optical { text-box: trim-both cap alphabetic; }
@supports not (text-box: trim-both cap alphabetic) { .optical { text-box-trim: both; text-box-edge: cap alphabetic; } }

/* A name or number that must not break across lines. */
.nowrap { white-space: nowrap; text-wrap: nowrap; }

/* Figures that line up in a column. */
.nums { font-variant-numeric: tabular-nums; }

/* ---- helpers ------------------------------------------------------------ */

/* Read by a screen reader, seen by nobody: the skip link's target, a label a design leaves out. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ground, #fff);
  color: var(--ink, #16181a);
}
.skip-link:focus { left: var(--gutter, 20px); }

/* A table, a wide figure or a code block scrolls in its own box; the page never scrolls sideways. */
.scroll-x { overflow-x: auto; }
