/* ================================================================== *
 * base.css – Fonts, Typografie, Grundlayout
 * Wird nach css/tailwind.css eingebunden.
 * ================================================================== */

/* ---- Variable Fonts (self-hosted, font-display: optional) -------- */
@font-face {
  font-family: "Sora Variable";
  font-style: normal;
  font-display: optional;
  font-weight: 100 800;
  src: url("../fonts/sora-var.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: optional;
  font-weight: 200 800;
  src: url("../fonts/manrope-var.woff2") format("woff2-variations");
}

/* ---- Metrisch angepasste Fallbacks (kein Layout-Shift) ----------- */
@font-face {
  font-family: "Sora Fallback";
  src: local("Arial");
  size-adjust: 133.66%;
  ascent-override: 72.57%;
  descent-override: 21.70%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Manrope Fallback";
  src: local("Arial");
  size-adjust: 128.11%;
  ascent-override: 83.21%;
  descent-override: 23.42%;
  line-gap-override: 0%;
}

/* ---- Fluid Type-Scale (clamp mit rem-Anteil) --------------------- */
:root {
  --step--1: clamp(0.8rem, 0.779rem + 0.107vw, 0.875rem);
  --step-0: clamp(1rem, 0.982rem + 0.089vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.093rem + 0.286vw, 1.35rem);
  --step-2: clamp(1.35rem, 1.236rem + 0.571vw, 1.75rem);
  --step-3: clamp(1.55rem, 1.35rem + 1vw, 2.25rem);
  --step-4: clamp(1.9rem, 1.586rem + 1.571vw, 3rem);
  --step-5: clamp(2.25rem, 1.821rem + 2.143vw, 3.75rem);

  --container: 82rem;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2.5rem);
}

/* ---- Reset & Grundlagen ------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--color-neutral-800);
  background: var(--color-neutral-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-neutral-900);
  margin: 0 0 0.6em;
  text-wrap: balance;
  /* Lange deutsche Komposita (Schmutzfangmatten, Waschraumhygiene) sauber
     umbrechen statt am Rand abschneiden – greift nur, wenn ein Wort zu breit ist. */
  overflow-wrap: break-word;
  hyphens: auto;
}
h1 {
  font-size: var(--step-5);
  font-weight: 800;
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}
p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}
a {
  color: var(--color-primary-700);
  text-decoration-color: color-mix(in oklch, var(--color-primary-500) 40%, transparent);
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--color-primary-800);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
/* Inline-Icons: sichere Grundgröße als Sicherheitsnetz. Fehlt einem Icon die
   kontextspezifische Regel, bleibt es bei 1em statt auf die Browser-Standard-
   größe (300×150) zu wachsen. Spezifischere Regeln (.btn svg, .feature__ic svg …)
   gewinnen unverändert. */
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
}
strong {
  font-weight: 700;
  color: var(--color-neutral-900);
}

/* ---- Fokus & Barrierefreiheit ------------------------------------ */
:focus-visible {
  outline: 3px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--color-primary-700);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
  color: #fff;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout-Hilfen ----------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  max-width: 52rem;
}
.section {
  padding-block: clamp(3.5rem, 2.5rem + 4vw, 7rem);
}
/* Schmaler Streifen, z. B. für Bildquellen-Credits – kein voller Sektionsabstand. */
.section--slim {
  padding-block: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-600);
}
.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--color-neutral-700);
}

/* ---- Reveal-Animation -------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Utility-Helfer */
.text-center {
  text-align: center;
}
.mx-auto {
  margin-inline: auto;
}
.max-prose {
  max-width: 46rem;
}
.bg-tint {
  background: var(--color-primary-50);
}
.bg-neutral {
  background: var(--color-neutral-100);
}
