/* =========================================================
   BioVenue — academic landing
   Type: Source Serif 4 (display) + Inter (UI) + JetBrains Mono
   Palette: warm off-white, ink, single muted ink-blue accent
   ========================================================= */

:root {
  --bg:        #f7f5ef;          /* warm paper */
  --bg-elev:   #fdfcf8;
  --ink:       #1b1b1a;
  --ink-2:     #3a3a37;
  --muted:     #7a766e;
  --rule:      #d9d4c6;
  --rule-soft: #e8e3d5;
  --accent:    oklch(0.42 0.07 248);   /* muted ink-blue */
  --accent-soft: oklch(0.94 0.02 248);
  --accent-line: oklch(0.55 0.06 248);

  --serif: "Source Serif 4", "Source Serif Pro", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  /* Loose vertical snap: each landmark section is a snap point but
     scrolling THROUGH the workflow scrolly is uninterrupted (proximity,
     not mandatory). Effect: when the user scrolls down from the hero,
     the page snaps PAST the method scrolly to the dimensions section
     (which is the bottom-of-section-2 view they actually want to see).
     The scrolly demo is still reachable by deliberate scrolling. */
  scroll-snap-type: y proximity;
}
.hero, .dimensions, .cta-band, .foot { scroll-snap-align: start; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(rgba(60,55,40,0.025) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }

/* =========================================================
   Top bar
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 18px; height: 18px;
  border: 1.25px solid var(--ink);
  border-radius: 50%;
  position: relative;
}
.brand .mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.brand-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.005em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.nav a:hover { color: var(--ink); }
.nav .cta {
  padding: 7px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
}
.nav .cta:hover { background: var(--ink); color: var(--bg-elev); }

/* =========================================================
   Shared
   ========================================================= */
.kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
em { font-style: italic; color: var(--accent); font-weight: 400; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 90px 40px 56px;
  z-index: 1;
  /* Fill the first visible viewport so the workflow scrolly sits below
     the fold — visitors see the manuscript bubble + 'scroll to follow
     the workflow' hint at the bottom of their screen before any extra
     content peeks through. ~65px subtracts the sticky topbar height. */
  min-height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
}

/* Push the manuscript bubble + scroll hint to the bottom edge of the
   hero so they're the last thing the user sees before scrolling. */
.hero .hero-stage {
  margin-top: auto;
}
.hero-meta { margin-bottom: 28px; }
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.012em;
  margin: 0 0 28px;
  max-width: 18ch;
  text-wrap: balance;
}
.hero-sub {
  max-width: 60ch;
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}

.hero-stage {
  margin-top: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.hero-node {
  transform: translateY(0);
  animation: floatIn 0.9s 0.1s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(4px); }
}

/* =========================================================
   Nodes (workflow blocks)
   ========================================================= */
.node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px;
  min-width: 200px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 12px 32px -24px rgba(40,30,15,0.18);
  margin: 0;
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.4s;
}
.node-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.node-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.node-sub {
  font-size: 12.5px;
  color: var(--muted);
}
.node--manuscript {
  align-items: center;
  text-align: center;
  padding: 22px 30px 26px;
}
.node--manuscript .node-pages {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}
.node--manuscript .node-pages span {
  width: 6px; height: 9px;
  background: var(--rule);
  border-radius: 1px;
}
.node--manuscript .node-pages span:nth-child(odd) { background: var(--rule-soft); }

/* stage-coloured accents on the node frames */
.node[data-stage="1"] { border-left: 2px solid var(--accent-line); }
.node[data-stage="2"] { border-left: 2px solid var(--accent-line); }
.node[data-stage="3"] { border-left: 2px solid var(--accent-line); }
.node[data-stage="4"] { border-left: 2px solid var(--accent); }
.node[data-stage="5"] { border-left: 2px solid var(--ink); }

/* =========================================================
   Scrolly section — diagram pinned top, explainer pinned bottom
   ========================================================= */
.method {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  background: var(--bg);
}
.method-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  /* pin + triggers overlap in the same grid cell */
}
.method-inner > .pin,
.method-inner > .triggers {
  grid-column: 1;
  grid-row: 1;
}

.pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 80px 40px 56px;
  pointer-events: none; /* let the page scroll through */
}
.pin > * { pointer-events: auto; }

/* --- top: horizontal diagram --- */
.pin-diagram {
  display: flex;
  flex-direction: column;
  gap: 28px;
  justify-content: center;
  align-items: stretch;
  min-height: 0;
}
.pin-diagram-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pin-diagram-head .caption-index {
  color: var(--accent);
  font-weight: 500;
}
.pin-diagram-head .caption-label {
  color: var(--ink);
  letter-spacing: 0.08em;
}

.hdiagram {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
}
.hdiagram .node {
  flex: 1 1 0;
  min-width: 0;
  padding: 16px 18px;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px) scale(0.99);
  transition:
    opacity 0.55s cubic-bezier(.2,.7,.2,1),
    transform 0.55s cubic-bezier(.2,.7,.2,1),
    border-color 0.4s, box-shadow 0.4s;
}
.hdiagram .node.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.hdiagram .node.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 18px 40px -28px rgba(40,30,15,0.25);
}
.hdiagram .node .node-title { font-size: 15px; }
.hdiagram .node .node-sub   { font-size: 11.5px; }

.hdiagram .h-connector {
  flex: 0 0 28px;
  align-self: center;
  position: relative;
  height: 1px;
  background: var(--rule);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.hdiagram .h-connector.is-visible { opacity: 1; }
.hdiagram .h-connector::after {
  content: "";
  position: absolute;
  right: -1px; top: 50%;
  width: 6px; height: 6px;
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  transform: translateY(-50%) rotate(45deg);
}
.hdiagram .h-connector.is-active {
  background: var(--accent-line);
}
.hdiagram .h-connector.is-active::after {
  border-color: var(--accent-line);
}

/* --- bottom: explainer cards (cross-fade) --- */
.pin-explainer {
  position: relative;
  align-self: end;
  border-top: 1px solid var(--rule-soft);
  padding-top: 28px;
  min-height: 230px;
}
.explainer-card {
  position: absolute;
  inset: 28px 0 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 72ch;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.explainer-card.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.explainer-card .panel-index {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.explainer-card h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  text-wrap: balance;
}
.explainer-card p {
  margin: 0 0 12px;
  font-size: 15.5px;
  color: var(--ink-2);
  line-height: 1.6;
  text-wrap: pretty;
}
.explainer-card .chips { margin-top: 14px; }

.pin-progress {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pin-progress span {
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rule);
  transition: background 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}
.pin-progress span:hover {
  background: var(--accent-line);
  transform: scale(1.6);
}
.pin-progress span.is-current {
  background: var(--accent);
  transform: scale(1.4);
}
.pin-progress span.is-past {
  background: var(--ink-2);
}

/* --- triggers (invisible scroll spacers) --- */
.triggers {
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.trigger {
  height: 110vh;
}
/* first trigger a bit shorter so the hero doesn't need a huge scroll gap */
.trigger[data-step="0"] { height: 90vh; }
/* last trigger longer so the final step stays visible before scrolling to overview */
.trigger[data-step="5"] { height: 140vh; }
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 22px 0 0;
}
.chips li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
}
.chips--sources li { border-color: var(--accent-line); color: var(--accent); }
.chips--evidence li,
.chips--criteria li { background: transparent; }

/* =========================================================
   Overview (full diagram)
   ========================================================= */
.overview {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 140px 40px 120px;
}
.overview-head {
  max-width: 56ch;
  margin: 0 0 70px;
}
.overview-head .kicker { display: block; margin-bottom: 18px; }
.overview-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.012em;
  margin: 0 0 22px;
  text-wrap: balance;
}
.overview-head p {
  font-size: 17px;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}

.score-dimensions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}
.score-dim {
  flex: 1 1 0;
  min-width: 140px;
  padding: 20px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent-line);
  border-radius: 4px;
  text-align: center;
}
.score-dim-label {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

/* =========================================================
   Dimensions section — rich score cards
   ========================================================= */
.dimensions {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px 40px 80px;
  border-top: 1px solid var(--rule-soft);
}
.dimensions-head {
  max-width: 56ch;
  margin: 0 0 56px;
}
.dimensions-head .kicker { display: block; margin-bottom: 16px; }
.dimensions-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.012em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.dimensions-head p {
  font-size: 17px;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}

.dim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.dim-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 22px 28px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.dim-card:hover {
  border-color: var(--accent-line);
  box-shadow: 0 8px 28px -16px rgba(40,30,15,0.15);
}
.dim-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 4px;
}
.dim-label {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 8px;
}
.dim-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}

.full-diagram {
  position: relative;
  padding: 20px 0 0;
}

.fd-band {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 28px minmax(0, 3.6fr) 28px minmax(180px, 1fr);
  align-items: stretch;
  gap: 0;
}

.fd-bookend {
  align-self: center;
  text-align: center;
  align-items: center;
  padding: 22px 20px;
  background: var(--bg-elev);
}
.fd-bookend[data-kind="input"] {
  border-left: 2px solid var(--ink);
}
.fd-bookend[data-kind="output"] {
  border-left: 2px solid var(--accent);
  background:
    linear-gradient(180deg, var(--bg-elev) 0%, color-mix(in srgb, var(--accent-soft) 70%, var(--bg-elev)) 100%);
}

.fd-arrow {
  align-self: center;
  position: relative;
  height: 1px;
  background: var(--rule);
  margin: 0 6px;
}
.fd-arrow::after {
  content: "";
  position: absolute;
  right: -1px; top: 50%;
  width: 6px; height: 6px;
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  transform: translateY(-50%) rotate(45deg);
}
.fd-arrow--thin { background: var(--rule-soft); }
.fd-arrow--thin::after { border-color: var(--rule-soft); }

.fd-stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr) ;
  align-items: stretch;
  gap: 0;
  position: relative;
}
.fd-stages .fd-arrow--thin {
  width: 18px;
  justify-self: stretch;
}
/* Use flex layout instead — grid + inline arrows is brittle */
.fd-stages {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.fd-stages > .fd-stage { flex: 1 1 0; }
.fd-stages > .fd-arrow--thin {
  flex: 0 0 22px;
  align-self: center;
}

.fd-stage {
  padding: 22px 20px 20px;
  background: var(--bg-elev);
  border-left: 2px solid var(--accent-line);
  border-radius: 4px;
  gap: 10px;
  min-width: 0;
}
.fd-stage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.fd-step {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.fd-step-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.fd-stage .node-title {
  font-size: 17px;
  line-height: 1.2;
}
.fd-stage .node-sub {
  font-size: 12px;
}
.fd-detail {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fd-detail li {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--sans);
  position: relative;
  padding-left: 12px;
}
.fd-detail li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 4px; height: 1px;
  background: var(--accent-line);
}

.fd-caption {
  margin: 44px auto 0;
  max-width: 70ch;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}
.fd-caption .kicker {
  display: inline-block;
  margin-right: 10px;
  color: var(--accent);
}

/* Simplified full-diagram variant */
.fd-band--simple {
  display: flex;
  align-items: center;
  gap: 0;
}
.fd-simple {
  flex: 1 1 0;
  min-width: 0;
  padding: 16px 14px;
  text-align: center;
  align-items: center;
  gap: 0;
}
.fd-simple .node-title {
  font-size: 14px;
  line-height: 1.25;
}

/* =========================================================
   CTA band
   ========================================================= */
.cta-band {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px 40px 100px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: end;
  border-top: 1px solid var(--rule-soft);
}
.cta-band h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 14px 0 12px;
  text-wrap: balance;
  max-width: 18ch;
}
.cta-band p {
  color: var(--ink-2);
  margin: 0;
  font-size: 16px;
  max-width: 44ch;
}
.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn--primary { background: var(--ink); color: var(--bg-elev); }
.btn--primary:hover { background: var(--accent); }
.btn--ghost { border-color: var(--rule); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }

.foot {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 40px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--rule-soft);
}
.foot-meta { font-family: var(--mono); letter-spacing: 0.04em; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .pin { padding: 60px 24px 40px; }
  .hdiagram { flex-wrap: wrap; gap: 8px; }
  .hdiagram .node { flex: 1 1 40%; }
  .hdiagram .h-connector { display: none; }
  .pin-progress { display: none; }
  .nav a:not(.cta) { display: none; }
  .cta-band { grid-template-columns: 1fr; }
  .cta-actions { justify-content: flex-start; }
  .fd-band {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .fd-arrow {
    height: 22px; width: 1px;
    margin: 0 auto;
    justify-self: center;
  }
  .fd-arrow::after {
    top: auto; right: auto;
    left: 50%; bottom: -1px;
    transform: translateX(-50%) rotate(135deg);
  }
  .fd-stages { flex-direction: column; }
  .fd-stages > .fd-arrow--thin {
    flex: 0 0 22px;
    width: 1px;
    height: 22px;
    align-self: center;
  }
}
