/* ============================================================
   three-intro.css — Unified PinovioScene container styling.
   Canvas z-index is controlled from JS (15 during intro, 0 after).
   ============================================================ */

#pinovio-wave-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#pinovio-wave-background canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Smooth fade/slide for the top-level page sections when the intro reveals.
   These transitions apply always — the hidden state below is only active
   while the intro is running. */
body > .site-header,
body > main,
body > .site-footer {
  transition: opacity 0.9s ease, transform 0.9s ease;
}

/* Lock scroll + hide site content until user scrolls past the scroll cue */
body.pinovio-intro-active {
  overflow: hidden;
}

body.pinovio-intro-active > .site-header,
body.pinovio-intro-active > main,
body.pinovio-intro-active > .site-footer {
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
}

/* ============================================================
   Scroll cue — shown after the morph completes, prompts the
   user to scroll. Clicking/scrolling/keying dismisses it and
   reveals the page content.
   ============================================================ */
#pinovio-scroll-cue {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  color: #e6ecff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: auto;
  user-select: none;
  text-shadow: 0 2px 20px rgba(11, 18, 32, 0.8);
}

#pinovio-scroll-cue.pinovio-scroll-cue--visible {
  opacity: 1;
}

.pinovio-scroll-cue__label {
  display: block;
}

.pinovio-scroll-cue__arrow {
  color: #60a5fa;
  animation: pinovio-cue-bounce 1.6s ease-in-out infinite;
  filter: drop-shadow(0 2px 12px rgba(96, 165, 250, 0.5));
}

@keyframes pinovio-cue-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(8px); opacity: 1; }
}

/* ============================================================
   Motion toggle — floating switch (bottom-right) to pause/
   resume the wave particle animation.
   ============================================================ */
#pinovio-motion-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 10;
  pointer-events: auto;
  opacity: 0;
  animation: pinovio-toggle-fadein 0.5s ease 0.4s forwards;
}

@keyframes pinovio-toggle-fadein {
  to { opacity: 1; }
}

.pinovio-motion-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(14, 22, 40, 0.80);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 7px 12px 7px 9px;
  color: rgba(156, 163, 175, 0.75);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
  line-height: 1;
}

.pinovio-motion-btn:hover {
  background: rgba(20, 28, 48, 0.92);
  border-color: rgba(59, 130, 246, 0.32);
  color: rgba(249, 250, 251, 0.88);
}

/* Toggle track */
.pinovio-motion-btn__track {
  position: relative;
  width: 28px;
  height: 16px;
  background: #3b82f6;
  border-radius: 999px;
  flex-shrink: 0;
  transition: background 0.22s ease;
}

.pinovio-motion-btn__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease;
}

/* Off state */
#pinovio-motion-toggle.is-off .pinovio-motion-btn__track {
  background: rgba(75, 85, 99, 0.55);
}

#pinovio-motion-toggle.is-off .pinovio-motion-btn__thumb {
  transform: translateX(12px);
}

#pinovio-motion-toggle.is-off .pinovio-motion-btn {
  color: rgba(107, 114, 128, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  body > .site-header,
  body > main,
  body > .site-footer {
    transition: none;
  }
  .pinovio-scroll-cue__arrow {
    animation: none;
  }
  .pinovio-motion-btn__track,
  .pinovio-motion-btn__thumb {
    transition: none;
  }
}
