/* LAXspa Designsystem — Basis: Reset, Typografie, Hilfsklassen, Ausgangszustände der Bewegung */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--kopf-hoehe) + 1rem);
  background: var(--bg);
  overflow-x: clip;
}
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--schrift-text);
  font-size: var(--gr-text);
  line-height: var(--zeile-text);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--akzent); color: var(--akzent-text); }
[hidden] { display: none !important; }

/* ---------- Typografie ---------- */
.d-mega, .d-1, .d-2, .d-3,
h1, h2, h3 {
  font-family: var(--schrift-display);
  font-weight: var(--display-gewicht);
  font-stretch: var(--display-breite);
  text-transform: var(--display-versal);
  letter-spacing: var(--display-weite);
  line-height: var(--zeile-titel);
  text-wrap: balance;
  hyphens: manual;
}
.d-mega { font-size: var(--gr-mega); line-height: var(--zeile-eng); }
h1, .d-1 { font-size: var(--gr-h1); line-height: var(--zeile-eng); }
h2, .d-2 { font-size: var(--gr-h2); }
h3, .d-3 { font-size: var(--gr-h3); }
h4, .d-4 { font-family: var(--schrift-text); font-size: var(--gr-h4); font-weight: 500; line-height: 1.25; letter-spacing: 0; }
.t-gross { font-size: var(--gr-gross); line-height: 1.5; }
.t-klein { font-size: var(--gr-klein); }
.t-leise { color: var(--text-leise); }
.t-mass { max-width: var(--breite-text); }
p { text-wrap: pretty; }
/* Versal-Etikett: Reihe, Kategorie, Abschnittsnummer — sparsam */
.etikett {
  font-family: var(--schrift-text);
  font-size: var(--gr-mini);
  font-weight: 500;
  letter-spacing: var(--weite-versal);
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--text-leise);
}
.kontur {
  color: transparent;
  -webkit-text-stroke: 1px var(--text);
}
@supports not (-webkit-text-stroke: 1px black) { .kontur { color: var(--text); } }
.zahl { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- Gerüst ---------- */
.huelle {
  width: 100%;
  max-width: var(--breite-max);
  margin-inline: auto;
  padding-inline: var(--rand);
}
/* EIN Abschnittsabstand: jeder Abschnitt hat oben und unten --raum-abschnitt. Zwei Abschnitte hintereinander
   ergeben 2 × --raum-abschnitt – gleich, ob die Fläche wechselt oder nicht. „--eng“ ist seit V2.4 derselbe Wert
   (früher 0,55 ×, dadurch hatte jede Seite einen anderen Takt). */
.abschnitt { padding-block: var(--raum-abschnitt); position: relative; }
.abschnitt--alt { background: var(--bg-alt); }
/* Abschnittsende ohne Nachlauf: ein Kind mit eigenem Außenabstand unten addiert sich nicht zum Abschnittsabstand */
.huelle > :last-child { margin-bottom: 0; }
.stapel > * + * { margin-top: var(--stapel, var(--raum-5)); }
.nur-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprung {
  position: fixed; left: var(--raum-4); top: var(--raum-4); z-index: var(--z-ueber);
  padding: var(--raum-3) var(--raum-5); background: var(--akzent); color: var(--akzent-text);
  border-radius: var(--radius-knopf); transform: translateY(-300%);
}
.sprung:focus { transform: none; }

/* ---------- Bewegung: Ausgangszustände ----------
   Gelten NUR mit html.js (setzt ein Inline-Skript im Kopf). Ohne JS, bei Ladefehler
   (Sicherung nimmt .js nach 4 s wieder weg) und bei reduzierter Bewegung ist alles sichtbar. */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-anim="reveal"],
  html.js [data-anim="staffel"] > * { opacity: 0; }
  html.js [data-anim="split"] { visibility: hidden; }
  html.js [data-anim="reveal"].ist-da,
  html.js [data-anim="staffel"].ist-da > * { opacity: 1; }
  html.js [data-anim="split"].ist-da { visibility: visible; }
}
[data-anim="parallax"], [data-anim="magnet"] { will-change: transform; }
/* Natives Scrollen. Einzige Sperre: solange ein Vollbild-Dialog offen ist (Handy-Menü, Lichtkasten). */
html { scrollbar-gutter: stable; }
html.scroll-halt { overflow: hidden; }

/* ---------- Seitenübergänge (View Transitions, Rückfall: kurzer Ausblender per JS) ---------- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: lx-raus 260ms var(--kurve-ein-aus) both; }
  ::view-transition-new(root) { animation: lx-rein 520ms var(--kurve-aus) both; }
  /* Schemawechsel: neues Schema breitet sich als Tropfen vom Klickpunkt aus */
  html.thema-vt::view-transition-old(root) { animation: none; z-index: 0; }
  html.thema-vt::view-transition-new(root) {
    animation: lx-tropfen 900ms var(--kurve-ein-aus) both;
    z-index: 1;
  }
  html.geht body { opacity: 0; transition: opacity 180ms linear; }
}
@keyframes lx-raus { to { opacity: 0; transform: translateY(-12px); } }
@keyframes lx-rein { from { opacity: 0; transform: translateY(18px); } }
@keyframes lx-tropfen {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0%)); }
  to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 0%)); }
}
/* Rückfall Schemawechsel ohne View Transitions */
html.thema-weich,
html.thema-weich body,
html.thema-weich *:not(canvas) {
  transition: background-color 500ms ease, color 500ms ease, border-color 500ms ease, fill 500ms ease !important;
}

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

/* Kopfbereich (erste Bildschirmhöhe): Text steht sofort und rückt nur kurz ein – er wartet nicht auf das
   Bewegungs-Skript (bewegung.js lässt diese Elemente aus). Ohne Verblassen, damit das größte Element der Seite
   schon beim ersten Bild zählt. */
html.js :is(.hero, .seitenkopf, .pb, .ueber-buehne, .lkopf) :is([data-anim="reveal"], [data-anim="split"]),
html.js :is(.hero, .seitenkopf, .pb, .ueber-buehne, .lkopf) [data-anim="staffel"] > * { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: no-preference) {
  html.js :is(.hero, .seitenkopf, .pb, .ueber-buehne, .lkopf) :is([data-anim="reveal"], [data-anim="split"]),
  html.js :is(.hero, .seitenkopf, .pb, .ueber-buehne, .lkopf) [data-anim="staffel"] > * { animation: lx-kopf-ein 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
}
@keyframes lx-kopf-ein { from { transform: translateY(1.1rem); } to { transform: none; } }
