/* Everest motion layer. One authored moment (the capital comparison) plus quiet supporting motion.
   Hooks (Elementor global classes): .ew-hero, .ew-hero-copy, .ew-stat-number, .ew-steps,
   .ew-compare, .ew-mainnav. Content is visible by default; assets/js/motion.js only arms a
   pre-state for elements that start below the fold. */

/* 1. Hero: the mountain eases into focus and the copy settles in a short cascade. CSS only, so
   the copy still ends visible if scripts fail. */
.ew-hero { overflow: clip; }
.ew-hero video {
  transform-origin: 62% 38%;
  animation: ew-hero-video 2400ms var(--ew-ease-out) both;
}
.ew-hero-copy > * { animation: ew-settle 760ms var(--ew-ease-spring) both; }
.ew-hero-copy > :nth-child(2) { animation-delay: 110ms; }
.ew-hero-copy > :nth-child(3) { animation-delay: 200ms; }
.ew-hero-copy > :nth-child(4) { animation-delay: 290ms; }

@keyframes ew-hero-video {
  from { opacity: 0.4; transform: scale(1.06); }
  to   { opacity: 1;   transform: scale(1); }
}
@keyframes ew-settle {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: none;             filter: none; }
}

/* 2. Three steps: a hairline draws left to right and each step arrives as the line reaches it. */
.ew-steps-line {
  position: absolute;
  top: -22px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--ew-silver-violet) 0%, rgba(196, 181, 253, 0.2) 100%);
  transform-origin: left center;
  pointer-events: none;
}
.ew-steps--armed .ew-steps-line { transform: scaleX(0); }
.ew-steps--armed > .e-con { opacity: 0.3; transform: translateY(10px); }
.ew-steps--run .ew-steps-line { transform: scaleX(1); transition: transform 1100ms var(--ew-ease-out); }
.ew-steps--run > .e-con {
  opacity: 1;
  transform: none;
  transition: opacity 520ms ease, transform 640ms var(--ew-ease-spring);
}
.ew-steps--run > .e-con:nth-of-type(2) { transition-delay: 380ms; }
.ew-steps--run > .e-con:nth-of-type(3) { transition-delay: 760ms; }
@media (max-width: 767px) { .ew-steps-line { display: none; } }

/* 3. Capital comparison (the authored moment): both figures start at the same R1 000 000, then one
   erodes and one grows. The bars carry the divergence for anyone not reading the numbers. */
.ew-compare-bar {
  display: block;
  width: min(240px, 100%);
  height: 6px;
  margin: 14px auto 12px;
  border-radius: 999px;
  background: rgba(50, 23, 77, 0.1);
  overflow: hidden;
}
.ew-compare-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ew-plum-900);
  transform-origin: left center;
}
.ew-compare-bar--loss i { background: var(--status-negative); }

/* 4. Text reveals: the resting state remains visible unless motion.js has initialised. */
.ew-scroll-reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 460ms ease-out var(--ew-reveal-delay, 0ms),
              transform 460ms ease-out var(--ew-reveal-delay, 0ms);
  will-change: opacity, transform;
}
.ew-scroll-reveal.ew-scroll-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* 4. Condensed header: once the hero has scrolled away, the nav row docks to the top as a slim
   obsidian bar. */
html.ew-nav-condensed .elementor .ew-mainnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  padding-block: 8px;
  background: rgba(26, 11, 43, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px -20px rgba(26, 11, 43, 0.7);
  animation: ew-nav-dock 320ms var(--ew-ease-spring) both;
}
/* The 75% white pill reads as muddy grey on the obsidian bar; firm it up while docked. */
html.ew-nav-condensed .elementor .ew-navlinks { background-color: rgba(255, 255, 255, 0.95) !important; }
html.ew-nav-condensed .elementor .ew-brand-mark {
  width: 48px !important;
  height: 48px !important;
}
@keyframes ew-nav-dock {
  from { transform: translateY(-100%); }
  to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ew-hero video,
  .ew-hero-copy > *,
  html.ew-nav-condensed .elementor .ew-mainnav { animation: none; }
  .ew-steps--armed > .e-con { transform: none; }
  .ew-scroll-reveal { opacity: 1; transform: none; transition: none; will-change: auto; }
}
