@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("assets/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #040405;
  /* Schrift: Hierarchie über Größe, nicht über Grau. Gedämpft nur Rechtliches. */
  --ink: #efeee9;                  /* aller Text                      17,4:1 */
  --ink-soft: #8f8e8a;             /* Impressum, Datenschutz           6,3:1 */

  /* Abstände: 4er-Raster */
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --section: clamp(104px, 15svh, 168px);

  /* Typo */
  --display: "Archivo", "Geist", system-ui, sans-serif;
  --text: "Geist", system-ui, sans-serif;
  --light: 214, 222, 236;          /* kühles Silberlicht, einziger Farbakzent */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));

  /* Logo: begrenzt durch Breite, Maximalmaß und Höhe (flache Viewports) */
  --logo-w: min(76vw, 920px, 118svh);

  /* Negativ-Darstellung des Original-Logos für dunklen Grund:
     Schwarz → gebrochenes Weiß (#edeceb), Grau #a3a3a3 bleibt Grau. */
  --logo-negative: invert(1) contrast(0.322) brightness(1.407);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Startseite ---------- */

.home {
  min-height: 100svh;
  overflow-x: hidden;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  /* Logo optisch knapp über der Mitte, Kontakt in ruhigem Abstand darunter */
  grid-template-rows: 1.08fr auto clamp(56px, 11svh, 128px) auto 1fr;
  justify-items: center;
  padding:
    max(28px, env(safe-area-inset-top))
    var(--gutter)
    max(64px, calc(env(safe-area-inset-bottom) + 52px));
}

.mark {
  grid-row: 2;
  width: var(--logo-w);
  margin: 0;
  line-height: 0;
  font-size: inherit;
}

.mark__img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* Mit JavaScript übernimmt die 3D-Szene; das Bild bleibt als Alternativtext und Maßvorlage */
.js .mark__img { opacity: 0; }

/* ---------- Kapitel ---------- */

.chapter {
  position: relative;
  z-index: 1;
  overflow-x: clip;
  min-height: 135svh;
  display: grid;
  align-items: center;
  padding: 0 var(--gutter);
}

.chapter__inner {
  position: relative;
  isolation: isolate;
  width: min(100%, 40rem);
  text-shadow: 0 2px 30px rgba(4, 4, 6, 0.95);
}

/* Weicher Schatten hinter dem Text: die Kapitelfilme bleiben sichtbar, der Text lesbar */
.gl .chapter__inner::before {
  content: "";
  position: absolute;
  inset: -28% -34%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(4, 4, 5, 0.82), rgba(4, 4, 5, 0.55) 55%, transparent);
  pointer-events: none;
}

/* Wechselnder Rhythmus: links, rechts, mittig; das Bild steht jeweils auf der freien Seite */
.chapter--left .chapter__inner { margin-left: clamp(0px, 8vw, 140px); }
.chapter--right .chapter__inner { margin-left: auto; margin-right: clamp(0px, 8vw, 140px); }
.chapter--center { align-items: end; padding-bottom: 24svh; }
.chapter--center .chapter__inner { margin: 0 auto; text-align: center; width: min(100%, 60rem); }
.chapter--center .chapter__text { margin-inline: auto; }

/* Große, dünne Kapitelziffer statt Mini-Label */
.chapter__num {
  margin: 0 0 var(--s-5);
  font-family: var(--display);
  font-stretch: 100%;
  font-weight: 200;
  font-size: clamp(56px, 6.5vw, 112px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.chapter__title {
  margin: 0 0 var(--s-6);
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(36px, 4.4vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--ink);
}

.chapter__text {
  margin: 0;
  max-width: 34ch;
  font-family: var(--text);
  font-size: clamp(20px, 0.8vw + 14px, 28px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: pretty;
}

/* Wörter mit Bindestrich zusammenhalten */
.nowrap { white-space: nowrap; }

/* ---------- Abschnitte nach der Geschichte ---------- */

.block {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--gutter), 1160px);
  margin: 0 auto;
  padding: var(--section) 0;
  font-family: var(--text);
}

.block__title {
  max-width: 12ch;
  margin: 0 0 clamp(var(--s-7), 7svh, var(--s-8));
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(40px, 5vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--ink);
}

/* Grundsätze: Überschrift links, sechs Aussagen rechts in zwei Spalten */
@media (min-width: 1001px) {
  .principles {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 0 clamp(48px, 6vw, 112px);
    align-items: start;
  }
  .principles .block__title {
    position: sticky;
    top: 30svh;
    margin: 0;
  }
}

.principles__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-7) clamp(var(--s-6), 4vw, var(--s-8));
}

.principles__item {
  padding-top: var(--s-5);
  border-top: 1px solid rgba(var(--light), 0.22);
}

.principles__title {
  margin: 0 0 var(--s-3);
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(21px, 0.5vw + 17px, 25px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.principles__text {
  margin: 0;
  max-width: 32ch;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
}

/* Abschluss: Kontakt */
.closing {
  display: grid;
  justify-items: center;
  gap: clamp(var(--s-7), 7svh, var(--s-8));
  min-height: 80svh;
  align-content: center;
  padding-bottom: clamp(128px, 18svh, 200px);
  text-align: center;
}

.closing__title {
  max-width: 12ch;
  margin: 0;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(42px, 6.2vw, 104px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: var(--ink);
}

.closing .contact { grid-row: auto; }

/* Einblenden: aus der Unschärfe nach oben, gestaffelt */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(10px);
  transition:
    opacity 1s var(--ease),
    transform 1.2s var(--ease),
    filter 1s var(--ease);
}

.js [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
.js [data-reveal]:nth-child(3) { transition-delay: 0.22s; }

.js .is-in[data-reveal],
.js .is-in [data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- Finale ---------- */

.finale {
  grid-template-rows: 1fr auto clamp(var(--s-7), 7svh, var(--s-8)) auto 1.1fr;
}

.finale .mark { grid-row: 2; }

.finale__title {
  grid-row: 4;
  max-width: 16ch;
  margin: 0;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 600;
  font-size: clamp(36px, 4.8vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-align: center;
  text-wrap: balance;
}



/* ---------- Startseite: Positionierung ---------- */

.hero {
  overflow-x: clip;
  grid-template-rows: 1.08fr auto clamp(48px, 9svh, 104px) auto clamp(36px, 6svh, 64px) auto 1fr;
}

.hero__tagline {
  grid-row: 4;
  max-width: 18ch;
  margin: 0;
  font-family: var(--display);
  font-stretch: 112%;
  font-size: clamp(30px, 3.9vw, 64px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-align: center;
  text-wrap: balance;
}

.hero .contact { grid-row: 6; }

/* Beim Scrollen treten Headline und Kontakt weich zurück (--hero-out kommt aus main.js) */
.hero__tagline,
.hero .contact {
  opacity: calc(1 - var(--hero-out, 0));
  filter: blur(calc(var(--hero-out, 0) * 8px));
}

.hero-gone .hero .contact { visibility: hidden; }

/* Weicher Schatten unter Tagline und Kontakt: der Planetenboden bleibt sichtbar, der Text ruhig */
.gl .hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(var(--hero-gap, 58%) + 2%);
  z-index: -1;
  width: min(900px, 100%);
  height: 46svh;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(4, 4, 5, 0.7), rgba(4, 4, 5, 0.4) 60%, transparent);
  pointer-events: none;
}

/* ---------- Kontakt ---------- */

.contact {
  grid-row: 4;
  display: flex;
  justify-content: center;
  gap: clamp(14px, 1.6vw, 24px);
  font-style: normal;
}

/* Gläserne Kapsel: Icon, Wert, Pfeil */
.contact__link {
  --x: 50%;
  --y: 50%;
  --mx: 0px;
  --my: 0px;
  --press: 1;
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 24px 9px 9px;
  border: 1px solid rgba(var(--light), 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--light), 0.07), rgba(var(--light), 0.015));
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 34px -16px rgba(0, 0, 0, 0.9);
  color: var(--ink);
  text-decoration: none;
  outline: none;
  transform: translate3d(var(--mx), var(--my), 0) scale(var(--press));
  transition:
    transform 0.6s var(--ease),
    border-color 0.4s var(--ease),
    background 0.4s var(--ease),
    box-shadow 0.5s var(--ease);
  isolation: isolate;
}

/* Lichtfleck innen, folgt dem Zeiger */
.contact__link > .contact__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--x) var(--y), rgba(var(--light), 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

/* Randlicht: nur der Rahmen leuchtet, dort wo der Zeiger ist */
.contact__link::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(120px circle at var(--x) var(--y), #fff, rgba(var(--light), 0.35) 45%, transparent 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

/* Inhalt folgt dem Zeiger etwas stärker als die Kapsel: leichte Tiefe */
.contact__icon,
.contact__value,
.contact__arrow {
  translate: calc(var(--mx) * 0.45) calc(var(--my) * 0.45);
  transition: translate 0.6s var(--ease);
}

.contact__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(var(--light), 0.24);
  border-radius: 50%;
  background: rgba(var(--light), 0.05);
  transition:
    translate 0.6s var(--ease),
    background 0.4s var(--ease),
    border-color 0.4s var(--ease),
    color 0.4s var(--ease);
}

.contact__icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact__value {
  font-family: var(--display);
  font-stretch: 100%;
  font-size: clamp(19px, 0.7vw + 13px, 25px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.contact__arrow {
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
  transform: translate(-3px, 3px);
  transition:
    translate 0.6s var(--ease),
    opacity 0.35s var(--ease),
    transform 0.55s var(--ease);
}

.contact__link:hover,
.contact__link:focus-visible {
  border-color: rgba(var(--light), 0.3);
  background: linear-gradient(180deg, rgba(var(--light), 0.11), rgba(var(--light), 0.03));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 18px 44px -14px rgba(0, 0, 0, 0.9),
    0 0 48px -12px rgba(var(--light), 0.4);
}

.contact__link:hover::before,
.contact__link:focus-visible::before,
.contact__link:hover .contact__glow,
.contact__link:focus-visible .contact__glow { opacity: 1; }

.contact__link:hover .contact__icon,
.contact__link:focus-visible .contact__icon {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.contact__link--tel:hover .contact__icon svg { animation: contact-ring 0.8s var(--ease); }
.contact__link--mail:hover .contact__icon svg { animation: contact-lift 0.8s var(--ease); }

@keyframes contact-ring {
  0%, 100% { transform: none; }
  15% { transform: rotate(-16deg); }
  35% { transform: rotate(14deg); }
  55% { transform: rotate(-9deg); }
  75% { transform: rotate(4deg); }
}

@keyframes contact-lift {
  0%, 100% { transform: none; }
  40% { transform: translateY(-4px) rotate(-6deg); }
  70% { transform: translateY(1px); }
}

.contact__link:hover .contact__arrow,
.contact__link:focus-visible .contact__arrow {
  opacity: 1;
  transform: translate(3px, -3px);
}

.contact__link:active { --press: 0.97; }

.contact__link:focus-visible {
  outline: 1px solid rgba(var(--light), 0.65);
  outline-offset: 4px;
}

/* ---------- Rechtliches ---------- */

.legal {
  position: absolute;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  padding: 4px;
  border: 1px solid rgba(var(--light), 0.12);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--light), 0.05), rgba(var(--light), 0.01));
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 30px -16px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  transition: border-color 0.5s var(--ease);
}

.legal:hover { border-color: rgba(var(--light), 0.22); }

/* Wie die Kapitelnavigation: Versalien, weit gesperrt, Licht statt Farbe */
.legal a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  color: var(--ink-soft);
  font: 500 12px/1 var(--text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  outline: none;
  transition: color 0.4s var(--ease), background 0.4s var(--ease), letter-spacing 0.5s var(--ease);
}

/* Lichtpunkt vor dem Wort: glimmt beim Überfahren auf */
.legal a::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(var(--light), 0.35);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), scale 0.4s var(--ease);
}

/* Lichtlinie unter dem Wort: zeichnet sich von der Mitte aus */
.legal a::after {
  content: "";
  position: absolute;
  left: 34px;
  right: 20px;
  bottom: 7px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--light), 0.9), transparent);
  transform: scaleX(0);
  transition: transform 0.6s var(--ease);
}

.legal a:hover,
.legal a:focus-visible {
  color: var(--ink);
  background: rgba(var(--light), 0.07);
  letter-spacing: 0.2em;
}

.legal a:hover::before,
.legal a:focus-visible::before {
  background: #fff;
  box-shadow: 0 0 10px 1px rgba(var(--light), 0.9);
  scale: 1.25;
}

.legal a:hover::after,
.legal a:focus-visible::after { transform: scaleX(1); }

.legal a:focus-visible { box-shadow: inset 0 0 0 1px rgba(var(--light), 0.5); }

/* ---------- Statischer Fallback (kein WebGL) ---------- */

.no-gl .home {
  background:
    radial-gradient(ellipse 46% 26% at 50% 40%, rgba(var(--light), 0.05), transparent 70%),
    radial-gradient(ellipse 34% 7% at 50% 63%, rgba(var(--light), 0.07), transparent 70%),
    radial-gradient(ellipse 130% 100% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    var(--bg);
}

.no-gl .scene { display: none; }

.no-gl .mark__img {
  opacity: 1;
  filter: var(--logo-negative) drop-shadow(0 18px 30px rgba(0, 0, 0, 0.7));
  transition: opacity 0.6s var(--ease);
}

/* ---------- Kleine Viewports ---------- */

/* Smartphone hoch: Szene neu komponiert, Kontakt untereinander und groß tippbar */
@media (max-width: 640px) {
  :root { --logo-w: min(84vw, 520px); }

  .stage {
    grid-template-rows: 1fr auto clamp(64px, 13svh, 120px) auto 0.82fr;
    padding-bottom: max(72px, calc(env(safe-area-inset-bottom) + 60px));
  }

  .contact {
    flex-direction: column;
    gap: 12px;
    width: min(100%, 360px);
  }

  .contact__link { padding-right: 20px; }

  /* Ohne Hover: Pfeil immer sichtbar und rechts, als Hinweis auf die Aktion */
  .contact__arrow { margin-left: auto; opacity: 0.6; transform: none; }

  .contact__value { font-size: 21px; }
}

@media (max-width: 640px) {
  .chapter {
    min-height: 120svh;
    align-items: end;
    padding-bottom: 14svh;
  }

  .chapter .chapter__inner { margin: 0; text-align: left; }

  .finale {
    grid-template-rows: 1fr auto clamp(28px, 5svh, 48px) auto 0.9fr;
  }

  .hero {
    grid-template-rows: 1fr auto clamp(40px, 8svh, 80px) auto clamp(28px, 5svh, 48px) auto 0.82fr;
  }

  .hero__tagline { max-width: none; }

  .principles__grid { grid-template-columns: 1fr; gap: var(--s-6); }
}

@media (max-width: 360px) {
  .contact__value { font-size: 18px; }
  .contact__icon { width: 40px; height: 40px; }
}

/* Flache Viewports (Smartphone quer) */
@media (max-height: 520px) and (min-width: 641px) {
  :root { --logo-w: min(50vw, 90svh); }

  .stage {
    grid-template-rows: 1fr auto clamp(44px, 14svh, 72px) auto 1fr;
    padding-bottom: max(48px, calc(env(safe-area-inset-bottom) + 40px));
  }

  .contact__link { padding-block: 5px; gap: 12px; }
  .contact__icon { width: 38px; height: 38px; }
  .legal { bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* ---------- Unterseiten: Impressum, Datenschutz, 404 ---------- */

/* Flach und schwarz: keine Lichtstimmung, nur Text */
html:has(.doc) { background: #000; }

.doc {
  min-height: 100svh;
  background: #000;
}

.doc__wrap {
  width: min(100%, 720px);
  margin: 0 auto;
  padding:
    max(40px, env(safe-area-inset-top))
    var(--gutter)
    max(56px, calc(env(safe-area-inset-bottom) + 32px));
}

.doc__home {
  display: inline-block;
  width: clamp(120px, 28vw, 168px);
  line-height: 0;
}

.doc__home img {
  width: 100%;
  height: auto;
  filter: var(--logo-negative);
}

.doc h1 {
  margin: clamp(48px, 10vw, 88px) 0 40px;
  font-family: var(--display);
  font-stretch: 112%;
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.doc h2 {
  margin: 48px 0 12px;
  font-family: var(--display);
  font-stretch: 112%;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.doc p,
.doc li,
.doc dd {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}

.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 18px; }

.doc dl {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  gap: 10px 20px;
  margin: 0;
  padding: 22px 0;
  border-top: 1px solid rgba(var(--light), 0.12);
  border-bottom: 1px solid rgba(var(--light), 0.12);
}

.doc dt {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.doc dd { margin: 0; }

.doc a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(var(--light), 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.doc a:hover { text-decoration-color: var(--ink); }
.doc a.doc__home { text-decoration: none; }

/* Zurück zur Startseite: dieselbe Kapsel wie Impressum und Datenschutz, hier im Textfluss */
.legal--inline {
  position: static;
  transform: none;
  display: inline-flex;
  margin-top: 48px;
}

.doc .legal a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.4s var(--ease), background 0.4s var(--ease), letter-spacing 0.5s var(--ease);
}

.doc .legal a:hover,
.doc .legal a:focus-visible { color: var(--ink); }

.doc__meta {
  margin-top: 40px;
  font-size: 14px !important;
  color: var(--ink-soft) !important;
}

/* Platzhalter, die vor dem Livegang ersetzt werden müssen */
.doc mark.todo {
  padding: 1px 4px;
  background: rgba(214, 180, 90, 0.18);
  color: #e8d9a8;
}

@media (max-width: 560px) {
  .doc dl { grid-template-columns: 1fr; gap: 2px; }
  .doc dd { margin-bottom: 12px; }
}

/* ---------- Cursor: Lichtpunkt mit federndem Ring ---------- */

.has-cursor,
.has-cursor * { cursor: none !important; }

.cursor {
  --caret: 28px;
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.cursor-on .cursor { opacity: 1; }

.cursor__dot,
.cursor__ring {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

/* Punkt: sitzt exakt am Zeiger */
.cursor__dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(var(--light), 0.9), 0 0 2px #fff;
  transition:
    width 0.3s var(--ease),
    height 0.3s var(--ease),
    margin 0.3s var(--ease),
    opacity 0.4s var(--ease);
}

/* Ring: folgt gefedert, mit Hauch Silberlicht.
   Radien in px statt %, damit Kreis und Schreibmarke weich ineinander übergehen. */
.cursor__ring {
  --morph: 0.6s cubic-bezier(0.65, 0, 0.35, 1);
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(var(--light), 0.55);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0);
  box-shadow:
    0 0 18px -4px rgba(var(--light), 0.45),
    inset 0 0 12px -6px rgba(var(--light), 0.5);
  transition:
    width var(--morph),
    height var(--morph),
    margin var(--morph),
    border-radius var(--morph),
    border-color 0.45s var(--ease),
    background 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    opacity 0.45s var(--ease);
}

/* Links: Ring weitet sich und tritt zurück, die Kapsel hat ihr eigenes Licht */
[data-cursor="link"] .cursor__ring {
  width: 66px;
  height: 66px;
  margin: -33px 0 0 -33px;
  border-radius: 33px;
  border-color: rgba(var(--light), 0.3);
  opacity: 0.6;
}

[data-cursor="link"] .cursor__dot {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
}

/* Text: Ring wird zur leuchtenden Schreibmarke in Schrifthöhe */
[data-cursor="text"] .cursor__ring {
  width: 2px;
  height: var(--caret);
  margin: calc(var(--caret) / -2) 0 0 -1px;
  border-color: rgba(var(--light), 0);
  border-radius: 1px;
  background: rgba(255, 255, 255, 1);
  box-shadow:
    0 0 14px rgba(var(--light), 0.7),
    inset 0 0 0 0 rgba(var(--light), 0);
}

[data-cursor="text"] .cursor__dot { opacity: 0; }


/* ---------- Weiter-Knopf und Kapitelnavigation (aus scroll.js) ---------- */

.next,
.rail {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s var(--ease), visibility 0s 0.9s, translate 0.9s var(--ease);
}

.ui-ready .next,
.ui-ready .rail {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s var(--ease), visibility 0s, translate 0.9s var(--ease);
}

/* Am Ende tritt der Knopf ab, dort stehen Kontakt und Rechtliches */
.ui-ready.at-end .next {
  opacity: 0;
  visibility: hidden;
  translate: -50% 16px;
  transition: opacity 0.6s var(--ease), visibility 0s 0.6s, translate 0.6s var(--ease);
}

.next {
  position: fixed;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
  z-index: 20;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 12px/1 var(--text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}

.next__label {
  min-height: 1em;
  opacity: 0.62;
  transition: opacity 0.4s var(--ease), letter-spacing 0.5s var(--ease);
  text-shadow: 0 1px 12px rgba(4, 4, 5, 0.9);
}

.next__ring {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(var(--light), 0.22);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(var(--light), 0.08), rgba(var(--light), 0.02));
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 30px -14px rgba(0, 0, 0, 0.9);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.5s var(--ease), scale 0.5s var(--ease);
}

.next__ring svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: next-drift 2.6s var(--ease) infinite;
}

@keyframes next-drift {
  0%, 100% { transform: translateY(-2px); opacity: 1; }
  45% { transform: translateY(4px); opacity: 0.55; }
}

.next:hover .next__label,
.next:focus-visible .next__label { opacity: 1; letter-spacing: 0.22em; }

.next:hover .next__ring,
.next:focus-visible .next__ring {
  border-color: rgba(var(--light), 0.5);
  background: linear-gradient(180deg, rgba(var(--light), 0.16), rgba(var(--light), 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 28px -6px rgba(var(--light), 0.45);
  scale: 1.06;
}

.next:active .next__ring { scale: 0.94; }
.next { outline: none; }
.next:focus-visible .next__ring { outline: 1px solid rgba(var(--light), 0.65); outline-offset: 4px; }

/* Kapitelnavigation: Striche am rechten Rand, Name beim Überfahren */
.rail {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px));   /* unten rechts, auf Höhe des Weiter-Knopfs */
  z-index: 20;
}

.rail__track {
  position: absolute;
  top: 18px;
  bottom: 18px;
  right: 13.5px;               /* exakt durch die Mitte der Striche */
  width: 1px;
  background: rgba(var(--light), 0.12);
}

.rail__fill {
  position: absolute;
  inset: 0;
  background: rgba(var(--light), 0.7);
  transform: scaleY(0);
  transform-origin: top;
}

.rail__list {
  position: relative;
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Feste Spalten: Nummer | Name | Strich. Jede Zeile gleich breit, alles steht exakt untereinander. */
.rail__item {
  display: grid;
  grid-template-columns: 2.2em 8.4em 28px;
  align-items: center;
  column-gap: 18px;
  height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 14px/1 var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.rail__label {
  display: contents;
}

.rail__num,
.rail__name {
  opacity: 0;
  translate: 6px 0;
  white-space: nowrap;
  text-shadow: 0 1px 12px rgba(4, 4, 5, 0.95);
  transition: opacity 0.4s var(--ease), translate 0.5s var(--ease);
  pointer-events: none;
}

.rail__num { font-variant-numeric: tabular-nums; }

/* Alle Striche gleich lang; der Zustand zeigt sich über Helligkeit und Stärke */
.rail__tick {
  width: 28px;
  height: 1px;
  background: rgba(var(--light), 0.3);
  transition: background 0.4s var(--ease), height 0.3s var(--ease), box-shadow 0.4s var(--ease);
}

.rail__item.is-past .rail__tick { background: rgba(var(--light), 0.6); }
.rail__item.is-active .rail__tick { height: 3px; background: #fff; box-shadow: 0 0 10px rgba(var(--light), 0.8); }

.rail:hover .rail__num { opacity: 0.3; translate: 0 0; }
.rail:hover .rail__name { opacity: 0.5; translate: 0 0; }
.rail:hover .rail__item.is-active .rail__num { opacity: 0.6; }
.rail:hover .rail__item.is-active .rail__name,
.rail__item:hover .rail__name,
.rail__item:focus-visible .rail__name { opacity: 1; translate: 0 0; }
.rail__item:hover .rail__num,
.rail__item:focus-visible .rail__num { opacity: 0.6; translate: 0 0; }
.rail__item:hover .rail__tick,
.rail__item:focus-visible .rail__tick { background: #fff; }

/* Kleine Viewports: nur der Knopf, ohne Beschriftung */
@media (max-width: 760px), (max-height: 520px) {
  .rail { display: none; }
  .next__label { display: none; }
  .next__ring { width: 42px; height: 42px; }
}


/* ---------- Ladeschirm (aus loader.js, bei jedem Aufruf) ---------- */

.loader { display: none; }

.js .loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(28px, 5svh, 44px);
  background:
    radial-gradient(ellipse 40% 34% at 50% 46%, rgba(var(--light), 0.06), transparent 70%),
    var(--bg);
  color: var(--ink);
}

.is-loading { overflow: hidden; }

.loader__core {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(150px, 22vmin, 220px);
  aspect-ratio: 1;
}

/* Umlaufbahn: feiner Ring, ein Komet mit Lichtschweif kreist um das x */
.loader__orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(var(--light), 0.1);
  animation: loader-in 0.9s var(--ease) both;
}

.loader__comet {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(var(--light), 0.08) 72%, rgba(var(--light), 0.85) 99.4%, transparent 99.6%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1px));
  animation: loader-spin 1.6s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

/* Kopf des Kometen */
.loader__comet::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -1.5px 0 0 -3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 2px rgba(var(--light), 0.9);
  transform: rotate(-2deg);
}

/* x: Kontur wird gezeichnet, dann füllt es sich, ein Lichtstreif fährt darüber */
.loader__mark {
  width: 42%;
  height: auto;
  overflow: visible;
}

.loader__lines polygon {
  fill: none;
  stroke: rgba(var(--light), 0.9);
  stroke-width: 5;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: loader-draw 1.3s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}

.loader__lines polygon:nth-child(2) { animation-delay: 0.4s; }
.loader__lines polygon:nth-child(3) { animation-delay: 0.55s; }

.loader__fill {
  opacity: 0;
  color: #d9d8d4;
  animation: loader-fill 0.8s var(--ease) 1.25s forwards;
}

.loader__sheen { animation: loader-sheen 2.2s var(--ease) 1.5s infinite; }

.loader__count {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 3px;
  font: 300 13px/1 var(--text);
  letter-spacing: 0.24em;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--light), 0.7);
  animation: loader-in 0.9s var(--ease) 0.3s both;
}

.loader__num { min-width: 3ch; text-align: right; }
.loader__pct { opacity: 0.5; }

@keyframes loader-in { from { opacity: 0; transform: scale(0.92); } }
@keyframes loader-spin { to { transform: rotate(1turn); } }
@keyframes loader-draw { to { stroke-dashoffset: 0; } }
@keyframes loader-fill { to { opacity: 1; } }
@keyframes loader-sheen {
  from { transform: translateX(0); }
  60%, to { transform: translateX(800px); }
}

/* Öffnen: Ring weitet sich, das x zieht in den Raum, der Vorhang löst sich */
.is-loaded .loader {
  pointer-events: none;
  animation: loader-out 1.1s cubic-bezier(0.7, 0, 0.2, 1) 0.15s forwards;
}

.is-loaded .loader__orbit { animation: loader-orbit-out 1s cubic-bezier(0.6, 0, 0.2, 1) forwards; }
.is-loaded .loader__mark { animation: loader-mark-out 0.9s cubic-bezier(0.6, 0, 0.3, 1) forwards; }
.is-loaded .loader__count { animation: loader-count-out 0.5s var(--ease) forwards; }

@keyframes loader-out {
  to { opacity: 0; visibility: hidden; }
}
@keyframes loader-orbit-out {
  to { transform: scale(4.5); opacity: 0; border-color: rgba(var(--light), 0.4); }
}
@keyframes loader-mark-out {
  to { transform: scale(1.6); opacity: 0; filter: blur(10px); }
}
@keyframes loader-count-out {
  to { opacity: 0; transform: translateY(8px); letter-spacing: 0.5em; }
}

/* Nach dem Öffnen treten Headline und Kontakt nacheinander auf */
.is-loaded .hero__tagline,
.is-loaded .hero .contact {
  animation: hero-enter 1.3s var(--ease) both;
}
.is-loaded .hero__tagline { animation-delay: 1s; }
.is-loaded .hero .contact { animation-delay: 1.25s; }

@keyframes hero-enter {
  from { opacity: 0; translate: 0 22px; filter: blur(10px); }
}

/* ---------- Reduzierte Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  .contact__link,
  .contact__link::before,
  .contact__icon,
  .contact__value,
  .contact__arrow,
  .contact__glow,
  .legal a, .legal a::before, .legal a::after,
  .no-gl .mark__img { transition: none; }
  .contact__icon svg { animation: none !important; }
  .cursor__dot,
  .cursor__ring { transition: opacity 0.2s; }
  .next__ring svg { animation: none; }
  .loader *, .is-loaded .hero__tagline, .is-loaded .hero .contact { animation: none !important; }
  .loader__lines polygon { stroke-dashoffset: 0; }
  .loader__fill { opacity: 1; }
  .is-loaded .loader { animation: loader-out 0.3s linear forwards; }
}
