:root {
  --ink: #17212b;
  --muted: #65707a;
  --paper: #f4f2ed;
  --surface: #fbfaf7;
  --accent: #b64e35;
  --accent-dark: #873824;
  --blue: #264f68;
  --line: #d9d5cd;
  --content: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--ink); }
img { max-width: 100%; }
p { margin: 0 0 20px; }
h1, h2, h3 { margin-top: 0; color: var(--ink); line-height: 1.08; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.04em; }
h1 { margin-bottom: 26px; font-size: clamp(58px, 8.5vw, 104px); }
h2 { margin-bottom: 20px; font-size: clamp(37px, 5vw, 58px); }
h3 { margin-bottom: 10px; font-size: 21px; letter-spacing: -.02em; }

.skip-link { position: fixed; top: 10px; left: 12px; z-index: 50; padding: 8px 14px; color: white; background: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 20; background: rgba(244,242,237,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.nav-shell { width: min(calc(100% - 48px), var(--content)); height: 82px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 15px; font-weight: 750; letter-spacing: -.01em; text-decoration: none; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; color: var(--surface); background: var(--ink); font-size: 11px; letter-spacing: .08em; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { position: relative; padding: 9px 0; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.site-nav a::after { content: ""; position: absolute; right: 0; bottom: 2px; left: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 170ms ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.save-pdf { min-height: 39px; padding: 7px 13px; display: inline-flex; align-items: center; gap: 8px; color: white; background: var(--ink); border: 1px solid var(--ink); font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.save-pdf:hover { color: white; background: var(--accent-dark); border-color: var(--accent-dark); }
.save-pdf span { color: #efb09f; font-size: 15px; }
.nav-toggle { display: none; width: 42px; height: 42px; padding: 10px; background: transparent; border: 1px solid var(--line); }
.nav-toggle > span:not(.sr-only) { display: block; width: 100%; height: 1px; margin: 4px 0; background: var(--ink); }

.page-shell { width: min(calc(100% - 48px), var(--content)); margin: 0 auto; }
.database-loading { min-height: calc(100vh - 188px); display: grid; place-content: center; justify-items: center; color: var(--muted); }
.database-loading span { width: 32px; height: 32px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: database-spin 700ms linear infinite; }
.database-loading p { margin: 14px 0 0; font-size: 13px; }
.database-error { min-height: calc(100vh - 188px); display: grid; align-content: center; max-width: 760px; }
.database-error h1 { font-size: clamp(44px,7vw,76px); }
@keyframes database-spin { to { transform: rotate(360deg); } }
.home-grid { min-height: 690px; padding: 92px 0 84px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr); align-items: center; gap: clamp(55px, 9vw, 120px); }
.eyebrow { margin: 0 0 19px; color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .15em; line-height: 1.45; text-transform: uppercase; }
.lede { max-width: 690px; color: #48545e; font-size: clamp(19px, 2.15vw, 24px); line-height: 1.55; }
.lede strong { color: var(--ink); }
.actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 11px; }
.button { min-height: 49px; padding: 10px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: white; background: var(--ink); border: 1px solid var(--ink); font-size: 14px; font-weight: 750; text-decoration: none; transition: background 160ms ease, transform 160ms ease; }
.button:hover { color: white; background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-2px); }
.button.secondary { color: var(--ink); background: transparent; }
.button.secondary:hover { color: white; background: var(--ink); border-color: var(--ink); }
.contact-dialog { width: min(calc(100% - 32px), 560px); padding: clamp(22px,3.5vw,32px); color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 100px rgba(23,33,43,.3); }
.contact-dialog::backdrop { background: rgba(23,33,43,.52); backdrop-filter: blur(5px); }
.contact-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.contact-dialog-head h2 { margin-bottom: 5px; font-size: clamp(30px,4vw,38px); }
.contact-close { width: 34px; height: 34px; flex: 0 0 auto; color: var(--ink); background: transparent; border: 1px solid var(--line); font-size: 21px; line-height: 1; cursor: pointer; }
.contact-close:hover { color: white; background: var(--ink); }
.contact-intro { max-width: 540px; color: var(--muted); font-size: 14px; }
.contact-options { margin-top: 20px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.contact-options article { padding: 18px; background: white; }
.contact-options article > span { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.contact-options h3 { margin: 8px 0 6px; font-size: 13px; }
.contact-options p { min-height: 40px; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.contact-options article > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.contact-options a, .contact-options button { color: var(--accent-dark); background: transparent; border: 0; font-size: 12px; font-weight: 800; cursor: pointer; }
.contact-options button { padding: 5px; text-decoration: underline; text-underline-offset: 4px; }
.copy-status { min-height: 20px; margin: 12px 0 -17px; color: var(--muted); font-size: 11px; }
.portrait-frame { position: relative; justify-self: end; }
.portrait-frame::before { content: ""; position: absolute; inset: 20px -20px -20px 20px; z-index: -1; background: var(--accent); }
.portrait { display: block; width: min(330px, 72vw); height: auto; aspect-ratio: 479 / 541; object-fit: contain; filter: saturate(.78) contrast(1.04); }
.location { position: absolute; bottom: -42px; left: 20px; color: var(--muted); font-family: Georgia, serif; font-size: 14px; font-style: italic; }

.desktop-section { padding: 100px 0; border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(50px, 9vw, 120px); }
.body-copy { max-width: 680px; color: #4e5962; font-size: 18px; }
.body-copy strong { color: var(--ink); }
.tag-list { margin: 31px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tag { padding: 5px 11px; color: var(--blue); border: 1px solid #9fafb7; font-size: 12px; font-weight: 750; }
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline-item { padding: 0 0 34px; display: grid; grid-template-columns: 100px 1fr; column-gap: 24px; border-bottom: 1px solid var(--line); }
.timeline-item + .timeline-item { padding-top: 27px; }
.timeline-item:last-child { padding-bottom: 0; border-bottom: 0; }
.timeline-date { margin: 3px 0 0; color: var(--accent); font-size: 12px; font-weight: 850; }
.timeline-item h3 { margin-bottom: 4px; }
.timeline-organization { margin: 0 0 7px; color: var(--muted); font-size: 14px; }
.timeline-description { max-width: 620px; margin: 0; color: #4e5962; font-size: 13px; line-height: 1.6; }

.page-heading { max-width: 850px; padding: 104px 0 72px; }
.page-heading h1 { font-size: clamp(55px, 8vw, 92px); }
.page-heading .lede { font-size: 20px; }
.research-stories { padding-bottom: 110px; }
.research-story { padding: 84px 0; display: grid; grid-template-columns: minmax(340px,.9fr) minmax(0,1.1fr); align-items: center; gap: clamp(50px,8vw,105px); border-top: 1px solid var(--line); }
.research-story:nth-child(even) .concept-figure { order: 2; }
.research-story:last-child { border-bottom: 1px solid var(--line); }
.story-copy h2 { font-size: clamp(32px,4vw,47px); }
.publication-meta { margin-bottom: 35px; color: var(--muted); font-size: 13px; }
.publication-meta strong { color: var(--ink); }
.story-section { margin-top: 24px; }
.story-section h3 { margin-bottom: 7px; color: var(--accent-dark); font-size: 12px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.story-section p { color: #505c65; font-size: 15px; }
.publication-links { margin-top: 29px; display: flex; flex-wrap: wrap; align-items: center; gap: 13px; }
.publication-links > a:not(.button) { margin-left: 3px; font-size: 13px; font-weight: 800; }
.concept-figure { margin: 0; padding: 22px; background: rgba(251,250,247,.76); border: 1px solid var(--line); }
.concept-figure img { display: block; width: 100%; height: auto; }
.concept-figure figcaption { margin: 9px 0 0; color: var(--muted); font-family: Georgia, serif; font-size: 13px; font-style: italic; text-align: center; }

.project-heading { max-width: 920px; }
.project-index-list { padding-bottom: 110px; border-top: 2px solid var(--ink); }
.project-row { min-height: 240px; padding: 36px 0; display: grid; grid-template-columns: 70px minmax(0,1fr) 155px; align-items: center; gap: clamp(24px,5vw,68px); border-bottom: 1px solid var(--line); }
.project-index { align-self: start; color: var(--accent); font-family: Georgia, serif; font-size: 20px; }
.project-summary h2 { margin-bottom: 13px; font-size: clamp(31px,4vw,46px); }
.project-summary > p { max-width: 660px; color: var(--muted); font-size: 16px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.project-tags span { padding: 4px 9px; color: var(--blue); border: 1px solid #aab6ba; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.project-action { min-height: 52px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--ink); border: 1px solid var(--ink); font-size: 12px; font-weight: 800; text-decoration: none; transition: color 160ms ease, background 160ms ease; }
.project-action:hover { color: white; background: var(--ink); }
.project-action span:last-child { color: var(--accent); font-size: 18px; }

.credentials-heading { max-width: 900px; }
.credentials-section { padding: 84px 0; display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(50px,9vw,120px); border-top: 1px solid var(--line); }
.credentials-section > div:first-child h2 { max-width: 430px; }
.competency-list { margin: 0; padding: 0; display: grid; gap: 1px; list-style: none; counter-reset: competency; background: var(--line); border: 1px solid var(--line); }
.competency-list li { position: relative; min-height: 106px; padding: 24px 25px 24px 72px; display: flex; align-items: center; color: #4e5962; background: var(--surface); font-size: 15px; line-height: 1.55; counter-increment: competency; }
.competency-list li::before { content: counter(competency, decimal-leading-zero); position: absolute; top: 27px; left: 24px; color: var(--accent); font-family: Georgia, serif; font-size: 13px; }
.education-list { border-top: 2px solid var(--ink); }
.education-item { padding: 25px 0; display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 20px; border-bottom: 1px solid var(--line); }
.education-date { margin: 3px 0 0; color: var(--accent); font-size: 12px; font-weight: 850; }
.education-item h3 { margin-bottom: 5px; }
.education-item div p { margin: 0; color: #4e5962; font-size: 14px; }
.education-item div span { color: var(--muted); font-size: 12px; }
.skills-section { padding-bottom: 110px; }
.skill-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.skill-group { min-height: 210px; padding: 25px; background: var(--surface); }
.skill-group h3 { margin-bottom: 19px; color: var(--accent-dark); font-size: 14px; text-transform: uppercase; letter-spacing: .07em; }
.skill-group ul { margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px; list-style: none; }
.skill-group li { padding: 4px 9px; color: var(--blue); border: 1px solid #aab6ba; font-size: 11px; font-weight: 750; }

.site-footer { border-top: 1px solid var(--line); }
.footer-shell { width: min(calc(100% - 48px), var(--content)); min-height: 105px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; color: var(--muted); font-size: 13px; }
.footer-shell p { margin: 0; }
.footer-shell div { display: flex; gap: 20px; }
.footer-note { display: none; }

.resume-body { background: #dde0e1; font-size: 14px; line-height: 1.5; }
.resume-toolbar { width: min(calc(100% - 32px), 210mm); margin: 24px auto 12px; display: flex; align-items: center; justify-content: space-between; }
.resume-toolbar > a { color: var(--ink); font-size: 13px; font-weight: 750; text-decoration: none; }
.resume-page { width: min(calc(100% - 32px), 210mm); min-height: 297mm; margin: 0 auto 40px; padding: 16mm 17mm; background: white; box-shadow: 0 20px 60px rgba(23,33,43,.15); }
.resume-header { padding-bottom: 28px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 40px; border-bottom: 2px solid var(--ink); }
.resume-kicker { margin-bottom: 5px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.resume-header h1 { margin-bottom: 7px; font-size: 43px; }
.resume-header p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.resume-header address { display: grid; align-content: end; justify-items: end; gap: 2px; font-size: 11px; font-style: normal; }
.resume-header address span { color: var(--muted); }
.resume-section { padding: 24px 0; display: grid; grid-template-columns: 125px minmax(0,1fr); gap: 28px; border-bottom: 1px solid var(--line); }
.resume-section:last-child { border-bottom: 0; }
.resume-section > h2 { margin: 2px 0 0; font-family: inherit; font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.resume-section > div > p { margin-bottom: 8px; }
.resume-tags { padding-top: 5px; color: var(--accent-dark); font-size: 11px; font-weight: 750; }
.resume-list, .resume-publications { display: grid; gap: 15px; }
.resume-list article, .resume-publications article { display: grid; grid-template-columns: 75px minmax(0,1fr); gap: 13px; break-inside: avoid; }
.resume-date { margin: 2px 0 0; color: var(--accent); font-size: 10px; font-weight: 850; }
.resume-list h3, .resume-publications h3 { margin-bottom: 2px; font-size: 13px; letter-spacing: -.01em; }
.resume-organization { margin: 0 0 3px; color: var(--muted); font-size: 10.5px; }
.resume-description { margin: 0; color: #4e5962; font-size: 9.5px; line-height: 1.45; }
.resume-publications article p { margin: 0; color: var(--muted); font-size: 10.5px; }
.resume-publications { gap: 18px; }
.resume-publications h3 a { color: var(--ink); text-decoration: none; }
.resume-publications strong { color: var(--ink); }
.resume-competencies { margin: 0; padding-left: 16px; display: grid; gap: 5px; color: #4e5962; font-size: 9.5px; }
.resume-skill-groups { display: grid; gap: 5px; }
.resume-skill-groups p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.resume-skill-groups strong { color: var(--ink); }

@media (max-width: 900px) {
  .nav-shell, .page-shell, .footer-shell { width: min(calc(100% - 32px), var(--content)); }
  .header-actions { gap: 9px; }
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 81px; right: 0; left: 0; padding: 18px 16px 24px; display: none; flex-direction: column; align-items: stretch; gap: 2px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 0; font-size: 16px; }
  .home-grid { grid-template-columns: 1fr; padding-top: 65px; }
  .portrait-frame { grid-row: 1; justify-self: center; }
  .portrait { width: min(285px,68vw); }
  .split, .research-story, .credentials-section { grid-template-columns: 1fr; }
  .research-story { padding: 68px 0; }
  .research-story:nth-child(even) .concept-figure { order: 0; }
  .concept-figure { max-width: 560px; margin: 0 auto; }
  .project-row { grid-template-columns: 45px minmax(0,1fr); }
  .project-action { grid-column: 2; width: min(210px,100%); }
  .desktop-section { padding: 72px 0; }
  .credentials-section { padding: 68px 0; }
  .card { min-height: 0; }
}

@media (max-width: 540px) {
  body { font-size: 16px; }
  .brand > span:last-child { display: none; }
  .save-pdf { min-height: 37px; padding: 6px 10px; }
  .home-grid { gap: 70px; }
  .actions .button { width: 100%; }
  .contact-options { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .research-story { gap: 39px; }
  .project-row { padding: 30px 0; grid-template-columns: 1fr; gap: 14px; }
  .project-index { font-size: 15px; }
  .project-action { grid-column: 1; }
  .skill-groups { grid-template-columns: 1fr; }
  .education-item { grid-template-columns: 1fr; gap: 4px; }
  .page-heading { padding: 76px 0 50px; }
  .footer-shell { padding: 27px 0; align-items: flex-start; flex-direction: column; gap: 10px; }
  .resume-page { width: 100%; min-height: 0; margin: 0; padding: 28px 20px; box-shadow: none; }
  .resume-toolbar { width: calc(100% - 32px); }
  .resume-header, .resume-section { grid-template-columns: 1fr; gap: 16px; }
  .resume-header address { justify-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .database-loading span { animation: none; }
}

@media print {
  .site-header, .site-footer, .actions, .contact-dialog { display: none; }
  body { background: white; }
  .page-shell { width: 100%; }
  .resume-toolbar { display: none; }
  .resume-page { width: 100%; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .resume-body { font-size: 11pt; }
}

@page { size: A4; margin: 12mm; }
