/* ============================================================================
   base.css – Reset, Grundtypografie, Layout-Primitive
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, video, svg { max-width: 100%; display: block; }
img, video { height: auto; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { color: var(--link-hover); }
strong { font-weight: 700; }

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

p { text-wrap: pretty; }

/* --- Fokus & Zugänglichkeit --- */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--wood-900); color: #fff; padding: .7em 1.1em;
  border-radius: var(--r-sm); transition: top var(--t) var(--ease);
}
.skip-link:focus { top: 8px; color: #fff; }

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

/* --- Layout-Primitive --- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: 46rem; }

.section { padding-block: var(--section-y); }
.section--paper2 { background: var(--paper-2); }
.section--surface { background: var(--surface); }
.section--wood { background: var(--wood-900); color: #F3E9DA; }
.section--wood h1, .section--wood h2, .section--wood h3 { color: #FBF3E6; }
.section--korn { background: var(--korn-100); }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose p { color: var(--ink); }
.prose--muted p { color: var(--text-muted); }

/* Eyebrow / Kicker */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  font-weight: 700;
  color: var(--korn);
  display: inline-flex; align-items: center; gap: .5em;
}
.section--wood .eyebrow { color: #E8C583; }

.lead { font-size: var(--fs-lead); color: var(--text-muted); max-width: 42rem; }
.section--wood .lead { color: #E7DAC7; }

/* Utility */
.center { text-align: center; margin-inline: auto; }
.stack > * + * { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.grid { display: grid; gap: var(--gutter); }

/* Reveal-Animation (nur wenn Bewegung erlaubt) */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--reveal-dur) var(--ease), transform var(--reveal-dur) var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
