/* ===== scrolly.css — scrollytelling page additions ===== */

/* Expand topbar to show nav links */
.scrolly-page .topbar {
  gap: 2rem;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex: 1;
  justify-content: center;
}

.topbar-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  opacity: .75;
  transition: opacity .2s ease;
}

.topbar-nav a:hover {
  opacity: 1;
}

/* Force header transparent over video */
.scrolly-page .topbar {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.scrolly-page .topbar-nav a,
.scrolly-page .topbar .brand-name {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
}

/* When scrolled past hero, restore frosted bar */
.scrolly-page .topbar.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom-color: color-mix(in srgb, var(--border) 60%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  transition: background .3s ease, border-color .3s ease;
}

.scrolly-page .topbar.scrolled .topbar-nav a,
.scrolly-page .topbar.scrolled .brand-name {
  color: var(--ink);
  text-shadow: none;
}

/* ===== 400vh scrolly track ===== */
.scrolly-track {
  height: 400vh;
  position: relative;
}

/* Sticky container: stays in view while track scrolls */
.scrolly-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}

/* Background video: full bleed */
.scrolly-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Gradient scrim: darkens bottom for legibility */
.scrolly-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.18) 0%,
    rgba(0,0,0,.08) 35%,
    rgba(0,0,0,.55) 75%,
    rgba(0,0,0,.72) 100%
  );
  pointer-events: none;
}

/* Text stages container */
.scrolly-stages {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

.scrolly-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(2.5rem, 8vw, 5rem) clamp(1.5rem, 6vw, 4rem);
  padding-top: 6rem; /* clear header */
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

/* First stage is visible on load (before any scroll), so the hero is never empty */
#stage-1 {
  opacity: 1;
}

/* Stage 4 CTA needs pointer events when visible */
#stage-4.visible {
  pointer-events: auto;
}

.stage-inner {
  max-width: 54ch;
  text-align: left;
}

.stage-eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.6);
  margin-bottom: .6rem;
}

/* Override global p color inside stages */
.scrolly-stage p {
  color: inherit;
}

.stage-heading {
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 2px 16px rgba(0,0,0,.3);
}

.stage-sub {
  font-size: clamp(.95rem, 2vw, 1.2rem);
  color: rgba(255,255,255,.82);
  max-width: 40ch;
  line-height: 1.55;
  font-weight: 500;
  margin-bottom: 0;
}

.stage-cta {
  margin-top: 1.75rem;
  pointer-events: auto;
  display: inline-flex;
}

/* Scroll cue (reuses .scroll-cue from style.css; recolor for the dark hero) */
.scrolly-cue {
  z-index: 3;
  bottom: 2rem;
  color: rgba(255,255,255,.85);
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
  transition: opacity .4s ease;
}
.scrolly-cue.cue-hide { opacity: 0; pointer-events: none; }

/* Thin progress bar along the bottom */
.scrolly-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,.15);
}

.scrolly-progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,.7);
  transition: width .05s linear;
}

/* ===== Below-fold sections ===== */
.below-fold {
  background: var(--bg);
  position: relative;
  z-index: 1;
}

.section-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 7rem) clamp(1.25rem, 5vw, 3rem);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: .75rem 1.25rem;
  font-family: inherit;
  font-weight: 700;
  font-size: .95rem;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panels {
  min-height: 280px;
}

.tab-panel {
  animation: fadeIn .25s ease;
}

.tab-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.tab-text h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: .75rem;
  letter-spacing: -.02em;
}

.tab-text p {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}

.feature-list li::before {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

/* ===== Vision ===== */
.vision-section {
  background: var(--accent);
}

.vision-inner {
  max-width: 44ch;
}

.vision-inner h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: .5rem 0 .75rem;
}

.vision-lead {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink) !important;
  margin-bottom: 1rem;
}

.vision-inner p:last-child {
  font-size: 1.08rem;
  line-height: 1.65;
}

/* ===== Footer links ===== */
.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s ease;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .topbar-nav {
    display: none; /* collapsed on mobile; hamburger is out of scope */
  }

  .scrolly-page .topbar {
    gap: 1rem;
  }

  .tab-content-grid {
    grid-template-columns: 1fr;
  }

  .stage-inner {
    text-align: center;
  }

  .stage-sub {
    max-width: 100%;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .scrolly-stage {
    transition: none;
  }

  .scrolly-progress-fill {
    transition: none;
  }
}
