/* ==========================================================================
   Ofira.app — Base / Reset / Typografie-Grundlage
   Nutzt ausschließlich Tokens aus tokens.css.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Progressiv: erlaubt animierte height:auto-Übergänge (FAQ) */
  interpolate-size: allow-keywords;
}

::selection {
  background: var(--orange-100);
  color: var(--navy-800);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--color-text-default);
  background-color: var(--color-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

input, button, textarea, select { font: inherit; color: inherit; }

/* --- Überschriften --------------------------------------------------- */
h1, h2, h3, h4 {
  color: var(--color-text-strong);
  font-weight: var(--fw-medium);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-hero);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ws-hero);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--ws-h2);
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  letter-spacing: var(--ws-h3);
}

p { text-wrap: pretty; }

/* ----------------------------------------------------------------------
   Wiederkehrender vertikaler Text-Rhythmus (tokenbasiert, T-Shirt-Größen).
   Statt Inline-Abstände: feste, immer gleiche Beziehungen zwischen Elementen.
   ---------------------------------------------------------------------- */
:where(h1, h2, h3) + .lead { margin-top: var(--space-md); }
.lead + p { margin-top: var(--space-md); }

.price-hero { margin-top: 0; }
.price-hero + .lead { margin-top: var(--space-sm); }

:where(.lead, p) + .check-list { margin-top: var(--space-lg); }

:where(h1, h2, h3, .lead, p, .check-list) + .cluster { margin-top: var(--space-xl); }
:where(.cluster, .lead, p) + :is(.form-note, .note) { margin-top: var(--space-xl); }

.statement { margin-top: var(--space-2xl); }
.statement + p { margin-top: var(--space-md); }

/* --- Links (Buttons ausgenommen: deren Farbe steuert ausschließlich .btn) - */
/* Transition hier (nicht in der :where-Regel), weil a:not(.btn) höhere
   Spezifität hat und die Transition sonst überschrieben würde -> keine Animation. */
a:not(.btn) {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--motion-fast) var(--easing),
              background-size var(--motion-medium) var(--easing-out);
}
a:not(.btn):hover { color: var(--color-link-hover); }

/* Animierter Unterstrich in Textfarbe: standardmäßig keine Linie, bei Hover
   wächst sie von links auf. Farbe = currentColor (z. B. weiß bei weißem Text
   im Footer), NICHT orange. Niedrige Spezifität (:where), damit Kontexte mit
   eigener Linie — etwa der Header (orange) — gewinnen. Pfeil-Links (.link-arrow)
   sind ausgenommen, da der Pfeil bereits die Affordance liefert. */
:where(a:not(.btn):not(.link-arrow)) {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
}
:where(a:not(.btn):not(.link-arrow)):hover { background-size: 100% 1px; }
@media (prefers-reduced-motion: reduce) {
  a:not(.btn) { transition: color var(--motion-fast) var(--easing); }
}

/* --- Tabellenziffern für Preise -------------------------------------- */
.tnum { font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums; }

/* --- Fokus (sichtbar, markenkonform) --------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Skip-Link ------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--color-surface);
  color: var(--color-text-strong);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: top var(--motion-fast) var(--easing);
}
.skip-link:focus { top: var(--space-4); }

/* --- Hilfsklassen ---------------------------------------------------- */
.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;
}

/* --- Reduced Motion -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
