/* ============================================================
   DREIZACK — descent.css  (VOLLSTÄNDIG)
   Diese Datei ersetzt assets/css/descent.css KOMPLETT.
   Reihenfolge: 1) Kern-Layout (fixierte Ebenen)  2) Tiefenmesser  3) Menü-Highlight
   ============================================================ */


/* ============================================================
   1 — KERN-LAYOUT
   Desktop (≥811px): fixierte Szene + Scroll-Pinning (descent.js).
   Mobil (≤810px):    normaler Fluss, volle Höhe, Video als ruhiger Hintergrund.
   Alles nur im Frontend (.bricks-is-frontend) — Builder bleibt editierbar.
   ============================================================ */

@media (min-width: 811px) {
  .bricks-is-frontend .descent-experience {
    position: relative;
    height: 800vh;                 /* liefert die Scrolldistanz */
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    z-index: 0;
  }

  .bricks-is-frontend .video-fixed {
    --dz-snapshot: url('/wp-content/uploads/2026/06/descent-desktop-snapshot.avif');
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100svh !important;
    max-width: none !important;
    overflow: hidden !important;
    pointer-events: none;
    z-index: 0;
  }
  .bricks-is-frontend .video-fixed video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: calc(100% + 40px) !important;
    height: calc(100% + 40px) !important;
    max-width: none !important;
    object-fit: cover !important;
    transform: translate(-50%, -50%);
    will-change: transform;
  }

  /* Poster-Overlay exakt deckungsgleich zum Video (gleiche Überskalierung & Zentrierung) */
  .bricks-is-frontend .video-poster {
    top: 50%;
    left: 50%;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    transform: translate(-50%, -50%);
    will-change: transform;
  }

  .bricks-is-frontend .water-particles { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
  .bricks-is-frontend .water-particles canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: block; }

  .bricks-is-frontend .content-layer { position: fixed !important; inset: 0 !important; z-index: 3 !important; pointer-events: none; }
  .bricks-is-frontend .content-section { position: absolute !important; inset: 0 !important; opacity: 0; pointer-events: none; will-change: transform, opacity; }
  .bricks-is-frontend .content-section.content-visible { pointer-events: auto; }
  /* Hero sofort sichtbar (vor JS) — descent.js steuert sie beim Scrollen weiterhin */
  .bricks-is-frontend .content-section.content-1 { opacity: 1; pointer-events: auto; }
}

@media (max-width: 810px) {
  /* Normaler Fluss: Sektionen in natürlicher Höhe untereinander → nichts wird abgeschnitten.
     Spacing/Styling der Sektionen kommt komplett aus Bricks (nicht hier setzen). */
  .bricks-is-frontend .descent-experience { height: auto; }
  .bricks-is-frontend .content-layer { position: relative !important; inset: auto !important; height: auto !important; z-index: 1; }

  /* Video bleibt fixer, mitscrubbender Hintergrund; Inhalt scrollt normal darüber.
     !important nötig, damit Bricks-eigene Element-Styles es nicht überschreiben.
     --dz-focus-x: ein Regler für die horizontale Lage (Video + Poster) — POIs liegen rechts. */
  .bricks-is-frontend .video-fixed {
    --dz-snapshot: url('/wp-content/uploads/2026/06/descent-mobile-snapshot.avif');
    --dz-focus-x: 80%;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;     /* Fallback */
    height: 100lvh !important;    /* deckt auch ab, wenn die Browser-Leisten ausblenden */
    overflow: hidden !important;
    pointer-events: none;
    z-index: 0;
    background-position: var(--dz-focus-x) center;
  }
  .bricks-is-frontend .video-fixed video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: var(--dz-focus-x) center !important;
    transform: none !important;
  }

  /* Poster-Overlay viewport-genau (mobil kein Overscan/Parallax), gleicher Fokus wie Video */
  .bricks-is-frontend .video-poster {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
    background-position: var(--dz-focus-x) center;
  }

  /* Partikel-Canvas auf Mobil aus (Performance) */
  .bricks-is-frontend .water-particles { display: none; }

  /* Anker-Ziele: scrollIntoView landet sauber unter dem Sticky-Header.
     Rein scroll-bezogen (kein sichtbares Spacing) → Bricks-Layout bleibt unberührt.
     EINE Stellschraube für den Abstand: --dz-anchor-offset (Default 84px). */
  .bricks-is-frontend .content-section { scroll-margin-top: var(--dz-anchor-offset, 84px); }
}

/* Standbild bereits beim CSS-Parsen sichtbar (frühester Paint, vor JS) + dunkler Grundton.
   --dz-snapshot wird pro Breakpoint oben auf .video-fixed gesetzt. */
.bricks-is-frontend .video-fixed {
  background-color: #01030a;
  background-image: var(--dz-snapshot);
  background-size: cover;
  background-position: var(--dz-focus-x, center) center;
  background-repeat: no-repeat;
}

/* Poster-Overlay (erster Frame) über dem Video — wird von descent.js sanft ausgeblendet,
   sobald das Video Frame 0 zeigt. Verhindert den harten Bild→Video-Tausch (Flash).
   Erbt --dz-snapshot vom Eltern-Element .video-fixed (gerätespezifisch). */
.bricks-is-frontend .video-poster {
  position: absolute;
  background-image: var(--dz-snapshot);
  background-position: var(--dz-focus-x, center) center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .bricks-is-frontend .video-poster { transition: none; }
}

html, body { overflow-x: hidden; max-width: 100%; }


/* ============================================================
   2 — TIEFENMESSER  (Skala rechts, an Speed-Tabelle gekoppelt)
   ============================================================ */

.depth-meter {
  --m-accent: #0ef0ff;
  font-family: 'Lato', sans-serif;
  position: fixed;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  height: 50vh;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.depth-meter.is-visible { opacity: 1; }

.depth-meter__label {
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  opacity: 0.9;
  color: var(--m-accent);
  text-shadow: 0 0 12px color-mix(in srgb, var(--m-accent) 38%, transparent);
  transition: color 0.6s ease, text-shadow 0.6s ease;
}

.depth-meter__track {
  position: relative;
  width: 2px;
  flex: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.10);
}

.depth-meter__fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--m-accent) 25%, transparent),
    color-mix(in srgb, var(--m-accent) 8%,  transparent)
  );
}

.depth-meter__dot {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background-color: var(--m-accent);
  box-shadow:
    0 0 24px var(--m-accent),
    0 0 8px  var(--m-accent),
    0 0 48px color-mix(in srgb, var(--m-accent) 38%, transparent);
  transition: background-color 0.6s ease, box-shadow 0.6s ease;
}

.depth-meter__tick {
  position: absolute;
  top: 0; right: 8px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
}
.depth-meter__tickline {
  width: 12px; height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.20);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.depth-meter__ticklabel {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.25);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}
.depth-meter__tick.is-near .depth-meter__tickline {
  background: var(--m-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--m-accent) 38%, transparent);
}
.depth-meter__tick.is-near .depth-meter__ticklabel {
  color: var(--m-accent);
  text-shadow: 0 0 8px color-mix(in srgb, var(--m-accent) 25%, transparent);
}

.depth-meter__readout {
  margin-top: 16px;
  width: 60px;
  text-align: center;
  font-size: 16px; font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--m-accent);
  text-shadow: 0 0 16px color-mix(in srgb, var(--m-accent) 44%, transparent);
  transition: color 0.6s ease, text-shadow 0.6s ease;
}

@media (max-width: 810px) {
  .depth-meter { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .depth-meter,
  .depth-meter__label,
  .depth-meter__dot,
  .depth-meter__tickline,
  .depth-meter__ticklabel,
  .depth-meter__readout { transition: none; }
}


/* ============================================================
   3 — MENÜ-HIGHLIGHT  (aktiver Punkt je Scrollposition)
   ============================================================ */

.dz-nav-item {
  position: relative;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.40);
  transition: color 0.3s ease;
}
.dz-nav-item:hover { color: rgba(255, 255, 255, 0.80); }
.dz-nav-item.is-active { color: var(--nav-accent); }
.dz-nav-item.is-active::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 2px;
  border-radius: 1px;
  background: var(--nav-accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--nav-accent) 56%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .dz-nav-item { transition: none; }
}