/* ═══════════════════════════════════════════════════════════════════
   SCROLL ANIMATION SECTION — scroll-section.css
   HydroSolar Cinematic Canvas Scrollytelling
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Hide UI elements as requested ─────────── */
/* ─── Hide UI elements as requested ─────────── */
.sa-progress-bar,
.sa-step-dots,
#sa-progress-fill,
.sa-section-tag::before {
  display: none !important;
}

/* Global Grid Background removed as requested */
:root {
  --sa-bg: #ffffff;
  --sa-text: #1e293b;
  /* Matches --gray-800 */
  --sa-text-60: #475569;
  /* Matches --gray-600 */
  --sa-text-20: #94a3b8;
  /* Matches --gray-400 */
  --sa-amber: #11a139;
  /* Matches --green-500 */
  --sa-amber-bg: rgba(17, 161, 57, 0.08);
  --sa-amber-bd: rgba(17, 161, 57, 0.2);
  /* Safe Font Stack */
  --font-body: 'DM Sans', system-ui, sans-serif;
}

/* ─── Section Shell ─────────────────────────────────────────────── */
#scroll-animation-section {
  position: relative;
  width: 100%;
  height: 100vh;
  background: var(--sa-bg);
  overflow: hidden;
  /* clips the zoom-scale canvas edge */
}

/* Subtle background grid removed from here, now global on body */
.sa-grid-bg {
  display: none;
}

/* ─── Canvas ────────────────────────────────────────────────────── */
#sa-canvas {
  position: absolute;
  top: 15vh;
  right: 2vw;
  height: 70vh;
  width: 55%;
  aspect-ratio: 16 / 9;
  display: block;
  background: var(--sa-bg);
  transform-origin: center center;
  will-change: transform;
  transform: translateZ(0);
  /* Removed mix-blend-mode to ensure grid lines stay behind the frame */
}

/* ─── Depth Layers ──────────────────────────────────────────────── */
.sa-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
      transparent 40%,
      rgba(255, 255, 255, 0.4) 100%);
}

.sa-bottom-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  z-index: 6;
  pointer-events: none;
  background: linear-gradient(to top,
      var(--sa-bg) 0%,
      transparent 100%);
}

/* ─── Section Label (top-left) ──────────────────────────────────── */
.sa-section-tag {
  position: absolute;
  top: 38px;
  left: 8vw;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sa-fh);
  font-size: 0.70rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sa-text-60);
}

.sa-section-tag::before {
  content: '';
  display: block;
  width: 22px;
  height: 1px;
  background: var(--sa-amber);
}

/* ─── Step Text Overlays ────────────────────────────────────────── */
.sa-step-overlay {
  position: absolute;
  top: 50%;
  left: 8vw;
  right: auto;
  transform: translateY(-50%);
  width: 40vw;
  max-width: 500px;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
  text-align: left;
  /* No CSS transitions — GSAP scrub drives everything */
  transition: none;
}

.sa-step-label {
  display: inline-block;
  font-family: var(--sa-fb);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sa-amber);
  padding: 4px 14px;
  background: var(--sa-amber-bg);
  border: 1px solid var(--sa-amber-bd);
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.sa-step-heading {
  font-family: var(--sa-fh);
  font-size: clamp(1.6rem, 3.8vw, 2.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--sa-text);
  margin: 0 0 0.8rem;
}

.sa-step-body {
  font-family: var(--sa-fb);
  font-size: clamp(0.875rem, 1.4vw, 1rem);
  line-height: 1.72;
  color: var(--sa-text-60);
  max-width: 420px;
  margin-left: 0;
}

/* ─── Progress Bar ──────────────────────────────────────────────── */
.sa-progress-bar {
  position: absolute;
  bottom: 52px;
  left: 8vw;
  right: 8vw;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.sa-step-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sa-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  transition: background 0.25s, transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

/* Active / done states driven by GSAP in the timeline */
.sa-step-dot[style*="rgb(245, 166, 35)"],
.sa-step-dot.active {
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.7);
}

.sa-progress-track {
  width: 100%;
  height: 1.5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

#sa-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sa-amber), #ff8f00);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.45);
}

/* ─── Scroll Hint ───────────────────────────────────────────────── */
.sa-scroll-hint {
  position: absolute;
  bottom: 22px;
  right: 6vw;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.sa-scroll-hint-text {
  font-family: var(--sa-fb);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sa-text-20);
  writing-mode: vertical-rl;
  rotate: 180deg;
}

.sa-scroll-hint-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--sa-text-20), transparent);
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #scroll-animation-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 80px;
  }

  #sa-canvas {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    top: 0;
    right: 0;
    z-index: 1;
  }

  .sa-step-overlay {
    position: absolute;
    top: auto;
    bottom: 120px;
    /* Positioned below canvas */
    left: 5vw;
    right: 5vw;
    width: 90vw;
    max-width: 100%;
    transform: none;
    text-align: center;
    z-index: 10;
    padding: 0;
  }

  .sa-step-body {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
  }

  .sa-step-heading {
    font-size: clamp(1.4rem, 6vw, 2rem);
    margin-bottom: 0.5rem;
  }

  .sa-step-body {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .sa-progress-bar {
    position: fixed;
    left: 5vw;
    right: 5vw;
    bottom: 40px;
  }

  .sa-section-tag {
    position: fixed;
    top: 25px;
    left: 5vw;
  }
}

/* ─── prefers-reduced-motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #sa-canvas {
    will-change: auto;
    transform: none !important;
  }

  .sa-step-overlay {
    transition: none !important;
    filter: none !important;
  }

  #sa-progress-fill {
    transition: none !important;
  }
}