@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/space-grotesk.woff2) format("woff2");
}

:root {
  color-scheme: dark;
  --space: #04060f;
  --space-2: #0a1026;
  --fg: #e8ecf8;
  --muted: #a3acc8;
  --faint: #6f7898;
  --cyan: #6fd6ff;
  --violet: #a98bff;
  --amber: #ffb35c;
  --glass: rgba(16, 22, 46, .58);
  --glass-2: rgba(24, 32, 64, .72);
  --line: rgba(150, 175, 255, .16);
  --line-2: rgba(150, 175, 255, .32);
  --radius: 14px;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  font: 17px/1.65 var(--body);
  background: var(--space);
}
/* Farbnebel als feste Ebene statt "background-attachment: fixed": das zwingt
   viele Browser, bei jedem Scrollschritt die ganze Seite neu zu malen. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 85% 10%, rgba(110, 70, 200, .22), transparent 70%),
    radial-gradient(ellipse 60% 45% at 5% 60%, rgba(40, 110, 200, .16), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 120%, rgba(255, 140, 70, .08), transparent 70%),
    linear-gradient(180deg, var(--space) 0%, var(--space-2) 100%);
}

#sterne {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

a { color: var(--cyan); text-underline-offset: .18em; }
a:hover { color: #b5ebff; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--amber); color: #120a00; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 16px; top: 8px; }

/* ---------- Kopf ---------- */
.kopf {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  background: rgba(4, 6, 15, .55);
  border-bottom: 1px solid var(--line);
}
.kopf-in {
  max-width: 1120px;
  margin: auto;
  padding: .7rem 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem 1.6rem;
}
.marke {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-right: auto;
  font: 700 1.3rem/1 var(--display);
  letter-spacing: .01em;
  color: var(--fg);
  text-decoration: none;
}
.marke:hover { color: var(--fg); }
.marke svg { width: 30px; height: 30px; flex: none; }
.marke b { color: var(--cyan); font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: .2rem 1.3rem; font: 500 .98rem/1.4 var(--display); }
.nav a { color: var(--muted); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current] { color: var(--fg); border-bottom-color: var(--amber); }

main { flex: 1; width: 100%; }
.wrap { max-width: 1120px; margin: auto; padding: 0 16px; }
.schmal { max-width: 780px; }

/* ---------- Startseite: Held ---------- */
.held {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: 2rem;
  min-height: min(74vh, 700px);
  padding: 3rem 0 2rem;
}
.held h1 {
  font: 700 clamp(2.9rem, 8vw, 5.6rem)/.95 var(--display);
  letter-spacing: -.035em;
  margin: 0 0 1.2rem;
  background: linear-gradient(100deg, #ffffff 0%, #cfe9ff 35%, var(--cyan) 65%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ueberzeile {
  font: 500 .85rem/1 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 1.1rem;
}
.held .lead { font-size: clamp(1.08rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 34em; margin: 0 0 2rem; }
.knoepfe { display: flex; flex-wrap: wrap; gap: .8rem; }
.knopf {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .78rem 1.25rem;
  border-radius: 999px;
  font: 600 1rem/1 var(--display);
  text-decoration: none;
  border: 1px solid var(--line-2);
  color: var(--fg);
  background: var(--glass);
  transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
}
.knopf:hover { color: var(--fg); transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 6px 28px rgba(111, 214, 255, .18); }
.knopf.voll { background: linear-gradient(135deg, #3aa8e8, #6a5cf0); border-color: transparent; color: #fff; }
.knopf.voll:hover { box-shadow: 0 8px 32px rgba(106, 92, 240, .45); }
.knopf svg { width: 1em; height: 1em; }

/* Planet mit Mond */
.system {
  --d: min(400px, 78vw);
  position: relative;
  width: var(--d);
  height: var(--d);
  margin: auto;
}
.planet {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #102060;
  box-shadow:
    0 0 0 1px rgba(160, 200, 255, .25),
    0 0 40px 6px rgba(90, 150, 255, .35),
    0 0 140px 30px rgba(110, 90, 255, .18);
}
.planet .flaeche, .planet .wolken, .planet .lichter {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* Drehung per transform statt background-position: die Textur wird nur einmal
   gemalt und dann vom Compositor verschoben. Das <i> ist zwei Texturbreiten
   breit (Textur = doppelte Planetenbreite) und wandert um eine davon. */
.planet i, .mond-flaeche i {
  position: absolute;
  top: 0;
  left: 0;
  width: 400%;
  height: 100%;
  background-repeat: repeat-x;
  background-size: 50% 100%;
  will-change: transform;
  animation: drehen 90s linear infinite;
}
.planet .flaeche i { background-image: url(planet-surface.webp); }
.planet .wolken i { background-image: url(planet-clouds.webp); animation-duration: 60s; }
.planet .wolken { opacity: .9; }
/* Stadtlichter: drehen mit der Oberflaeche, sichtbar nur auf der Nachtseite */
.planet .lichter i { background-image: url(planet-lights.webp); }
.planet .lichter {
  -webkit-mask-image: linear-gradient(98deg, transparent 56%, #000 74%);
  mask-image: linear-gradient(98deg, transparent 56%, #000 74%);
  opacity: .95;
}
.planet .schatten {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle calc(var(--d) * .5) at 26% 36%, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(98deg, rgba(2, 4, 18, 0) 50%, rgba(2, 4, 18, .82) 70%, rgba(2, 4, 18, .97) 86%),
    radial-gradient(circle closest-side, rgba(0, 0, 0, 0) 72%, rgba(2, 4, 18, .45) 100%);
  box-shadow: inset 0 0 26px 6px rgba(120, 180, 255, .35), inset -26px -10px 60px rgba(0, 0, 10, .7);
}
@keyframes drehen { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Umlaufbahn rein in 2D (WebKit auf iPhone/iPad animiert die 3D-Variante
   nicht): zwei verschachtelte Bewegungen entlang der geneigten Achsen der
   Ellipse ergeben die Bahn, z-index wechselt, wenn der Mond hinter den
   Planeten laeuft. Neigung 12 Grad, Halbachsen 0,74 d und 0,2 d. */
.bahn {
  position: absolute;
  left: -24%;
  top: calc(50% - var(--d) * .2);
  width: 148%;
  height: calc(var(--d) * .4);
  border-radius: 50%;
  border: 1px solid rgba(170, 190, 255, .18);
  transform: rotate(-12deg);
  z-index: 0;
  pointer-events: none;
}
.bahn.vorn { z-index: 3; clip-path: inset(50% 0 0 0); }
.planet { z-index: 2; }
.mond-x {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(calc(var(--d) * .724), calc(var(--d) * -.154));
  animation: mond-x 20s cubic-bezier(.37, 0, .63, 1) infinite alternate, mond-z 40s steps(1, end) infinite;
}
.mond-y { animation: mond-y 20s cubic-bezier(.37, 0, .63, 1) -10s infinite alternate; }
.mond {
  position: absolute;
  width: calc(var(--d) * .15);
  height: calc(var(--d) * .15);
  margin: calc(var(--d) * -.075) 0 0 calc(var(--d) * -.075);
  border-radius: 50%;
  overflow: hidden;
  background: #8a8780;
  box-shadow: 0 0 16px rgba(255, 240, 220, .14);
}
.mond > div { position: absolute; inset: 0; border-radius: 50%; }
.mond-flaeche { overflow: hidden; }
.mond-flaeche i { background-image: url(moon-surface.webp); animation-duration: 30s; }
/* gleiche Lichtrichtung wie beim Planeten */
.mond-licht {
  background:
    radial-gradient(circle calc(var(--d) * .075) at 28% 38%, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(98deg, rgba(4, 4, 10, 0) 48%, rgba(4, 4, 10, .8) 70%, rgba(4, 4, 10, .95) 86%),
    radial-gradient(circle closest-side, rgba(0, 0, 0, 0) 70%, rgba(4, 4, 10, .4) 100%);
}
/* Mondfinsternis: rechts vom Planeten liegt sein Schatten. Der Umlauf
   beginnt (t = 0) am rechten Ende der Bahn, deshalb um 0 % und 100 %. */
.mond-finster {
  background: #7a3018;
  mix-blend-mode: multiply;
  opacity: 0;
  animation: finsternis 40s linear infinite;
}
@keyframes finsternis {
  0%, 8% { opacity: .9; }
  15%, 85% { opacity: 0; }
  92%, 100% { opacity: .9; }
}
@keyframes mond-x {
  from { transform: translate(calc(var(--d) * .724), calc(var(--d) * -.154)); }
  to { transform: translate(calc(var(--d) * -.724), calc(var(--d) * .154)); }
}
@keyframes mond-y {
  from { transform: translate(calc(var(--d) * -.0416), calc(var(--d) * -.196)) scale(.8); }
  to { transform: translate(calc(var(--d) * .0416), calc(var(--d) * .196)) scale(1.1); }
}
@keyframes mond-z { 0% { z-index: 3; } 50% { z-index: 1; } 100% { z-index: 1; } }

@media (prefers-reduced-motion: reduce) {
  .planet i, .mond-flaeche i, .mond-x, .mond-y, .mond-finster { animation: none; }
}

/* ---------- Leichte Ansicht ----------
   Fuer langsame Rechner (Software-Rendering, VMs): sterne.js schaltet sie
   automatisch ein, wenn die Seite ruckelt, oder per ?ansicht=leicht. Keine
   Unschaerfe-Filter, keine Animationen, keine Hover-Bewegungen. */
html.leicht { scroll-behavior: auto; }
html.leicht *, html.leicht *::before, html.leicht *::after { transition: none !important; }
html.leicht .planet i, html.leicht .mond-flaeche i, html.leicht .mond-x, html.leicht .mond-y, html.leicht .mond-finster { animation: none; will-change: auto; }
html.leicht .kopf, html.leicht .karte, html.leicht .feld { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.leicht .kopf { background: #070a18; }
html.leicht .karte, html.leicht .feld { background: #0d1330; }
html.leicht .knopf:hover, html.leicht .karte:hover, html.leicht .karte:hover .bild img { transform: none; box-shadow: none; }
html.leicht .planet { box-shadow: 0 0 0 1px rgba(160, 200, 255, .25), 0 0 30px 4px rgba(90, 150, 255, .3); }
html.leicht .mond { box-shadow: none; }

/* ---------- Abschnitte ---------- */
.abschnitt { padding: 3.5rem 0; }
.abschnitt-kopf { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 1.8rem; }
.abschnitt-kopf h2 { margin: 0; }
.abschnitt-kopf p { margin: .4rem 0 0; color: var(--muted); max-width: 40em; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 2.6rem 0 1rem; }
h3 { font-size: 1.25rem; line-height: 1.3; margin: 1.8rem 0 .5rem; }
.seite h1 { font: 700 clamp(2.2rem, 6vw, 3.4rem)/1.05 var(--display); letter-spacing: -.03em; margin: 3rem 0 1rem; }
.seite .lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 1rem; }

.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1.1rem; }
.karte {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.karte:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 14px 40px rgba(0, 0, 0, .45), 0 0 0 1px rgba(111, 214, 255, .12); }
.karte .bild { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #0b1124; border-bottom: 1px solid var(--line); }
.karte .bild img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: transform .5s; }
.karte .bild img.zoom { width: 175%; height: auto; }
.karte:hover .bild img { transform: scale(1.04); }
.karte .inhalt { padding: 1rem 1.15rem 1.15rem; display: flex; flex-direction: column; flex: 1; }
.karte h3 { margin: 0 0 .35rem; font-size: 1.3rem; }
.karte h3 a { color: var(--fg); text-decoration: none; }
.karte h3 a::after { content: ""; position: absolute; inset: 0; }
.karte p { margin: 0 0 1rem; color: var(--muted); font-size: .96rem; line-height: 1.55; }
.karte .marken { margin-top: auto; display: flex; flex-wrap: wrap; gap: .4rem; position: relative; z-index: 1; }
.marke-klein {
  font: 500 .78rem/1 var(--mono);
  padding: .42em .7em;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  text-decoration: none;
  background: rgba(255, 255, 255, .03);
}
a.marke-klein:hover { color: var(--fg); border-color: var(--cyan); }

.hinweis {
  border-left: 3px solid var(--amber);
  background: rgba(255, 179, 92, .07);
  padding: .8rem 1rem;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-size: .95rem;
}
.hinweis strong { color: var(--amber); }

/* Zweispaltiger Block mit Bild */
.feld {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.feld h2, .feld h3 { margin-top: 0; }
.feld p { color: var(--muted); }
.feld figure { margin: 0; }
.feld figure img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); }
.feld figcaption { color: var(--faint); font-size: .85rem; margin-top: .5rem; }
.feld + .feld { margin-top: 1.4rem; }

.liste { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: .45rem 1.2rem; }
.feld .liste { grid-template-columns: 1fr; }
.liste li { position: relative; padding-left: 1.4rem; color: var(--fg); }
.liste li::before { content: ""; position: absolute; left: .1rem; top: .62em; width: .5rem; height: .5rem; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c9f1ff, var(--cyan) 60%, #2a6fb0); box-shadow: 0 0 8px rgba(111, 214, 255, .6); }

.downloads { display: grid; gap: .7rem; margin: 1.2rem 0; }
.download {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--fg);
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.download:hover { color: var(--fg); border-color: var(--cyan); background: rgba(111, 214, 255, .06); }
.download svg { width: 1.6rem; height: 1.6rem; flex: none; color: var(--cyan); }
.download span { display: flex; flex-direction: column; line-height: 1.3; }
.download small { color: var(--faint); font-family: var(--mono); font-size: .78rem; }

/* Rechtstexte */
.text h2 { font-size: 1.45rem; margin: 2.2rem 0 .6rem; }
.text p, .text li { color: #cdd3e6; }
.rueck { unicode-bidi: bidi-override; direction: rtl; }
.rueck b { font-weight: inherit; }
.adresse { font-style: normal; line-height: 1.7; }

/* ---------- Fuss ---------- */
.fuss { border-top: 1px solid var(--line); background: rgba(4, 6, 15, .6); margin-top: 3rem; }
.fuss-in { max-width: 1120px; margin: auto; padding: 1.4rem 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem; color: var(--faint); font-size: .9rem; }
.fuss a { color: var(--muted); text-decoration: none; }
.fuss a:hover { color: var(--fg); text-decoration: underline; }
.fuss nav { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.fuss .ansicht { flex-basis: 100%; gap: .3rem .9rem; font-size: .85rem; }
.fuss .ansicht a[aria-current] { color: var(--fg); text-decoration: underline; text-decoration-color: var(--amber); }

/* 404 */
.verloren { text-align: center; padding: 5rem 0 3rem; }
.verloren .zahl { font: 700 clamp(5rem, 22vw, 11rem)/1 var(--display); letter-spacing: -.05em; background: linear-gradient(180deg, #fff, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.verloren p { color: var(--muted); }

@media (max-width: 820px) {
  .held { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 2rem; text-align: left; }
  .held .system { --d: min(300px, 70vw); order: -1; margin: 1.5rem auto 2.5rem; }
  .feld { grid-template-columns: 1fr; }
  .feld figure { order: -1; }
}
