/* ==========================================================================
   Skjon · Basis (v3)
   Gemeinsame Datei. Reset, Typografie-Klassen, Layout-Primitive, Utilities,
   Seitenübergang, Reveals, Reduced Motion.
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: calc(var(--nav-h) + var(--space-4));
}
@media (prefers-reduced-motion: no-preference) { html:not(.lenis) { scroll-behavior: smooth; } }
@media (pointer: fine) { html { overscroll-behavior: none; } }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
main { flex: 1 0 auto; }
::selection { background: var(--selection); color: var(--ink); }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
a, button, summary, label, [role="tab"] { -webkit-tap-highlight-color: rgb(253 110 136 / .18); touch-action: manipulation; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
:where(section, article)[id], :where(h2, h3)[id] { scroll-margin-top: calc(var(--nav-h) + var(--space-4)); }
main:focus, [tabindex="-1"]:is(h1, h2, h3, section, article):focus { outline: none; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Typografie ---------- */
p, li, dd, figcaption { text-wrap: pretty; hyphens: auto; -webkit-hyphens: auto; }
.display, .h1, .h2, .h3, .h4, h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: var(--fw-head);
  text-wrap: balance;
  font-kerning: normal;
}
.display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
.h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1); max-width: 22ch; }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); max-width: var(--measure-head); }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }
.h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); letter-spacing: var(--ls-h4); }
/* Lange deutsche Komposita in schmalen Spalten sauber trennen */
@media (max-width: 767px) { .display, .h1, .h2, .h3 { hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 10 4 4; } }

/* Headlines: ein Schriftschnitt (Schibsted Grotesk). Kein kursiver Akzent; falls doch ein <em> in einer Überschrift steht, wird es normal gesetzt. */
:is(.display, .h1, .h2, .h3, .h4, h1, h2, h3, h4) :is(em, i) { font-style: normal; font-family: inherit; font-weight: inherit; }
.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--ink-muted);
  max-width: var(--measure-lead);
}
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--space-4); }
.prose p, .prose li { color: var(--ink-muted); }
.prose strong { color: var(--ink); font-weight: var(--fw-strong); }
.small { font-size: var(--fs-small); }
.muted { color: var(--ink-muted); }
.num, .tabular, td.num { font-variant-numeric: tabular-nums; }

.eyebrow, .label {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-size: var(--fs-eyebrow); font-weight: var(--fw-ui); line-height: var(--lh-ui);
  letter-spacing: var(--ls-eyebrow);
  color: var(--ink-muted);
}
.label { color: var(--ink-subtle); }
.dot {
  display: inline-block; flex: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.dot--signal { background: var(--signal); box-shadow: 0 0 10px 1px rgb(253 110 136 / .7); }
/* Punkt vor ein- oder mehrzeiligen Labels: immer mittig zur ERSTEN Zeile (lh = Zeilenhöhe) */
:is(.eyebrow, .label, .card__kicker, .callout__title, .finder__kicker, .trust__title, .services__title, .case__blocks dt, .step__result):has(> .dot) { align-items: flex-start; }
:is(.eyebrow, .label, .card__kicker, .callout__title, .finder__kicker, .trust__title, .services__title, .case__blocks dt, .step__result) > .dot { margin-top: calc(.5lh - 3px); }
/* Markennamen nie trennen */
[translate="no"] { hyphens: manual; -webkit-hyphens: manual; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--container) + var(--pad-l) + var(--pad-r));
  margin-inline: auto;
  padding-left: var(--pad-l);
  padding-right: var(--pad-r);
}
.wrap--text { max-width: calc(var(--container-text) + var(--pad-l) + var(--pad-r)); }
.section { position: relative; isolation: isolate; padding-block: var(--section-m); }
.section--s { padding-block: var(--section-s); }
.section--l { padding-block: var(--section-l); }
.section--flush-top { padding-top: 0; }
.section--line { border-top: 0; }
/* Aufeinanderfolgende Sektionen: Abstand nicht verdoppeln (ruhiger Rhythmus) */
.section + .section:not(.section--line), .page-head + .section:not(.section--line) { padding-top: 0; }
/* Mit Trennlinie: auf beiden Seiten die kompakte Stufe, damit nichts „schwimmt“ */
.section--line { padding-top: var(--section-s); }
.section:has(+ .section--line) { padding-bottom: var(--section-s); }
.section > .wrap { position: relative; z-index: var(--z-base); }

/* Einspaltige Grids nie breiter als ihr Container */
.grid, .stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--grid-gap); }
ul.grid, ol.grid { list-style: none; margin: 0; padding: 0; }
.stack { gap: var(--stack-gap); }
@media (min-width: 768px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-9); }
}

/* Sektionskopf: Eyebrow → H2 → Lead → Inhalt, überall gleiche Abstände */
.section-head { display: grid; justify-items: start; margin-bottom: var(--head-content-gap); }
.section-head > .eyebrow + * { margin-top: var(--head-eyebrow-gap); }
.section-head > .h2 + .lead, .section-head > .h1 + .lead, .section-head > .h3 + .lead { margin-top: var(--head-lead-gap); }
.section-head > .lead + .section-head__actions { margin-top: var(--space-6); }
.section-head--center { justify-items: center; text-align: center; }
.section-head--center .h2, .section-head--center .lead { margin-inline: auto; }
.section-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }

/* Aura hinter Glas-Sektionen (statisch) */
.aura {
  position: absolute; z-index: -1; pointer-events: none;
  width: 80vmax; height: 80vmax; border-radius: 50%;
  background: radial-gradient(closest-side, var(--aura-blue), transparent 72%);
}
.aura--tr { top: -20vmax; right: -40vmax; }
.aura--bl { bottom: -30vmax; left: -45vmax; background: radial-gradient(closest-side, var(--aura-pink), transparent 70%); }
.aura--br { bottom: -30vmax; right: -35vmax; }
.section:has(> .aura) { overflow: clip; }

/* ---------- Utilities ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.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;
}
.skip-link {
  position: fixed; left: var(--space-4); top: var(--space-3); z-index: var(--z-skip);
  display: inline-flex; align-items: center; min-height: var(--control-h-s);
  padding: 0 var(--space-5); border-radius: var(--radius-pill);
  background: var(--solid-bg); color: var(--solid-ink); font-weight: var(--fw-strong); text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--d-base) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }
.icon {
  width: 1.125em; height: 1.125em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.wordmark { height: 24px; width: auto; aspect-ratio: 266 / 101; overflow: visible; color: var(--ink); }

/* Optische Zentrierung einzeiliger UI-Beschriftungen (Buttons, Pills, Chips, Nav):
   Kasten = Versalhöhe bis Grundlinie, damit Text und Icon exakt mittig sitzen. */
@supports (text-box: trim-both cap alphabetic) {
  .ui-text { text-box: trim-both cap alphabetic; }
}

/* ---------- Seitenübergang: kurzes Überblenden (progressive enhancement) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out 160ms var(--ease-in-out) both; }
  ::view-transition-new(root) { animation: vt-in 220ms var(--ease-out) both; }
  .nav { view-transition-name: site-nav; }
  ::view-transition-group(site-nav) { animation: none; }
  /* Browser ohne View Transitions: Inhalt blendet sanft ein */
  @supports not (view-transition-name: none) {
    .js main { animation: vt-in 240ms var(--ease-out) both; }
  }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Reveals (nur mit JS, nie dauerhaft versteckt) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(var(--space-5)); }
.js [data-reveal].is-in { opacity: 1; transform: none; transition: opacity var(--d-slow) ease, transform var(--d-slow) var(--ease-out); }
.js [data-reveal]:focus-within, .js.reveal-all [data-reveal] { opacity: 1; transform: none; }

.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; }

/* ---------- Reduced Motion: alles statisch lesbar ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal], .js [data-intro] { opacity: 1; transform: none; }
}

/* Keine Trennlinien, keine Kanten: Abschnitte gehen über weiche, überlappende Lichtverläufe ineinander über */
.section, .trust, .footer { position: relative; isolation: isolate; }
.section::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: calc(var(--section-m) * -.75) 0;
  background:
    radial-gradient(55% 60% at 88% 30%, var(--glow-a, rgb(94 155 203 / .09)), transparent 70%),
    radial-gradient(45% 50% at 8% 78%, var(--glow-b, rgb(219 242 252 / .04)), transparent 70%);
}
.section:nth-of-type(even)::before {
  background:
    radial-gradient(55% 60% at 12% 30%, var(--glow-a, rgb(94 155 203 / .09)), transparent 70%),
    radial-gradient(40% 45% at 92% 80%, var(--glow-c, rgb(253 110 136 / .035)), transparent 70%);
}
:root[data-theme="light"] .section::before { --glow-a: rgb(94 155 203 / .14); --glow-b: rgb(94 155 203 / .06); --glow-c: rgb(253 110 136 / .05); }
/* Lichtflächen enden nie an einer Kante: vertikal komplett ausblenden */
.section::before {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 65%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 65%, transparent 100%);
}
/* CTA-Band, Footer: Flächen blenden oben und unten weich aus */
.cta-band__bg, .cta-band > .ribs, .cta-band .atmo, .cta-band .atmo-fallback {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 38%, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 38%, #000 82%, transparent 100%);
}
/* Keine Punkte vor Überschriften/Labels (Status-Punkte in Pills und Mini-UIs bleiben) */
:is(.eyebrow, .label, .card__kicker, .callout__title, .finder__kicker, .trust__title, .services__title, .case__blocks dt, .step__result) > .dot { display: none; }
