/* ==========================================================================
   RHEIN RUHR ENERGIEBERATUNG — SCROLLYTELLING CANVAS STAGE v4
   Apple-Style Full-Bleed 3D Sequence with Architectural Light Mode
   ========================================================================== */

/* CANVAS BACKGROUND STAGE — Fixed to full viewport */
.bg-sequence-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-canvas);
  pointer-events: none;
  overflow: hidden;
  background: var(--rre-bg);
}

.bg-sequence-canvas {
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
}

/* Architectural Light Vignette & Text Backdrop (Preserves 3D model clarity on right) */
.scrolly-vignette-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-scrolly-bg);
  pointer-events: none;
  background:
    radial-gradient(ellipse 95% 85% at 70% 50%, transparent 40%, rgba(248, 249, 250, 0.75) 80%, rgba(248, 249, 250, 0.98) 100%),
    linear-gradient(90deg, rgba(248, 249, 250, 0.96) 0%, rgba(248, 249, 250, 0.85) 35%, rgba(248, 249, 250, 0.30) 65%, transparent 88%);
}

/* Scroll Progress Bar at the Top */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--rre-green);
  z-index: calc(var(--z-header) + 1);
  transition: width 0.08s linear;
}

/* ── APPLE-STYLE SCROLL SCENE ARCHITECTURE ───────────────────────────────── */
/* In scrollytelling scenes, text floats on the left side while the 3D model
   in the center/right of the canvas remains completely unobstructed. */

.scrolly-milestone-section {
  position: relative;
  z-index: var(--z-content);
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 0;
}

.scrolly-two-col {
  display: grid;
  grid-template-columns: minmax(320px, 560px) 1fr;
  gap: 40px;
  align-items: center;
  width: 100%;
}

.scrolly-right-empty {
  /* Keeps the 3D model in the center/right 100% visible */
  pointer-events: none;
  min-height: 280px;
}

/* ── APPLE-STYLE FADE-IN & FADE-OUT ON SCROLL ───────────────────────────── */
/* Elements with .scrolly-fade dynamically transition opacity & translateY
   as they enter the viewport and exit the viewport. */

.scrolly-fade {
  opacity: 0;
  transform: translateY(32px) scale(0.98);
  transition:
    opacity 0.65s var(--ease-spring),
    transform 0.65s var(--ease-spring);
  will-change: opacity, transform;
}

.scrolly-fade.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scrolly-fade.passed-out {
  opacity: 0.15;
  transform: translateY(-24px) scale(0.98);
  filter: blur(1px);
}

/* Fallback for standard reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s var(--ease-spring),
    transform 0.6s var(--ease-spring);
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }

/* ── HUD PILLS (FLOATING ON CANVAS) ─────────────────────────────────────── */
.canvas-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--rre-card-border);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--rre-ink);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.canvas-hud-pill:hover {
  border-color: var(--rre-green);
  transform: translateY(-2px);
}

.canvas-hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rre-green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

@media (max-width: 900px) {
  .scrolly-two-col {
    grid-template-columns: 1fr;
  }
  .scrolly-right-empty {
    display: none;
  }
}
