/* ---------- Variablen ---------- */
:root {
  --bg: #0b0b0b;
  --fg: #fff;
  --muted: #757575;
  --line: #242424;
  --graphics: #c6c6c6;
  --highlight-1: #a86eff;
  --highlight-2: #c8ff31;
  --highlight-bg: #0b0b0b;

  --font: "PP Neue Montreal", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs-hero: clamp(1.5rem, 8.1vw, 4.4rem);
  --fs-lead: clamp(1.2rem, 2vw, 1.9rem);
  --fs-feature: clamp(1.2rem, 2vw, 1.9rem);
  --fs-small: clamp(1rem, 1.4vw, 1.2rem);

  --gap: 1px;                       /* Linien zwischen den Zellen */
  --line-width: 2px;                /* Strichstärke der Grafiken */
  --gutter-y: clamp(1.5rem, 3vw, 3rem);
  --gutter: var(--gutter-y);
  --graphic-padding: clamp(1rem, 5vw, 8rem);
  --radius: clamp(12px, 1.2vw, 20px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@font-face {
  font-family: "PP Neue Montreal";
  src: url("fonts/PPNeueMontreal-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "PP Neue Montreal";
  src: url("fonts/PPNeueMontreal-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);         /* scheint durch die Gaps = Linien */
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-lead);
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.hide { display: none !important; }

/* ---------- Header ---------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--gutter);
  background: var(--bg);
}

.logo { font-weight: 700; font-size: 1.1rem; }

.nav { display: flex; gap: .6rem; }

.btn {
  display: grid;
  place-items: center;
  width: 3.5rem;
  aspect-ratio: 1;
  border: 1px solid var(--fg);
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  transition: background .2s, color .2s;
}
.btn--filled,
.btn:hover { background: var(--fg); color: var(--bg); }

/* ---------- Raster ----------
   main stapelt Zeilen, jede .row ist ein eigenes Grid.
   Regeln:
   - Eine .row = genau eine Zeile auf dem Desktop.
   - Desktop-Spalten pro Zeile änderbar: <div class="row" style="--cols: 4">
   - Mobil: 2 Spalten; .stack-m auf der .row = 1 Spalte.
   Klassen für Zellen:
   .span-2        2 Spalten (mobil: volle Breite)
   .span-full     volle Breite überall
   .span-full-m   volle Breite nur mobil
   Leere .cell    Platzhalter, mobil ausgeblendet
*/

.hero{
display: flex;
  flex-direction: column;
  justify-content: flex-end;
}



main,
.row { 
  display: grid; gap: var(--gap); 
  background: var(--line);
}

main{ 
  min-height: 100vh;  /* Ensures the main element takes at least the full viewport height */
}

.row { grid-template-columns: repeat(var(--cols, 3), 1fr); }
.row[hidden] { display: none; }

.collapsible { overflow: clip; }
.collapsed { height: 0; overflow: clip; }

/* Zeilen mit Feature-Karten: Titel | Link | Grafik | Absatz */
.row:has(> .feature) { grid-auto-rows: auto auto 1fr auto; }

.span-2    { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }

.cell {
  --r-start: var(--radius);
  --r-end: var(--radius);
  background: var(--bg);
  padding: var(--gutter);
  border-radius: var(--r-start) var(--r-end) var(--r-end) var(--r-start);
}

/* Außenkanten eckig: Zeilenanfang links, Zeilenende rechts */
.cell:first-child { --r-start: 0; }
.cell:last-child  { --r-end: 0; }

main > .row:has(+ #imprint) > .cell,
main > .row:has(+ #privacy-policy) > .cell {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* ---------- Typografie ---------- */
.display {
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 1.1;
}

.stack-m > .display {
  min-width: 0;
  overflow-wrap: anywhere;
}

.display .muted { margin-top: .40em; }

.hero span { display: block; max-width: 12em; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.4;
  color: var(--muted);
}
.lead p { max-width: 34em; }
.lead p + p { margin-top: 1.4em; }

.small{
  font-size: var(--fs-small);
}

/* ---------- Legal disclosures ---------- */
.legal-disclosure > .cell {
  display: grid;
  grid-template-columns: minmax(0, 900px) 2.75rem;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  font-size: var(--fs-small);
  line-height: 1.5;
}

.legal-disclosure-text {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.legal-disclosure-text :is(h2, h3) { font-size: inherit; }
.legal-disclosure-text :is(h2, p) { margin-bottom: 1em; }

.legal-disclosure-close {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: var(--gutter-y);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: color .2s;
}

.legal-disclosure-close:hover { color: var(--muted); }
.legal-disclosure-close:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.legal-links {
  display: grid;
  align-content: end;
  justify-content: start;
  gap: 1rem;
  font-size: var(--fs-small);
}

.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--highlight-color); }
.legal-links a:focus-visible {
  outline: none;
  color: var(--muted);
}

.link { font-size: var(--fs-small); color: var(--muted); }

/* ---------- Newsletter ---------- */
.newsletter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  width: 100%;
  font-size: var(--fs-small);
}

.newsletter > label[for="email"] {
  grid-column: 1 / -1;
  color: var(--fg);
  font-size: var(--fs-feature);
  margin-bottom: 2vw;
}

.newsletter > input[type="email"],
.newsletter > button {
  min-width: 0;
  min-height: 3.5rem;
  padding: .8rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font: inherit;
}

.newsletter > input[type="email"] {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  transition: border-color .2s;
}

.newsletter > input[type="email"]::placeholder { color: var(--muted); opacity: 1; }
.newsletter > input[type="email"]:hover { border-color: var(--highlight-color); }
.newsletter > input[type="email"]:focus,
.newsletter > input[type="email"]:focus:hover {
  border-color: var(--muted);
  outline: none;
}

.newsletter > button {
  grid-column: 2;
  grid-row: 2;
  background: transparent;
  border-color: var(--fg);
  color: var(--fg);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}

.newsletter > button:hover {
  background: var(--highlight-color);
  border-color: var(--highlight-color);
  color: var(--bg);
}

.newsletter .consent {
  grid-column: 1 / -1;
  grid-row: 3;
  line-height: 1.5;
}

.newsletter .consent input {
  appearance: none;
  width: 1em;
  height: 1em;
  margin-right: .4em;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background-color: var(--bg);
  font: inherit;
  vertical-align: -.1em;
  cursor: pointer;
  transition: border-color .2s;
}

.newsletter .consent input:hover {
  border-color: var(--highlight-color);
}

.newsletter .consent input:checked {
  background-image: radial-gradient(circle, var(--highlight-color) 0 35%, transparent 40%);
}



.newsletter .consent a:hover { color: var(--highlight-color); }

.newsletter .consent a:focus-visible {
  outline: none;
  text-decoration-thickness: 2px;
}

.newsletter :is(input, button, a):focus-visible {
  outline: 1px solid var(--highlight-color);
  outline-offset: -1px;
}

.newsletter-msg { margin: 1rem 0; padding: .75rem 1rem; border-radius: 8px; max-width: 100%; }
.newsletter-msg.ok    { background: var(--highlight-2); color: var(--bg); }
.newsletter-msg.error { background: var(--highlight-1); color: var(--bg); }

/* ---------- Feature-Cells (ganze Zelle = Link) ---------- */
.feature {
  --shrink: 8px;                    /* Einrückung der Karte beim Hover */
  position: relative;
  isolation: isolate;               /* ::before bleibt hinter dem Inhalt */
  overflow: hidden;                 /* Grafiken nicht über die Zelle hinaus */
  display: grid;
  grid-row: span 4;                 /* Titel, Link, Grafik, Absatz */
  grid-template-rows: subgrid;      /* Zeilenhöhen mit den Nachbarkarten teilen */
  row-gap: 0;                       /* statt der Linien-Gaps der .row */
  min-height: clamp(14rem, 27vw, 30rem);
  background: transparent;          /* Hintergrund übernimmt ::before */
  pointer-events: none;              /* verhindert, dass ::before die Interaktion blockiert */
}

.feature h2       { grid-row: 1; font-size: var(--fs-feature); font-weight: 400; }
.feature .link    { grid-row: 2; }
.feature .graphic { grid-row: 3; }
.feature p        { grid-row: 4; }
.feature > * + *  { margin-top: .4em; }   /* Abstand zwischen Titel, Link, Grafik */

/* Die sichtbare Karte */
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg);
  border-radius: inherit;           /* übernimmt die Eckenlogik der .cell */
  transition: inset .4s var(--ease), border-radius .4s var(--ease);
}

/* Link-Fläche über die ganze Zelle ziehen */
.feature .link::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Hover und Tastaturfokus */
.feature:is(:hover, :has(.link:focus-visible)) {
  --graphics: var(--fg);
}
.feature:is(:hover, :has(.link:focus-visible))::before {
  inset: var(--shrink);
  border-radius: var(--radius);
}
.feature:is(:hover, :has(.link:focus-visible)) .link { color: var(--fg); }

.feature .link:focus-visible { outline: none; }
.feature:has(.link:focus-visible) {
  outline: var(--gap) solid var(--fg);
  outline-offset: calc(var(--gap) * -1);
}

/* ---------- Grafiken ---------- */
.graphic {
  display: grid;                    /* füllt die dritte Zeile, Grafik mittig */
  place-items: center;
}

.graphic-padding {
  padding: var(--graphic-padding);
}

.graphic svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.graphic :is(line, path) {
  stroke: var(--graphics);
  stroke-width: var(--line-width);
  vector-effect: non-scaling-stroke;
}

/* ---------- Gemeinsame Zeitachse für Stern und Linien ----------
   Läuft linear 0 → 1, Easing steckt jeweils in der Formel */
@property --t {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}
@keyframes timeline { to { --t: 1; } }

/* Zwischenwerte als Zahl registrieren: Der Browser rechnet jede Stufe
   einmal aus, statt den Text über var() immer weiter zu verschachteln
   (sonst Absturz in Safari auf iOS) */
@property --b    { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --d2   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --k    { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --time { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --u1   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --w1   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --a    { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --d1   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --p1   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --e1   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --p2   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --e2   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --s    { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --st   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --f1   { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --f2   { syntax: "<number>"; inherits: false; initial-value: 0; }

/* ---------- Grafik 1: Drehende Segmente ---------- */
@keyframes spin { to { rotate: 360deg; } }

.spin path {
  transform-box: fill-box;          /* Drehpunkt = Mitte des Segments */
  transform-origin: center;
  animation: spin 5s ease-in-out infinite;
}

/* ---------- Grafik 2: Stern ---------- */
.star line {
  --i: 0;                           /* Position der Linie, 0 bis 14 */

  /* Einstellungen */
  --duration: 5;                    /* Gesamtdauer in s (ohne Einheit) */
  --pause: 0;                       /* Verweildauer Stern / Ruhezustand in s */
  --stagger: .1;                    /* Versatz zwischen Linien (relativ) */
  --base: .3;                       /* Grunddauer jeder Linie (relativ) */
  --speed: 300;                     /* Tempo pro Grad (relativ) */

  /* Zeitplan (automatisch) */
  --b:  max(var(--base) + 337.5 / var(--speed),
            14 * var(--stagger) + var(--base) + 22.5 / var(--speed));
  --d2: calc(var(--base) + 337.5 / var(--speed));
  --k:  calc((var(--duration) - 2 * var(--pause)) / (var(--b) + var(--d2)));
  --time: calc(var(--t) * var(--duration));

  /* Aufbau: Phasenzeit mit Ease-in-Out, dann jede Linie einzeln */
  --u1: clamp(0, var(--time) / (var(--b) * var(--k)), 1);
  --w1: calc(var(--b) * var(--u1) * var(--u1) * var(--u1) * (var(--u1) * (6 * var(--u1) - 15) + 10));
  --a:  calc(337.5 - var(--i) * 22.5);
  --d1: calc(var(--base) + var(--a) / var(--speed));
  --p1: clamp(0, (var(--w1) - var(--i) * var(--stagger)) / var(--d1), 1);
  --e1: calc(var(--p1) * var(--p1) * (3 - 2 * var(--p1)));

  /* Abbau: „Besen“ von 22,5° bis 360°, nimmt jede Linie mit */
  --p2: clamp(0, (var(--time) - var(--b) * var(--k) - var(--pause)) / (var(--d2) * var(--k)), 1);
  --e2: calc(var(--p2) * var(--p2) * var(--p2) * (var(--p2) * (6 * var(--p2) - 15) + 10));
  --s:  calc(22.5 + 337.5 * var(--e2));

  rotate: calc((var(--a) * var(--e1) + max(0, var(--s) - var(--a))) * 1deg);
  transform-box: view-box;
  transform-origin: 136.5px 136px;  /* exakt in der Achse der Linien */
  animation: timeline 1s linear infinite;
  animation-duration: calc(var(--duration) * 1s);
}

.star line:nth-child(2)  { --i: 1; }
.star line:nth-child(3)  { --i: 2; }
.star line:nth-child(4)  { --i: 3; }
.star line:nth-child(5)  { --i: 4; }
.star line:nth-child(6)  { --i: 5; }
.star line:nth-child(7)  { --i: 6; }
.star line:nth-child(8)  { --i: 7; }
.star line:nth-child(9)  { --i: 8; }
.star line:nth-child(10) { --i: 9; }
.star line:nth-child(11) { --i: 10; }
.star line:nth-child(12) { --i: 11; }
.star line:nth-child(13) { --i: 12; }
.star line:nth-child(14) { --i: 13; }
.star line:nth-child(15) { --i: 14; }   /* kürzester Weg = Besen beim Abbau */
.star line:nth-child(16) { rotate: none; animation: none; }   /* fester Strahl oben */

/* ---------- Grafik 3: Gleitende Linien ---------- */
.slide { padding: clamp(.8rem, 3vw, 3rem); }

.slide line {
  --i: 0;                           /* Linie 1 = 0 … Linie 9 = 8 */

  /* Einstellungen */
  --duration: 10;                   /* Gesamtdauer in s (ohne Einheit) */
  --move: .4;                       /* Anteil eines Viertels pro Linie (0–1) */
  --step: 25;                       /* Abstand im aufgebauten Zustand: 200 / 8 */

  /* Zeitplan: erste Hälfte, die zweite läuft per alternate rückwärts */
  --st: calc((1 - var(--move)) / 7);
  --f1: clamp(0, var(--t) * 2, 1);
  --f2: clamp(0, var(--t) * 2 - 1, 1);

  /* 1. Viertel: Linie 1 zuerst, gleitet auf ihren Platz */
  --p1: clamp(0, (var(--f1) - var(--i) * var(--st)) / var(--move), 1);
  --e1: calc(var(--p1) * var(--p1) * (3 - 2 * var(--p1)));

  /* 2. Viertel: Linie 2 zuerst, alle gleiten zur untersten Position */
  --p2: clamp(0, (var(--f2) - (var(--i) - 1) * var(--st)) / var(--move), 1);
  --e2: calc(var(--p2) * var(--p2) * (3 - 2 * var(--p2)));

  translate: 0 calc(((8 - var(--i)) * var(--e1) + var(--i) * var(--e2)) * var(--step) * 1px);
  animation: timeline 1s linear infinite alternate;
  animation-duration: calc(var(--duration) / 2 * 1s);
}

.slide line:nth-of-type(2) { --i: 1; }
.slide line:nth-of-type(3) { --i: 2; }
.slide line:nth-of-type(4) { --i: 3; }
.slide line:nth-of-type(5) { --i: 4; }
.slide line:nth-of-type(6) { --i: 5; }
.slide line:nth-of-type(7) { --i: 6; }
.slide line:nth-of-type(8) { --i: 7; }
.slide line:nth-of-type(9) { --i: 8; }

/* ---------- Highlight ---------- */
@property --highlight-color {
  syntax: "<color>";
  inherits: true;
  initial-value: #a86eff;
}

@keyframes highlight {
  from { --highlight-color: var(--highlight-1); }
  to   { --highlight-color: var(--highlight-2); }
}

.highlight,
.newsletter { animation: highlight 2.5s ease-in-out infinite alternate; }

.highlight { 
  color: var(--highlight-color);
  background-color: var(--highlight-bg);
}

/* ---------- Hilfeseiten ---------- */
.help {
  max-width: 40em;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--graphics);
  overflow-wrap: anywhere;
}

.help h2 {
  margin: 2.5em 0 .75em;
  font-size: var(--fs-feature);
  font-weight: 400;
  line-height: 1.25;
  color: var(--fg);
  scroll-margin-top: var(--gutter-y);
}

.help :is(p, ul, ol, pre, table) { margin-bottom: 1em; }
.help :is(ul, ol) { padding-left: 1.4em; }
.help li + li,
.help li > :is(ol, ul) { margin-top: .4em; }
.help li > :is(ol, ul) { margin-bottom: 0; }

.help strong { font-weight: 700; color: var(--fg); }

.help a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.help a:hover { color: var(--highlight-color); }

.help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .875em;
}

.help :not(pre) > code {
  padding: .1em .3em;
  border-radius: 4px;
  background: var(--line);
  color: var(--fg);
}

.help pre {
  padding: 1em;
  border-radius: var(--radius);
  background: var(--line);
  color: var(--fg);
  white-space: pre-wrap;
}

.help table { width: 100%; border-collapse: collapse; }
.help :is(th, td) {
  padding: .6em .8em .6em 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.help th { font-weight: 400; color: var(--muted); }
.help :is(th, td):first-child { white-space: nowrap; }





/* ---------- Mobil ---------- */
@media (max-width: 800px) {
  :root {
    --gap: 1px;
    --line-width: 1px;
    --gutter-y: clamp(2rem, 5vw, 4rem);
    --gutter: var(--gutter-y) clamp(1rem, 2.5vw, 2rem);
  }
  .row { grid-template-columns: 1fr 1fr; }
  .cell:empty { display: none; }

  .newsletter { grid-template-columns: minmax(0, 1fr); }
  .newsletter > button { grid-column: 1; grid-row: 4; }

  /* Volle Breite: alle Ecken eckig */
  .row > :is(.span-2, .span-full, .span-full-m),
  .stack-m > .cell {
    grid-column: 1 / -1;
    --r-start: 0;
    --r-end: 0;
  }

  /* Übrige Zellen paarweise gezählt: ungerade = links, gerade = rechts */
  .cell:nth-child(odd of .cell:not(.span-2, .span-full, .span-full-m, :empty))  { --r-start: 0; }
  .cell:nth-child(even of .cell:not(.span-2, .span-full, .span-full-m, :empty)) { --r-end: 0; }

  /* Zelle vor einem ausgeblendeten Platzhalter am Zeilenende */
  .cell:has(+ .cell:empty:last-child) { --r-end: 0; }

  .newsletter button{
    margin-top: 1rem;
  }

.display .muted { margin-top: .55em; }

  .spin{
    margin: 1rem 0;
  }
}