/* Reset, document defaults, accessibility basics. */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; color-scheme: dark; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font: 400 var(--fs-body)/var(--lh-base) var(--font-body);
  font-variation-settings: "wdth" var(--wdth-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;          /* nothing may scroll the page sideways */
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; font-variation-settings: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

/* The display face is the mockup's: condensed, uppercase, tight. */
/* long German compounds (Datenschutzerklärung) must break on narrow screens: lang="de-CH" drives hyphenation */
h1, h2, h3 { hyphens: auto; overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 850; line-height: var(--lh-tight); letter-spacing: -.005em; text-transform: uppercase; text-wrap: balance; }
h4 { font: inherit; font-weight: 700; }
p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }

ul, ol { list-style: none; padding: 0; }

.icon { width: 20px; height: 20px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.mono-t { font-family: var(--font-mono); }

/* Visible focus is not optional. Square, like everything else. */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--color-brand); color: var(--color-on-brand); }

.visually-hidden {
  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: var(--z-toast);
  padding: var(--space-8) var(--space-16); background: var(--color-brand); color: var(--color-on-brand); font-weight: 700;
}
.skip-link:focus { left: var(--space-8); top: var(--space-8); }

/* A hidden control inside a component must stay hidden even when the component
   sizes its inputs (`.field input { width:100% }`): the doubled class wins. */
.visually-hidden.visually-hidden { width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; }

/* A hidden element must stay hidden even when a component sets display. */
[hidden][hidden] { display: none !important; }

/* Tap targets: 24×24 minimum (WCAG 2.2 AA, 2.5.8) added by a pseudo-element. */
.tap-target { position: relative; }
.tap-target::after {
  content: ""; position: absolute; inset: 50% 0 auto 0; translate: 0 -50%;
  height: 100%; min-height: 24px; z-index: 1;
}
