/* ============================================================
   Celva Bio — Homepage v4: Hybrid
   V1 warmth (cream/navy, serif display) + V3 monospace rigor
   (section tags, labels, tabular tracks, case-report IDs).
   Layers on top of site.css.
   ============================================================ */

/* Mono utilities */
.v4 .v4-mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400; }
.v4 .v4-lbl { color: var(--ink-muted); }

.v4 .v4-section__head { max-width: 760px; margin: 0 0 56px; }
.v4 .v4-section__head .v4-mono { display: inline-block; margin-bottom: 20px; color: var(--accent-blue); }
.v4 .v4-section__head .section__h2 { margin: 0 0 20px; }

/* ============================================================
   HERO
   ============================================================ */
.v4 .v4-hero { padding: 0 0 0; background: var(--surface-tint); border-bottom: 1px solid var(--border); position: relative; }

/* system bar */
.v4 .v4-sysbar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 14px clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
  font-size: 11px; color: var(--ink-muted);
}
.v4 .v4-sysbar .v4-mono { font-size: 10.5px; color: var(--ink-muted); }
.v4 .v4-sysbar .v4-mono b { color: var(--ink); font-weight: 500; }
.v4 .v4-sysbar__sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.v4 .v4-mono--ok { color: #2f7d52 !important; display: inline-flex; align-items: center; gap: 8px; }
.v4 .v4-pulse { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; position: relative; }
.v4 .v4-pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: #4ade80; opacity: 0.4; animation: v4pulse 2s ease-out infinite; }
@keyframes v4pulse { 0%{transform:scale(0.5);opacity:0.4} 100%{transform:scale(1.6);opacity:0} }

.v4 .v4-hero__grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 80px;
  padding: clamp(56px, 7vw, 96px) clamp(24px, 4vw, 64px);
  align-items: start;
  max-width: 1400px; margin: 0 auto;
}
.v4 .v4-section-tag { margin-bottom: 28px; }
.v4 .v4-section-tag .v4-mono { color: var(--accent-blue); }

.v4 .v4-hero__h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.25rem, 6.4vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 32px;
}
.v4 .v4-hero__h1 em { font-style: italic; color: var(--accent-blue); font-weight: 400; }

.v4 .v4-hero__sub { font-size: 19px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 32px; max-width: 56ch; }

.v4 .v4-hero__ctas { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; margin-bottom: 56px; }

.v4 .v4-hero__pillars {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; padding-top: 28px;
  border-top: 1px solid var(--border);
}
.v4 .v4-hero__pillars > div { padding: 0 20px; border-right: 1px solid var(--border); }
.v4 .v4-hero__pillars > div:last-child { border-right: 0; }
.v4 .v4-hero__pillars .v4-lbl { font-size: 10px; letter-spacing: 0.1em; margin-bottom: 8px; display: block; }
.v4 .v4-pillar__n { font-family: var(--font-display); font-weight: 300; font-size: 34px; line-height: 1; color: var(--ink); }
.v4 .v4-pillar__n sup { font-size: 12px; font-family: 'JetBrains Mono', monospace; color: var(--ink-muted); letter-spacing: 0.04em; margin-left: 2px; vertical-align: top; position: relative; top: 4px; }
.v4 .v4-pillar__l { font-size: 13px; line-height: 1.45; color: var(--ink-muted); margin-top: 6px; max-width: 22ch; }

/* hero visual */
.v4 .v4-hero__visual { position: relative; }
.v4 .v4-hero__img { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #e8e5dc; }
.v4 .v4-hero__img img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) contrast(1.02); }
.v4 .v4-hero__scrim { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(11,29,58,0.35) 100%); }
.v4 .v4-hero__imgcap {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 0 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}
.v4 .v4-hero__imgcap-t { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 16px; color: var(--ink); }

.v4 .v4-hero__quote {
  padding: 20px 0 0;
  border-left: 2px solid var(--accent-blue);
  padding-left: 20px;
  margin-top: 20px;
}
.v4 .v4-hero__quote .v4-lbl { display: block; margin-bottom: 10px; color: var(--accent-blue) !important; font-weight: 500; }
.v4 .v4-hero__quote blockquote { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 20px; line-height: 1.32; color: var(--ink); margin: 0 0 10px; }
.v4 .v4-hero__quote cite { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--ink-muted); letter-spacing: 0.06em; }

/* ticker */
.v4 .v4-hero__ticker { border-top: 1px solid var(--border); overflow: hidden; padding: 14px 0; background: rgba(255,255,255,0.6); }
.v4 .v4-ticker__row { display: flex; gap: 40px; white-space: nowrap; color: var(--ink-muted); animation: v4ticker 65s linear infinite; }
.v4 .v4-ticker__row span { position: relative; padding-right: 40px; }
.v4 .v4-ticker__row span::after { content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.v4 .v4-ticker__row span:last-child::after { display: none; }
@keyframes v4ticker { to { transform: translateX(-50%); } }

/* ============================================================
   TRACKS TABLE
   ============================================================ */
.v4 .v4-tracks {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--white);
}
.v4 .v4-tracks__head {
  display: grid;
  grid-template-columns: 1.3fr 2.4fr 1fr 1fr 0.7fr 0.25fr;
  gap: 28px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-muted);
}

.v4 .v4-track {
  display: grid;
  grid-template-columns: 1.3fr 2.4fr 1fr 1fr 0.7fr 0.25fr;
  gap: 28px;
  padding: 32px 24px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-top: 0;
  align-items: flex-start;
  background: var(--white);
  transition: background 200ms var(--ease-standard);
  color: var(--ink-soft);
}
.v4 .v4-track:last-child { border-bottom: 0; }
.v4 .v4-track:hover { background: var(--surface-tint); }

/* Track code with SVG icon */
.v4 .v4-track__code { display: flex; align-items: center; gap: 16px; color: var(--ink); }
.v4 .v4-track__code > div { display: flex; flex-direction: column; gap: 4px; }
.v4 .v4-track__code i {
  font-style: normal;
  color: var(--accent-blue);
  font-weight: 500;
}
.v4 .v4-track__code b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--ink);
  line-height: 1.1;
}
.v4 .v4-track__icon {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: 2px;
  background: var(--surface-tint);
  color: var(--accent-blue);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 200ms, color 200ms, transform 300ms var(--ease-out-expo);
}
.v4 .v4-track__icon svg { width: 44px; height: 44px; display: block; }
.v4 .v4-track:hover .v4-track__icon { background: var(--accent-blue); color: var(--white); transform: scale(1.04); }

.v4 .v4-track__desc {
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 12px;
}
.v4 .v4-track__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink-soft);
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.v4 .v4-track__cell { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.v4 .v4-track__cell b { color: var(--ink); font-size: 15px; font-weight: 500; }
.v4 .v4-track__cell i { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--ink-muted); letter-spacing: 0.04em; text-transform: uppercase; }

.v4 .v4-pill {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 2px;
  font-weight: 500;
}
.v4 .v4-pill--blue { background: rgba(45,110,177,0.12); color: var(--accent-blue); }
.v4 .v4-pill--amber { background: rgba(180,125,40,0.14); color: #8a5a1f; }

.v4 .v4-track__arrow {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-muted);
  font-size: 18px;
  text-align: right;
  align-self: center;
  transition: transform 200ms, color 200ms;
}
.v4 .v4-track:hover .v4-track__arrow { color: var(--accent-blue); transform: translateX(4px); }

.v4 .v4-footnote {
  font-size: 10.5px; color: var(--ink-muted);
  line-height: 1.6; margin-top: 24px; max-width: 80ch;
  letter-spacing: 0.04em;
  font-family: 'JetBrains Mono', monospace;
  text-transform: none;
}

/* ============================================================
   METHODOLOGY (5 steps)
   ============================================================ */
.v4 .v4-method__head {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px;
  padding: 0 calc(clamp(20px, 4vw, 56px) + 28px) 64px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  margin: 0 0 56px;
}
.v4 .v4-method__head .section__h2 { margin: 16px 0 0; color: var(--white); }
.v4 .v4-method__head p { color: rgba(255,255,255,0.78); font-size: 17px; line-height: 1.6; margin: 0 0 16px; }
.v4 .v4-method__head p:last-child { margin-bottom: 0; }

.v4 .v4-steps {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.2);
}
.v4 .v4-step {
  padding: 32px 28px 28px;
  border-right: 1px solid rgba(255,255,255,0.14);
  display: flex; flex-direction: column; gap: 14px;
  min-height: 320px;
  transition: background 200ms;
}
.v4 .v4-step:last-child { border-right: 0; }
.v4 .v4-step:hover { background: rgba(255,255,255,0.03); }
.v4 .v4-step__head { display: flex; justify-content: space-between; align-items: baseline; }
.v4 .v4-step__num {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: 48px;
  color: var(--accent-ice);
  line-height: 1;
}
.v4 .v4-step__dur { color: rgba(255,255,255,0.55) !important; font-size: 10px; letter-spacing: 0.06em; text-transform: none !important; }
.v4 .v4-step h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--white);
  margin: 4px 0 0;
  line-height: 1.2;
}
.v4 .v4-step p { font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,0.68); margin: 0; }
.v4 .v4-step__who {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.55) !important;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: none !important;
}

/* ============================================================
   SPLIT — journey overlay
   ============================================================ */
.v4-split-visual { position: relative; }
.v4-split-visual::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,29,58,0.1) 0%, rgba(11,29,58,0.55) 100%);
  pointer-events: none;
}
.v4-journey {
  position: absolute; left: 32px; right: 32px; top: 32px;
  z-index: 2;
  color: var(--white);
  background: rgba(11,29,58,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px 24px 16px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.15);
}
.v4-journey__title { color: rgba(255,255,255,0.75); font-size: 10px; letter-spacing: 0.12em; margin-bottom: 6px; }
.v4-journey__svg { width: 100%; height: 110px; display: block; overflow: visible; }
@media (max-width: 640px) {
  .v4-journey { left: 16px; right: 16px; top: 16px; padding: 14px 16px 12px; }
}

/* ============================================================
   SCIENCE
   ============================================================ */
.v4 .v4-science { padding: clamp(80px, 10vw, 160px) 0; background: var(--white); border-bottom: 1px solid var(--border); }
.v4 .v4-science__inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
  max-width: 1400px; margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 64px);
  align-items: center;
}
.v4 .v4-science__text h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.25rem, 4.2vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 20px 0 28px;
}
.v4 .v4-science__text h2 em { font-style: italic; color: var(--accent-blue); font-weight: 400; }
.v4 .v4-science__text .lead { color: var(--ink-soft); font-size: 19px; line-height: 1.55; margin: 0 0 20px; max-width: 54ch; }
.v4 .v4-science__text > p { font-size: 16px; line-height: 1.65; color: var(--ink-muted); max-width: 54ch; }

.v4 .v4-spec {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin-top: 36px;
  border-top: 1px solid var(--border);
}
.v4 .v4-spec > div { padding: 14px 0; border-bottom: 1px solid var(--border); }
.v4 .v4-spec > div:nth-child(odd) { padding-right: 16px; border-right: 1px solid var(--border); }
.v4 .v4-spec > div:nth-child(even) { padding-left: 16px; }
.v4 .v4-spec dt { font-size: 12px; margin-bottom: 4px; }
.v4 .v4-spec dd {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--ink);
}

.v4 .v4-science__diagram {
  background: #fafaf9;
  padding: 32px;
  border: none;
  border-radius: 2px;
}
.v4 .v4-diagram__svg { width: 100%; height: auto; display: block; }

/* ============================================================
   REGISTRY / CASE REPORTS
   ============================================================ */
.v4 .v4-registry { background: var(--surface-tint); }

.v4 .v4-registry__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.v4 .v4-case { background: var(--white); display: flex; flex-direction: column; }
.v4 .v4-case__img { position: relative; aspect-ratio: 5/3; overflow: hidden; background: #e8e5dc; }
.v4 .v4-case__img img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.v4 .v4-case__id {
  position: absolute; top: 16px; left: 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  padding: 6px 10px;
  color: var(--accent-blue);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.v4 .v4-case__body { padding: 28px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.v4 .v4-case__body > .v4-lbl { font-size: 10px; letter-spacing: 0.1em; color: var(--accent-blue) !important; }
.v4 .v4-case blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  flex: 1;
}
.v4 .v4-case__meta {
  display: grid; gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin: 0;
}
.v4 .v4-case__meta > div {
  display: grid; grid-template-columns: 90px 1fr;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.v4 .v4-case__meta dt {
  color: var(--ink-muted);
  font-weight: 400;
  letter-spacing: 0.08em;
  margin: 0;
  font-size: 10px;
  padding-top: 3px;
}
.v4 .v4-case__meta dd { margin: 0; color: var(--ink); font-weight: 500; }

/* ============================================================
   FAQ
   ============================================================ */
.v4 .v4-faq__list { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.v4 .v4-faq__list details { border-bottom: 1px solid var(--border); padding: 24px 0; }
.v4 .v4-faq__list summary {
  list-style: none; cursor: pointer;
  display: grid;
  grid-template-columns: 64px 1fr 24px;
  gap: 20px;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
}
.v4 .v4-faq__list summary::-webkit-details-marker { display: none; }
.v4 .v4-faq__n {
  color: var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding-top: 8px;
}
.v4 .v4-faq__ic {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  color: var(--accent-blue);
  font-weight: 300;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  line-height: 1;
  transform-origin: 50% 50%;
  transition: transform 200ms;
}
.v4 .v4-faq__list details[open] .v4-faq__ic { transform: rotate(45deg); }
.v4 .v4-faq__a {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 20px 0 0 84px;
  max-width: 64ch;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .v4 .v4-hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .v4 .v4-tracks__head { display: none; }
  .v4 .v4-track {
    grid-template-columns: auto 1fr;
    gap: 20px;
    grid-template-areas:
      'icon     meta'
      'desc     desc'
      'delivery cost'
      'pill     arrow';
  }
  .v4 .v4-track__code { grid-area: icon / icon / meta / meta; align-self: start; }
  .v4 .v4-track__desc { grid-area: desc; }
  .v4 .v4-track .v4-track__cell:nth-child(3) { grid-area: delivery; }
  .v4 .v4-track .v4-track__cell:nth-child(4) { grid-area: cost; }
  .v4 .v4-pill { grid-area: pill; }
  .v4 .v4-track__arrow { grid-area: arrow; text-align: right; }
  .v4 .v4-method__head { grid-template-columns: 1fr; gap: 32px; }
  .v4 .v4-steps { grid-template-columns: repeat(2, 1fr); }
  .v4 .v4-step { border-bottom: 1px solid rgba(255,255,255,0.14); }
  .v4 .v4-science__inner { grid-template-columns: 1fr; gap: 48px; }
  .v4 .v4-registry__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* Stack pillars vertically. Padding so content doesn't butt up against the horizontal dividers.
     First pillar has no top padding; it sits flush below the container's border-top + padding-top. */
  .v4 .v4-hero__pillars { grid-template-columns: 1fr; gap: 0; }
  .v4 .v4-hero__pillars > div {
    border-right: 0;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
  }
  .v4 .v4-hero__pillars > div:first-child { padding-top: 0; }
  .v4 .v4-hero__pillars > div:last-child { border-bottom: 0; }
  .v4 .v4-steps { grid-template-columns: 1fr; }
  .v4 .v4-spec { grid-template-columns: 1fr; }
  .v4 .v4-spec > div:nth-child(odd) { border-right: 0; padding-right: 0; }
  .v4 .v4-spec > div:nth-child(even) { padding-left: 0; }
  .v4 .v4-faq__a { margin-left: 0; }
  .v4 .v4-faq__list summary { grid-template-columns: 1fr 24px; }
  .v4 .v4-faq__n { display: none; }
}
