/* Compact chapters share the reference card geometry; only Work retains its long endpoint. */
[data-chapter="timeline"] {
  color-scheme: dark;
  --t-bg: var(--midnight-lagoon); --t-surface: #10272d;
  --t-text: #eef4f3; --t-heading: var(--champagne-50); --t-muted: #bccbcc;
  --t-link: #b5e4dd; --t-link-visited: var(--champagne-200); --t-focus: var(--cyan-seaglass);
  --t-accent: var(--champagne-200); --t-accent-2: var(--cyan-seaglass);
}
#timeline, #contact { min-height: 0; padding-block: 32px 40px; }
.chapter-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.chapter-heading h2 { margin: 0; }
.chapter-heading .crew-lane { flex: 0 1 240px; min-width: 96px; height: 64px; }
.chapter-heading + .lede, .compact-pin > .lede { margin: 8px 0 20px; max-width: 66ch; }
.work-heading { position: relative; }
.work-heading .crew-lane { position: absolute; right: 0; top: -10px; width: min(55%, 240px); height: 64px; }
.materials-ready .compact-pin { padding-top: 12px; }
.compact-pin h2 { font-size: clamp(27.2px, 3vw, 40px); }
.compact-chapter .material-viewport { padding-bottom: 8px; }
.compact-chapter .material-card { min-height: 220px; }
.compact-chapter .material-card :is(h3,p) { margin: 0 0 12px; }
.compact-chapter .material-card h3 { font-size: 20px; line-height: 1.25; }
.compact-chapter .material-card p { line-height: 1.5; }
[data-material-compact] > article { position: relative; width: min(680px, 100%); padding: 16px; border: 1px solid var(--glass-line); border-radius: 18px; background: var(--glass); }
.material-detail { margin: 0; }
.material-detail > summary { min-height: 44px; padding-block: 10px; cursor: pointer; line-height: 1.4; color: var(--t-link); }
.material-detail > summary:focus-visible { outline-offset: 2px; }
.materials-ready .compact-chapter .material-card.is-expanded { width: min(680px, calc(100vw - 32px)); }
.timeline-detail-body, .directory-entries { padding-top: 16px; }
.directory-entries { list-style: none; margin: 0; padding-left: 0; }
.directory-entries > li + li, .timeline-entry + .timeline-entry, .coursework { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--glass-line); }
.compact-chapter .material-card h4 { margin: 0 0 8px; font: 600 17px/1.4 "Public Sans", sans-serif; color: var(--t-heading); }
.compact-chapter .entry-status { font-size: 13px; color: var(--t-muted); }
.timeline-card .timeline-date { font-size: 13px; font-weight: 600; color: var(--t-muted); }
.materials-ready #timeline-track { position: relative; padding-top: 22px; }
.materials-ready #timeline-track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 1px; background: var(--t-accent-2); }
.materials-ready .timeline-card::after { content: ""; position: absolute; left: 16px; top: -17px; width: 10px; height: 10px; border-radius: 50%; background: var(--t-accent-2); box-shadow: 0 0 0 3px var(--t-bg); }
.target-alias { display: block; height: 0; scroll-margin-top: 112px; }
.course-list { margin: 12px 0 0; padding-left: 20px; }
.course-list li { margin-bottom: 8px; break-inside: avoid; }
.course-code { font-weight: 600; white-space: nowrap; }
.materials-ready .is-height-reading #timeline-track::after, .materials-ready .is-height-reading #ecosystem-track::after { display: none; }
.story-card { border: 1px solid var(--glass-line); border-radius: 18px; padding: 20px; background: var(--glass); }
.story-card :is(h3,p) { margin: 0 0 12px; }
.story-card summary { min-height: 44px; padding-block: 10px; cursor: pointer; }
.workshop-copy { max-width: 960px; margin: 20px auto 0; }
.crew-roster { display: grid; gap: 10px; padding-left: 20px; }
.contact-copy { max-width: 760px; margin: 24px auto 0; }
.contact-copy .doors { max-width: 480px; margin: 16px auto; }
.contact-copy .contact-links { margin-bottom: 0; }
@media (min-width: 721px) {
  #timeline, #contact { padding-block: 40px 48px; }
  .is-expanded .course-list { columns: 2; column-gap: 28px; }
}
@media (max-width: 720px) {
  .chapter-heading { gap: 12px; }
  .chapter-heading .crew-lane { flex-basis: 160px; min-width: 144px; }
  .chapter-heading h2 { font-size: 27.2px; }
  .compact-chapter .material-card { min-height: 220px; }
  .story-card { padding: 16px; }
}
@media print {
  .crew-lane { display: none !important; }
  #timeline, #contact { padding: 12px 0 !important; min-height: 0 !important; }
  .materials-ready .compact-pin, .compact-pin { padding-top: 0 !important; }
  .compact-chapter .material-card, .materials-ready .compact-chapter .material-card.is-expanded { width: 100% !important; min-height: 0; break-inside: auto; }
  .materials-ready #timeline-track { padding-top: 0; }
  .materials-ready #timeline-track::before, .materials-ready .timeline-card::after { display: none; }
  .course-list { columns: 2; }
  .chapter-heading { min-height: 0; }
}

/* Keep the first read to identity, Work and the timeline; supporting material is optional. */
#intro { min-height: 0; height: auto; overflow: visible; padding-bottom: 20px; }
#intro .hero-stage { width: 100%; max-width: 960px; margin-inline: auto; }
#intro .intro-copy { margin-top: 12px; }
.portfolio-support details > summary { min-height: 44px; padding-block: 10px; cursor: pointer; color: var(--t-link); }
.portfolio-support h5 { margin: 0 0 8px; font-size: 1rem; }
.portfolio-support #workshop { margin-top: 12px; }
.portfolio-support .crew-lane { height: 64px; width: min(100%, 240px); margin-left: auto; }
#contact .contact-copy { margin-top: 16px; }

/* Existing portrait beside the biography, preserving its full original frame. */
#intro .intro-copy.has-portrait { max-width: 864px; display: grid; grid-template-columns: minmax(0, 1fr) 160px; align-items: center; gap: 24px; }
/* Original /preview/home portrait window, centered within its rim with white behind the cutout. */
#intro .intro-portrait {
  position: relative; width: 160px; aspect-ratio: 132 / 172; margin: 0; justify-self: end;
  border-radius: 66px 66px 14px 14px; overflow: hidden; isolation: isolate; background: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 14px 30px rgb(0 0 0 / .35);
}
#intro .intro-headshot {
  position: absolute; display: block; inset: auto 0 0; width: 100%; max-width: 100%; height: auto;
  border-radius: 0; background-color: #fff;
  -webkit-mask-image: linear-gradient(#000 82%, transparent);
  mask-image: linear-gradient(#000 82%, transparent);
}
#intro .intro-portrait::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, #f6efe3, #e8dbc5 30%, transparent 55%, #8ed4ce);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.beta-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 4px; color: var(--t-link); font-size: 12px; line-height: 1.25; }
.beta-link img { display: block; width: 16px; height: 16px; border-radius: 4px; }
/* Original homepage welcome-mark underline language, adapted to headings without its pill. */
#intro .intro-biography h1, .work-heading h2, .chapter-heading h2 { position: relative; width: fit-content; }
#intro .intro-biography h1::after, .work-heading h2::after, .chapter-heading h2::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.12em; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #e8dcc0 15%, #8ed4ce 85%, transparent);
  transform: scaleX(1); transform-origin: left center;
}
@keyframes heading-underline-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
#intro .intro-biography h1::after { animation: heading-underline-in 900ms 180ms ease-out both; }
:is(.work-heading h2, .chapter-heading h2).title-pending::after { transform: scaleX(0); }
:is(.work-heading h2, .chapter-heading h2).is-in::after { animation: heading-underline-in 900ms 180ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  #intro .intro-biography h1::after, .work-heading h2::after, .chapter-heading h2::after,
  :is(.work-heading h2, .chapter-heading h2):is(.title-pending, .is-in)::after { animation: none; transform: none; }
}
@media (max-width: 720px) {
  #intro .intro-copy.has-portrait { grid-template-columns: minmax(0, 1fr) 112px; gap: 16px; align-items: start; }
  #intro .intro-portrait { width: 112px; }
}
