/* ============================================================================
   base.css — Reset, Typo-Defaults, A11y-Defaults, prefers-reduced-motion
   ========================================================================== */

/* ---------- Self-hosted Inter ---------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2-variations"),
       url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

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

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

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

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

button { font: inherit; cursor: pointer; background: none; border: 0; padding: 0; color: inherit; }

a {
  color: inherit;
  text-decoration: none;
}

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

/* ---------- Body ---------- */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Typo-Defaults ---------- */
h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--type-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--type-h2);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--type-h3);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}

p { max-width: 60ch; }

strong { font-weight: var(--weight-bold); }

.eyebrow {
  font-size: inherit;
  font-weight: var(--weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-2xs);
}

.lead {
  font-size: var(--type-lead);
  line-height: var(--leading-snug);
  max-width: 50ch;
}

/* ---------- A11y: Skip-Link ---------- */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--space-2xs) var(--space-s);
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: var(--weight-medium);
  z-index: var(--z-modal);
  transform: translateY(-100%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- A11y: Focus-States ---------- */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

/* ---------- A11y: Touch-Targets ---------- */
a, button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Override für Inline-Links im Fließtext */
.prose a, p > a, li > a {
  display: inline;
  min-height: 0;
  min-width: 0;
}

/* ---------- prefers-reduced-motion ---------- */
@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;
  }
  [data-parallax] { transform: none !important; }
}

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

/* ---------- Selection ---------- */
::selection {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
