/* ==========================================================================
   02 — BASE
   Reset, Grundtypografie, Layout-Container, Hilfsklassen, Scroll-Reveal.
   ========================================================================== */

/* ---------- Reset (schlank gehalten) ------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anker-Sprünge dürfen nicht unter dem Sticky-Header verschwinden */
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--c-cream);
  color: var(--c-ink-2);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* verhindert horizontale Überläufe durch versetzte/überlappende Elemente */
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure, blockquote, p, h1, h2, h3, h4, h5, h6 { margin: 0; }
hr { border: 0; border-top: 1px solid var(--c-line-soft); margin: 0; }

::selection { background: var(--c-sand-deep); color: var(--c-ink); }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ---------- Typografie -------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--c-ink);
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
/* Die Display-Serife läuft breit: Zeilenumbrüche im Hero stehen im Markup,
   die Größen darunter sind so gewählt, dass H1 nie mehr als zwei Zeilen wird. */
h2 { font-size: var(--fs-h2); line-height: var(--lh-head); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-h4); line-height: var(--lh-snug); letter-spacing: -0.015em; }

p { text-wrap: pretty; }

/* Eyebrow / Kategorienüberschrift – kleines Label über großen Headlines */
.eyebrow {
  display: block;
  font-family: var(--font-text);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: clamp(1rem, 2vw, 1.75rem);
}
.eyebrow--accent { color: var(--c-accent-ink); }
.eyebrow--rule {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.eyebrow--rule::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--c-line);
  max-width: 120px;
}

/* Lead – etwas größerer Einleitungstext */
.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--c-ink-2);
}

.prose > * + * { margin-top: 1.15em; }
.prose { max-width: 62ch; }

.muted { color: var(--c-muted); }
.ink   { color: var(--c-ink); }

/* ---------- Layout ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--slim { max-width: calc(var(--container-slim) + 2 * var(--gutter)); }

.section { padding-block: var(--section-y); position: relative; }
.section--lg { padding-block: var(--section-y-lg); }
.section--tight { padding-block: clamp(3.5rem, 7vw, 6.5rem); }

/* Flächenwechsel: sorgt für optische Trennung der Sektionen */
.bg-cream { background: var(--c-cream); }
.bg-shell { background: var(--c-shell); }
.bg-sand  { background: var(--c-sand); }
.bg-ink   { background: var(--c-ink); color: rgba(244, 239, 230, 0.72); }
.bg-ink h1, .bg-ink h2, .bg-ink h3, .bg-ink h4 { color: var(--c-ink-invert); }
.bg-ink .eyebrow { color: rgba(244, 239, 230, 0.5); }

/* Section-Header: Eyebrow + Headline + optionaler Beschreibungstext */
.section-head { max-width: 62ch; }
.section-head--wide { max-width: 78ch; }
.section-head p { margin-top: clamp(1rem, 2vw, 1.5rem); }

/* Dezente Haarlinie als Sektionsabschluss */
.rule { height: 1px; background: var(--c-line-soft); }

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

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--c-ink); color: var(--c-ink-invert);
  padding: 0.75rem 1.25rem; font-size: var(--fs-small);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- Scroll-Reveal ----------------------------------------------
   Elemente mit [data-reveal] starten leicht versetzt und blenden ein,
   sobald sie im Viewport sind (siehe assets/js/main.js).
   ----------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* Gestaffelte Verzögerung für Listen/Grids */
[data-reveal-stagger] > * { --reveal-delay: 0ms; }
[data-reveal-stagger] > *:nth-child(2) { --reveal-delay: 90ms; }
[data-reveal-stagger] > *:nth-child(3) { --reveal-delay: 180ms; }
[data-reveal-stagger] > *:nth-child(4) { --reveal-delay: 270ms; }
[data-reveal-stagger] > *:nth-child(5) { --reveal-delay: 360ms; }
[data-reveal-stagger] > *:nth-child(6) { --reveal-delay: 450ms; }

/* Barrierefreiheit: alle Bewegungen abschalten, wenn gewünscht */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
