/* base.css — Grundregeln für alle Seiten: Reset, Schrift, Fokus, Barrierefreiheit. Nur Variablen aus tokens.css. */

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

/* „hidden“ muss immer gewinnen – sonst überschreibt z. B. .btn { display: … } das Attribut (Fund Live-Test 16.11.). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { margin: 0; }

a { color: var(--c-link); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }

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

button, input, select, textarea { font: inherit; color: inherit; }

/* Tastaturbedienung: deutlich sichtbarer Fokus, nur bei Tastatur */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Nur für Screenreader sichtbar */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Sprunglink zum Inhalt */
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 100;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-primary); color: var(--c-on-primary);
  border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: var(--sp-4); }

/* Icons aus dem Sprite */
.icon {
  width: 1.25em; height: 1.25em;
  flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* Bewegung nur, wenn das Gerät sie nicht abgeschaltet hat */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Hintergrund-Muster auf allen Seiten (Jens 19.11.2026): leise Kritzel-Kachel, Schleier aus tokens.css hält Text lesbar.
   Steht fest, der Inhalt scrollt darüber. Eigene feste Ebene statt background-attachment: fixed,
   weil iOS-Safari das nicht kann. */
body.app, body.site, body.auth {
  background-color: var(--c-bg);
}
body.app::before, body.site::before, body.auth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(var(--pattern-veil), var(--pattern-veil)), url("../img/pattern-doodles-512.webp");
  background-size: 256px 256px;
}
