/* ============================================================
   PLANKERN DARK-GLASS DESIGN SYSTEM — CORE
   Lädt als LETZTES Stylesheet auf jeder Seite.
   Definiert Tokens, dunkle Basis, Shared-Chrome-Fixes,
   Aurora-Hintergrund (dark-fx.js) und Utility-Komponenten.
============================================================ */

:root {
  /* Flächen & Text (dunkel) */
  --bg: #04050e;
  --bg-2: #070919;
  --surface: rgba(255, 255, 255, .04);
  --surface-muted: rgba(255, 255, 255, .07);
  --surface-solid: #0b0e20;
  --border: rgba(255, 255, 255, .09);
  --border-soft: rgba(255, 255, 255, .06);
  --text: #eef1ff;
  --text-muted: #9aa1c0;
  --text-light: #6b7294;

  /* Blau-Skala (Brand) */
  --c-950: #020817;
  --c-900: #0f172a;
  --c-800: #1e3a8a;
  --c-700: #1d4ed8;
  --c-600: #2563eb;
  --c-500: #3b82f6;
  --c-400: #60a5fa;
  --c-300: #93c5fd;
  --c-200: #bfdbfe;

  /* Akzente */
  --c-sky: #38bdf8;
  --c-indigo: #6366f1;
  --c-violet: #8b5cf6;
  --c-green: #22c55e;
  --c-amber: #f59e0b;
  --c-red: #ef4444;
  --c-teal: #14b8a6;
  --c-pink: #ec4899;
  --c-orange: #f97316;

  --grad: linear-gradient(100deg, #38bdf8 0%, #4f7cff 45%, #8b5cf6 100%);

  /* Layout */
  --nav-h: 72px;
  --container: 1280px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Schatten / Glow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .5);
  --shadow-blue: 0 8px 34px rgba(59, 130, 246, .35);
  --shadow-blue-lg: 0 14px 46px rgba(59, 130, 246, .45);
  --shadow-glow: 0 0 80px rgba(59, 130, 246, .14);
}

/* ── Dunkle Basis ─────────────────────────────────────────── */
html {
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(99, 110, 255, .35); }

/* ── Aurora-Hintergrund (injiziert von dark-fx.js) ────────── */
.dkfx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 600px at 85% -5%, rgba(59, 130, 246, .13), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(139, 92, 246, .10), transparent 55%),
    radial-gradient(1000px 800px at 70% 105%, rgba(56, 189, 248, .06), transparent 55%),
    var(--bg);
}

.dkfx-ribbon {
  position: absolute;
  pointer-events: none;
  animation: dkDrift 16s ease-in-out infinite;
  will-change: transform;
}

.dkfx-ribbon svg {
  display: block;
  overflow: visible;
  width: 100%;
  height: auto;
}

.dkfx-ribbon .glow { position: absolute; inset: 0; filter: blur(20px); opacity: .55; }
.dkfx-ribbon .crisp { position: relative; filter: blur(.4px); }

@keyframes dkDrift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -22px, 0) rotate(1.2deg); }
}

.dkfx-stars { position: absolute; inset: 0; }

/* ── Shared-Chrome-Fixes (Nav-Dropdown war hell) ──────────── */
.nav-dropdown {
  background: rgba(10, 13, 28, .94);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55), 0 0 60px rgba(59, 130, 246, .08);
}

.nav-dd-item:hover { background: rgba(255, 255, 255, .06); }
.nav-dd-icon { filter: saturate(1.15) brightness(1.25); }

/* CTA-Button in der Nav: is-active (aktuelle Seite) darf die Schrift
   nicht einfärben – site-nav.css setzt sonst var(--c-400) !important
   auf dem blauen Gradient-Button (unlesbar auf demo/kontakt). */
#navbar .nav-actions .btn.is-active,
#navbar .nav-actions a.is-active,
#mobile-menu .btn.is-active,
#mobile-menu .mobile-cta a.is-active {
  color: #fff !important;
}
.nav-dd-footer-link { color: var(--c-400); }
.nav-dd-badge { background: rgba(59, 130, 246, .16); color: var(--c-300); }
.nav-dropdown-footer { border-top-color: var(--border-soft); }

/* Footer an Seitenhintergrund angleichen */
footer, .sol-footer, .br-footer {
  background: color-mix(in srgb, var(--bg) 70%, #000 10%);
}

/* ── Utility-Komponenten (für migrierte Seiten) ───────────── */
.dk-container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }

.dk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform .35s, border-color .35s, box-shadow .35s;
}

.dk-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, .45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35), 0 0 50px rgba(59, 130, 246, .12);
}

.dk-grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(99, 110, 255, .35));
}

.dk-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-full);
  padding: 13px 26px;
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
  white-space: nowrap;
  cursor: pointer;
}

.dk-btn-white { background: #fff; color: #0a0c1e; box-shadow: 0 8px 30px rgba(255, 255, 255, .12); }
.dk-btn-white:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(255, 255, 255, .18); }

.dk-btn-grad {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-blue), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.dk-btn-grad:hover { transform: translateY(-2px); box-shadow: var(--shadow-blue-lg), inset 0 1px 0 rgba(255, 255, 255, .25); }

.dk-btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.dk-btn-ghost:hover { background: var(--surface-muted); border-color: rgba(96, 165, 250, .5); }

.dk-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-400);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dk-label::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; opacity: .7; }

/* ── Theme-Toggle (injiziert von dark-fx.js) ─────────────── */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer; flex-shrink: 0;
  margin-left: .75rem;
  transition: color .2s, border-color .2s, transform .3s;
}
.theme-toggle:hover { color: var(--text); border-color: rgba(96, 165, 250, .5); transform: rotate(15deg); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ── LIGHT THEME ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f3f5fc;
  --bg-2: #eaedf8;
  --surface: rgba(12, 16, 48, .035);
  --surface-muted: rgba(12, 16, 48, .055);
  --surface-solid: #ffffff;
  --border: rgba(12, 16, 48, .12);
  --border-soft: rgba(12, 16, 48, .07);
  --text: #0c1030;
  --text-muted: #4d5470;
  --text-light: #7a809c;
  --shadow-glow: 0 0 80px rgba(59, 130, 246, .10);
}

[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] ::selection { background: rgba(99, 110, 255, .22); }

[data-theme="light"] .dkfx {
  background:
    radial-gradient(1100px 600px at 85% -5%, rgba(59, 130, 246, .14), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(139, 92, 246, .12), transparent 55%),
    var(--bg);
}
[data-theme="light"] .dkfx-ribbon { opacity: .38; }
[data-theme="light"] .dkfx-stars { opacity: .3; }

/* Nav (site-nav.css hat hardcodierte Dark-Werte) */
[data-theme="light"] #navbar { background: rgba(255, 255, 255, .62); border-color: rgba(12, 16, 48, .08); }
[data-theme="light"] #navbar.scrolled { background: rgba(255, 255, 255, .88); border-color: rgba(12, 16, 48, .1); box-shadow: 0 8px 32px rgba(12, 16, 48, .1); }
[data-theme="light"] .nav-logo-text { color: #0c1030; }
[data-theme="light"] .nav-links a, [data-theme="light"] .nav-link-btn { color: rgba(12, 16, 48, .72); }
[data-theme="light"] .nav-links a:hover { color: var(--c-600) !important; }
[data-theme="light"] .nav-item:hover .nav-link-btn { color: var(--c-600); }
[data-theme="light"] .nav-hamburger span { background: rgba(12, 16, 48, .8); }
[data-theme="light"] .nav-dropdown {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(12, 16, 48, .1);
  box-shadow: 0 24px 64px rgba(12, 16, 48, .16), 0 4px 16px rgba(12, 16, 48, .07);
}
[data-theme="light"] .nav-dd-icon { filter: none; }
[data-theme="light"] .nav-dd-icon.fi-amber { color: #b45309; }
[data-theme="light"] .nav-dd-icon.fi-yellow { color: #a16207; }
[data-theme="light"] .nav-dd-icon.fi-green { color: #15803d; }
[data-theme="light"] .nav-dd-item:hover { background: rgba(12, 16, 48, .05); }
[data-theme="light"] .nav-dd-footer-link { color: var(--c-600); }
[data-theme="light"] .nav-dd-badge { background: rgba(59, 130, 246, .12); color: var(--c-600); }
[data-theme="light"] #navbar a.is-active { color: var(--c-600) !important; }

/* Mobile-Menü */
[data-theme="light"] #mobile-menu { background: rgba(245, 247, 255, .98); }
[data-theme="light"] #mobile-menu a { color: rgba(12, 16, 48, .85); border-bottom-color: rgba(12, 16, 48, .08); }
[data-theme="light"] #mobile-menu a:hover { color: var(--c-600); }
[data-theme="light"] .mobile-accordion { border-bottom-color: rgba(12, 16, 48, .08); }
[data-theme="light"] .mobile-accordion-btn { color: rgba(12, 16, 48, .85); }
[data-theme="light"] .mobile-accordion-body a { color: rgba(12, 16, 48, .65) !important; }
[data-theme="light"] .mobile-accordion-body a:hover { background: rgba(12, 16, 48, .05); }
[data-theme="light"] #mobile-menu a.is-active { color: var(--c-600) !important; }

/* Footer (site-footer.css hat hardcodierte Dark-Werte) */
[data-theme="light"] footer, [data-theme="light"] .sol-footer, [data-theme="light"] .br-footer {
  background: #e9ecf7; border-top-color: rgba(12, 16, 48, .08);
}
[data-theme="light"] .footer-brand-desc, [data-theme="light"] .sol-footer-desc, [data-theme="light"] .br-footer-desc { color: rgba(12, 16, 48, .5); }
[data-theme="light"] .footer-col-title, [data-theme="light"] .sol-footer-col-title, [data-theme="light"] .br-footer-col-title { color: rgba(12, 16, 48, .6); }
[data-theme="light"] .footer-links a, [data-theme="light"] .sol-footer-links a, [data-theme="light"] .br-footer-links a { color: rgba(12, 16, 48, .55); }
[data-theme="light"] .footer-links a:hover, [data-theme="light"] .sol-footer-links a:hover, [data-theme="light"] .br-footer-links a:hover { color: rgba(12, 16, 48, .9); }
[data-theme="light"] .footer-bottom, [data-theme="light"] .sol-footer-bottom, [data-theme="light"] .br-footer-bottom { border-top-color: rgba(12, 16, 48, .08); }
[data-theme="light"] .footer-copy, [data-theme="light"] .footer-made,
[data-theme="light"] .footer-bottom > span, [data-theme="light"] .sol-footer-bottom > span, [data-theme="light"] .br-footer-bottom > span { color: rgba(12, 16, 48, .45); }
[data-theme="light"] .footer-legal a, [data-theme="light"] .sol-footer-legal a, [data-theme="light"] .br-footer-legal a { color: rgba(12, 16, 48, .45); }
[data-theme="light"] .footer-legal a:hover, [data-theme="light"] .sol-footer-legal a:hover, [data-theme="light"] .br-footer-legal a:hover { color: rgba(12, 16, 48, .8); }
[data-theme="light"] footer .nav-logo-text { color: #0c1030; }

/* Utility-Buttons */
[data-theme="light"] .dk-btn-white, [data-theme="light"] .nh-btn-white { background: #0c1030; color: #fff; box-shadow: 0 8px 30px rgba(12, 16, 48, .25); }
[data-theme="light"] .nh-btn-link:hover { color: var(--c-600); }
[data-theme="light"] .nh-flag { box-shadow: 0 0 0 1px rgba(12, 16, 48, .15); }

/* Scroll-Reveal (IntersectionObserver in dark-fx.js) */
.dk-reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2, .65, .25, 1), transform .8s cubic-bezier(.2, .65, .25, 1); }
.dk-reveal.dk-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .dkfx-ribbon { animation: none; }
  .dk-reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 820px) {
  .dkfx-ribbon { opacity: .55; }
}
