.page-index {
  position: sticky;
  top: var(--header);
  z-index: 5;
  background: light-dark(#f5f5f5,#0b0b0b);
  border-block: 1px solid var(--line);
}
.page-index-links { display: flex; gap: clamp(20px, 4vw, 52px); overflow-x: auto; }
.page-index a { padding: .8rem 0; color: var(--muted); white-space: nowrap; font-size: .88rem; text-decoration: none; }
.page-index a span, .page-section-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.page-index a span { margin-right: .4em; }
.page-index a:hover, .page-index a:focus-visible, .page-index a[aria-current] { color: light-dark(#111,#fff); text-decoration: underline; text-underline-offset: .35em; }
.page-index-target { scroll-margin-top: 48px; }
.page-section-label { margin-bottom: 1rem; }
@keyframes section-rollout { from { opacity: .4; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .page-rollout.is-entering { animation: section-rollout 560ms ease-out both; }
}

@media print { .page-index { display: none; } }

/* Give major sections a consistent rhythm across the site. */
@media screen {
  main {
    --section-space: clamp(78px, 9vw, 144px);
    --intro-space: clamp(48px, 7vw, 98px);
    --heading-gap: clamp(18px, 2.5vw, 32px);
    --section-divider: light-dark(rgba(0,0,0,.19),rgba(255, 255, 255, .19));
  }

  main h2 {
    margin-bottom: var(--heading-gap);
    text-wrap: balance;
  }

  main p + p { margin-top: 1.05em; }

  .research-intro, .cap-opening, .about-intro, .conversation-hero,
  .work-opening, .cv-intro {
    padding-bottom: var(--intro-space);
  }

  .research-intro .intro-description { max-width: 46ch; }

  .home-section, .story-row, .about-page main > .section,
  .cap-practice, .cap-demo, .cap-invitation, .research-project,
  .approach, .digital-section, .podcast {
    padding-block: var(--section-space);
  }

  .story-row, .about-page main > .section, .cap-practice, .cap-demo,
  .cap-invitation, .work-page .work-shell > section[id], .podcast {
    border-top: 1px solid var(--section-divider);
  }

  .home-section h2, .story-row h2, .about-page main > .section h2,
  .cap-practice h2, .cap-demo h2, .approach h2, .project-copy h2,
  .work-page .work-shell h2, .journal > h2, .podcast h2 {
    line-height: 1.12;
    margin-bottom: var(--heading-gap);
  }

  .home-section h2 {
    max-width: 22ch;
    font-size: clamp(2.15rem, 4.6vw, 4.2rem);
  }

  .home-section .home-lead, .story-row p, .about-evidence p,
  .research-project .project-summary, .approach p {
    max-width: 55ch;
  }

  .home-why { background: light-dark(#f5f5f5,#101010); }
  .home-feature, .cap-invitation { background: light-dark(#fff,#080808); }

  .study-heading { margin-top: clamp(28px, 5vw, 70px); }
  .work-page .film-feature, .work-page #projects { padding-block: var(--section-space); margin-bottom: 0; }
  .journal { padding-block: var(--intro-space) var(--section-space); }
  .cv-area { padding-top: clamp(18px, 4vw, 56px); }
  .cv-profile { padding-block: clamp(44px, 6vw, 80px); }
  .cv-section { padding-block: clamp(36px, 6vw, 76px); }

  .page-index-links {
    flex-wrap: wrap;
    column-gap: clamp(18px, 4vw, 52px);
    row-gap: 0;
    overflow: visible;
  }
  .page-index a { display: inline-flex; align-items: baseline; gap: .4em; }
  .page-index a span { margin: 0; }
  .research-project.page-index-target { scroll-margin-top: 48px; }
}

@media screen and (max-width: 760px) {
  main { --section-space: clamp(76px, 13vw, 100px); }
  .page-index { position: static; }
  .page-index-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding-block: 10px;
  }
  .page-index a { white-space: normal; align-items: baseline; padding-block: .65rem; }
  .page-index-target, .research-project.page-index-target { scroll-margin-top: 0; }
  .home-section h2 { max-width: 17ch; }
  .home-pillars article { padding-block: 32px; }
  .research-project .project-visual { margin-bottom: 6px; }
}


#mission > p:not(.page-section-label) { max-width: 60ch; }
