/* ===================================================================
 * today-vs · 3D Cinematic Stage
 * Three.js Canvas hinter den Karten, dazu CSS-Fallback-Plates wenn 3D
 * ausgeschaltet (reduced-motion / mobile / no WebGL).
 * Sektion erbt die bestehenden today-vs-Tokens aus hollywood.css.
 * =================================================================== */

.today-vs--3d {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.today-vs__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Sanfte Vignette nach außen damit die Karten klar trennen */
  mask-image: radial-gradient(
    ellipse 80% 70% at 50% 50%,
    #000 55%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 80% 70% at 50% 50%,
    #000 55%,
    transparent 100%
  );
}

.today-vs__canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1);
}
.today-vs__stage.is-3d-ready .today-vs__canvas {
  opacity: 1;
}

/* Fallback nur wenn Stage nicht 3D-ready geworden ist */
.today-vs__fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.today-vs__stage.is-fallback .today-vs__fallback {
  display: flex;
  opacity: 1;
}
.today-vs__stage.is-fallback .today-vs__canvas {
  display: none;
}

.today-vs__plate {
  width: clamp(120px, 18vw, 220px);
  height: clamp(120px, 18vw, 220px);
  border-radius: 24px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.01)
  );
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 30px 80px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  animation: todayvsFloat 9s ease-in-out infinite;
}
.today-vs__plate img {
  width: 65%;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(94, 191, 191, 0.35));
}
.today-vs__plate--left {
  animation-delay: -2s;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 30px 80px rgba(255, 90, 90, 0.18),
    0 0 60px -20px rgba(255, 90, 90, 0.55);
}
.today-vs__plate--right {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 30px 80px rgba(94, 191, 191, 0.25),
    0 0 60px -20px rgba(94, 191, 191, 0.75);
}

@keyframes todayvsFloat {
  0%, 100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-14px) rotate(3deg);
  }
}

/* Inhalt klar OBEN über der Stage */
.today-vs--3d .today-vs__inner {
  position: relative;
  z-index: 1;
}

/* Brand-Marks vor "Heute"/"Morgen" — kleine Pille */
.today-vs__brand-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}
.today-vs__brand-mark--shadow {
  background: radial-gradient(circle at 30% 30%, #ff8c8c, #b03a3a);
  box-shadow: 0 0 12px rgba(255, 100, 100, 0.55);
}
.today-vs__brand-mark--sphere {
  background: radial-gradient(circle at 30% 30%, #8be1e1, #2c6a6a);
  box-shadow: 0 0 12px rgba(94, 191, 191, 0.65);
}

/* Bridge-Pulse erweitert um SVG-Animation */
.today-vs__bridge-pulse {
  transform-origin: 40px 120px;
  animation: bridgePulse 3.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.today-vs__bridge-path {
  stroke-dashoffset: 0;
  animation: bridgeDash 6s linear infinite;
}
@keyframes bridgePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.55;
  }
}
@keyframes bridgeDash {
  to {
    stroke-dashoffset: -20;
  }
}

/* Light-Theme — Plates dezenter, weniger Glow weil hellere BG */
html[data-theme="light"] .today-vs__plate {
  background: linear-gradient(
    135deg,
    rgba(11, 14, 17, 0.04),
    rgba(11, 14, 17, 0.01)
  );
  border-color: rgba(11, 14, 17, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 24px 60px rgba(0, 0, 0, 0.12);
}
html[data-theme="light"] .today-vs__plate--left {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 24px 60px rgba(192, 48, 48, 0.18);
}
html[data-theme="light"] .today-vs__plate--right {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 24px 60px rgba(45, 142, 142, 0.22);
}
html[data-theme="light"] .today-vs__brand-mark--shadow {
  background: radial-gradient(circle at 30% 30%, #d54545, #8a1f1f);
}
html[data-theme="light"] .today-vs__brand-mark--sphere {
  background: radial-gradient(circle at 30% 30%, #2d8e8e, #0e5252);
}
html[data-theme="light"] .today-vs__stage {
  mask-image: radial-gradient(
    ellipse 75% 65% at 50% 50%,
    #000 50%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 75% 65% at 50% 50%,
    #000 50%,
    transparent 100%
  );
}

/* Auto-Theme spiegelt prefers-color-scheme */
@media (prefers-color-scheme: light) {
  html[data-theme="auto"] .today-vs__plate {
    background: linear-gradient(
      135deg,
      rgba(11, 14, 17, 0.04),
      rgba(11, 14, 17, 0.01)
    );
    border-color: rgba(11, 14, 17, 0.08);
  }
  html[data-theme="auto"] .today-vs__brand-mark--shadow {
    background: radial-gradient(circle at 30% 30%, #d54545, #8a1f1f);
  }
  html[data-theme="auto"] .today-vs__brand-mark--sphere {
    background: radial-gradient(circle at 30% 30%, #2d8e8e, #0e5252);
  }
}

/* Reduced-Motion: Animationen aus, statische Plates */
@media (prefers-reduced-motion: reduce) {
  .today-vs__plate,
  .today-vs__bridge-pulse,
  .today-vs__bridge-path {
    animation: none !important;
  }
  .today-vs__canvas {
    display: none;
  }
  .today-vs__stage {
    /* Trigger Fallback auch wenn JS nicht greift */
  }
  .today-vs__fallback {
    display: flex;
    opacity: 1;
  }
}

/* Mobile — Plates kleiner, Stage etwas dezenter */
@media (max-width: 760px) {
  .today-vs__stage {
    opacity: 0.7;
    mask-image: radial-gradient(
      ellipse 90% 75% at 50% 50%,
      #000 45%,
      transparent 100%
    );
    -webkit-mask-image: radial-gradient(
      ellipse 90% 75% at 50% 50%,
      #000 45%,
      transparent 100%
    );
  }
  .today-vs__plate {
    width: 110px;
    height: 110px;
    border-radius: 18px;
  }
}
