/* ============================================================
   Base — Reset, Typografie, Layout-Primitive
   ============================================================ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* GSAP-Reveals (data-reveal="left/right") schieben Elemente vor der
     Animation seitlich raus — clip verhindert den horizontalen Scroll,
     ohne (anders als overflow:hidden) position:sticky zu brechen. */
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

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

a { color: inherit; }

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

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

/* --- Überschriften --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: inherit;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { max-width: 68ch; }

/* --- Layout --- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section { padding-block: var(--sp-8); }
.section--dark {
  background: var(--ink);
  color: var(--text-inv);
}
.section--deep {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgb(255 178 0 / 0.06), transparent 60%),
    var(--ink-deep);
  color: var(--text-inv);
}

/* --- Signatur: Diagnostic-Readout-Eyebrow ---
   Mono-Label mit Messlinie, angelehnt an Diagnosegeräte-UI */
.readout {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: var(--sp-4);
}
.section--dark .readout, .section--deep .readout { color: var(--brand); }
.readout::before {
  content: "";
  width: 2.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-hot));
  flex: none;
  transition: width 0.7s var(--ease-out);
}
/* Messlinie wächst, wenn der Readout in den Viewport kommt (setzt animations.js) */
.js-motion .readout:not(.is-inview)::before { width: 0; }

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-3);
  z-index: 200;
  padding: var(--sp-2) var(--sp-3);
  background: var(--brand);
  color: var(--ink);
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Reveal-Elemente starten unsichtbar nur wenn JS + Motion erlaubt
   (Klasse setzt animations.js, kein FOUC ohne JS) */
.js-motion [data-reveal] { opacity: 0; }
