/* ===== THEMES ===== */
:root, [data-theme="light"] {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --fg: #0b1f33;
  --head: #0b2f5b;
  --muted: #5b6b7a;
  --accent: #1e6fd9;
  --cta-bg: #0b2f5b;
  --cta-fg: #ffffff;
  --card: rgba(255,255,255,.85);
  --line: rgba(11,47,91,.10);
  --shadow: 0 10px 40px rgba(11,47,91,.08);
  --hero-panel: rgba(255,255,255,.7);
}
[data-theme="dark"] {
  --bg: #05070a;
  --surface: #0b1118;
  --fg: #eef6fa;
  --head: #eef6fa;
  --muted: #8ea3b0;
  --accent: #5ee1ff;
  --cta-bg: #5ee1ff;
  --cta-fg: #001018;
  --card: rgba(8,12,18,.6);
  --line: rgba(255,255,255,.08);
  --shadow: 0 10px 40px rgba(0,0,0,.4);
  --hero-panel: rgba(5,7,10,.45);
}
[data-theme="warm"] {
  --bg: #faf3e6;
  --surface: #fffaf0;
  --fg: #3b2a1a;
  --head: #3b2a1a;
  --muted: #7a6650;
  --accent: #b4531b;
  --cta-bg: #b4531b;
  --cta-fg: #fffaf0;
  --card: rgba(255,250,240,.85);
  --line: rgba(59,42,26,.12);
  --shadow: 0 10px 40px rgba(59,42,26,.10);
  --hero-panel: rgba(255,250,240,.7);
}

/* ===== BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6; overflow-x: hidden;
  transition: background-color .6s ease, color .6s ease;
}
a { color: inherit; }
main, header, footer { position: relative; z-index: 1; }
canvas#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ===== HEADER ===== */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem clamp(1.25rem, 4vw, 3rem);
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, var(--bg), transparent);
}
.logo { font-weight: 800; letter-spacing: .04em; font-size: 1.05rem; color: var(--head); text-decoration: none; }
.logo span { color: inherit; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1.25rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: .9rem; transition: color .3s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--head); }
.nav a.highlight { color: var(--accent); font-weight: 600; }

/* ===== THEME-SCHALTER (überall gleich) ===== */
.theme-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px; background: var(--surface);
}
.theme-switch button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  padding: .4rem .85rem; border-radius: 999px; cursor: pointer; transition: background .3s, color .3s;
}
.theme-switch button[aria-pressed="true"] { background: var(--cta-bg); color: var(--cta-fg); }
.theme-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== HERO ===== */
.hero { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 7rem 1.5rem 3rem; }
.hero-inner {
  background: transparent; padding: clamp(1rem, 3vw, 2rem); max-width: 980px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .3em; font-size: .75rem; color: var(--accent); margin-bottom: 1.25rem; font-weight: 600; }
h1 { font-size: clamp(2.4rem, 6.2vw, 5.2rem); line-height: 1.04; font-weight: 800; letter-spacing: -.03em; color: var(--head); }
h1 .gradient {
  background: linear-gradient(120deg, var(--head), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); max-width: 36rem; margin: 1.5rem auto 2.5rem; font-size: 1.1rem; }
.hint { margin-top: 2.5rem; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* ===== BUTTONS ===== */
.btns { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.cta, .ghost {
  display: inline-block; padding: 1rem 2rem; border-radius: 999px;
  font-weight: 700; text-decoration: none; transition: transform .3s, box-shadow .3s;
}
.cta { background: var(--cta-bg); color: var(--cta-fg); box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.ghost { border: 1px solid var(--line); color: var(--head); background: var(--surface); }
.cta:hover, .ghost:hover { transform: translateY(-2px); }

/* ===== SECTIONS ===== */
section { padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 6vw, 6rem); }
.section-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 1rem; color: var(--head); }
.section-sub { color: var(--muted); max-width: 40rem; margin-bottom: 3rem; }
.page-hero { padding-top: 10rem; padding-bottom: 2rem; }

/* ===== CARDS ===== */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 2rem; box-shadow: var(--shadow);
  transition: transform .4s, box-shadow .4s;
}
.card:hover { transform: translateY(-6px); }
.card .idx { color: var(--accent); font-size: .85rem; letter-spacing: .15em; font-weight: 600; }
.card h3 { font-size: 1.35rem; margin: .75rem 0 .5rem; color: var(--head); }
.card p, .card li { color: var(--muted); font-size: .95rem; }
.card ul { margin-top: .75rem; padding-left: 1.1rem; }
.card .more { display: inline-block; margin-top: 1.25rem; color: var(--accent); font-weight: 600; text-decoration: none; }

.steps { counter-reset: s; }
.step { position: relative; padding-left: 3.5rem; margin-bottom: 2rem; }
.step::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 800; font-size: 1.4rem;
}
.step h3 { color: var(--head); font-size: 1.15rem; margin-bottom: .25rem; }
.step p { color: var(--muted); }

/* ===== RECHNER-SLOT ===== */
.calc-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  padding: clamp(1.5rem, 4vw, 3rem); max-width: 880px; margin: 0 auto; text-align: center; box-shadow: var(--shadow);
}
.calc-box p { color: var(--muted); }

/* ===== KONTAKT ===== */
.contact-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.contact-grid .card h3 { font-size: 1rem; color: var(--accent); margin-bottom: .4rem; }
.contact-grid .card a, .contact-grid .card p { color: var(--head); text-decoration: none; font-size: 1rem; font-weight: 500; }

/* ===== FOOTER ===== */
footer {
  padding: 3rem clamp(1.25rem, 6vw, 6rem); border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; background: var(--surface);
}
footer a { color: var(--muted); }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(40px); }

@media (max-width: 720px) {
  .nav { gap: .9rem; }
  .nav a { font-size: .8rem; }
  .hero, .page-hero { padding-top: 9rem; }
  .step { padding-left: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Schalter mit gleitender Markierung ===== */
.theme-switch { position: relative; }
.theme-switch .ts-thumb { position: absolute; left: 3px; top: 3px; bottom: 3px; width: 0; border-radius: 999px; background: var(--cta-bg);
  box-shadow: 0 4px 14px rgba(10,132,255,.35); transition: transform .5s cubic-bezier(.3,1.25,.5,1), width .5s cubic-bezier(.3,1.25,.5,1), background-color .9s ease; z-index: 0; }
.theme-switch button { position: relative; z-index: 1; }
.theme-switch button[aria-pressed="true"] { background: transparent; color: var(--cta-fg); }

/* ===== Weicher Übergang beim Wechsel des Farbmodus ===== */
html.theme-fade body,
html.theme-fade body *:not(.pk-wrap):not(.pk-wrap *):not(.ts-thumb),
html.theme-fade body *:not(.pk-wrap):not(.pk-wrap *)::before,
html.theme-fade body *:not(.pk-wrap):not(.pk-wrap *)::after {
  transition: background-color .9s ease, color .9s ease, border-color .9s ease, fill .9s ease, stroke .9s ease,
    box-shadow .9s ease, outline-color .9s ease, text-decoration-color .9s ease, --ga .9s ease, --gb .9s ease !important;
}
@media (prefers-reduced-motion: reduce) { .theme-switch .ts-thumb { transition: none; } }

/* Moduswechsel per View Transition: alte Ansicht bleibt stehen, neue wächst als Kreis darüber */
html.vt-theme::view-transition-old(root), html.vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.vt-theme::view-transition-old(root) { z-index: 1; }
html.vt-theme::view-transition-new(root) { z-index: 2; }
