/* Shared design. Each page's palette is defined below; content lives in JSON. */
:root {
  color-scheme: dark;
  --background: #1c211e;
  --surface: #242b26;
  --surface-soft: #29312b;
  --text: #dadcd4;
  --heading: #f0f1e9;
  --muted: #aeb8ad;
  --line: #3b483e;
  --line-strong: #7b8c7e;
  --accent: #bfceb7;
  --accent-hover: #eaf0e2;
  --accent-soft: #354236;
  --typeface: Georgia, "Times New Roman", Times, serif;
  --measure: 880px;
}
/* About: blue ink. Projects: graphite. Notes: warm brown. */
.about-page {
  --background: #19212b; --surface: #202b37; --surface-soft: #25323f;
  --text: #d7dce3; --heading: #eef2f6; --muted: #acb9c7;
  --line: #38495b; --line-strong: #718ca5;
  --accent: #bacfe0; --accent-hover: #e5f1fc; --accent-soft: #304258;
}
.projects-page {
  --background: #202122; --surface: #282a2b; --surface-soft: #2e3132;
  --text: #d9dcdd; --heading: #f1f2f0; --muted: #afb7b9;
  --line: #42484a; --line-strong: #7e8a8c;
  --accent: #b8cecf; --accent-hover: #e5f2f3; --accent-soft: #344447;
}
.notes-page {
  --background: #26211e; --surface: #302923; --surface-soft: #382f28;
  --text: #e0d7cb; --heading: #f5eadc; --muted: #bfb1a0;
  --line: #514234; --line-strong: #95806b;
  --accent: #d7bf9e; --accent-hover: #f2e0c7; --accent-soft: #4a3b2d;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--background); color: var(--text); font: 17px/1.7 var(--typeface); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.35; }
h1 { margin: 0 0 18px; font-size: clamp(1.9rem, 4.5vw, 2.4rem); font-weight: 400; letter-spacing: -.025em; }
h2 { margin: 0 0 22px; font-size: 1.4rem; font-weight: 400; }
h3 { margin: 0 0 10px; font-size: 1.1rem; font-weight: 400; }
h4 { margin: 0 0 6px; font-size: 1rem; }
p { margin: 0 0 18px; }
ul, ol { padding-left: 1.3em; }
::selection { background: var(--accent-soft); color: var(--heading); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 10; padding: 8px 14px; background: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* Navigation stays visible on phones; no menu or appearance settings needed. */
.site-header, .home-main, .page-main, .site-footer { width: min(var(--measure), calc(100% - 48px)); margin-inline: auto; }
.nav-shell { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 100px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; padding-block: 8px; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; filter: brightness(0) invert(.9); }
.primary-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.primary-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: 1rem; text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--heading); text-decoration: underline; text-underline-offset: 7px; }
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 24px 0 40px; color: var(--muted); font-size: .8rem; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--muted); }

/* Home: portrait, short introduction, and an existing Friedrich painting. */
.hero { padding: 56px 0 38px; }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 44px; align-items: start; }
.hero-photo { grid-column: 2; grid-row: 1; width: 100px; height: 122px; object-fit: cover; }
.hero-copy { grid-column: 1; grid-row: 1; min-width: 0; }
.hero-role { margin-bottom: 18px; color: var(--muted); font-size: 1rem; }
.hero-statement { max-width: 610px; }
.social-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 22px; font-size: .9rem; }
.social-link { display: inline-flex; align-items: center; min-height: 36px; }
.home-art { display: none; margin: 0; }
.has-art-background .home-art { display: block; }
.home-art-image { height: clamp(160px, 23vw, 238px); background-image: var(--home-background-image); background-position: var(--home-background-position, center); background-repeat: no-repeat; background-size: cover; }
.home-art figcaption { margin-top: 8px; color: var(--muted); font-size: .75rem; text-align: right; }
.home-overview { margin-top: 34px; }
.home-directory { margin: 0; }
.home-directory > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.home-directory > div:last-child { border-bottom: 0; }
.home-directory dt, .home-directory dd { margin: 0; }
.home-directory dd { color: var(--muted); font-size: 1rem; }

/* Interior documents share a readable spacing rhythm. */
.page-main { padding-top: 50px; }
.page-hero { margin-bottom: 40px; }
.page-hero > p { max-width: 680px; color: var(--muted); }
.page-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 24px; }
.section-heading h2 { margin: 0; }
.section-heading--row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; }
.section-heading--row > p { margin: 0; font-size: .85rem; color: var(--muted); }
.section-kicker { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.about-section { margin-top: 0; padding-top: 0; border-top: 0; }
.prose { max-width: 680px; }
.prose p:last-child { margin-bottom: 0; }
.profile-card { display: grid; grid-template-columns: 1.2fr 1.2fr .7fr; gap: 28px; margin: 30px 0 0; }
.profile-card dt { margin-bottom: 6px; color: var(--heading); font-size: .9rem; }
.profile-card dd { margin: 0; color: var(--muted); font-size: .9rem; }
/* About is organized like a research profile, with section names in the margin. */
.about-page .page-section:not(.about-section) { display: grid; grid-template-columns: 135px minmax(0, 1fr); gap: 32px; }
.about-page .section-heading h2 { font-size: 1.12rem; }
.about-page .section-heading { margin: 0; }
.experience-entry { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 36px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.about-page .experience-entry { grid-template-columns: 1fr; gap: 10px; }
.experience-entry:first-child { padding-top: 0; }
.experience-entry:last-child { padding-bottom: 0; border-bottom: 0; }
.experience-entry h3 { margin-bottom: 6px; }
.experience-organization { margin: 0; font-size: .95rem; }
.experience-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; color: var(--muted); font-size: .8rem; }
.experience-summary { margin: 0; font-size: 1rem; }
.skills-grid, .coursework-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; row-gap: 32px; }
.skill-card, .coursework-card, .focus-card { min-width: 0; }
.skill-card h3, .coursework-card h3 { margin-bottom: 14px; }
.skill-subgroup + .skill-subgroup { margin-top: 14px; }
.skill-subgroup h4 { color: var(--muted); font-size: .875rem; font-weight: 400; }
.skill-list { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.skill-list li { display: inline; }
.skill-list li:not(:last-child)::after { content: " · "; color: var(--muted); }
.coursework-list { margin: 0; padding: 0; list-style: none; }
.coursework-list li { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: baseline; padding-block: 5px; font-size: .95rem; }
.course-name { min-width: 0; }
.course-level { display: inline-block; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 2px; font-size: .75rem; line-height: 1.5; white-space: nowrap; }
.course-level--graduate { background: #244b35; border-color: #3e7354; color: #e1f2e5; }
.course-level--coursera { background: #234c73; border-color: #426e97; color: #e3f0ff; }
.focus-grid { display: grid; gap: 22px; }
.focus-card h3 { margin-bottom: 6px; }
.focus-card p { margin: 0; color: var(--muted); }

/* Projects: expanded engineering write-ups with a discreet PDF action. */
.portfolio-print-only { display: none; }
.portfolio-toolbar { margin-top: 20px; }
.portfolio-print-button { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 2px; background: transparent; color: var(--text); font-size: .875rem; }
.portfolio-print-button:hover { border-color: var(--accent); color: var(--accent); }
.portfolio-projects-section { margin-top: 0; padding-top: 0; border-top: 0; }
.portfolio-case-study { padding-block: 34px; border-top: 1px solid var(--line); }
.portfolio-case-study:last-child { padding-bottom: 0; }
.portfolio-case-header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px 30px; }
.portfolio-case-header > div { min-width: 0; }
.portfolio-case-header h3 { max-width: 680px; font-size: 1.4rem; }
.portfolio-case-date { flex-shrink: 0; color: var(--muted); font-size: .8rem; }
.portfolio-case-overview { margin: 12px 0 24px; color: var(--muted); }
.portfolio-case-details { display: grid; gap: 18px; }
.portfolio-case-detail { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; }
.portfolio-case-detail h4 { padding-top: 3px; color: var(--muted); font-size: .875rem; font-weight: 400; }
.portfolio-case-detail p { margin: 0; }
.portfolio-case-tools, .portfolio-case-attachments { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; margin-top: 22px; }
.portfolio-case-tools > span, .portfolio-case-attachments > span { padding-top: 2px; color: var(--muted); font-size: .875rem; }
.portfolio-case-tools p, .portfolio-case-attachments p { margin: 0; font-size: .9rem; }
.entry-links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .9rem; }
.portfolio-case-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 28px; }
.portfolio-case-media { margin: 0; min-width: 0; }
.portfolio-case-media img { width: 100%; }
.portfolio-case-media figcaption { margin-top: 8px; color: var(--muted); font-size: .8rem; }
.portfolio-cover-grid, .portfolio-profile-grid { display: grid; gap: 20px; }
.portfolio-contact-list { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 14px 0 0; padding: 0; }

/* Notes: a narrower reading column and a conventional document index. */
.notes-page .page-main { max-width: 780px; }
.notes-page .page-hero { padding-bottom: 18px; border-bottom: 3px double var(--line-strong); }
.notes-section { margin-top: 0; padding-top: 0; border-top: 0; }
.content-entry { padding: 22px 0; border-bottom: 1px solid var(--line); }
.content-entry h3 { margin-bottom: 5px; font-size: 1.1rem; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .8rem; }
.status-message { padding-block: 18px; color: var(--muted); }
.status-message--error { color: #edb4a6; }

@media (max-width: 700px) {
  .site-header, .home-main, .page-main, .site-footer { width: calc(100% - 36px); }
  .nav-shell { min-height: 80px; gap: 16px; }
  .brand-logo { width: 30px; height: 30px; }
  .primary-nav { gap: 18px; }
  .primary-nav a { font-size: .9rem; }
  .hero { padding-top: 36px; }
  .hero-layout { grid-template-columns: minmax(0, 1fr) 72px; column-gap: 20px; row-gap: 0; }
  .hero-photo { width: 72px; height: 88px; }
  .hero-copy { display: contents; }
  .hero-copy h1 { grid-column: 1; grid-row: 1; align-self: center; margin-bottom: 0; }
  .hero-copy > p, .hero-copy > div { grid-column: 1 / -1; }
  .hero-role { margin-top: 18px; }
  .social-links { margin-top: 2px; }
  .home-art-image { height: 190px; background-image: var(--home-background-image-mobile, var(--home-background-image)); background-position: var(--home-background-position-mobile, center); }
  .home-art figcaption { font-size: .75rem; text-align: left; }
  .home-directory > div { grid-template-columns: 78px minmax(0, 1fr); gap: 14px; }
  .page-main { padding-top: 32px; }
  .profile-card, .skills-grid, .coursework-grid, .experience-entry, .about-page .page-section:not(.about-section) { grid-template-columns: 1fr; gap: 20px; }
  .experience-entry, .about-page .experience-entry { gap: 10px; }
  .portfolio-case-header { display: block; }
  .portfolio-case-date { margin: 0 0 14px; }
  .portfolio-case-detail, .portfolio-case-tools, .portfolio-case-attachments { grid-template-columns: 1fr; gap: 4px; }
  .portfolio-case-header h3 { font-size: 1.3rem; }
  .portfolio-case-media-grid { grid-template-columns: 1fr; }
  .site-footer { margin-top: 42px; }
}
@media (max-width: 360px) {
  .primary-nav { gap: 12px; }
  .primary-nav a { font-size: .85rem; }
  .nav-shell { flex-wrap: wrap; padding-block: 12px; }
}

/* PDF portfolio: white paper, compact text, continuous project flow. */
@page { size: Letter; margin: .45in .5in; }
@media print {
  :root, .about-page, .projects-page, .notes-page {
    color-scheme: light; --background: #fff; --surface: #fff; --surface-soft: #fff;
    --text: #303030; --heading: #151515; --muted: #555; --line: #ccc;
    --line-strong: #aaa; --accent: #214c62; --accent-hover: #214c62;
  }
  body { font-size: 9pt; line-height: 1.4; background: #fff; }
  .site-header, .site-footer, .skip-link, .home-art, .projects-screen-only, .portfolio-toolbar { display: none !important; }
  .portfolio-print-only { display: block !important; }
  .home-main, .page-main { width: auto; max-width: none; padding: 0; margin: 0; }
  h1, h2, h3, h4 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  a { color: #214c62; }
  .portfolio-cover { margin-bottom: .2in; }
  .portfolio-cover-grid { grid-template-columns: .75in minmax(0, 1fr); gap: .2in; }
  .portfolio-photo { width: .75in; height: .9in; object-fit: cover; }
  .portfolio-introduction h1 { font-size: 21pt; margin-bottom: 5pt; }
  .section-kicker { font-size: 7pt; margin-bottom: 4pt; }
  .portfolio-role, .portfolio-statement { margin-bottom: 4pt; font-size: 8pt; }
  .portfolio-contact-list { gap: 4pt 12pt; margin-top: 6pt; font-size: 7.5pt; }
  .portfolio-profile-grid { grid-template-columns: 3fr 1fr; margin-top: 9pt; gap: 14pt; }
  .portfolio-profile-item p { font-size: 7.5pt; margin-bottom: 3pt; }
  .portfolio-profile-label { font-weight: bold; }
  .portfolio-cover-summary { margin-top: 10pt; }
  .section-heading { margin-bottom: 8pt; }
  .section-heading h2 { font-size: 12pt; }
  .portfolio-cover-summary .section-kicker { display: none; }
  .page-section { margin-top: 12pt; padding-top: 10pt; }
  .experience-entry { grid-template-columns: 1fr 1.6fr; gap: 16pt; padding-block: 6pt; }
  .experience-entry h3, .skill-card h3 { font-size: 8.5pt; margin-bottom: 3pt; }
  .experience-organization, .experience-summary { font-size: 7.5pt; }
  .experience-meta { font-size: 6.5pt; margin-bottom: 3pt; }
  .skills-grid, .coursework-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10pt 20pt; }
  .skill-subgroup + .skill-subgroup { margin-top: 4pt; }
  .skill-subgroup h4 { font-size: 7.5pt; margin-bottom: 2pt; }
  .skill-list { font-size: 7pt; }
  .portfolio-case-study { padding-block: 12pt; break-inside: auto; }
  .portfolio-case-header { display: flex; gap: 12pt; break-after: avoid; }
  .portfolio-case-header h3 { font-size: 12pt; }
  .portfolio-case-date { font-size: 7pt; }
  .portfolio-case-overview { font-size: 8pt; margin: 5pt 0 10pt; }
  .portfolio-case-details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9pt 18pt; }
  .portfolio-case-detail { display: block; break-inside: avoid; }
  .portfolio-case-detail h4 { font-size: 7.5pt; font-weight: bold; color: #244b35; margin-bottom: 3pt; }
  .portfolio-case-detail p { font-size: 8pt; }
  .portfolio-case-tools, .portfolio-case-attachments { grid-template-columns: 80pt minmax(0, 1fr); gap: 10pt; margin-top: 7pt; }
  .portfolio-case-tools > span, .portfolio-case-attachments > span, .portfolio-case-tools p, .entry-links, .portfolio-case-attachments p { font-size: 7pt; }
  .portfolio-case-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12pt; margin-bottom: 10pt; }
  .portfolio-case-media { break-inside: avoid; }
  .portfolio-case-media img { max-height: 2in; object-fit: contain; }
  .portfolio-case-media figcaption { font-size: 7pt; }
  .coursework-card { break-inside: avoid; }
  .coursework-card h3 { font-size: 9pt; margin-bottom: 4pt; }
  .coursework-list li { font-size: 7.5pt; padding-block: 2pt; }
  .course-level { font-size: 6.5pt; padding: 0 4pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .course-level--graduate, .course-level--coursera { color: #fff; }
  .profile-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-card dt, .profile-card dd { font-size: 8pt; }
}
