/* ==========================================================================
   BASE — Reset, Typografie, Layout-Primitive
   Voraussetzung: tokens.css. Referenz: design/DESIGN-SYSTEM.md
   ========================================================================== */

/* ---- Reset (schlank) ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background-color: var(--c-stein-50);
  background-image: var(--paper);
  background-repeat: repeat;
  background-size: 190px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: var(--c-brand-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--c-tanne-900); }
::selection { background: var(--c-brand); color: var(--c-tanne-950); }

/* Body darf nie horizontal scrollen (Layering-Regel) */
.page-wrap { overflow-x: clip; display: flex; min-height: 100vh; flex-direction: column; }
main { flex: 1; }

/* ---- Fokus (A11y) ---- */
:focus-visible { outline: 2px solid var(--c-brand-deep); outline-offset: 2px; border-radius: var(--r-s); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: calc(var(--z-modal) + 1);
  background: var(--c-tanne-950); color: var(--c-weiss); padding: var(--sp-3) var(--sp-4);
}
.skip-link:focus { left: 0; }

/* ---- Typografie ---- */
/* Fraunces bewusst mit niedrigem, EINHEITLICHEM opsz (20) — sturdier/ruhiger Schnitt, keine
   variablen Achsen-Spielereien (Kundenwunsch). Gewicht 900 bleibt (plakativ). */
h1, h2, .font-display {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 20;
  font-weight: var(--fw-display);
  line-height: var(--lh-head);
  letter-spacing: -0.015em;
  color: var(--c-tanne-900);
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: none;
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); }
h3, h4, h5, h6 {
  font-family: var(--font-text);
  font-weight: var(--fw-heading);
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
  color: var(--c-tanne-900);
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: none;
}
h3 { font-size: var(--fs-h3); }
h4 { font-size: 1.25rem; }
h5, h6 { font-size: 1.0625rem; }
p, li { max-width: 65ch; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--c-ink); }
.text-soft { color: var(--c-ink-soft); }
small, .small { font-size: var(--fs-small); }
strong { font-weight: 600; }
hr { border: 0; border-top: var(--border); margin: var(--sp-6) 0; }

.kicker {
  display: block;
  font-size: var(--fs-kicker);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-brand-deep);
  margin-bottom: var(--sp-4);
}

/* Separator-Icon statt langem Gedankenstrich (—): zweifarbiges Blatt-Dinkus (Kundendatei).
   NUR in Headings/Subheadings/Kicker/Card-Kurztexten — NICHT im Fließtext (Policy). */
.hsep {
  display: inline-block; vertical-align: middle;
  width: 1em; height: .8em; margin: 0;
  background: var(--hsep-svg) center / contain no-repeat;
}
:root {
  /* Relativer Pfad ab CSS-Datei = BASE_PATH-sicher (läuft auch im Unterordner) */
  --hsep-svg: url("../img/ui/hsep.svg");
}

/* Sekundäraussage in H1/H2 (Teil nach dem abschließenden Gedankenstrich): dünner + kleiner (~70%) */
.h-sec { font-weight: 400; font-size: .7em; letter-spacing: -0.005em; opacity: .92; }

/* Fließtext-Container (Artikel) */
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { margin-top: var(--sp-6); }
.prose h3 { margin-top: var(--sp-5); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose ul { list-style: none; }
.prose ul > li { position: relative; padding-left: .4em; }
.prose ul > li::before {
  content: ''; position: absolute; left: -1em; top: .62em;
  width: .45em; height: .45em; border-radius: 50%; background: var(--c-brand);
}
.prose ol { list-style: decimal; }
.prose blockquote {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--c-tanne-700);
  border-left: 3px solid var(--c-brand);
  padding-left: var(--sp-4);
}
.prose table { width: 100%; }

/* ---- Layout-Primitive ---- */
/* Content nutzt ~90% Bildschirmbreite (mit Cap für sehr große Screens) */
.container { width: 90%; max-width: var(--container); margin-inline: auto; }
.container--wide { width: 94%; max-width: var(--container-wide); }
.container--text { width: 90%; max-width: var(--container-text); }
/* Lesestrecke innerhalb einer breiten .container-Sektion nicht überdehnen */
.container .container--text, .prose.container--text { width: 100%; }
.section { padding-block: var(--sp-section); }
.section--s { padding-block: var(--sp-section-s); }
.section--dark {
  background-color: var(--c-tanne-950);
  color: var(--c-stein-100);
}
.section--dark :is(h1, h2, h3, h4) { color: var(--c-weiss); }
.section--dark .kicker { color: var(--c-brand); }
.section--dark a:not(.btn) { color: var(--c-stein-100); }
.section--tinted {
  background-color: var(--c-stein-100);
  background-image: var(--paper);
  background-repeat: repeat;
  background-size: 140px;
}
.section--wasser { --kontext-akzent: var(--c-wasser); }

/* Asymmetrische 2-Spalter */
.split { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 7fr 5fr; gap: var(--sp-7); }
  .split--rev { grid-template-columns: 5fr 7fr; }
  .split--rev > :first-child { order: 2; }
  .split--half { grid-template-columns: 1fr 1fr; }
}

/* Utility */
.mt-0 { margin-top: 0 !important; }
.center { text-align: center; }
.center :is(p, li) { margin-inline: auto; }

/* Zentrierter Sektionskopf (Heading + Lead über vollbreitem Inhalt) */
.sec-head { text-align: center; max-width: 60rem; margin-inline: auto; }
.sec-head :is(p, .lead) { margin-inline: auto; }

/* Zentrierte Fließtext-Sektionen (Unterseiten), ohne Hintergrund/Border */
.text-flow { text-align: center; max-width: var(--container-text); margin-inline: auto; }
.text-flow :is(p, li) { margin-inline: auto; }
/* Animierte Zeile (motion.js Zeilen-Fade) */
.aln { display: block; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Reveal-Basis (IntersectionObserver, einmalig; ohne JS sichtbar) */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity var(--t-reveal), transform var(--t-reveal); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
