/* ─── STICKY SCROLL STORY SECTIONS ─────────────────────────
   Two section types:
   A) .ss-left  — left panel STICKY, right panel SCROLLS
   B) .ss-right — right panel STICKY, left panel SCROLLS
───────────────────────────────────────────────────────────── */

/* ─── BASE STRUCTURE ──────────────────────────────────────── */
/* Using flex (not grid) — flex stretch reliably makes the rail match the
   scroll column height, giving position:sticky a real scroll range.
   Grid + sticky has known cross-browser unreliability. */
.story-section {
  display: flex;
  position: relative;
}

/* ─── STICKY RAIL (flex child = half the section width) ───── */
/* Flex default align-items:stretch makes the rail grow to match the scroll
   column. The sticky panel inside then has a real scroll range. */
.story-sticky-rail {
  width: 50%;
  flex-shrink: 0;
  background: var(--navy);        /* ss-left colour — full column stays navy */
  position: relative;             /* needed so sticky finds this as its box */
}
.ss-right .story-sticky-rail { background: var(--off-white); }

/* ─── STICKY COLUMN (inside the rail) ─────────────────────── */
.story-sticky {
  position: sticky;
  top: 64px;           /* clear the fixed nav bar */
  height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ─── SCROLL COLUMN (flex child, fills remaining width) ───── */
.story-scroll {
  flex: 1;
  min-width: 0;          /* prevent flex blowout */
  display: flex;
  flex-direction: column;
}

/* spacer at top/bottom so first/last step hits center */
.story-scroll-cap {
  height: 25vh;
}

/* ─── EACH SCROLL STEP ────────────────────────────────────── */
.story-step {
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 4rem;
  transition: opacity .5s ease;
  opacity: .25;
}
.story-step.is-active { opacity: 1; }

.step-content { max-width: 480px; }
.step-tag {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--orange);
  margin-bottom: 1.25rem;
}
.step-tag::before { content: ''; width: 16px; height: 1.5px; background: var(--orange); }
.step-num-badge {
  font-family: var(--font-serif);
  font-size: 4rem; letter-spacing: -.06em;
  color: var(--light-border, #E2E8F0); line-height: 1;
  margin-bottom: .5rem; display: block;
  transition: color .4s;
}
.story-step.is-active .step-num-badge { color: var(--orange); }
.step-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  letter-spacing: -.03em; line-height: 1.15;
  color: var(--navy); margin-bottom: 1rem;
}
.step-body { font-size: .95rem; color: var(--text-mid); line-height: 1.8; margin-bottom: 1.5rem; }
.step-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.step-chip {
  padding: .35rem .9rem; border-radius: 100px;
  font-size: .78rem; font-weight: 600;
  background: var(--off-white); color: var(--text-mid);
  border: 1px solid var(--border);
  transition: background .4s, color .4s, border-color .4s;
}
.story-step.is-active .step-chip {
  background: #FFF3E8; color: var(--orange); border-color: rgba(240,122,26,.25);
}

/* ─── THE STICKY PANEL CARD ───────────────────────────────── */
.sticky-card {
  width: 100%; max-width: 460px;
  padding: 3rem;
  transition: all .5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sticky panel bg — rail already sets the full column colour; this ensures
   the 100vh sticky viewport also matches. */
.ss-left  .story-sticky { background: var(--navy); }
.ss-right .story-sticky { background: var(--off-white); }

/* ─── PANEL CONTENT ───────────────────────────────────────── */
.sp-eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,.4);
  margin-bottom: 2rem; display: block;
}
.sp-eyebrow-dark {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-light);
  margin-bottom: 2rem; display: block;
}

/* Big number background */
.sp-big-num {
  font-family: var(--font-serif);
  font-size: 10rem; line-height: 1;
  letter-spacing: -.08em;
  color: rgba(255,255,255,.05);
  position: absolute;
  top: 50%; right: -1rem;
  transform: translateY(-50%);
  pointer-events: none; user-select: none;
  transition: transform .6s cubic-bezier(0.16, 1, 0.3, 1),
              color .5s;
}
.sp-big-num-dark {
  color: rgba(11,29,58,.05);
}

/* Progress dots */
.sp-progress-dots {
  display: flex; gap: .6rem; margin-bottom: 2rem;
}
.sp-dot {
  width: 28px; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,.15);
  transition: background .4s, width .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.sp-dot.active { background: var(--orange); width: 52px; }
.sp-dot-dark { background: var(--border); }
.sp-dot-dark.active { background: var(--navy); width: 52px; }

/* Step number */
.sp-step-label {
  font-family: var(--font-serif);
  font-size: 1rem; color: rgba(255,255,255,.4);
  margin-bottom: .5rem; display: block;
  transition: opacity .3s;
}
.sp-step-label-dark { color: var(--text-light); }

.sp-step-num {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 5vw, 5rem);
  letter-spacing: -.06em; line-height: 1;
  color: var(--white);
  transition: all .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.sp-step-num-dark { color: var(--navy); }

/* Panel headline */
.sp-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  letter-spacing: -.03em; line-height: 1.2;
  color: var(--white); margin: 1rem 0 .75rem;
  transition: all .5s cubic-bezier(0.16, 1, 0.3, 1);
}
.sp-title-dark { color: var(--navy); }

.sp-desc {
  font-size: .875rem; line-height: 1.7;
  color: rgba(255,255,255,.55);
  transition: all .5s cubic-bezier(0.16, 1, 0.3, 1);
}
.sp-desc-dark { color: var(--text-mid); }

/* Metric chip inside panel */
.sp-metric {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .65rem 1.1rem; margin-top: 1.75rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  transition: all .5s cubic-bezier(0.16, 1, 0.3, 1);
}
.sp-metric-dark {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.sp-metric-icon { font-size: 1.25rem; }
.sp-metric-body strong {
  display: block; font-family: var(--font-serif);
  font-size: 1.35rem; letter-spacing: -.04em;
  color: var(--orange);
}
.sp-metric-body span { font-size: .75rem; color: rgba(255,255,255,.5); }
.sp-metric-body-dark span { color: var(--text-light); }

/* Panel illustration area */
.sp-illustration {
  margin-top: 2rem; position: relative;
}
.sp-timeline-bar {
  height: 3px; background: rgba(255,255,255,.1);
  border-radius: 3px; margin-bottom: 1rem; overflow: hidden;
}
.sp-timeline-fill {
  height: 100%; background: var(--orange);
  border-radius: 3px;
  transition: width .8s cubic-bezier(0.16, 1, 0.3, 1);
}
.sp-timeline-bar-dark { background: var(--border); }
.sp-timeline-fill-dark { background: var(--navy); }

.sp-day-label {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.35);
}
.sp-day-label-dark { color: var(--text-light); }
.sp-day-value {
  font-family: var(--font-serif);
  font-size: 1.1rem; color: var(--white); margin-top: .25rem;
  transition: all .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.sp-day-value-dark { color: var(--navy); }

/* ─── STEP CONNECTOR LINE (right scroll col) ──────────────── */
.story-step-line {
  display: flex; align-items: flex-start; gap: 1.5rem;
  position: relative;
}
.step-dot-track {
  display: flex; flex-direction: column;
  align-items: center; flex-shrink: 0;
  padding-top: .35rem;
}
.step-dot-circle {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  transition: border-color .4s, background .4s, transform .4s;
  flex-shrink: 0;
}
.story-step.is-active .step-dot-circle {
  border-color: var(--orange);
  background: var(--orange);
  transform: scale(1.4);
}
.step-dot-line {
  width: 2px; flex: 1; min-height: 60px;
  background: var(--border); margin-top: .4rem;
  transition: background .4s;
}
.story-step.is-active .step-dot-line { background: rgba(240,122,26,.3); }

/* ─── ss-right variant (scroll LEFT, sticky RIGHT) ─────────── */
.ss-right {
  flex-direction: row-reverse; /* scroll col first in DOM but shown on left */
}
.ss-right .story-step {
  padding: 4rem 4rem 4rem 4rem;
}
.ss-right .step-content { max-width: 460px; }
.ss-right .step-tag { color: var(--navy); }
.ss-right .step-tag::before { background: var(--navy); }
.ss-right .step-num-badge { color: var(--border); }
.ss-right .story-step.is-active .step-num-badge { color: var(--navy); }
.ss-right .story-step.is-active .step-chip {
  background: #EFF6FF; color: var(--blue-dark); border-color: rgba(14,165,233,.25);
}

/* ─── SECTION LABELS ──────────────────────────────────────── */
.story-section-header {
  grid-column: 1 / -1;
  padding: 5rem 4rem 0;
  background: inherit;
}
.story-section-header .section-tag { display: block; margin-bottom: .75rem; }
.story-section-header h2.section-title { max-width: 600px; }

/* ─── MOBILE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .story-section       { flex-direction: column; }
  .story-sticky-rail   { display: none; }   /* hide sticky panel on mobile */
  .story-sticky        { display: none; }
  .story-scroll        { width: 100%; }
  .story-scroll-cap    { height: 2rem; }
  .story-step          { opacity: 1; min-height: auto; padding: 2.5rem 1.5rem; }
  .story-section-header { padding: 4rem 1.5rem 0; }
  .sp-big-num          { display: none; }
}
@media (max-width: 600px) {
  .story-step { padding: 2rem 1.5rem; }
}

/* ─── SNAP SCROLL — full-viewport sticky panel story ────────
   .snap-section  outer container (height = 4×100vh)
   .snap-sticky   position:sticky viewport
   .snap-header   top bar (label + counter + dots)
   .snap-panels   panel stage
   .snap-panel    individual full-screen panel
────────────────────────────────────────────────────────────── */

.snap-section {
  position: relative;
  /* height set by JS: panels × 100vh */
}

/* cinematic.css applies overflow:hidden to [data-cin-num] elements,
   which breaks position:sticky on .snap-sticky inside.
   Override with higher specificity (type + class + attr wins over attr alone). */
div.snap-section[data-cin-num] {
  overflow: visible !important;
}

.snap-sticky {
  position: sticky;
  top: 72px;                   /* nav height */
  height: calc(100vh - 72px);
  background: var(--white);
  display: flex;
  flex-direction: column;
  /* no overflow:hidden here — we clip per-panel instead */
}

/* ── Top header bar ──────────────────────────────────────── */
.snap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem clamp(1.5rem, 5vw, 4rem);
  padding-left: 210px; /* clear logo badge: nav-padding(48px) + badge-width(135px) + buffer */
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
}
@media (max-width: 1200px) { .snap-header { padding-left: 185px; } }
@media (max-width: 768px)  { .snap-header { padding-left: 170px; } }
@media (max-width: 600px)  { .snap-header { padding-left: 1.25rem; } }
.snap-header-left {
  display: flex;
  align-items: center;
}
/* counter hidden — numbered steps convey position instead */
.snap-counter { display: none; }

/* ── Numbered step grid ──────────────────────────────────── */
.snap-steps {
  display: flex;
  align-items: center;
  gap: 0;
}
.snap-dot {
  /* circle badge with step number */
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 700; letter-spacing: .03em;
  color: var(--text-light);
  background: transparent;
  border: 1.5px solid var(--border);
  transition: background .35s, border-color .35s, color .35s, transform .35s cubic-bezier(0.16,1,0.3,1);
  flex-shrink: 0;
  cursor: default;
}
.snap-dot.active {
  background: #198e4c;
  border-color: #198e4c;
  color: #fff;
  transform: scale(1.15);
}
.snap-section--tech .snap-dot.active {
  background: #198e4c;
  border-color: #198e4c;
}
.snap-step-line {
  width: 22px; height: 1.5px;
  background: var(--border);
  flex-shrink: 0;
}
.snap-section--tech .snap-step-line { background: var(--border); }

/* ── Dot-grid background on sticky area (static — no animation, avoids jank) */
.snap-sticky {
  background-image: radial-gradient(circle, rgba(0,0,0,.07) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}

/* ── Panels stage ────────────────────────────────────────── */
.snap-panels {
  flex: 1;
  position: relative;
  overflow: hidden;            /* clip inactive panels here */
  min-height: 0;
}

/* Each panel: column flex, content vertically centered via margin:auto */
.snap-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(2rem, 4vh, 3.5rem) clamp(1.5rem, 5vw, 5rem);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s cubic-bezier(0.16,1,0.3,1),
              transform .45s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
}
.snap-panel--active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ── Panel step-number watermark (hero 01 concept) ──────── */
.snap-panel-num {
  position: absolute;
  top: -1.5rem;
  right: clamp(1rem, 4vw, 3.5rem);
  font-family: var(--font-serif);
  font-size: clamp(9rem, 20vw, 18rem);
  line-height: 1;
  letter-spacing: -.06em;
  color: rgba(0,0,0,.055);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  transition: color .5s;
}
.snap-section--tech .snap-panel-num { color: rgba(26,95,214,.055); }

/* ── Content containers ──────────────────────────────────── */
.snap-content {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: auto;
  position: relative;
  z-index: 1;
}
.snap-content--split {
  flex-direction: row;
  align-items: center;
  gap: clamp(2rem, 4vw, 4.5rem);
}
.snap-content--center {
  align-items: center;
  text-align: center;
}

/* ── Typography ──────────────────────────────────────────── */
.snap-eyebrow {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mid);
}
.snap-heading {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 4.5vw, 5rem);
  letter-spacing: -.04em; line-height: 1.06;
  color: var(--navy);
}
.snap-heading em { color: #198e4c; font-style: italic; }
.snap-section--tech .snap-heading em { color: #198e4c; }
.snap-heading--sm {
  font-size: clamp(2rem, 3.2vw, 3.25rem);
}
.snap-sub-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  letter-spacing: -.03em; color: var(--navy);
}
.snap-sub {
  font-size: 1rem; color: var(--text-mid);
  line-height: 1.75; max-width: 48ch;
}

/* ── Pain-point grid ─────────────────────────────────────── */
.snap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.snap-item {
  display: flex; flex-direction: column; gap: .55rem;
  padding: 1.4rem 1.25rem;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-left: 3px solid #198e4c;
  border-radius: 12px;
}
.snap-section--tech .snap-item { border-left-color: #198e4c; }
.snap-item-icon { font-size: 1.25rem; color: #198e4c; margin-bottom: .15rem; }
.snap-section--tech .snap-item-icon { color: #198e4c; }
.snap-item strong { font-size: .92rem; font-weight: 600; color: var(--navy); line-height: 1.35; }
.snap-item span { font-size: .82rem; color: var(--text-mid); line-height: 1.6; }

/* ── Solution split panel ────────────────────────────────── */
.snap-sol-left { flex: 0 0 auto; max-width: 400px; }
.snap-sol-right { flex: 1; display: flex; flex-direction: column; gap: .6rem; }

.snap-sol-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(25,142,76,.1); color: #198e4c;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; margin-bottom: 1rem;
}
.snap-sol-icon--tech { background: rgba(26,95,214,.1); color: #198e4c; }

.snap-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.1rem;
  background: var(--off-white);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: .9rem; font-weight: 500; color: var(--navy);
  transition: background .2s, border-color .2s, transform .2s var(--ease-out);
}
.snap-link span:last-child { color: #198e4c; flex-shrink: 0; }
.snap-link:hover {
  background: rgba(25,142,76,.06);
  border-color: rgba(25,142,76,.28);
  transform: translateX(4px);
}
.snap-section--tech .snap-link span:last-child { color: #198e4c; }
.snap-section--tech .snap-link:hover {
  background: rgba(26,95,214,.05);
  border-color: rgba(26,95,214,.22);
}

/* ── Delivery / stack pills ──────────────────────────────── */
.snap-pills {
  display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center;
}
.snap-pill {
  padding: .55rem 1.3rem; border-radius: 100px;
  background: var(--off-white); border: 1px solid var(--border);
  font-size: .875rem; font-weight: 600; color: var(--navy);
}

/* ── CTA button ──────────────────────────────────────────── */
.snap-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 1rem 2rem;
  background: #198e4c; color: #fff;
  border-radius: 12px; font-size: .95rem; font-weight: 600;
  margin-top: .75rem;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.snap-cta:hover {
  background: #147a40; transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(25,142,76,.32);
}
.snap-section--tech .snap-cta { background: #198e4c; }
.snap-section--tech .snap-cta:hover {
  background: #1450b8;
  box-shadow: 0 8px 22px rgba(26,95,214,.28);
}

/* ── Inline CTA callout ──────────────────────────────────── */
.snap-cta-inline {
  margin-top: 1.1rem;
  font-size: .95rem; font-weight: 600; color: var(--navy);
  padding: .65rem 1rem;
  background: rgba(25,142,76,.07);
  border-left: 3px solid #198e4c;
  border-radius: 0 8px 8px 0;
}
.snap-section--tech .snap-cta-inline {
  background: rgba(26,95,214,.07);
  border-left-color: #198e4c;
}

/* ── Stats row (Why Us panel) ────────────────────────────── */
.snap-stats-row {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  margin-top: 1.1rem; margin-bottom: 1rem;
}
.snap-stat {
  display: flex; flex-direction: column; gap: .15rem;
}
.snap-stat strong {
  font-size: 1.35rem; font-weight: 700; color: #198e4c; line-height: 1;
}
.snap-section--tech .snap-stat strong { color: #198e4c; }
.snap-stat span {
  font-size: .78rem; color: var(--text-mid); font-weight: 500;
}

/* ── Static snap-link (no hover arrow, no pointer) ──────── */
.snap-link--static {
  cursor: default; pointer-events: none;
}
.snap-link--static:hover {
  transform: none; background: var(--off-white);
  border-color: var(--border);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .snap-content--split { flex-direction: column; gap: 1.25rem; }
  .snap-sol-left { max-width: 100%; }
  .snap-stats-row { gap: 1rem; }
}
@media (max-width: 600px) {
  .snap-grid  { grid-template-columns: 1fr; gap: .5rem; }
  .snap-item  { padding: .65rem .8rem; }
  .snap-header { padding: .6rem 1.25rem; }
  .snap-panel  { padding: 1rem 1.25rem; }
  .snap-content { gap: .75rem; }
  .snap-dot { width: 22px; height: 22px; font-size: .58rem; }
  .snap-step-line { width: 12px; }
}
/* Short-viewport safety: ensure content is never clipped at top */
@media (max-height: 500px) {
  .snap-sticky { top: 0; height: 100vh; }
  .snap-dot { width: 22px; height: 22px; font-size: .58rem; }
  .snap-step-line { width: 14px; }
  .snap-heading { font-size: clamp(1.5rem, 5vw, 2.5rem); }
  .snap-item span { display: none; }  /* hide sub-text on tiny screens */
}
