/* ==========================================================================
   sfx-seasonal.css — Season-Aware Visual Animation Layer
   Prefix rule: Every class, ID, variable, and keyframe uses "sfx-"
   ========================================================================== */

/* ---------- 1. Seasonal Accent Variables ---------- */
:root {
  --sfx-accent: #f2b500;
  --sfx-accent-glow: rgba(242, 181, 0, 0.4);
}

html[data-sfx-season="monsoon"] {
  --sfx-accent: #38bdf8;
  --sfx-accent-glow: rgba(56, 189, 248, 0.4);
}

html[data-sfx-season="winter"] {
  --sfx-accent: #93c5fd;
  --sfx-accent-glow: rgba(147, 197, 253, 0.4);
}

html[data-sfx-season="summer"] {
  --sfx-accent: #f59e0b;
  --sfx-accent-glow: rgba(245, 158, 11, 0.4);
}

html[data-sfx-season="festival"] {
  --sfx-accent: #f2b500;
  --sfx-accent-glow: rgba(242, 181, 0, 0.5);
}

/* ---------- 2. Canvases (Background & Cursor Trail) ---------- */
#sfx-canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.4s ease;
}

#sfx-canvas-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9990;
  pointer-events: none;
}

/* ---------- 3. Scroll Progress Bar ---------- */
#sfx-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  z-index: 10001;
  pointer-events: none;
  background: linear-gradient(90deg, #f2b500 0%, #ffd043 50%, var(--sfx-accent) 100%);
  box-shadow: 0 1px 8px var(--sfx-accent-glow);
  transition: width 0.08s linear;
}

/* ---------- 4. Scroll Reveal Animations ---------- */
/* Only elements on a page with .sfx-js on <html> get initial hidden states */
html.sfx-js .sfx-reveal {
  opacity: 0;
  transform: translateY(26px);
  will-change: opacity, transform;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

html.sfx-js .sfx-reveal.sfx-slide-left {
  transform: translateX(-32px);
}

html.sfx-js .sfx-reveal.sfx-slide-right {
  transform: translateX(32px);
}

html.sfx-js .sfx-reveal.sfx-zoom {
  transform: scale(0.94);
}

html.sfx-js .sfx-reveal.sfx-in {
  opacity: 1;
  transform: none;
}

/* Stagger Delays for child cards */
html.sfx-js .sfx-stagger > *:nth-child(1) { transition-delay: 0ms; }
html.sfx-js .sfx-stagger > *:nth-child(2) { transition-delay: 90ms; }
html.sfx-js .sfx-stagger > *:nth-child(3) { transition-delay: 180ms; }
html.sfx-js .sfx-stagger > *:nth-child(4) { transition-delay: 270ms; }
html.sfx-js .sfx-stagger > *:nth-child(5) { transition-delay: 360ms; }
html.sfx-js .sfx-stagger > *:nth-child(6) { transition-delay: 450ms; }

/* ---------- 5. 3D Card Tilt ---------- */
.sfx-tilt {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* ---------- 6. Floating Control Dock ---------- */
.sfx-dock {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9995;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 12px;
  line-height: 1;
}

.sfx-dock-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(8, 43, 80, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(242, 181, 0, 0.4);
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: #ffffff;
}

.sfx-dock-select {
  height: 28px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sfx-dock-select option {
  background: #082b50;
  color: #ffffff;
}

.sfx-dock-select:focus,
.sfx-dock-select:hover {
  border-color: #f2b500;
  background: rgba(255, 255, 255, 0.2);
}

.sfx-dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sfx-dock-btn:hover,
.sfx-dock-btn:focus {
  background: rgba(242, 181, 0, 0.25);
  border-color: #f2b500;
  color: #f2b500;
  outline: none;
}

.sfx-dock-btn[aria-pressed="true"] {
  background: rgba(242, 181, 0, 0.35);
  border-color: #f2b500;
  color: #f2b500;
}

/* ---------- 7. Responsive & Accessibility ---------- */
@media (max-width: 600px) {
  .sfx-dock {
    bottom: 12px;
    right: 12px;
  }
  .sfx-dock-inner {
    padding: 5px 8px;
    gap: 6px;
  }
  .sfx-dock-select {
    height: 26px;
    font-size: 11px;
    padding: 0 4px;
    max-width: 105px;
  }
  .sfx-dock-btn {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
}

/* Respect user's motion preference */
@media (prefers-reduced-motion: reduce) {
  #sfx-canvas-bg,
  #sfx-canvas-trail {
    display: none !important;
  }
  #sfx-progress {
    transition: none !important;
  }
  html.sfx-js .sfx-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .sfx-tilt {
    transform: none !important;
    transition: none !important;
  }
}
