/* ==========================================================================
   HERO TIMELINE — App Store 2 interactive Hero controller.
   Wraps the 5 EXISTING coded industry Heroes (loaded via <iframe> from
   hero-fragments/<industry>.html, each fragment being nothing more than
   the exact .fc-hero markup + its own hero-<industry>-chrome.css/js,
   unmodified) with a vertical industry timeline + a premium crossfade
   transition. Iframes are used deliberately: every industry hero reuses
   the same unscoped class names (.fc-hero, .fc-layer, .fc-glow, ...) with
   different rules per industry, so loading two industries' chrome CSS on
   one page would silently clash — an iframe gives each hero its own
   isolated document, with zero risk of cross-industry style bleed and a
   clean way to fully unmount (stop rAF/listeners) the outgoing hero after
   the transition by setting its src to about:blank.
   ========================================================================== */

.hero-timeline {
  position: relative;
  display: flex;
  min-height: 100svh;
  background: transparent;
  overflow: hidden;
}

/* Two-layer ambient accent glow behind everything, crossfaded between the
   previous and next industry's color on switch (see JS). */
.hero-timeline__ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-timeline__ambient-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 900ms cubic-bezier(0.22, 1, 0.36, 1);
  background: radial-gradient(ellipse 60% 50% at 30% 45%, rgba(var(--glow-rgb, 255, 122, 50), 0.1) 0%, transparent 70%);
}
.hero-timeline__ambient-layer.is-active { opacity: 1; }

/* ---------- Vertical industry timeline (left rail) ---------- */
.hero-timeline__nav {
  position: relative;
  z-index: 2;
  flex: none;
  width: clamp(150px, 12vw, 210px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  padding: 0 0 0 4vw;
  list-style: none;
}

.hero-timeline__line {
  position: absolute;
  left: calc(4vw + 5px);
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: rgba(168, 170, 172, 0.22);
  z-index: 0;
}

.hero-timeline__indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 11px;
  height: 11px;
  margin: 0;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgb(var(--glow-rgb, 255, 122, 50));
  box-shadow: 0 0 12px 2px rgba(var(--glow-rgb, 255, 122, 50), 0.65);
  transition: left 650ms cubic-bezier(0.22, 1, 0.36, 1), top 650ms cubic-bezier(0.22, 1, 0.36, 1), background-color 650ms ease, box-shadow 650ms ease;
  z-index: 1;
  pointer-events: none;
}

.hero-timeline__item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 4px 8px 4px 0;
  background: none;
  border: none;
  color: var(--warm-gray-dim);
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.hero-timeline__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(168, 170, 172, 0.4);
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.hero-timeline__item:hover { color: var(--warm-gray); }
.hero-timeline__item:hover .hero-timeline__dot { background: rgba(242, 242, 242, 0.6); }

.hero-timeline__item.is-active {
  color: var(--ivory);
}
.hero-timeline__item.is-active .hero-timeline__dot {
  background: rgb(var(--glow-rgb, 255, 122, 50));
  box-shadow: 0 0 8px 1px rgba(var(--glow-rgb, 255, 122, 50), 0.7);
  transform: scale(1.15);
}

/* ---------- Hero stage (right area) — full-bleed, each industry Hero
   fills the stage directly. ---------- */
.hero-timeline__stage {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
}

.hero-timeline__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transform: scale(1.01) translateY(12px);
  filter: blur(4px);
  transition:
    opacity 850ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 850ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 850ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.hero-timeline__frame.is-current {
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: blur(0);
  pointer-events: auto;
  z-index: 1;
}
.hero-timeline__frame.is-leaving {
  opacity: 0;
  transform: scale(0.985) translateY(-10px);
  filter: blur(4px);
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 900px) {
  .hero-timeline {
    flex-direction: column;
  }
  .hero-timeline__nav {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 0;
    padding: calc(var(--nav-h) + 18px) 4vw 0;
    order: 0;
  }
  .hero-timeline__line { display: none; }
  .hero-timeline__item {
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    font-size: 11px;
    text-align: center;
  }
  .hero-timeline__stage {
    min-height: 62vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-timeline__indicator,
  .hero-timeline__dot,
  .hero-timeline__ambient-layer {
    transition: none;
  }
  .hero-timeline__frame {
    transition: opacity 300ms linear;
    transform: none;
    filter: none;
  }
  .hero-timeline__frame.is-leaving {
    transform: none;
    filter: none;
  }
}
