/* ====== Design-Variablen ====== */
:root {
  --bg: #0e0f12;
  --fg: #e7e9ee;
  --muted: #aab0bd;
  --glass: rgba(255,255,255,0.06);
  --glass-strong: rgba(255,255,255,0.12);
  --shadow: 0 20px 40px rgba(0,0,0,0.45);
  --accent: 255,255,255;
}

html[data-theme="light"] {
  --bg: #f1f2f5;
  --fg: #111216;
  --muted: #5b6270;
  --glass: rgba(255,255,255,0.55);
  --glass-strong: rgba(255,255,255,0.75);
  --shadow: 0 30px 50px rgba(0,0,0,0.12);
  --accent: 17,18,22;
}

/* Seite */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial;
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at 70% 10%, rgba(255,255,255,0.04), transparent 60%),
    radial-gradient(1000px 500px at 10% 90%, rgba(255,255,255,0.05), transparent 60%),
    var(--bg);
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.page {
  width: min(920px, 92vw);
  margin: 0 auto;
  padding: 40px 24px 80px;
  text-align: center;
}

h1 {
  font-size: clamp(32px, 6vw, 60px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--fg);
}
h1 span {
  display: inline-block;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.35));
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.35));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hint{
  color: var(--muted);
  margin-top: 18px;
  font-size: 14px;
}

/* ====== Glass Toggle ====== */
.glass-toggle {
  --w: 280px;
  --h: 72px;
  border: 0;
  padding: 0;
  width: var(--w);
  height: var(--h);
  background: transparent;
  cursor: pointer;
  position: relative;
  border-radius: calc(var(--h) / 2);
  isolation: isolate;
}

.track {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border-radius: inherit;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.25),
    inset 0 -1px 1px rgba(0,0,0,0.12),
    var(--shadow);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  overflow: hidden;
}

.track::before {
  content: "";
  position: absolute; inset: -30%;
  background: radial-gradient(80% 60% at 20% 20%, rgba(255,255,255,0.25), transparent 60%),
              radial-gradient(70% 50% at 80% 80%, rgba(255,255,255,0.15), transparent 60%);
  pointer-events: none;
}

.label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--muted);
  opacity: 0.9;
  user-select: none;
  transition: color .35s ease, opacity .35s ease;
  font-size: 16px;
}
.label--left  { left: 22px; }
.label--right { right: 22px; }

.glass-toggle[aria-pressed="true"] .label--left { color: var(--fg); opacity: 1; }
.glass-toggle[aria-pressed="false"] .label--right { color: var(--fg); opacity: 1; }

/* Knopf */
.knob {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(var(--h) - 12px);
  height: calc(var(--h) - 12px);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.55));
  box-shadow:
    0 10px 30px rgba(0,0,0,0.35),
    inset 0 2px 4px rgba(255,255,255,0.65),
    inset 0 -2px 6px rgba(0,0,0,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), background .35s ease, box-shadow .35s ease;
  z-index: 1;
}

.glass-toggle[aria-pressed="false"] .knob {
  transform: translateX(calc(var(--w) - var(--h)));
}

/* Lichtreflex */
.glare {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(60% 40% at 30% 25%, rgba(255,255,255,0.9), transparent 60%),
    radial-gradient(80% 60% at 70% 80%, rgba(255,255,255,0.3), transparent 70%);
  mix-blend-mode: soft-light;
  pointer-events: none;
  filter: blur(0.2px);
}

/* Icons */
.icon {
  width: 28px; height: 28px; fill: rgb(var(--accent));
  opacity: .9; transition: opacity .25s ease;
}
.icon--sun { opacity: 0; }
html[data-theme="light"] .icon--sun { opacity: .95; }
html[data-theme="light"] .icon--moon { opacity: 0; }

/* Focus / Hover */
.glass-toggle:focus-visible { outline: 3px solid rgba(100,150,255,0.6); outline-offset: 4px; }
.glass-toggle:hover .knob { box-shadow: 0 16px 40px rgba(0,0,0,0.45), inset 0 2px 4px rgba(255,255,255,0.65), inset 0 -2px 6px rgba(0,0,0,0.15); }

/* Sanfter Theme-Übergang */
html {
  transition: background-color .35s ease, color .35s ease, background .45s ease;
}
