/* Night Drive v4 — full-page integration + logo contrast */

/* ── Logo: sharp marks (2× assets, no overscale) ── */
body.has-night-drive .nav-logo,
body.has-night-drive .nav-logo--glow {
  filter: none;
}
body.has-night-drive .nav-logo-svg,
body.has-night-drive .nav-logo svg {
  overflow: visible;
  width: min(360px, 56vw);
  height: auto;
  max-height: 78px;
}
@media (max-width: 900px) {
  body.has-night-drive .nav-logo-svg,
  body.has-night-drive .nav-logo svg {
    width: min(240px, 68vw) !important;
    max-height: 64px !important;
    height: auto !important;
  }
  body.has-night-drive nav {
    min-height: 72px;
  }
}
/* Logo: baked outline PNGs + light CSS only (heavy drop-shadow stacks removed) */
body.has-night-drive .nav-logo .logo-eye-img,
body.has-night-drive .nav-logo .logo-art-img,
body.has-night-drive footer .nav-logo image,
body.has-night-drive footer .nav-logo .logo-eye-img,
body.has-night-drive footer .nav-logo .logo-art-img {
  filter:
    brightness(1.08)
    drop-shadow(1px 0 0 #fff)
    drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 -1px 0 #fff)
    drop-shadow(0 0 4px rgba(255,255,255,0.45));
  animation: none;
}
body.has-night-drive .nav-logo .logo-mark-glow {
  display: none !important;
}
/* Orion flares: opacity pulse only */
body.has-night-drive .nav-logo .logo-star-rays .star-flare {
  animation: orionLogoTwinkle 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.7));
}
body.has-night-drive .nav-logo .logo-star-rays .orion-1 { animation-delay: 0s; }
body.has-night-drive .nav-logo .logo-star-rays .orion-2 { animation-delay: 0.35s; }
body.has-night-drive .nav-logo .logo-star-rays .orion-3 { animation-delay: 0.7s; }
@keyframes orionLogoTwinkle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body.has-night-drive .nav-logo .logo-star-rays .star-flare {
    animation: none;
    opacity: 0.85;
  }
}
body.has-night-drive nav .nav-logo a,
body.has-night-drive nav .nav-logo--glow a {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 2px 4px 2px 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.has-night-drive nav .nav-logo a::before {
  content: none;
  display: none;
}
body.has-night-drive .nav-logo .logo-word-schlepp,
body.has-night-drive footer .nav-logo .logo-word-schlepp,
body.has-night-drive .nav-logo text tspan:nth-child(1),
body.has-night-drive footer .nav-logo text tspan:nth-child(1) {
  fill: #FFFFFF !important;
}
body.has-night-drive .nav-logo .logo-word-stop,
body.has-night-drive footer .nav-logo .logo-word-stop,
body.has-night-drive .nav-logo text tspan:nth-child(2),
body.has-night-drive footer .nav-logo text tspan:nth-child(2) {
  fill: #FF2A2A !important;
  filter: none;
}
body.has-night-drive .nav-logo text:last-of-type,
body.has-night-drive footer .nav-logo text:last-of-type {
  fill: #C5DCF5 !important;
}
body.has-night-drive nav {
  height: auto;
  min-height: 78px;
  padding-top: 6px;
  padding-bottom: 6px;
  overflow: visible;
}

body.has-night-drive nav {
  background: rgba(7, 13, 24, 0.94);
  border-bottom: 3px solid #E82020;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
body.has-night-drive .nav-links a {
  color: #E8F2FF;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
body.has-night-drive .nav-links a:hover {
  color: #fff;
}
body.has-night-drive .nav-toggle {
  color: #EEF4FA;
}

/* ── After sticky drive: truck scene stays as FIXED multi-layer bg + keeps moving ── */
.nd-continuum {
  position: relative;
  background: transparent;
  overflow: visible;
}
/* Viewport-sized only (fixed) — never stretch photo over full document height */
.nd-continuum-bg {
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease;
  overflow: hidden;
  background: #070d18;
}
.nd-continuum-bg.is-on {
  opacity: 1;
  visibility: visible;
  display: block !important;
}
.nd-bg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: auto;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
body.nd-scrolling .nd-bg-world,
body.nd-scrolling .nd-bg-stars,
body.nd-scrolling .nd-bg-pyramids {
  will-change: transform;
}
.nd-bg-sky {
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 15%, rgba(60, 90, 140, 0.22), transparent 55%),
    linear-gradient(180deg, #070d18 0%, #0d1626 50%, #152740 100%);
}
.nd-bg-stars {
  z-index: 1;
  opacity: 0.75;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 28% 32%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1.6px 1.6px at 55% 12%, rgba(255,245,220,0.95), transparent),
    radial-gradient(1px 1px at 72% 28%, rgba(220,235,255,0.75), transparent),
    radial-gradient(1.3px 1.3px at 88% 16%, #fff, transparent),
    radial-gradient(1px 1px at 40% 8%, rgba(255,255,255,0.65), transparent),
    radial-gradient(1px 1px at 18% 42%, rgba(200,220,255,0.55), transparent),
    radial-gradient(1.4px 1.4px at 63% 38%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 8% 55%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.2px 1.2px at 48% 48%, rgba(200,230,255,0.65), transparent);
  animation: starTwinkle 5.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .nd-bg-stars { animation: none !important; }
}
.nd-bg-pyramids {
  z-index: 2;
  opacity: 0.4;
  background:
    linear-gradient(to top, rgba(7,13,24,0.35), transparent 40%);
  /* soft far silhouettes via CSS polygons */
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, #000 55%, transparent 100%);
}
.nd-bg-pyramids::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 8%;
  height: 32%;
  background:
    linear-gradient(135deg, transparent 42%, #0a121f 42.5%, #0a121f 57%, transparent 57.5%) 8% 100% / 28% 100% no-repeat,
    linear-gradient(135deg, transparent 40%, #0c1524 40.5%, #0c1524 60%, transparent 60.5%) 38% 100% / 36% 100% no-repeat,
    linear-gradient(135deg, transparent 42%, #0a121f 42.5%, #0a121f 58%, transparent 58.5%) 72% 100% / 30% 100% no-repeat;
  opacity: 0.85;
}
.nd-bg-world {
  z-index: 3;
  background: url('../images/hero.webp') center 42% / cover no-repeat;
  transform: translate3d(0, 0, 0) scale(1.02);
  opacity: 0.88;
}
.nd-bg-scrim {
  z-index: 4;
  background:
    linear-gradient(180deg, rgba(7,13,24,0.35) 0%, rgba(7,13,24,0.55) 50%, rgba(7,13,24,0.78) 100%),
    linear-gradient(90deg, rgba(7,13,24,0.45) 0%, transparent 40%, transparent 100%);
}
.nd-continuum > *:not(.nd-continuum-bg) {
  position: relative;
  z-index: 1;
}

/* All content stations as glass on night */
body.has-night-drive .emergency-strip {
  background: linear-gradient(90deg, #b01515, #E82020 40%, #c41c1c);
  border-top: 1px solid rgba(240,160,32,0.35);
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

body.has-night-drive #leistungen,
body.has-night-drive #warum,
body.has-night-drive #ablauf,
body.has-night-drive #einsatzgebiet,
body.has-night-drive #vertrauen,
body.has-night-drive #kontakt {
  background: transparent;
  color: #D6E4F2;
}
body.has-night-drive #leistungen .section-title,
body.has-night-drive #warum .section-title,
body.has-night-drive #ablauf .section-title,
body.has-night-drive #einsatzgebiet .section-title,
body.has-night-drive #vertrauen .section-title,
body.has-night-drive #kontakt .section-title,
body.has-night-drive #leistungen .service-card h3,
body.has-night-drive #vertrauen .trust-card h3,
body.has-night-drive #warum .why-point h4,
body.has-night-drive #ablauf .process-step h4,
body.has-night-drive #kontakt .contact-info-item h4 {
  color: #EEF4FA;
}
body.has-night-drive .section-label {
  color: #F0A020;
}
body.has-night-drive .section-sub,
body.has-night-drive #leistungen .service-card p,
body.has-night-drive #vertrauen .trust-card p,
body.has-night-drive #warum .why-point p,
body.has-night-drive #ablauf .process-step p,
body.has-night-drive #kontakt .section-sub,
body.has-night-drive #kontakt .contact-info-item p,
body.has-night-drive #kontakt .contact-info-item a {
  color: rgba(210, 228, 248, 0.82);
}

body.has-night-drive .service-card,
body.has-night-drive .trust-card,
body.has-night-drive .review-card,
body.has-night-drive .process-step,
body.has-night-drive .contact-form,
body.has-night-drive .why-points {
  background: rgba(10, 18, 32, 0.78);
  border: 1px solid rgba(180, 210, 240, 0.12);
  border-radius: 6px;
}
body.has-night-drive .service-card,
body.has-night-drive .trust-card {
  padding: 40px 32px;
}
body.has-night-drive .service-card:hover,
body.has-night-drive .trust-card:hover {
  background: rgba(16, 28, 48, 0.88);
  border-color: rgba(232, 32, 32, 0.35);
}
body.has-night-drive .service-card .tag {
  background: rgba(232, 32, 32, 0.18);
  color: #ff8a80;
}
body.has-night-drive .service-icon .icon,
body.has-night-drive .contact-info-icon .icon {
  color: #F0A020;
}

body.has-night-drive .area-tag {
  background: rgba(10, 18, 32, 0.7);
  border-color: rgba(180, 210, 240, 0.2);
  color: #EEF4FA;
}
body.has-night-drive .area-tag:hover {
  background: #E82020;
  border-color: #E82020;
}

body.has-night-drive .step-circle {
  box-shadow: 0 0 0 8px rgba(7, 13, 24, 0.85);
}
body.has-night-drive .process-steps::before {
  background: rgba(232, 32, 32, 0.65);
}
body.has-night-drive .why-num {
  color: #E82020;
  opacity: 0.55;
}
/* Warum: new coupe plate — full scene, no harsh crop */
body.has-night-drive .why-image-block {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(214, 228, 242, 0.12);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
body.has-night-drive .why-image-block img,
body.has-night-drive .why-image-block .why-photo {
  width: 100%;
  height: auto;
  min-height: 280px;
  max-height: 520px;
  object-fit: cover;
  object-position: center 45%;
  display: block;
  border-radius: 8px;
}

/* Form on night */
body.has-night-drive .contact-form {
  padding: 28px;
}
body.has-night-drive .contact-form input,
body.has-night-drive .contact-form select,
body.has-night-drive .contact-form textarea {
  background: rgba(7, 13, 24, 0.55);
  border-color: rgba(180, 210, 240, 0.25);
  color: #EEF4FA;
}
body.has-night-drive .contact-form input::placeholder,
body.has-night-drive .contact-form textarea::placeholder {
  color: rgba(180, 200, 220, 0.55);
}
body.has-night-drive .contact-form select option {
  background: #18283A;
  color: #EEF4FA;
}
body.has-night-drive .form-consent {
  color: rgba(210, 228, 248, 0.75);
  background: rgba(7, 13, 24, 0.35);
  border-color: rgba(180, 210, 240, 0.15);
}
body.has-night-drive .form-consent a {
  color: #F0A020;
}

/* Footer night */
body.has-night-drive footer {
  background: #070d18;
  border-top: 3px solid #E82020;
  color: #D6E4F2;
}
body.has-night-drive footer h4 {
  color: #E82020;
}
body.has-night-drive footer ul a,
body.has-night-drive .footer-brand p,
body.has-night-drive .footer-bottom p,
body.has-night-drive .footer-bottom a {
  color: rgba(200, 220, 240, 0.7);
}
body.has-night-drive footer ul a:hover,
body.has-night-drive .footer-bottom a:hover {
  color: #fff;
}
body.has-night-drive footer::before {
  opacity: 0.12;
  filter: brightness(1.3);
}

/* Station enter */
/* Always readable — never leave page "bricked" at 0.4 opacity if JS late */
body.has-night-drive .nd-station {
  opacity: 1;
  transition: none;
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}
body.has-night-drive .nd-station.is-in {
  opacity: 1;
}

/* Mobile continuum: only after hero (JS), lighter layers */
@media (max-width: 900px) {
  .nd-continuum-bg {
    display: block !important;
  }
  .nd-bg-pyramids {
    display: none !important; /* perf */
  }
  .nd-bg-stars {
    opacity: 0.45;
    animation: none !important;
  }
  .nd-bg-world {
    opacity: 0.85;
    /* match mobile hero: full plate, no cinema crop */
    background-position: center center;
    background-size: contain;
    background-repeat: no-repeat;
    background-color: #070d18;
    transform: none !important;
  }
  .nd-bg-scrim {
    background: linear-gradient(180deg, rgba(7,13,24,0.55) 0%, rgba(7,13,24,0.78) 55%, rgba(7,13,24,0.9) 100%);
  }
  body.has-night-drive .why-image-block img {
    height: auto;
  }
  body.has-night-drive .nd-station {
    opacity: 1;
    transform: none;
  }
  body.has-night-drive nav .nav-logo a {
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nd-continuum-bg { transform: none !important; opacity: 1; }
  .nd-bg-layer { transform: none !important; animation: none !important; }
  body.has-night-drive .nd-station {
    opacity: 1;
    transform: none;
  }
}


/* ═══════════ v15: Endlosfahrt ═══════════ */

/* Sterne als nahtlos wiederholbare Kachel, die dauerhaft driftet.
   Drift-Distanz = exakt eine Kachelbreite -> unsichtbarer Loop-Punkt. */
body.nd-idle-drive .nd-bg-stars {
  background-size: 540px 360px;
  background-repeat: repeat;
  animation: starTwinkle 5.5s ease-in-out infinite,
             ndStarDrift 110s linear infinite;
}
@keyframes ndStarDrift {
  from { background-position: 0 0; }
  to   { background-position: -540px 0; }
}

/* Sticky-Stage: Striche streamen ab Frame 1 (Fahrt beginnt sofort) */
body.nd-idle-drive .drive-road-dashes {
  animation: ndDashFlow 1.35s linear infinite;
}
@keyframes ndDashFlow {
  from { background-position: 0 0; }
  to   { background-position: -96px 0; } /* eine Gradient-Periode = nahtlos */
}

/* Continuum-Fahrbahn: dezentes Straßenband am unteren Rand, streamt dauerhaft */
.nd-bg-road {
  z-index: 3;
  top: auto;
  height: 16%;
  background: linear-gradient(180deg, transparent 0%,
              rgba(7,13,24,0.45) 35%, rgba(7,13,24,0.8) 100%);
}
.nd-bg-road::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 55%;
  height: 4px;
  background: repeating-linear-gradient(90deg,
              rgba(214,228,242,0.38) 0 48px, transparent 48px 96px);
  animation: ndDashFlow 1.1s linear infinite;
  opacity: 0.55;
}

/* Video-Loop-Layer (wird von JS nur eingefügt, wenn die Datei existiert) */
.nd-bg-video {
  z-index: 3;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
  background: #070d18;
}
body.nd-video-on .nd-bg-video { opacity: 0.92; }
/* Doppelbilder vermeiden: CSS-Szene weicht dem Video */
body.nd-video-on .nd-bg-world,
body.nd-video-on .nd-bg-pyramids,
body.nd-video-on .nd-bg-road { opacity: 0; transition: opacity 1.4s ease; }

/* reduced-motion: Endlosfahrt wird ruhiger, nicht tot (Projekt-Linie) */
@media (prefers-reduced-motion: reduce) {
  body.nd-idle-drive .nd-bg-stars { animation-duration: 5.5s, 300s; }
  body.nd-idle-drive .drive-road-dashes { animation-duration: 4.5s; }
  .nd-bg-road::after { animation-duration: 3.6s; }
  body.nd-video-on .nd-bg-video { opacity: 0.65; }
}

/* User: remove red emergency strip after hero / over video loop */
body.has-night-drive .emergency-strip { display: none !important; }

/* User: remove floating Jetzt anrufen */
body.has-night-drive .float-cta,
.float-cta { display: none !important; }

/* ── Legal pages (Impressum / Datenschutz) night theme ── */
body.legal-page {
  background: #0d1626;
  color: #D6E4F2;
  min-height: 100vh;
}
body.legal-page .pt-nav {
  padding-top: 100px;
  padding-bottom: 48px;
}
body.legal-page .legal-section {
  max-width: 820px;
  margin: 0 auto 40px;
  padding: 0 5%;
}
body.legal-page .section-label {
  color: rgba(232, 32, 32, 0.95);
}
body.legal-page .section-title {
  color: #EEF4FA;
}
body.legal-page .section-sub {
  color: rgba(214, 228, 242, 0.72);
}
body.legal-page .legal-content {
  color: rgba(214, 228, 242, 0.92);
  line-height: 1.75;
}
body.legal-page .legal-content h3 {
  color: #EEF4FA;
  margin-top: 1.6em;
}
body.legal-page .legal-content a {
  color: #7ec8ff;
}
body.legal-page .legal-content a:hover {
  color: #fff;
}
body.legal-page .legal-note {
  color: rgba(214, 228, 242, 0.6);
  border-top-color: rgba(138, 170, 190, 0.25);
}
body.legal-page footer {
  background: #0a121f;
  border-top: 3px solid #E82020;
  color: #D6E4F2;
}
body.legal-page footer h4 {
  color: #E82020;
}
body.legal-page footer ul a,
body.legal-page .footer-brand p,
body.legal-page .footer-bottom p,
body.legal-page .footer-bottom a {
  color: rgba(214, 228, 242, 0.75);
}
body.legal-page footer ul a:hover,
body.legal-page .footer-bottom a:hover {
  color: #fff;
}
body.legal-page .footer-bottom {
  border-top-color: rgba(138, 170, 190, 0.2);
}
body.legal-page .nav-logo .logo-word-schlepp {
  fill: #FFFFFF !important;
}
body.legal-page .nav-logo .logo-word-stop {
  fill: #FF2A2A !important;
}

/* ═══ v26: Mobile Continuum — volle Szene statt Zoom-Slice ═══
   Ursache: 20:9-Video mit object-fit:cover im Hochkant-Viewport zeigt
   nur ~21% der Bildbreite. Fix: contain — das GANZE Motiv als Band,
   Letterbox verschmilzt mit dem Nachtgrund. Bild-Fallback bleibt an. */
@media (max-width: 900px) {
  /* v27: echtes 9:16-Video für Mobil -> cover füllt ohne Balken & ohne Slice */
  .nd-bg-video {
    object-fit: cover !important;
    object-position: center center !important;
    background: #070d18;
  }
  /* 9:16-Standbild als Fallback/Poster hinter dem Video */
  .nd-bg-world {
    background-image: url('../images/hero-mobile.webp');
    background-position: center center;
    background-size: cover;
    opacity: 0.9;
  }
  body.nd-video-on .nd-bg-world { opacity: 0.9; }
  body.nd-video-on .nd-bg-road { opacity: 1; }
}


/* ═══ v28: Mobiler Hero = 9:16-Artwork vollflächig, Text im Himmel ═══
   Ersetzt das gestapelte Layout (Textpanel + Bildstreifen) durch das
   Hochformat-Kino. Quelle wählt <picture> (hero-mobile.webp ≤900px).
   Lädt NACH night-drive.css -> gewinnt bei gleicher Spezifität. */
@media (max-width: 900px) {
  .drive-stage {
    position: relative !important;
    min-height: 100svh;
  }
  .drive-world,
  .drive-layer.drive-world {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    order: 0 !important;
    border-top: none !important;
    z-index: 1 !important;
    overflow: hidden !important;
  }
  .drive-world picture { display: block; width: 100%; height: 100%; }
  .drive-world img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    object-fit: cover !important;
    object-position: center bottom !important;
  }
  /* Text-Overlay: transparenter Scrim oben statt eigener Gradient-Fläche */
  .drive-ui {
    position: absolute !important;
    inset: 0 !important;
    z-index: 3 !important;
    background: linear-gradient(180deg,
      rgba(7,13,24,0.62) 0%, rgba(7,13,24,0.28) 34%, rgba(7,13,24,0) 55%) !important;
    justify-content: flex-start !important;
  }
  /* Roter Akzent wandert vom Bildstreifen an die Hero-Unterkante */
  .drive-stage::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: var(--nd-red, #E82020);
    z-index: 4;
  }
}
