.secondary-page .sub-hero {
  padding-block: clamp(3.5rem, 9vw, 8rem) clamp(2.5rem, 6vw, 5rem);
}

.sub-hero .eyebrow { margin: 0 0 1.25rem; }

.sub-hero h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.75rem);
  font-family: var(--display);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.07em;
  text-wrap: balance;
}

.sub-hero .sub-lead {
  max-width: 43rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  line-height: 1.5;
}

.sub-link {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .25em;
  text-decoration-color: transparent;
  transition: text-decoration-color .18s ease;
}

.sub-link:hover, .sub-link:focus-visible { text-decoration-color: currentColor; }
.back-link { margin: 0 0 2.5rem; }
.back-link span { margin-right: .3em; }

.project-index, .project-detail, .archive, .article-grid, .about-grid {
  padding-bottom: clamp(4.5rem, 9vw, 8rem);
}

.project-spotlight, .series-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.75rem, 6vw, 5rem);
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .45rem;
}

.project-spotlight h2, .series-panel h2, .archive h2, .project-reading h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4.4vw, 3.25rem);
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.project-spotlight h2 a { text-decoration: none; }
.project-spotlight .eyebrow, .series-panel .eyebrow, .project-reading .eyebrow { margin: 0 0 .9rem; }
.project-spotlight p:not(.eyebrow), .series-panel p:not(.eyebrow) { color: var(--muted); margin: 0 0 1.35rem; }
.project-spotlight .button { margin-top: .5rem; }
.spotlight-art { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .3rem; }

.past-projects { margin-top: 3rem; }
.project-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(0, 3fr);
  gap: clamp(1rem, 4vw, 3rem);
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.project-row:first-child { border-top: 1px solid var(--line); }
.project-row h2 { margin: 0 0 .6rem; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.04em; }
.project-row p { margin: 0 0 .75rem; }
.project-row div > p { max-width: 52ch; color: var(--muted); }
.project-row .sub-link + .sub-link { margin-left: 1.5rem; }

.project-body, .article-grid, .about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 21rem);
  align-items: start;
  gap: clamp(2rem, 7vw, 7rem);
}

.detector-demo { scroll-margin-top: .75rem; }
.project-body { margin-top: clamp(2.5rem, 6vw, 5rem); }
.project-reading { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.project-reading .sub-link { display: table; margin-top: .65rem; }
.project-facts { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: .45rem; }
.project-facts .eyebrow { margin: 0 0 1rem; }
.project-facts dl, .project-facts dd { margin: 0; }
.project-facts dt { color: var(--muted); font-size: .85rem; }
.project-facts dt:not(:first-child) { margin-top: .8rem; }

.series-panel { scroll-margin-top: 6rem; }
.series-panel p:not(.eyebrow) { margin-bottom: 0; }
.series-steps { margin: 0; padding-inline-start: 1.4rem; }
.series-steps li { padding: .4rem 0 .4rem .35rem; }
.series-steps li::marker { color: var(--accent); font-variant-numeric: tabular-nums; }
.series-steps a { text-underline-offset: .18em; text-decoration-color: var(--line); }
.series-steps a:hover { text-decoration-color: currentColor; }

.archive { margin-top: clamp(3.5rem, 8vw, 7rem); scroll-margin-top: 6rem; }
.note-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 .75rem; }
.note-filter[hidden], .note-row[hidden] { display: none; }
.note-filter button {
  padding: .5rem .95rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.note-filter button:hover { border-color: var(--accent); }
.note-filter button[aria-pressed="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.note-count { margin: 0 0 1.2rem; color: var(--muted); font-size: .875rem; }
.archive-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.note-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .5rem 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.note-row time, .note-kind { color: var(--muted); font-size: .85rem; }
.note-row a { font-size: clamp(1rem, 2.4vw, 1.25rem); font-weight: 600; text-decoration: none; }
.note-row a:hover, .note-row a:focus-visible { text-decoration: underline; text-underline-offset: .22em; }

.article-hero h1 { max-width: 19ch; }
.article-byline { margin-top: 1.35rem; color: var(--muted); font-size: .9rem; }
.article-grid { grid-template-columns: minmax(9rem, 13rem) minmax(0, 44rem); gap: clamp(1.5rem, 6vw, 5rem); }
.article-aside { position: sticky; top: 6rem; }
.article-aside nav { display: grid; gap: .65rem; }
.article-aside p { margin: 0 0 .2rem; }
.article-aside a { color: var(--muted); text-decoration: none; }
.article-aside a:hover, .article-aside a:focus-visible { color: var(--ink); text-decoration: underline; }

.reading-copy { max-width: 67ch; font-size: clamp(1.05rem, 1.5vw, 1.18rem); line-height: 1.72; }
.reading-copy > :first-child, .reading-copy section > :first-child { margin-top: 0; }
.reading-copy section { margin: 2.5rem 0; scroll-margin-top: 6rem; }
.reading-copy h2 { margin: 0 0 .75rem; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; letter-spacing: -.045em; }
.reading-copy p { margin: 0 0 1.1rem; }
.reading-copy a { text-underline-offset: .22em; }

.equation {
  margin: 1.5rem 0;
  padding: 1rem .5rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .65rem;
}

.article-figure { margin: 2rem 0; }
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: .5rem;
}
.article-figure figcaption, .about-portrait figcaption { margin-top: .65rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.article-next { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.article-next .eyebrow { margin: 0 0 .65rem; }

.about-portrait { margin: 0 0 2rem; }
.about-portrait img { display: block; width: 100%; height: auto; border-radius: .45rem; }
.about-side .sub-link { display: table; margin: .6rem 0 0; }

@media (max-width: 720px) {
  .project-spotlight, .series-panel, .project-body, .article-grid, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .project-row { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .project-row .sub-link { display: table; }
  .project-row .sub-link + .sub-link { margin: .4rem 0 0; }
  .article-aside { position: static; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
  .article-aside nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-aside p { grid-column: 1 / -1; }
  .about-side { max-width: 22rem; }
  .note-row { grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .8rem; }
  .note-row a { grid-area: 2 / 1 / 3 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .sub-link, .note-filter button { transition: none; }
}
