/* ================= PROFESSIONAL SCROLL REVEALS ================= */
:root {
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --reveal-duration: 0.65s;
  --reveal-distance: 18px;
  --stagger-step: 80ms;
}

.fade-in,
.slide-in-left,
.slide-in-right,
.reveal-up {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--ease-expo),
    transform var(--reveal-duration) var(--ease-expo);
  will-change: transform, opacity;
}

.fade-in.visible,
.slide-in-left.visible,
.slide-in-right.visible,
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings inside observed containers */
.stagger-children > * {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--ease-expo),
    transform var(--reveal-duration) var(--ease-expo);
  will-change: transform, opacity;
}

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: var(--stagger-step); }
.stagger-children > *:nth-child(3) { transition-delay: calc(var(--stagger-step) * 2); }
.stagger-children > *:nth-child(4) { transition-delay: calc(var(--stagger-step) * 3); }
.stagger-children > *:nth-child(5) { transition-delay: calc(var(--stagger-step) * 4); }
.stagger-children > *:nth-child(6) { transition-delay: calc(var(--stagger-step) * 5); }

/* Section heading gold underline draw */
.section-title {
  position: relative;
  display: inline-block;
  width: 100%;
}

.section-title::after {
  content: "";
  display: block;
  width: 0;
  height: 3px;
  background: var(--color-gold);
  margin: var(--space-4) auto 0;
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease-expo);
}

.section-title.underline-visible::after {
  width: 60px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-gold);
  color: var(--color-primary-dark);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.4s var(--ease-expo),
    transform 0.4s var(--ease-expo),
    visibility 0.4s;
  z-index: var(--z-fixed);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-gold-light);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

/* Mobile nav overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 26, 43, 0.6);
  z-index: calc(var(--z-modal) - 1);
  backdrop-filter: blur(4px);
}

body.mobile-menu-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in,
  .slide-in-left,
  .slide-in-right,
  .reveal-up,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .section-title::after {
    width: 60px !important;
    transition: none !important;
  }

  .back-to-top {
    transition: none !important;
  }
}
