/* ============================================================
   PAPYROS — homepage storytelling sections
   ============================================================ */

.body--story { overflow-x: clip; }
.story-main { padding: 0; max-width: none; }

/* ---------- Section 1: Network hero ---------- */
.network-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  overflow: hidden;
}
.network-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.network-hero__overlay {
  position: relative;
  z-index: 2;
  max-width: var(--page);
  padding: calc(var(--masthead-h) + 2rem) var(--gutter) 4rem;
  text-align: center;
}
.network-hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 auto;
  max-width: 22em;
}

/* ---------- Section 2: Pipeline ---------- */
.pipeline {
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
  background: var(--paper-raised);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.pipeline__inner {
  max-width: var(--page);
  margin: 0 auto;
}
.pipeline__heading,
.archive-showcase__heading,
.timeline__heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.65rem, 3.5vw, 2.4rem);
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 0.85rem;
}
.pipeline__lede,
.archive-showcase__lede,
.timeline__lede {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 3rem;
}
.pipeline__track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
}
.pipeline__chain {
  position: relative;
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
}
.pipeline__chain-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0 0 1.5rem;
}
.pipeline__chain-title a { color: var(--rubric); }
.pipeline__steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pipeline__step {
  opacity: 0.35;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.pipeline__step.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.pipeline__label {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rubric);
  margin-bottom: 0.25rem;
}
.pipeline__step p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.pipeline__step a { color: var(--ink); border-bottom: 1px solid rgba(154,123,47,0.35); }
.pipeline__line { display: none; }

/* ---------- Section 3: Archive showcase ---------- */
.archive-showcase {
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
  background: var(--paper);
}
.archive-showcase__inner {
  max-width: var(--page);
  margin: 0 auto;
}
.archive-showcase__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.archive-showcase__plate {
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.5rem 1.25rem;
  margin: 0;
  text-align: center;
  background-image: url("/static/plate-grid.svg");
  background-size: 28px 28px;
}
.archive-showcase__math {
  overflow-x: auto;
  min-height: 2em;
  color: var(--ink);
}
.archive-showcase__math .katex { font-size: 0.85em; max-width: 100%; }
.archive-showcase__math .katex-display { margin: 0; overflow-x: auto; overflow-y: hidden; }
.archive-showcase__plate figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: 1rem;
}
.archive-showcase__plate figcaption a { color: var(--rubric); }
.archive-showcase__more { margin: 1.25rem 0 0; }

/* ---------- Section 4: Timeline ---------- */
.timeline {
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
  background: var(--paper-raised);
  border-top: 1px solid var(--rule);
}
.timeline__inner {
  max-width: var(--page);
  margin: 0 auto;
  position: relative;
}
.timeline__track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.timeline__node {
  opacity: 0.4;
  transform: translateX(-12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  border-left: 2px solid var(--rule);
  padding: 0 0 2rem 1.5rem;
  margin-left: 0.5rem;
}
.timeline__node.is-visible {
  opacity: 1;
  transform: translateX(0);
  border-left-color: var(--rubric);
}
.timeline__link {
  display: block;
  transition: color 0.15s;
}
.timeline__link:hover .timeline__label { color: var(--rubric); }
.timeline__year {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--rubric);
  margin-bottom: 0.3rem;
}
.timeline__label {
  display: block;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
  transition: color 0.15s;
}
.timeline__desc {
  display: block;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-muted);
}
.timeline__connectors {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
.timeline__connectors line {
  stroke: var(--rubric);
  stroke-width: 1;
  opacity: 0.35;
  stroke-dasharray: 4 4;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .pipeline__step,
  .timeline__node {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 540px) {
  .network-hero__overlay {
    padding-top: calc(var(--masthead-h) + 1.5rem);
    text-align: left;
  }
  .network-hero__title { max-width: none; font-size: clamp(1.55rem, 6.5vw, 2rem); }
  .pipeline__track { grid-template-columns: 1fr; }
  .archive-showcase__grid { grid-template-columns: 1fr; }
  .timeline__track {
    overflow-x: auto;
    flex-direction: row;
    gap: 1.5rem;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .timeline__node {
    flex: 0 0 min(75vw, 16rem);
    scroll-snap-align: start;
    border-left: none;
    border-top: 2px solid var(--rule);
    padding: 1rem 0 0;
    margin: 0;
  }
  .timeline__node.is-visible { border-top-color: var(--rubric); }
  .timeline__connectors { display: none; }
}

@media (min-width: 900px) {
  .pipeline__step.is-visible,
  .timeline__node.is-visible { /* GSAP also sets these */ }
}
