/* =========================================================================
   Bio-Value Chain — Living Bio-Tree v4
   SVG organic branches · scroll-driven bidirectional · eased reveals
   ========================================================================= */

/* ─── Section ─────────────────────────────────────────────────────────────── */
.value-chain-section {
  position: relative;
  padding-block: 120px;
  background-color: transparent; /* Clean transparent background */
  overflow: hidden;
  z-index: 1;
  scroll-margin-block-start: calc(var(--nav-h, 80px) + 24px);
}
/* Removed ::before radial gradients as per user request */

/* ─── Header ──────────────────────────────────────────────────────────────── */
.vc-header {
  text-align: center;
  margin-block-end: 100px;
  position: relative; z-index: 1;
}
.vc-title {
  font-family: var(--idx-ff-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: var(--idx-navy);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  line-height: 1.1;
}
.vc-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--idx-slate);
  max-width: 580px;
  margin-inline: auto;
  line-height: 1.7;
}
.vc-subtitle strong {
  display: block;
  margin-block-start: 6px;
  font-weight: 600;
  color: var(--idx-navy);
}

/* ─── Timeline Container ──────────────────────────────────────────────────── */
.vc-timeline {
  position: relative;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 24px;
  z-index: 1;
}

/* ─── Central Spine (glass capillary) ────────────────────────────────────── */
.vc-spine {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 0;
  inset-block-end: 0;
  width: 3px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(153,184,186,0.22) 8%,
    rgba(153,184,186,0.15) 92%,
    transparent 100%
  );
  transform: translateX(-50%);
  z-index: 0;
}
:root[dir="rtl"] .vc-spine { transform: translateX(50%); }

/* Glowing liquid — height driven by JS directly */
.vc-spine-glow {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: -2px;
  width: 7px;
  height: 0%;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--idx-cyan) 0%, var(--idx-teal) 100%);
  box-shadow:
    0 0 10px 3px rgba(56,189,248,0.50),
    0 0 28px 6px rgba(15,118,110,0.25);
}

/* ─── Node Row — 3-col grid: card | branch+dot | card ────────────────────── */
.vc-node {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  grid-template-rows: 1fr; /* single row so dot and branch share it */
  align-items: center;
  position: relative;
  margin-block-end: 60px;
  z-index: 2;
}
.vc-node:last-child { margin-block-end: 0; }

/* Column assignments — dot and branch both in col 2, row 1 (overlapping) */
.vc-node-dot  { grid-column: 2; grid-row: 1; justify-self: center; align-self: center; position: relative; z-index: 5; }
.vc-branch    { grid-column: 2; grid-row: 1; justify-self: stretch; align-self: center; z-index: 3; }

/* Odd: card left, empty right */
.vc-node:nth-child(odd) .vc-content-wrapper { grid-column: 1; grid-row: 1; justify-self: end; }
.vc-node:nth-child(odd) .vc-empty-wrapper   { grid-column: 3; grid-row: 1; }
/* Even: empty left, card right */
.vc-node:nth-child(even) .vc-content-wrapper { grid-column: 3; grid-row: 1; justify-self: start; }
.vc-node:nth-child(even) .vc-empty-wrapper   { grid-column: 1; grid-row: 1; }

/* ─── Node Dot (bioluminescent orb) ──────────────────────────────────────── */
.vc-node-dot {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--idx-surface);
  border: 2px solid rgba(15,118,110,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  box-shadow: 0 0 12px rgba(15,118,110,0.06);
  transition: box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Hide bottom dots on desktop (they are only for mobile flow-through) */
.vc-node-dot.vc-dot-bottom {
  display: none;
}
.vc-node-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--idx-cyan);
  opacity: 0;
  transform: scale(0);
  box-shadow: 0 0 8px 2px rgba(56,189,248,0.9);
}

/* ─── SVG Organic Branch ─────────────────────────────────────────────────── */
.vc-branch {
  position: relative;
  /* Height covers the droop of the SVG path (viewBox y goes 12→56 = 44 units) */
  height: 60px;
  pointer-events: none;
  overflow: visible;
}

.vc-branch-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Faint tube track — always visible */
.vc-branch-track {
  stroke: rgba(153,184,186,0.22);
  fill: none;
}

/* Animated glowing fill — JS drives stroke-dashoffset */
.vc-branch-fill {
  stroke: #38BDF8;
  fill: none;
  /* filter applied per SVG via unique IDs */
}

/* Odd nodes (card on LEFT): branch goes from right→left
   Mirror the SVG horizontally around its center */
.vc-node:nth-child(odd) .vc-branch-svg {
  transform: scaleX(-1);
  transform-origin: center;
}

/* RTL mirrors */
:root[dir="rtl"] .vc-node:nth-child(odd)  .vc-branch-svg { transform: none; }
:root[dir="rtl"] .vc-node:nth-child(even) .vc-branch-svg {
  transform: scaleX(-1);
  transform-origin: center;
}

/* ─── Content Wrapper ─────────────────────────────────────────────────────── */
.vc-content-wrapper { width: 100%; }

/* ─── Liquid Glass Card ───────────────────────────────────────────────────── */
.vc-glass-card {
  position: relative;
  border-radius: 28px;
  min-height: 500px;

  /* Initial state — driven by JS */
  opacity: 0;
  /* Don't use transform here so JS can control it */

  --mouse-x: 50%;
  --mouse-y: 50%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --move-x: 0px;
  --move-y: 0px;
}

/* Hover-interactive class added by JS when card is visible */
.vc-glass-card.is-interactive {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Outer ambient mouse glow */
.vc-glass-card::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 31px;
  background: radial-gradient(
    circle 280px at var(--mouse-x) var(--mouse-y),
    rgba(56,189,248,0.11), transparent 100%
  );
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.vc-glass-card:hover::after,
.vc-glass-card.is-touched::after { 
  opacity: 1; 
}

/* Layer 1 — Glass Container */
.vc-glass-card .nav-pill-glass-container {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.85),
    0 20px 60px -12px rgba(15,23,42,0.09),
    0  4px 20px  -6px rgba(15,118,110,0.05);
}

/* Layer 2 — Frosted Backdrop */
.vc-glass-card .liquid-backdrop {
  position: absolute;
  inset: -20px;
  background: rgba(248,250,252,0.38);
  backdrop-filter: url(#liquid-glass-refraction-ca) blur(18px) saturate(130%);
  -webkit-backdrop-filter: url(#liquid-glass-refraction-ca) blur(18px) saturate(130%);
  pointer-events: none;
  z-index: 1;
}

/* Layer 3 — Specular Rim + Flashlight */
.vc-glass-card .liquid-specular-rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.70);
  box-shadow:
    inset 0  2px  5px rgba(255,255,255,0.85),
    inset 0 -2px  8px rgba(15,118,110,0.05),
    inset -2px 0  6px rgba(56,189,248,0.03);
  background: radial-gradient(
    circle 320px at var(--mouse-x) var(--mouse-y),
    rgba(255,255,255,0.16), transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Layer 4 — Content */
.vc-glass-card .liquid-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: inherit;
}

/* ─── Watermark Number ────────────────────────────────────────────────────── */
.vc-watermark {
  position: absolute;
  inset-block-start: -24px;
  inset-inline-end: 8px;
  font-family: var(--idx-ff-display);
  font-size: 13rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(153,184,186,0.16);
  z-index: 0;
  pointer-events: none;
  transition: transform 1.2s cubic-bezier(0.22,1,0.36,1);
  user-select: none;
}
.vc-glass-card:hover .vc-watermark,
.vc-glass-card.is-touched .vc-watermark { 
  transform: translate3d(0,-10px,0) scale(1.02); 
}

/* ─── Cinematic Image ─────────────────────────────────────────────────────── */
.vc-card-image-wrap {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.vc-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.vc-node:nth-of-type(1) .vc-card-image { object-position: center 5%; }

/* Image crossfade on hover & touch */
.vc-card-image-hover {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}
.vc-glass-card:hover .vc-card-image-hover,
.vc-glass-card.is-touched .vc-card-image-hover,
.vc-card-image-wrap.is-touched .vc-card-image-hover {
  opacity: 1;
}


/* Gradient mask — only last 28% fades */
.vc-card-image-gradient {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 62%,
    rgba(248,250,252,0.55) 80%,
    rgba(248,250,252,1.00) 100%
  );
}

/* ─── Text Content ────────────────────────────────────────────────────────── */
.vc-text-content {
  position: relative;
  z-index: 2;
  padding: 28px 32px 32px;
}
.vc-step-title {
  font-family: var(--idx-ff-display);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 700;
  color: var(--idx-navy);
  margin: 0 0 12px;
  line-height: 1.3;
}
.vc-step-desc {
  font-family: var(--idx-ff-body);
  font-size: 0.98rem;
  color: var(--idx-slate);
  line-height: 1.8;
  margin: 0;
}

/* ─── Stats Badges ────────────────────────────────────────────────────────── */
.vc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-block-start: 22px;
  margin-block-start: 22px;
  border-block-start: 1px solid rgba(153,184,186,0.28);
}
.vc-stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(153,184,186,0.38);
  box-shadow: 0 2px 8px -3px rgba(15,118,110,0.07), inset 0 1px 0 rgba(255,255,255,0.75);
  border-radius: 100px;
  font-family: var(--idx-ff-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--idx-teal);
  letter-spacing: 0.025em;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.vc-stat-badge:hover {
  transform: translateY(-2px);
  border-color: rgba(56,189,248,0.48);
  box-shadow: 0 5px 16px -4px rgba(56,189,248,0.18);
  color: #0F172A;
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE — Left spine, L-shaped branch, single column
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Center spine inside timeline and add runway for the first card */
  .vc-timeline { 
    padding-inline: 16px; 
    padding-block-start: 120px;
  }

  .vc-spine {
    inset-inline-start: 50% !important;
    inset-inline-end: auto !important;
    transform: translateX(-50%) !important;
  }
  :root[dir="rtl"] .vc-spine {
    inset-inline-start: 50% !important;
    inset-inline-end: auto !important;
    transform: translateX(50%) !important;
  }

  .vc-spine-glow {
    inset-inline-start: 50% !important;
    inset-inline-end: auto !important;
    transform: translateX(-50%) !important;
  }
  :root[dir="rtl"] .vc-spine-glow {
    inset-inline-start: 50% !important;
    inset-inline-end: auto !important;
    transform: translateX(50%) !important;
  }

  /* Single centered column */
  .vc-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-block-end: 40px;
    position: relative;
  }

  /* Block the timeline from passing behind the card */
  .vc-node::before {
    content: "";
    display: block;
    position: absolute;
    inset-block-start: 16px;
    inset-block-end: 16px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 32px), 440px);
    border-radius: 20px;
    background: var(--idx-surface);
    z-index: 1; /* Above spine (0), below glass card (2) */
  }
  :root[dir="rtl"] .vc-node::before {
    transform: translateX(50%);
  }
  .vc-node:last-child::before {
    inset-block-end: 16px;
  }

  .vc-node-dot {
    margin: 0;
  }
  .vc-node-dot.vc-dot-top {
    margin-bottom: -16px; /* Pulls the card up to overlap the dot */
    z-index: 3;
  }
  .vc-node-dot.vc-dot-bottom {
    display: flex;
    margin-top: -16px; /* Pulls the dot up to overlap the bottom of the card */
    z-index: 3;
  }

  /* Branches not needed in center-spine mobile layout */
  .vc-branch { display: none; }

  /* Center the cards */
  .vc-content-wrapper,
  .vc-node:nth-child(odd)  .vc-content-wrapper,
  .vc-node:nth-child(even) .vc-content-wrapper {
    grid-column: unset;
    grid-row: unset;
    justify-self: center;
    width: 100%;
    max-width: 440px;
    z-index: 2; /* Glass card covers the spine (z-index 0) */
  }
  .vc-empty-wrapper { display: none; }

  .vc-glass-card {
    min-height: unset;
    border-radius: 20px;
    background: var(--idx-surface);
  }
  .vc-card-image-wrap { height: 220px; border-radius: 20px 20px 0 0; }
  .vc-text-content { padding: 22px 22px 26px; }
  .vc-watermark { font-size: 8rem; inset-block-start: -14px; }
}

/* ─── Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vc-glass-card,
  .vc-branch-fill { transition: none !important; animation: none !important; }
}
