/* css/base.css — Design-Tokens, Fonts, Typography, Animationen */

: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;
  --space-32: 8rem;

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

/* === Self-hosted Variable Fonts (DSGVO-konform, kein Google Fonts) === */
@font-face {
  font-family: "Heading";
  src: url("/fonts/heading-variable.woff2") format("woff2");
  font-weight: 400 800;
  font-display: optional;
}
@font-face {
  font-family: "Body";
  src: url("/fonts/body-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-display: optional;
}
/* Metrisch angepasste Fallbacks gegen Layout-Shift, falls die Variable Font
   ausnahmsweise nicht rechtzeitig da ist. */
@font-face {
  font-family: "Heading Fallback";
  src: local("Arial");
  size-adjust: 104%;
  ascent-override: 94%;
  descent-override: 24%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Body Fallback";
  src: local("Arial");
  size-adjust: 100%;
  ascent-override: 92%;
  descent-override: 24%;
}

html {
  font-family: var(--font-body);
  color: var(--color-secondary-900);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--font-body);
}
h1, h2, h3, h4, .heading-hero, .heading-1, .heading-2, .heading-3 {
  font-family: var(--font-heading);
}

/* === Fluid Typography === */
.heading-hero {
  font-size: clamp(2.25rem, 1.8rem + 2vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.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.25rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
}
.heading-3 {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.35;
}
.body-lg { font-size: 1.125rem; line-height: 1.75; }
.body-md { font-size: 1rem; line-height: 1.7; }
.body-sm { font-size: 0.875rem; line-height: 1.6; }
.caption {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}
.overline {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.text-balance { text-wrap: balance; }

/* === Scroll-Reveal === */
.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%;
  }
}
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 300ms; }

@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-600);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.5rem 0;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}
