/* Base: reset, typography, page container, focus, utilities.
   Extracted from the reference pages (docs/design/referenz/), mobile first.
   Breakpoints are container queries on .page: 640px and 900px. */

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

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

/* Anchor links (TOC, skip link) glide to their target; instant with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.page {
  --c: var(--t-yo);
  --h: var(--h-yo);
  --d: var(--d-yo);
  container: page / inline-size;
  background: var(--bg);
  overflow-x: clip;
}

.wrap {
  max-width: var(--site-max);
  margin: 0 auto;
  padding-left: max(var(--gut), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gut), env(safe-area-inset-right, 0px));
}

/* Focus: always visible for keyboard users */
.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 2px; }

/* Screen-reader only */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: max(var(--gut), env(safe-area-inset-left, 0px));
  top: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

body.is-locked { overflow: hidden; }
main:focus { outline: none; }

/* Fallback templates until the real ones exist */
.fallback { padding-block: 32px 48px; }

/* Reduced motion is handled per component (see components.css and blocks/), as in the references. */
