:root {
  --bg: #ffffff;
  --fg: #16181C;
  --text: #2E333A;
  --muted: #5F6670;
  --footer: #8A9099;
  --track: #D9DCE1;
  --knob: #ffffff;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0E1013;
  --fg: #F2F3F5;
  --text: #D3D7DC;
  --muted: #A1A7B0;
  --footer: #7E848D;
  --track: #3A3F47;
  --knob: #F2F3F5;
  color-scheme: dark;
}

html, body { margin: 0; background: var(--bg); }
body {
  font-family: "Segoe UI Variable Display", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--fg); min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
a { color: inherit; }

/* Logo: im dunklen Modus weiß */
.logo-img { transition: filter .3s ease; }
html[data-theme="dark"] .logo-img { filter: invert(1); }

/* Startseite */
.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 48px 20px;
}
.hero .logo { width: min(80vw, 460px); height: auto; display: block; }
.hero h1 { margin: 56px 0 0; font-weight: 600; letter-spacing: -0.02em; font-size: clamp(28px, 5vw, 44px); line-height: 1.15; }
.hero p  { margin: 14px 0 0; font-size: clamp(16px, 2.4vw, 21px); color: var(--muted); }

/* Rechtstexte */
.legal { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 40px 24px 56px; box-sizing: border-box; line-height: 1.6; }
.legal .top { display: inline-block; margin-bottom: 40px; }
.legal .top img { width: 180px; height: auto; display: block; }
.legal h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 28px; }
.legal h2 { font-size: 18px; font-weight: 600; margin: 32px 0 8px; }
.legal p, .legal li { font-size: 16px; color: var(--text); }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 22px; }
.legal a { color: var(--fg); text-underline-offset: 3px; }

/* Fußzeile */
footer { padding: 20px; text-align: center; font-size: 14px; color: var(--footer); }
footer a { color: var(--footer); text-decoration: none; margin: 0 10px; }
footer a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* Hell/Dunkel-Schalter */
.theme-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 10;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px; border: 0; background: none; cursor: pointer; color: var(--muted);
  font: inherit; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.theme-toggle .track {
  position: relative; width: 46px; height: 26px; border-radius: 13px; background: var(--track);
  transition: background-color .3s ease;
}
.theme-toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--knob); box-shadow: 0 1px 3px rgba(0,0,0,.25);
  display: grid; place-items: center; color: #16181C;
  transition: transform .3s ease, background-color .3s ease;
}
html[data-theme="dark"] .theme-toggle .knob { transform: translateX(20px); color: #0E1013; }
.theme-toggle svg { width: 12px; height: 12px; }
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block !important; }
.theme-toggle:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 16px; }

/* Easter Egg: FI ausgelöst */
.fi-trip {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: #000; color: #F2F3F5; text-align: center;
  transition: opacity .5s ease;
  -webkit-user-select: none; user-select: none;
}
.fi-trip.flicker { animation: fi-flicker .7s steps(1) 1; }
.fi-trip.out { opacity: 0; }
.fi-msg { display: flex; flex-direction: column; gap: 10px; animation: fi-in .4s .7s ease both; }
.fi-trip:not(.flicker) .fi-msg { animation: none; }
.fi-msg strong { font-size: clamp(26px, 5vw, 40px); font-weight: 600; letter-spacing: -0.02em; }
.fi-msg span { font-size: clamp(16px, 2.4vw, 20px); color: #A1A7B0; }
.fi-msg small { font-size: 13px; color: #7E848D; margin-top: 8px; }
@keyframes fi-flicker {
  0% { opacity: 1; } 12% { opacity: 0; } 24% { opacity: .8; } 36% { opacity: .1; } 48% { opacity: 1; } 60% { opacity: .3; } 72% { opacity: 1; }
}
@keyframes fi-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  body, .logo-img, .theme-toggle .track, .theme-toggle .knob { transition: none; }
}
