/* =============================================================================
   BASE – Reset, Typografie, Layout-Grundlagen
   ============================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--color-bg-1);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: 0.03em;
  color: var(--color-text);
}
h1 em, h2 em, h3 em { font-style: normal; color: var(--color-accent); }
h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-4); color: var(--color-text-soft); }
p:last-child { margin-bottom: 0; }

a { color: var(--color-accent); text-decoration: none; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }
/* Keine Unterstreichung bei Flächen-Links (Buttons, Bilder, Icons, Chips) */
.btn:hover, .brand:hover, .gallery__item:hover, .card__media:hover, .social a:hover,
.year-nav a:hover, .nav__link:hover, .map-frame:hover { text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

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

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

.section { padding-block: var(--section-y); }
/* Sektionsflächen leicht durchscheinend, damit Nebel und Glut (.ambient, z-index -1) dahinter sichtbar bleiben */
.section--dark { background: rgba(10,10,12,.72); }
.section--alt { background: rgba(24,24,28,.55); }
.section--flush { padding-block: 0; }

.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;
}

.skip-link {
  position: absolute; top: -100%; left: var(--space-4);
  background: var(--color-accent); color: var(--color-accent-ink);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: var(--z-modal);
  font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

/* ---------- Typo-Helfer -------------------------------------------------- */
.eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}
.eyebrow--muted { color: var(--color-text-muted); }

.lead {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text-soft);
  max-width: 60ch;
}

.handwritten {
  font-family: var(--font-hand);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem);
  color: var(--color-accent);
  line-height: 1.15;
  transform: rotate(-4deg);
  display: inline-block;
  width: max-content;
  max-width: 100%;
}
.handwritten::after {
  content: "";
  display: block;
  width: 60%;
  height: 2px;
  margin-top: .25rem;
  margin-left: auto;
  background: currentColor;
  border-radius: 2px;
  opacity: .8;
}

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

/* ---------- Scroll-Reveal ------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 100ms; }
.reveal[data-delay="2"] { transition-delay: 200ms; }
.reveal[data-delay="3"] { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
