/* ═══ Grundlagen: Reset, Typografie, Grundelemente ═══ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: 6rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  /* „Betreibergesellschaft“, „Hundeschwimmen“, „Haftungsausschlusserklärung“:
     in großen Graden sprengen solche Wörter sonst ein schmales Display. */
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p, li { text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--highlight);
  color: var(--ink-900);
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin-block: var(--space-lg);
}

blockquote {
  border-inline-start: 4px solid var(--accent);
  padding-inline-start: var(--space-md);
  font-size: var(--step-1);
  font-style: italic;
  color: var(--text-muted);
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-sunken);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

/* Sprungmarke für Tastatur- und Screenreader-Nutzung */
.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--space-md);
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { inset-block-start: 0; color: #fff; }

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

/* ═══ Bewegung respektiert die Systemeinstellung ═══ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ Sanfte Seitenwechsel, wo der Browser sie unterstützt ═══ */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: vt-out 220ms var(--ease-in-out) both;
  }
  ::view-transition-new(root) {
    animation: vt-in 320ms var(--ease-out) both;
  }
}

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
