/**
 * Energieklar – Premium Surface Styles
 * -------------------------------------
 * Cursor-Layer nutzt mix-blend-mode für kontrastreiche Lesbarkeit auf
 * hellen UND dunklen Flächen (State-of-the-Art 2025/2026).
 * Kontext-Hover über CSS :has() – alle interaktiven Flächen tragen .cursor-target.
 */

:root {
  /* Öffentliche Hand: Tiefblau, ruhiges Teal, hohe Lesbarkeit */
  --ink: #0a1624;
  --slate: #121f2e;
  --mist: #8ea3b0;
  --paper: #e8eef4;
  --snow: #f4f7fa;
  --signal: #136f5c;
  --signal-dim: #0d5246;
  --ridge: #2a4a5e;
  --glass: rgba(244, 247, 250, 0.06);
  --ring: rgba(244, 247, 250, 0.92);
  --dot: rgba(244, 247, 250, 0.98);
}

/* --- Custom Cursor Container (nur Desktop / feine Zeiger) --- */
.custom-cursor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
  display: none;
}

html.is-cursor-on .custom-cursor {
  display: block;
}

/* Inneres: difference sorgt für automatische Kontrast-Anpassung */
.custom-cursor__inner {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  mix-blend-mode: difference;
}

.custom-cursor__dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 999px;
  background: var(--dot);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
}

.custom-cursor__ring {
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 999px;
  border: 1px solid var(--ring);
  opacity: 0.85;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease, border-radius 0.35s ease, width 0.35s ease,
    height 0.35s ease, margin 0.35s ease;
}

/* Kontext: größer / weicher auf interaktiven Elementen (:has auf body) */
body:has(.cursor-target:hover) .custom-cursor__ring,
body:has(.cursor-target:focus-visible) .custom-cursor__ring {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  opacity: 0.95;
  border-radius: 22%;
}

body:has(.cursor-target--media:hover) .custom-cursor__ring,
body:has(.cursor-target--media:focus-visible) .custom-cursor__ring {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 30%;
}

/* Native Cursor ausblenden, sobald JS die Klasse setzt */
html.is-cursor-on,
html.is-cursor-on body,
html.is-cursor-on a,
html.is-cursor-on button {
  cursor: none !important;
}

/* --- Navigation: Mehrstufig --- */
.nav-shell {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(
    180deg,
    rgba(10, 22, 36, 0.94) 0%,
    rgba(10, 22, 36, 0.78) 100%
  );
  border-bottom: 1px solid rgba(141, 152, 168, 0.12);
}

.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 220px;
  padding: 0.5rem 0;
  margin-top: 0.35rem;
  border-radius: 0.75rem;
  background: rgba(26, 36, 48, 0.96);
  border: 1px solid rgba(141, 152, 168, 0.15);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.group:hover .nav-dropdown,
.group:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile Panel */
@media (max-width: 1023px) {
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    margin: 0.25rem 0 0 0.75rem;
    padding: 0.25rem 0;
    background: transparent;
  }
}

/* --- Motion: respektiert prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
  .custom-cursor {
    display: none !important;
  }

  html.is-cursor-on,
  html.is-cursor-on body,
  html.is-cursor-on a,
  html.is-cursor-on button {
    cursor: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Grobe Zeiger (Touch): kein Custom Cursor */
@media (pointer: coarse) {
  .custom-cursor {
    display: none !important;
  }

  html.is-cursor-on,
  html.is-cursor-on body,
  html.is-cursor-on a,
  html.is-cursor-on button {
    cursor: auto !important;
  }
}

/* Utility: subtiler Mesh-Hintergrund für Hero */
.mesh-hero {
  background-color: var(--ink);
  background-image: radial-gradient(
      ellipse 120% 80% at 18% -8%,
      rgba(19, 111, 92, 0.28),
      transparent 52%
    ),
    radial-gradient(
      ellipse 95% 55% at 100% 15%,
      rgba(42, 74, 94, 0.5),
      transparent 48%
    ),
    linear-gradient(165deg, #0a1624 0%, #0f2233 42%, #0a1624 100%);
}

.grid-overlay {
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}
