/* =========================================================================
   Basis: Reset, Typografie, Layout, Sektionen, Browser-Oberflächen
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  color-scheme: light;
  interpolate-size: allow-keywords;
}
@media (prefers-reduced-motion: no-preference) { html:not(.reduce-motion) { scroll-behavior: smooth; } }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body.nacht { background: var(--ink); }

img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, label, summary, input, select, textarea { touch-action: manipulation; -webkit-tap-highlight-color: rgb(228 50 43 / 0.18); }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p, ul, ol, dl, figure, blockquote { margin: 0; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; }
table { border-collapse: collapse; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); font-stretch: 125%; font-weight: 850; letter-spacing: -0.035em; }
h2 { font-size: var(--step-4); font-stretch: 120%; letter-spacing: -0.03em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p, li, dd { text-wrap: pretty; }
strong, b { font-weight: 700; }

/* Zahlen, Zeiten, Preise, Klassen */
.mono, time, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 0; }
.tnum { font-variant-numeric: tabular-nums; }

/* Browser-Oberflächen im Markenstil */
::selection { background: var(--max-red); color: var(--white); }
:focus-visible { outline: 3px solid var(--max-red); outline-offset: 3px; border-radius: 4px; }
.sektion--dunkel :focus-visible, .nacht :focus-visible { outline-color: var(--max-red-bright); }
html { scrollbar-color: var(--max-red) var(--ink); scrollbar-width: thin; }
input, textarea { caret-color: var(--max-red); }

.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;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: var(--z-skip);
  background: var(--max-red-cta); color: var(--white); padding: 12px 18px; border-radius: var(--r-s);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* Platzhalter sichtbar markieren */
mark.ph {
  background: repeating-linear-gradient(135deg, #FFF3B0 0 8px, #FFE680 8px 16px);
  color: #3A2E00; font-family: var(--font-mono); font-size: 0.78em; font-weight: 600;
  padding: 0.05em 0.35em; border-radius: 4px; letter-spacing: 0; font-stretch: 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--schmal { max-width: 920px; }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-6) clamp(16px, 2vw, 32px); }
.measure { max-width: 64ch; }
.stack > * + * { margin-top: var(--flow, 1em); }

.sektion { position: relative; padding-block: var(--space-10); isolation: isolate; }
.sektion--eng { padding-block: var(--space-9); }
.sektion--dunkel { background: var(--ink); color: var(--white); color-scheme: dark; }
.sektion--dunkel .leise, .nacht .leise { color: var(--fog); }
.leise { color: var(--fog-ink); }
.sektion--rot { background: var(--max-red); color: var(--white); }

/* Feines Rauschen auf dunklen Flächen (fixiertes Pseudo-Element, nicht im Scroll-Container) */
.rauschen { position: relative; isolation: isolate; }
.rauschen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Rücklicht-Glow */
.glow {
  position: absolute; width: clamp(240px, 40vw, 640px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--max-red-glow), transparent 70%);
  pointer-events: none; z-index: -1; filter: blur(10px);
}

.kopf { margin-bottom: var(--space-7); max-width: 46rem; }
.kopf > * + * { margin-top: var(--space-4); }
.lead { font-size: var(--step-1); line-height: 1.5; max-width: 52ch; }

/* Fahrspur-Mittellinie als Teiler */
.spur {
  height: 4px; border: 0; margin: 0;
  background: repeating-linear-gradient(90deg, currentColor 0 36px, transparent 36px 64px);
  opacity: 0.25;
}

/* Inhalte ohne JS immer sichtbar; Start-Zustände nur mit .js */
.js [data-reveal]:not(.is-in) { opacity: 0; }
.reduce-motion [data-reveal] { opacity: 1 !important; transform: none !important; }

@media print {
  .site-header, .site-footer, .sticky-bar, .hinweis-banner, .video-bg, .wa-float, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .sektion { padding-block: 12pt; }
  a { text-decoration: none; }
}
