/* Personal website theme. */
:root {
  --paper: #ffffff;
  --paper-deep: #f7f8f9;
  --surface: #ffffff;
  --ink: #303943;
  --muted: #58636e;
  --line: #e2e6e9;
  --forest: #216582;
  --forest-light: #edf4f6;
  --amber: #216582;
  --amber-dark: #216582;
  --blue: #216582;
  --focus: #1976a3;
  --max: 1600px;
  --page-gutter: clamp(24px, 3.5vw, 72px);
  --serif: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { background: #fff; scroll-padding-top: 24px; }
section[id], h2[id] { scroll-margin-top: 24px; }
body { background: #fff; color: var(--ink); font-size: 15px; line-height: 1.65; }
main { min-width: 0; }
p { max-width: 72ch; }
a { color: var(--forest); }
h1, h2, h3 { font-family: var(--sans); color: var(--ink); letter-spacing: 0; line-height: 1.3; }
h1 { font-size: clamp(22px, 2vw, 27px); font-weight: 700; }
h2 { font-size: 20px; font-weight: 680; }
h3 { font-size: 16px; font-weight: 680; }
.kicker { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; text-transform: none; }
.shell { width: min(calc(100% - 2 * var(--page-gutter)), var(--max)); }

.preview-banner { min-height: 26px; padding: 3px max(var(--page-gutter), calc((100vw - var(--max)) / 2)); color: #64707a; background: #f5f6f7; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0; }
.preview-banner strong { color: #58636e; font-weight: 650; }
.preview-banner a { color: var(--forest); }
.site-header { position: static; background: #fff; border-color: var(--line); backdrop-filter: none; }
.site-header__inner { width: min(calc(100% - 2 * var(--page-gutter)), var(--max)); min-height: 58px; gap: 32px; }
.wordmark { gap: 0; color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.wordmark__mark, .wordmark__text small { display: none; }
.wordmark__text strong { display: inline; font-size: 15px; line-height: 1.3; }
.primary-nav { gap: 25px; }
.primary-nav a, .primary-nav a[aria-current="page"] { min-height: 0; padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { background: transparent; color: var(--forest); text-decoration: underline; text-underline-offset: 5px; }
.primary-nav a[aria-current="page"]::after { display: none; }
/* Home uses the available width for profiles, biography, and a larger portrait. */
.home-main { width: min(calc(100% - 2 * var(--page-gutter)), var(--max)); display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; padding-block: 42px 64px; }
/* Keep Home's identity column near the left edge even on ultrawide displays.
   The biography and portrait retain their reading width beside that column. */
@media (min-width: 801px) {
  body[data-preview-page="home"] .site-header__inner,
  body[data-preview-page="home"] .home-main { margin-inline: var(--page-gutter) auto; }
}
.profile-summary { min-width: 0; color: var(--muted); }
.profile-summary__label { margin: 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 700; }
.profile-summary nav { display: grid; }
.profile-summary nav a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 600; text-decoration: none; }
.profile-summary nav a span { display: block; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.profile-summary nav a:hover { text-decoration: underline; }
.personal-content { min-width: 0; }
.home-intro { display: grid; grid-template-columns: minmax(0, 1fr) clamp(190px, 20vw, 320px); align-items: start; gap: 32px; max-width: none; }
.home-intro__copy { min-width: 0; }
.home-intro__photo { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.home-intro h1, .home-section h2 { margin: 0 0 11px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 20px; }
.home-intro p, .home-section p { margin: 0 0 14px; color: var(--ink); font-size: 15px; line-height: 1.7; }
.home-intro p { max-width: 84ch; }
.home-section { max-width: 84ch; margin-top: 34px; }
.home-section a { font-weight: 600; }
.home-section .home-inline-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }

/* Research and Software share page/header edges and a consistent metadata column. */
body[data-preview-page="research"], body[data-preview-page="software"] { --max: 1240px; }
.research-main, .resource-main { width: min(calc(100% - 2 * var(--page-gutter)), 1240px); max-width: none; padding-block: 40px 64px; }
.superbench-main { width: min(calc(100% - 2 * var(--page-gutter)), var(--max)); }
.research-heading, .resource-heading { max-width: 800px; }
.research-heading h1, .resource-heading h1 { max-width: 780px; margin: 0 0 12px; font-size: 25px; }
.research-heading > p:last-child, .resource-heading > p:last-child { color: var(--ink); font-size: 15px; line-height: 1.7; }
.selected-work, .publications, .resource-list, .resource-guides { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.study-row a, .resource-entry__links a, .resource-guides a { color: var(--forest); font-weight: 600; }
.selected-work__heading, .publications__heading { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; align-items: baseline; margin-bottom: 12px; }
.selected-work__heading h2, .publications__heading h2 { margin: 0; font-size: 20px; }
.selected-work__heading > p, .publications__heading > p { max-width: 72ch; margin: 0; color: var(--muted); font-size: 12px; }
.research-heading { max-width: 900px; }
.research-heading > p { max-width: none; }
.selected-work__heading { display: block; max-width: 900px; }
.selected-work__heading > p { max-width: none; margin-top: 6px; }
.study-row { display: block; max-width: 900px; padding: 22px 0; border-top: 1px solid var(--line); }
.study-row__meta { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.study-row h3 { margin: 0 0 5px; font-size: 16px; }
.study-row p { max-width: none; margin: 0 0 10px; color: var(--ink); font-size: 13px; }
.study-row a { font-size: 13px; }
.study-links { display: flex; flex-wrap: wrap; gap: 7px 22px; margin-top: 12px; }
.study-row > div { min-width: 0; }
.study-figure { margin: 20px 0 8px; max-width: 850px; }
.study-figure--wide { max-width: none; }
.study-figure__viewport { overflow-x: auto; }
.study-figure__viewport > a { display: block; min-width: 900px; }
.study-figure__viewport:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.study-figure--scrollable .study-figure__access { margin-top: 8px; color: var(--muted); }
.study-figure img { display: block; width: 100%; height: auto; }
.study-figure figcaption { margin-top: 12px; max-width: none; color: var(--muted); }
.study-figure__pan-hint { display: none; }
.study-notes { margin-top: 10px; color: var(--muted); }
.study-notes summary { width: fit-content; cursor: pointer; color: var(--forest); }
.study-notes > p { margin-top: 8px; color: var(--muted); }
@media (max-width: 967px) { .study-figure__pan-hint { display: block; } }
.publications > h3 { margin: 24px 0 7px; font-size: 16px; }
.publication-list, .other-work ul { margin: 0; padding: 0; list-style: none; }
.publication-list li, .other-work li { padding: 13px 0; border-top: 1px solid var(--line); font-size: 13px; }
.publication-list li > span, .other-work li > span { display: block; color: var(--muted); font-size: 11px; }
.publication-list li > a, .other-work li > a { display: block; color: var(--forest); font-size: 14px; font-weight: 650; }
.publication-list li > p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.publication-links { margin-top: 3px; font-size: 12px; }
.other-work { margin-top: 26px; }
.other-work > h3 { margin: 0; font-size: 16px; }
.other-work > p { margin: 3px 0 12px; color: var(--muted); font-size: 12px; }

.resource-entry, .resource-guides { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.resource-entry__meta { color: var(--muted); font-size: 12px; }
.resource-entry__meta > span { display: none; }
.resource-entry__meta p { margin: 0; }
.resource-entry__meta strong { color: var(--ink); }
.resource-entry h2 { margin: 0 0 6px; font-size: 18px; }
.resource-entry p, .resource-guides p { margin: 0 0 11px; color: var(--ink); font-size: 14px; }
.resource-entry__links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; font-size: 13px; }
.resource-guides { border-top: 0; }
.resource-guides h2 { margin: 0; font-size: 16px; }
.superbench-section { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.superbench-section h2 { margin: 0 0 12px; }
.superbench-image-note { color: var(--muted); }
.superbench-tool-list { margin: 0; padding: 0; list-style: none; }
.superbench-tool-list li { display: grid; grid-template-columns: 12px minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 20px; align-items: start; padding: 20px 0; border-top: 1px solid var(--line); line-height: 1.7; }
.superbench-tool-list li::before { content: "•"; grid-column: 1; }
.superbench-tool-copy { grid-column: 2; }
.superbench-tool-shot { min-width: 0; grid-column: 3; margin: 0; }
.superbench-tool-shot > a { display: block; }
.superbench-tool-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.superbench-tool-shot figcaption { margin-top: 7px; color: var(--muted); line-height: 1.45; }
.superbench-tool-shot a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.superbench-tool-list strong { color: var(--ink); font-weight: 700; }
.superbench-tool-list a, .superbench-return a { font-weight: 600; }
.superbench-limits { margin: 20px 0 0; color: var(--muted); }
.superbench-return { margin: 20px 0 0; }

/* Keep the Figure page in the same quiet reading system. */
.section-nav { background: #fff; border-color: var(--line); }
.section-nav .shell { min-height: 44px; }
.section-nav a { color: var(--muted); }
.figure-hero { width: min(calc(100% - 2 * var(--page-gutter)), var(--max)); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: start; margin: 32px auto 0; padding: 0; background: #fff; border: 0; border-radius: 0; }
.figure-hero > div:first-child { align-self: start; padding: 8px 0 0; }
.figure-hero h1, .page-hero h1 { max-width: 650px; font-size: 25px; }
.figure-hero .hero__lead { margin-bottom: 12px; color: var(--ink); font-size: 15px; }
.figure-hero > div:first-child > p:not(.kicker) { line-height: 1.7; }
.figure-hero .hero__actions { margin-top: 24px; }
.figure-preview { min-width: 0; margin: 0; }
.figure-preview > a { display: block; }
.figure-preview img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.figure-preview figcaption { margin-top: 7px; color: var(--muted); line-height: 1.45; }
.figure-preview a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
body[data-preview-page="figure"] .question-index { padding-block: 32px; }
body[data-preview-page="figure"] .section-intro { margin-bottom: 24px; }
body[data-preview-page="figure"] .question-list li { grid-template-columns: 32px minmax(0, 1fr); gap: 18px; padding-block: 20px; }
body[data-preview-page="figure"] .question-list h3 { margin-bottom: 6px; }
.figure-library { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); gap: 40px; padding-block: 32px; border-top: 1px solid var(--line); }
.figure-library p { margin-top: 0; }
.figure-learning, .availability { width: min(calc(100% - 2 * var(--page-gutter)), var(--max)); margin: 34px auto 0; padding: 20px 0; background: #fff; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
body[data-preview-page="figure"] main { padding-bottom: 64px; }
.figure-learning { gap: 40px; }
.figure-learning > div > p:last-child, .availability__copy, .availability > p { color: var(--ink); font-size: 14px; }
.figure-format-band { width: min(calc(100% - 2 * var(--page-gutter)), var(--max)); margin: 34px auto 0; background: #f7f8f9; border: 1px solid var(--line); border-radius: 0; color: var(--ink); }
.figure-format-band__inner { padding: 20px; }
.figure-format-band h2 { color: var(--ink); font-size: 20px; }
.figure-format-band__inner > div:last-child { color: var(--ink); font-size: 14px; }
.button--primary { background: var(--forest); border-color: var(--forest); }
.button--primary:hover { background: #174e67; }

/* Retired Home variants remain available as compact comparison pages. */
.work-home, .profile-home { width: min(calc(100% - 2 * var(--page-gutter)), var(--max)); padding-block: 40px 64px; }
.work-home__hero h1, .profile-home__identity h1 { font-size: 25px; }
.work-home__featured { background: #f7f8f9; border-color: var(--line); }
.work-home__featured h2 { font-size: 19px; }
.profile-home__lead { font-size: 16px; }

@media (min-width: 1200px) {
  .personal-content { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
  .home-intro { grid-column: 1 / -1; }
  .home-section { margin-top: 38px; }
}

@media (max-width: 800px) {
  .site-header__inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 5px; padding-block: 9px; }
  .primary-nav { flex-wrap: wrap; gap: 3px 17px; }
  .home-main { grid-template-columns: 1fr; gap: 23px; }
  .personal-content { order: 1; }
  .profile-summary { order: 2; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
  .profile-summary nav { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  .home-intro { grid-template-columns: minmax(0, 1fr) 152px; gap: 20px; }
  .home-intro__photo { width: 152px; }
  .figure-hero, .figure-library, .figure-learning, .availability { grid-template-columns: 1fr; }
  .figure-preview { max-width: 680px; }
  .superbench-tool-list li { grid-template-columns: 12px minmax(0, 1fr); gap: 8px 12px; }
  .superbench-tool-shot { grid-column: 2; width: min(100%, 520px); }
}

@media (max-width: 620px) {
  html { scroll-padding-top: 24px; }
  section[id], h2[id] { scroll-margin-top: 24px; }
  .shell, .home-main, .research-main, .resource-main, .work-home, .profile-home, .figure-hero, .figure-library, .figure-learning, .availability, .figure-format-band { width: min(calc(100% - 32px), var(--max)); }
  .preview-banner { padding-inline: 16px; }
  .site-header__inner { width: min(calc(100% - 32px), var(--max)); min-height: 0; }
  .primary-nav a, .primary-nav a[aria-current="page"] { min-height: 0; padding: 3px 0; font-size: 12px; }
  h1, .research-heading h1, .resource-heading h1, .figure-hero h1, .work-home__hero h1, .profile-home__identity h1 { font-size: 23px; }
  h2 { font-size: 19px; }
  .home-main, .research-main, .resource-main { padding-block: 25px 15px; }
  .home-intro { grid-template-columns: minmax(0, 1fr) 136px; gap: 16px; }
  .home-intro__photo { width: 136px; }
  .selected-work__heading, .publications__heading { display: block; }
  .selected-work__heading > p, .publications__heading > p { margin-top: 5px; }
  .study-row, .resource-entry, .resource-guides { grid-template-columns: 1fr; gap: 5px; }
  .resource-entry__meta p { margin-bottom: 4px; }
  .figure-hero { gap: 18px; padding: 0; }
  .figure-library { gap: 8px; }
  .figure-learning, .availability { padding: 18px 0; }
}

/* Consistent typography across the personal pages. */
body, body * { font-family: var(--sans) !important; font-size: 15px !important; }
body h1, body h2, body h3 { font-size: 19px !important; }
