/* css/base.css — Design-Tokens, Typografie, Bewegungen */

@font-face {
  font-family: "Heading";
  src: url("/fonts/heading-variable.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: "Body";
  src: url("/fonts/body-variable.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: optional;
}
/* Metrisch angenaeherte Fallbacks - verhindern Layout-Shift im seltenen Fallback-Fall */
@font-face {
  font-family: "Heading Fallback";
  src: local("Arial");
  size-adjust: 104%;
  ascent-override: 92%;
  descent-override: 24%;
}
@font-face {
  font-family: "Body Fallback";
  src: local("Arial");
  size-adjust: 100%;
}

:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  color: var(--color-neutral-900);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
}

/* === Typography === */
.heading-hero {
  font-size: clamp(2.25rem, 1.7rem + 2.4vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.heading-1 {
  font-size: clamp(1.875rem, 1.5rem + 1.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.heading-2 {
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
}
.heading-3 {
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  font-weight: 600;
  line-height: 1.35;
}
.subheading {
  font-size: clamp(1.05rem, 1rem + 0.2vw, 1.25rem);
  color: var(--color-neutral-600);
  line-height: 1.6;
}
.body-lg { font-size: 1.125rem; line-height: 1.75; color: var(--color-neutral-700); }
.body-md { font-size: 1rem; line-height: 1.7; color: var(--color-neutral-700); max-width: 65ch; }
.body-sm { font-size: 0.875rem; line-height: 1.6; color: var(--color-neutral-600); }
.caption { font-size: 0.75rem; font-weight: 500; color: var(--color-neutral-500); letter-spacing: 0.02em; }
.overline {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary-600);
}
.text-balance { text-wrap: balance; }

/* === Reveal-Animationen (native scroll-driven, IO-Fallback im JS) === */
.reveal {
  opacity: 0;
  transform: translateY(20px);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
@supports (animation-timeline: view()) {
  @keyframes reveal-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .reveal {
    animation: reveal-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; animation: none; transition: none; }
}

/* === Skip-Link === */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary-700);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 0.375rem 0;
}
.skip-link:focus {
  left: 0;
}

/* === Print (fuer Leistungen/Preise-Uebersicht) === */
@media print {
  header, footer, .no-print { display: none !important; }
  body { color: #000; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
