/* css/base.css — Tokens, Typografie, Fonts, Bewegungs-Basis */

@font-face {
  font-family: "Heading";
  src: url("/fonts/heading-variable.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: "Body";
  src: url("/fonts/body-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: "Heading Fallback";
  src: local("Arial");
  size-adjust: 119.6%;
  ascent-override: 73.4%;
  descent-override: 17.6%;
}
@font-face {
  font-family: "Body Fallback";
  src: local("Arial");
  size-adjust: 123.4%;
  ascent-override: 77%;
  descent-override: 18.2%;
}

: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);

  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink-800);
  background: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img, svg { display: block; max-width: 100%; }

/* Tailwind-Preflight setzt svg{display:block} innerhalb eines eigenen Layers;
   das UA-Standardverhalten von [hidden] (display:none) verliert dagegen als
   UA-Stylesheet immer -- deshalb hier explizit erzwingen. */
[hidden] { display: none !important; }

/* === Skip-Link === */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--color-primary-600);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* === Fluid Typography === */
.heading-hero {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 1.9rem + 2.6vw, 4.25rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--color-ink-900);
}
.heading-1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 1.6rem + 1.8vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-ink-900);
}
.heading-2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2.125rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-ink-900);
}
.heading-3 {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-ink-900);
}
.subheading {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.6;
  color: var(--color-ink-600);
}
.body-lg { font-size: 1.125rem; line-height: 1.75; color: var(--color-ink-700); }
.body-md { font-size: 1rem; line-height: 1.7; color: var(--color-ink-600); }
.body-sm { font-size: 0.875rem; line-height: 1.6; color: var(--color-ink-500); }
.caption { font-size: 0.75rem; font-weight: 500; color: var(--color-ink-500); letter-spacing: 0.025em; }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary-500);
}
.text-balance { text-wrap: balance; }

/* === Long-form Content (FAQ/Leistungen Fliesstext) === */
.prose-content {
  max-width: 65ch;
}
.prose-content p { margin: 0 0 1.25em; }
.prose-content p:last-child { margin-bottom: 0; }
.prose-content strong { color: var(--color-ink-900); font-weight: 700; }

/* === Reveal-Animationen === */
.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: 90ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 180ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; animation: none; transition: none; }
}

/* === Print === */
@media print {
  header.site-header, footer.site-footer, .no-print { display: none !important; }
  body { color: #000; background: #fff; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
  a[href^="#"]::after, a[href^="tel:"]::after, a[href^="mailto:"]::after { content: ""; }
}
