/* base.css
   Page defaults, type, focus, the skip link and the few layout helpers every screen uses.
   Colours come from tokens.css only. Motion that moves or fades sits inside
   prefers-reduced-motion: no-preference, so reduced motion shows the finished state. */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /* Focus is never hidden under the sticky notice at the top or the bars at the bottom (WCAG 2.4.11). */
  scroll-padding-top: calc(var(--banner-h) + 16px);
  scroll-padding-bottom: calc(var(--bottombar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset, legend { margin: 0; padding: 0; }
ul[class], ol[class] { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--link); text-underline-offset: 3px; }
a, button, summary, label, select { touch-action: manipulation; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Focus is always an outline, on every control, in both schemes. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.on-brand :focus-visible, .on-inverse :focus-visible { outline-color: var(--on-brand); }
/* A heading that receives focus after a route change gets a roomier ring when the keyboard is in use. */
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible { outline-offset: 6px; border-radius: 6px; }

.h1, .h2, .h3 { font-family: var(--font-head); font-weight: 600; overflow-wrap: anywhere; }
.h1 { font-size: var(--t-h1); line-height: 1.04; letter-spacing: -0.04em; text-wrap: balance; }
.h2 { font-size: var(--t-h2); line-height: 1.2; letter-spacing: -0.03em; }
.h3 { font-size: var(--t-h3); line-height: 1.25; letter-spacing: -0.02em; }
.lede { font-size: 19px; color: var(--muted); max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: var(--t-label); }
.prose { max-width: 40em; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: var(--r-pill); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; }

.wrap {
  max-width: var(--max); margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}
.stack { display: flex; flex-direction: column; }
.stack--1 { gap: var(--s-1); }
.stack--2 { gap: var(--s-2); }
.stack--3 { gap: var(--s-3); }
.stack--4 { gap: var(--s-4); }
.stack--5 { gap: var(--s-5); }
.stack--6 { gap: var(--s-6); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.row > * { min-width: 0; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }

.icon { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }

/* The neutral first paint, before the hostname's context has arrived: no logo, no brand colour. */
#app:empty { min-height: 100dvh; }
.noscript { max-width: 34em; margin: 48px auto; padding-inline: 24px; }

@media (max-width: 639px) {
  .lede { font-size: 18px; }
}

@media print {
  .skip-link { display: none; }
}
