/* SSEM Network animations.
   Loaded after styles.css. Animation-specific classes only.
   All effects respect prefers-reduced-motion. */

/* =========================================================================
   Reveal on scroll (paired with IntersectionObserver in js/animations.js)
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Variants: control direction and distance */
.reveal--left {
  transform: translateX(-32px);
}
.reveal--left.is-visible { transform: translateX(0); }

.reveal--right {
  transform: translateX(32px);
}
.reveal--right.is-visible { transform: translateX(0); }

.reveal--scale {
  transform: scale(0.96);
}
.reveal--scale.is-visible { transform: scale(1); }

/* On narrow screens a horizontal slide-in pushes the element past the right
   edge while it is still below the fold, creating horizontal scroll / zoom-out.
   Fall back to the vertical reveal so nothing overflows sideways. */
@media (max-width: 600px) {
  .reveal--left,
  .reveal--right { transform: translateY(28px); }
  .reveal--left.is-visible,
  .reveal--right.is-visible { transform: translateY(0); }
}

/* =========================================================================
   Staggered children: each child reveals slightly after the previous
   ========================================================================= */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stagger-children.is-visible > * { opacity: 1; transform: translateY(0); }

.stagger-children.is-visible > *:nth-child(1)  { transition-delay: 0ms; }
.stagger-children.is-visible > *:nth-child(2)  { transition-delay: 80ms; }
.stagger-children.is-visible > *:nth-child(3)  { transition-delay: 160ms; }
.stagger-children.is-visible > *:nth-child(4)  { transition-delay: 240ms; }
.stagger-children.is-visible > *:nth-child(5)  { transition-delay: 320ms; }
.stagger-children.is-visible > *:nth-child(6)  { transition-delay: 400ms; }
.stagger-children.is-visible > *:nth-child(7)  { transition-delay: 480ms; }
.stagger-children.is-visible > *:nth-child(8)  { transition-delay: 560ms; }
.stagger-children.is-visible > *:nth-child(9)  { transition-delay: 640ms; }
.stagger-children.is-visible > *:nth-child(10) { transition-delay: 720ms; }

/* =========================================================================
   Hero parallax
   The hero gradient background already gives depth.
   js/parallax.js translates the hero content layer at ~0.4x scroll speed.
   This class just declares the will-change hint for the GPU.
   ========================================================================= */
.hero-parallax-target {
  will-change: transform;
}

.parallax-element {
  will-change: transform;
  transition: transform 0ms linear;
}

/* =========================================================================
   Card glow on hover (subtle gold halo)
   ========================================================================= */
.card-glow {
  position: relative;
  isolation: isolate;
}

.card-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(201, 167, 110, 0), rgba(201, 167, 110, 0.6), rgba(201, 167, 110, 0));
  opacity: 0;
  z-index: -1;
  transition: opacity 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card-glow:hover::after { opacity: 1; }

/* =========================================================================
   Button shine (sweeping highlight on hover)
   ========================================================================= */
.btn-shine {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(110deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 60%,
    transparent 100%);
  transition: left 700ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.btn-shine:hover::before { left: 100%; }

/* =========================================================================
   Underline draw (link emphasis on body links)
   ========================================================================= */
.underline-draw {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 350ms cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: 2px;
}

.underline-draw:hover { background-size: 100% 1.5px; }

/* =========================================================================
   Subtle float animation for decorative SVG icons
   ========================================================================= */
.float-soft {
  animation: float-soft 5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* =========================================================================
   Reduced motion: kill all motion-based effects, keep instant transitions
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .parallax-element { transform: none !important; }
  .float-soft { animation: none !important; }

  .btn-shine::before { display: none; }
  .card-glow::after { display: none; }
  .underline-draw {
    background-size: 100% 1.5px;
    transition: none;
  }
}
