@charset "UTF-8";
/*
 * Pure CSS Dark Mode mit 3 Modi: Auto (System), Hell, Dunkel
 * - Keine JS-Persistenz (Browser-Reload setzt auf Auto zurück)
 * - Tokens via CSS-Variablen
 * - :has() + Radio-Buttons für Umschalten
 * - @media (prefers-color-scheme) steuert Auto-Modus
 * - color-scheme passt native Form Controls an
 * - Optional: light-dark() als progressive Enhancement
 */
/* Grundlayout */
:root {
  --radius: 1rem;
  --gap: 1rem;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  /* Light-Defaults (werden im Auto-Modus bei fehlender dark-Präferenz genutzt) */
  --bg: #ffffff;
  --surface: #f5f7fb;
  --text: #0f172a; /* slate-900 */
  --muted: #475569; /* slate-600 */
  --border: #e5e7eb; /* gray-200 */
  --primary: 220 90% 56%; /* hsl für leichtere Varianten */
  color-scheme: light dark; /* signale an den UA: beide Schemata sind möglich */
}

/* Auto (System) – wenn der User dark bevorzugt, überschreiben wir Tokens */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e14; /* sehr dunkles Blau/Anthrazit */
    --surface: #121826; /* leicht heller für Cards */
    --text: #e6e6e6;
    --muted: #9aa0a6;
    --border: #2a3242;
    --primary: 220 90% 66%;
    color-scheme: dark light; /* dark zuerst -> stärkere Gewichtung für nat. Controls */
  }
}
/* Manueller Light-Mode */
:root:has(#mode-light:checked) {
  --bg: #ffffff;
  --surface: #f5f7fb;
  --text: #0f172a;
  --muted: #475569;
  --border: #e5e7eb;
  --primary: 220 90% 56%;
  color-scheme: light;
}

/* Manueller Dark-Mode */
:root:has(#mode-dark:checked) {
  --bg: #0b0e14;
  --surface: #121826;
  --text: #e6e6e6;
  --muted: #9aa0a6;
  --border: #2a3242;
  --primary: 220 90% 66%;
  color-scheme: dark;
}

/* Progressive Enhancement: light-dark() (falls unterstützt) */
@supports (color: light-dark(white, black)) {
  :root {
    /* Separierte Tokens: */
    --bg-light: #ffffff;
    --bg-dark: #0b0e14;
    --surface-light: #f5f7fb;
    --surface-dark: #121826;
    --text-light: #0f172a;
    --text-dark: #e6e6e6;
    --muted-light: #475569;
    --muted-dark: #9aa0a6;
    --border-light: #e5e7eb;
    --border-dark: #2a3242;
  }
  /* Auto (System) – wird von UA entschieden */
  :root:not(:has(#mode-light:checked, #mode-dark:checked)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --text: light-dark(var(--text-light), var(--text-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
  }
}
html {
  position: relative;
  height: auto;
  width: auto;
}
html body {
  height: auto;
  width: auto;
  position: relative;
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
html body main {
  height: auto;
  width: auto;
  position: relative;
  padding-block: 2rem;
}
html body main #space {
  height: auto;
  width: auto;
  position: relative;
  overflow-y: auto;
}

/* Segmented Control (Auto/Light/Dark) */
.mode-switch {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.mode-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.mode-switch label {
  position: relative;
  padding: 0.5rem 0.9rem;
  border-radius: calc(var(--radius) - 0.25rem);
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}

.mode-switch label:hover {
  border-color: var(--border);
}

/* Aktiven Zustand mit :has() hervorheben */
.mode-switch:has(#mode-auto:checked) label[for=mode-auto],
.mode-switch:has(#mode-light:checked) label[for=mode-light],
.mode-switch:has(#mode-dark:checked) label[for=mode-dark] {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 0px;
  background: color-mix(in oklab, hsl(var(--primary)) 12%, var(--surface));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 1px 0 color-mix(in oklab, #000 5%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, hsl(var(--primary)) 10%, var(--surface));
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Motion-Präferenz respektieren */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
.loader-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in oklab, var(--bg) 80%, #000 20%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top: 4px solid hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}