/* =================================================================
   Vitalqua Project — PROCESS page
   Snap-scroll layout: each stage = one full-viewport slide.
   Desktop: sticky SVG scene left | snap scroll column right.
   Mobile:  scene top (fixed height) | snap scroll column below.
   ================================================================= */
:root {
  --bg:        #F6F8FB;
  --bg-soft:   #ECF1F5;
  --surface:   #FFFFFF;
  --navy:      #0F1A2E;
  --navy-dp:   #07101E;

  --cy-xlt:    #D6EEF6;
  --cy-lt:     #A3D0E3;
  --cy:        #4FB3D9;
  --cy-dk:     #2A85B3;
  --cy-xdk:    #1B5F85;
  --sea:       #0F3A56;

  --ink:       #0F1A2E;
  --ink-soft:  #3F4F6B;
  --muted:     #6B7890;
  --faint:     #A3B5CD;

  --amber:     #FFD34E;
  --alert:     #D24736;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(15,26,46,.05), 0 4px 14px rgba(15,26,46,.04);
  --shadow-md: 0 4px 16px rgba(15,26,46,.08), 0 20px 40px rgba(15,26,46,.06);

  --ease: cubic-bezier(.22,.61,.36,1);

  --header-h:     64px;
  --indicators-h: 96px;
  --scene-h-mob:  52vh;
  /* height of each snap slide on desktop */
  --snap-h: calc(100vh - var(--header-h));
  /* height of each snap slide on mobile (below scene-col) */
  --snap-h-mob: calc(100vh - var(--header-h) - var(--scene-h-mob));
}

/* ---- Lock document scroll — only the scroll-col scrolls ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overflow: hidden; }
body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.58;
}
a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 48px);
}

/* =================================================================
   HEADER
   ================================================================= */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid rgba(15, 26, 46, .06);
  transition: background 260ms var(--ease);
}
.nav {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.logo-mark { width: auto; height: 34px; display: block; flex-shrink: 0; }
.nav-links {
  display: flex; gap: 26px;
  font-size: 0.88rem; font-weight: 600;
  color: var(--ink-soft);
}
.nav-links a { position: relative; transition: color 180ms ease; }
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--cy-dk);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms var(--ease);
}
.nav-links a:hover { color: var(--navy); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta {
  display: inline-flex; align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: background 180ms ease, transform 180ms var(--ease);
}
.nav-cta:hover { background: var(--cy-dk); transform: translateY(-1px); }

/* =================================================================
   SNAP PROGRESS BAR — slim line below the header showing progress
   ================================================================= */
.snap-progress {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: 2px;
  background: rgba(15, 26, 46, .07);
  z-index: 90;
  pointer-events: none;
}
.snap-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--cy-lt), var(--cy-dk));
  width: 0%;
  border-radius: 0 2px 2px 0;
  transition: width 480ms var(--ease);
}

/* =================================================================
   STAGE — the two-column snap layout
   ================================================================= */
.stage {
  margin-top: var(--header-h);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  height: var(--snap-h);
  overflow: hidden;
  position: relative;
}

/* ---------- Scene column (desktop) — fills its grid cell ---------- */
.scene-col {
  position: relative;
  height: 100%;
  background:
    radial-gradient(ellipse at 30% 25%, rgba(79,179,217,.06), transparent 60%),
    radial-gradient(ellipse at 70% 70%, rgba(255,211,78,.04), transparent 60%),
    var(--bg);
  overflow: hidden;
  transition: background 600ms var(--ease);
}
#scene {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: var(--indicators-h);
  width: 100%;
  height: calc(100% - var(--indicators-h));
  display: block;
  pointer-events: none;
}
.tri { shape-rendering: geometricPrecision; }
.scene-layer { opacity: 0; transition: opacity 600ms var(--ease); }
.scene-layer.active { opacity: 1; }

/* ---------- Indicators (pinned at bottom of scene column) ---------- */
.indicators {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--indicators-h);
  padding: 14px 22px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  background: linear-gradient(to top, rgba(246,248,251,0.96), rgba(246,248,251,0.7));
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(15, 26, 46, .06);
  align-items: center;
  z-index: 4;
}
.indicator { display: flex; flex-direction: column; gap: 4px; }
.ind-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ind-row { display: flex; align-items: baseline; gap: 8px; }
.ind-value {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color 300ms var(--ease);
}
.ind-value.ind-changed { color: var(--cy-dk); }
.ind-delta {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--alert);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.ind-delta.show { opacity: 1; transform: translateY(0); }
.ind-bar {
  display: block;
  height: 3px;
  background: rgba(15, 26, 46, .08);
  border-radius: 2px;
  overflow: hidden;
}
.ind-bar-fill {
  display: block; height: 100%;
  transition: width 700ms var(--ease), background 500ms var(--ease);
  border-radius: 2px;
}

/* ---------- Scroll column — the snap scroll container ---------- */
.scroll-col {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;      /* IE/Edge */
}
.scroll-col::-webkit-scrollbar { display: none; }

/* ---------- Steps container ---------- */
.steps {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
}

/* ---------- Individual step — one full viewport slide ---------- */
.step {
  flex-shrink: 0;
  height: var(--snap-h);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(28px, 5vw, 60px);
  opacity: 0.18;
  transform: translateY(12px) scale(0.99);
  transition:
    opacity 560ms var(--ease),
    transform 560ms var(--ease);
}
.step.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---- Step text ---- */
.step-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cy-dk);
  margin-bottom: 14px;
}
.step-eyebrow::before {
  content: ''; width: 20px; height: 1.5px;
  background: currentColor;
}
.step-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--navy);
  margin-bottom: 16px;
}
.step-desc {
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 42ch;
}
.step-desc .hl { color: var(--cy-dk); font-weight: 600; }
.step-hint {
  margin-top: 18px;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.step[data-step="0"] .step-title { font-size: clamp(2rem, 4vw, 2.6rem); }

/* Final CTA step */
.step-final {
  background: none;
  backdrop-filter: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
}
.step-cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 24px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: transform 180ms var(--ease), background 180ms ease;
}
.step-cta:hover { background: var(--cy-dk); transform: translateY(-2px); }


/* Night mode */
.stage.night .scene-col {
  background:
    radial-gradient(ellipse at 30% 30%, rgba(25, 45, 90, .6), transparent 70%),
    linear-gradient(180deg, #0A1425 0%, #07101E 100%);
}
.stage.night .indicators {
  background: linear-gradient(to top, rgba(7,16,30,0.94), rgba(7,16,30,0.62));
  border-top-color: rgba(255,255,255,.08);
}
.stage.night .ind-label { color: #8A9AB8; }
.stage.night .ind-value { color: #F4F6FA; }
.stage.night .ind-bar  { background: rgba(255,255,255,.08); }

/* =================================================================
   SNAP DOTS — vertical pill on the right edge (desktop only)
   ================================================================= */
.snap-dots {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 80;
  padding: 10px 5px;
  background: rgba(246, 248, 251, 0.65);
  backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid rgba(15, 26, 46, .07);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.snap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(15, 26, 46, 0.18);
  border: none;
  cursor: pointer;
  padding: 0;
  transition:
    background 250ms ease,
    transform 250ms ease,
    height 250ms var(--ease),
    border-radius 250ms var(--ease);
}
.snap-dot.active {
  background: var(--cy-dk);
  height: 16px;
  border-radius: 3px;
  transform: none;
}
.snap-dot:hover:not(.active) {
  background: var(--cy-lt);
  transform: scale(1.35);
}
/* Night mode dots */
.snap-dots.night .snap-dot { background: rgba(255,255,255,0.2); }
.snap-dots.night .snap-dot.active { background: var(--cy-lt); }

/* =================================================================
   MOBILE (≤ 900px) — scene fixed on top, snap column below
   ================================================================= */
@media (max-width: 900px) {
  :root {
    --indicators-h: 82px;
    --scene-h-mob:  52vh;
    --snap-h-mob:   calc(100vh - var(--header-h) - var(--scene-h-mob));
  }
  .nav-links { display: none; }
  .nav-cta { padding: 8px 14px; font-size: 0.8rem; }
  .logo-mark { height: 30px; }

  .stage {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    height: var(--snap-h);
    overflow: hidden;
  }
  .scene-col {
    flex-shrink: 0;
    height: var(--scene-h-mob);
    min-height: 260px;
    width: 100%;
    position: relative;
    z-index: 3;
  }
  #scene {
    bottom: var(--indicators-h);
    height: calc(100% - var(--indicators-h));
  }
  .indicators {
    height: var(--indicators-h);
    padding: 10px 14px;
    gap: 10px;
  }
  .ind-label { font-size: 0.56rem; letter-spacing: 0.12em; }
  .ind-value { font-size: 1rem; }
  .ind-delta { font-size: 0.62rem; }
  .ind-bar   { height: 2px; }

  .scroll-col {
    flex: 1;
    min-height: 0;
    height: auto;
    /* scroll-snap-type and overflow-y already set above */
  }
  .steps { height: auto; }
  .step {
    height: var(--snap-h-mob);
    padding: 18px clamp(18px, 4vw, 28px);
    /* use actual container height for reliability — JS will also use clientHeight */
  }
  .step-title  { font-size: clamp(1.3rem, 5.5vw, 1.8rem); }
  .step-desc   { font-size: 0.92rem; max-width: none; }

  /* Hide side dots on mobile — swipe handles navigation */
  .snap-dots { display: none; }

}

/* Extra-small phones */
@media (max-width: 520px) {
  :root {
    --header-h:    56px;
    --indicators-h: 74px;
    --scene-h-mob:  46vh;
  }
  .logo-mark { height: 26px; }
  .nav-cta   { padding: 7px 12px; font-size: 0.75rem; }
  .scene-col { min-height: 240px; }
  .indicators { padding: 8px 10px; gap: 6px; }
  .ind-label  { font-size: 0.5rem; letter-spacing: 0.08em; }
  .ind-value  { font-size: 0.88rem; }
  .ind-delta  { font-size: 0.58rem; }
  .step-eyebrow { font-size: 0.64rem; letter-spacing: 0.18em; }
  .step-title   { font-size: clamp(1.2rem, 6vw, 1.6rem); }
}
