:root {
  color-scheme: light;
  --paper: #f4f4f4;
  --ink: #171717;
  --muted: #565252;
  --line: #c5c5c5;
  --link: #285c91;
  --surface: #eaeaea;
  --body-font: Helvetica, Arial, sans-serif;
  --mono-font: Consolas, "Liberation Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body-font); font-size: 1rem; line-height: 1.65; isolation: isolate; }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { color: #173c64; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #597caa; outline-offset: 5px; }
p { margin: 0 0 1.1rem; }
h1, h2, h3 { color: var(--ink); font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
h3 { font-size: 1.16rem; margin: 1.7rem 0 .75rem; }
ul { padding-left: 1.3rem; margin: .8rem 0 1.15rem; }
li { margin-bottom: .45rem; }
svg { flex-shrink: 0; width: 1.1rem; height: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 10; padding: .7rem 1.1rem; background: #fff; color: var(--ink); }
.skip-link:focus { top: .75rem; }
.site-header, .page-layout, .cv-layout, .site-footer { position: relative; z-index: 1; max-width: 900px; width: calc(100% - 3rem); margin: 0 auto; }
.site-header { padding-top: 2rem; }
.identity { display: flex; align-items: center; justify-content: flex-start; gap: 3rem; min-height: 180px; }
.portrait-link { display: block; margin-left: 1rem; flex: 0 0 160px; }
.portrait { display: block; width: 160px; height: auto; aspect-ratio: 1; object-fit: cover; object-position: center; border-radius: 3px; }
.identity-text { flex: 1; min-width: 0; text-align: left; }
.identity-name { font-weight: 700; font-size: 4rem; line-height: 1.05; letter-spacing: -.035em; margin: 0 0 .55rem; }
.identity-name a { color: var(--ink); text-decoration: none; }
.identity-subtitle { font-size: 1.25rem; font-weight: 600; line-height: 1.3; text-wrap: balance; margin: 0 0 .55rem; }
.identity-affiliation { font-size: .875rem; line-height: 1.5; color: var(--muted); margin: 0; }
.navigation-row { display: flex; justify-content: center; align-items: center; padding: 1.25rem 0 .9rem; border-bottom: 1px solid var(--line); }
.main-navigation { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .35rem 2rem; }
.main-navigation a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; font-size: .875rem; font-family: var(--mono-font); }
.main-navigation a:hover, .main-navigation a[aria-current="page"] { color: var(--ink); }
.main-navigation a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .45em; }
.menu-toggle { display: none; background: transparent; color: var(--ink); border: 0; padding: .5rem .7rem; align-items: center; gap: .6rem; min-height: 44px; font-family: var(--mono-font); font-size: .875rem; }
.page-layout { padding: 2.7rem 0 3rem; }
.page-content { min-width: 0; overflow-wrap: anywhere; }
.portfolio-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.65rem 1.5rem; padding: .35rem 0 2.45rem; }
.portfolio-link { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--ink); padding: .45rem .2rem; min-width: 0; }
.portfolio-link:hover { color: var(--ink); }
.tile-icon { width: 92px; height: 92px; color: var(--icon-color, var(--ink)); stroke-width: 1.35; margin-bottom: 1rem; }
.project-thumbnail { display: block; object-fit: contain; flex-shrink: 0; border-radius: 2px; }
.tile-title { font-family: var(--mono-font); font-size: 1.1rem; line-height: 1.4; overflow-wrap: anywhere; }
.tile-subtitle { font-size: 1rem; color: var(--muted); line-height: 1.45; margin-top: .1rem; }
.portfolio-link:hover .tile-title { text-decoration: underline; }
.detail-page .page-content { max-width: 740px; margin: 0 auto; }
.detail-page .cv-layout .page-content { max-width: none; }
.intro-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .75rem; font-family: var(--mono-font); letter-spacing: .035em; line-height: 1.5; margin-bottom: 1rem; }
.intro-year { flex-shrink: 0; letter-spacing: 0; }
.section-heading { font-size: 1.55rem; margin: 2.4rem 0 1.2rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); font-weight: 400; }
.first-heading { margin-top: 0; }
.page-title { font-size: 2rem; }
.lead { font-size: 1.125rem; line-height: 1.65; }
.section-title-row { position: relative; }
.section-title-row > a { position: absolute; right: 0; top: .5rem; }
.section-title-row .section-heading { padding-right: 7rem; }
.text-link { font-size: .875rem; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.table-wrap { width: 100%; overflow-x: auto; }
.vitae-table { border-collapse: collapse; width: 100%; margin-bottom: 1.3rem; font-size: .9375rem; line-height: 1.5; }
.vitae-table th { text-align: left; padding: .6rem .65rem .65rem; border-bottom: 1px solid #898989; color: var(--ink); font-weight: 600; }
.vitae-table td { padding: .75rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.vitae-table th:first-child, .vitae-table td:first-child { padding-left: 0; width: 22%; }
.vitae-table th:last-child, .vitae-table td:last-child { padding-right: 0; }
.vitae-table td:first-child, .muted { color: var(--muted); }
.simple-list { padding-left: 1.25rem; font-size: .9375rem; }
.research-preview { padding: .35rem 0 1.3rem; }
.research-preview + .research-preview { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.research-preview h3 { margin: .4rem 0 .6rem; }
.research-preview h3 a { color: var(--ink); text-decoration: none; }
.research-preview h3 a:hover { color: var(--link); text-decoration: underline; }
.tag-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.tag-list span { border: 1px solid var(--line); border-radius: 2px; padding: .15rem .5rem; font-size: .75rem; line-height: 1.7; color: var(--muted); }
.experience-entry { padding: 1.4rem 0 2rem; border-bottom: 1px solid var(--line); }
.entry-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.entry-heading h2, .entry-heading h3 { font-size: 1.16rem; margin: .25rem 0 .3rem; }
.entry-organization { margin: 0; font-size: .875rem; font-weight: 600; color: var(--muted); }
.entry-date { font-size: .875rem; color: var(--muted); margin: 0; flex-shrink: 0; }
.entry-location { color: var(--muted); font-size: .875rem; margin: .25rem 0 1rem; }
.experience-entry li { padding-left: .1rem; }
.internship-experience .experience-entry:first-child { padding-top: 0; }
.internship-experience .experience-entry:last-child { padding-bottom: 0; border-bottom: 0; }
.internship-experience .entry-heading h2 { font-size: 1.125rem; font-weight: 600; margin: 0 0 .3rem; }
.internship-experience .entry-organization { font-size: 1rem; font-weight: 400; color: var(--ink); }
.internship-experience .entry-date { margin-top: .2rem; }
.internship-experience .entry-location { margin-top: .1rem; }
.leadership-entry { margin-bottom: 1.6rem; }
.leadership-entry p { margin-top: .6rem; }
.training-list { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 2rem; font-size: 1rem; }
.project-index { display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; padding: 1rem 0 1.35rem; margin: 0 0 .75rem; border-bottom: 1px solid var(--line); }
.project-index a { font-size: .875rem; text-decoration: none; }
.project-index a:hover { text-decoration: underline; }
.project-entry { padding: 1.7rem 0 2rem; border-bottom: 1px solid var(--line); scroll-margin-top: 1.5rem; }
.project-entry:last-child { border-bottom: 0; }
.project-entry h2 { font-size: 1.4rem; margin: .55rem 0 1rem; }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.small-label { font-size: .75rem; font-weight: 500; color: var(--muted); font-family: var(--mono-font); letter-spacing: .04em; line-height: 1.5; }
.project-status { font-size: .8125rem; line-height: 1.5; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); padding: .15rem .55rem; }
.project-date { font-size: .875rem; color: var(--muted); }
.project-details { border-left: 1px solid #aaa; margin: 1rem 0; padding-left: .9rem; }
.project-details summary { cursor: pointer; color: var(--link); font-size: .9375rem; padding: .25rem 0; }
.project-details > div { padding-top: .6rem; }
code { font-size: .9em; background: var(--surface); padding: .1rem .25rem; border-radius: 2px; }
.site-footer { border-top: 1px solid var(--line); padding: 1.9rem 0 1.5rem; }
.contact-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2.2rem; }
.contact-links a { color: #6e6e6e; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: .35rem; min-width: 44px; }
.contact-links a:hover { color: var(--ink); }
.contact-icon { width: 44px; height: 44px; stroke-width: 1.65; }
.contact-links span { font-size: .875rem; line-height: 1.5; }
.footer-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem 1.3rem; font-size: .75rem; color: var(--muted); margin-top: 1.6rem; }
.cv-layout { padding: 2.4rem 0 3rem; }
.cv-toolbar { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: flex-end; padding-bottom: 1.75rem; }
.outline-button, .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .9rem; min-height: 42px; border: 1px solid #aaa; border-radius: 2px; color: var(--ink); background: transparent; font-size: .875rem; line-height: 1.4; text-decoration: none; }
.outline-button:hover, .primary-button:hover { background: var(--surface); color: var(--ink); border-color: #666; }
.cv-document { padding: 2.8rem; background: #fff; }
.cv-header { border-bottom: 1px solid #898989; padding-bottom: 1.2rem; margin-bottom: 1.5rem; }
.cv-header h1 { font-size: 2.5rem; margin: .2rem 0 .4rem; }
.cv-header > p { margin-bottom: .35rem; }
.cv-contact { font-size: .875rem; overflow-wrap: anywhere; }
.cv-contact a { text-decoration: none; }
.cv-section h2 { font-size: 1.4rem; padding-bottom: .35rem; margin: 1.8rem 0 1rem; border-bottom: 1px solid var(--line); }
.cv-item { margin-bottom: 1.25rem; }
.cv-item-heading { display: flex; justify-content: space-between; gap: 1.2rem; align-items: baseline; }
.cv-item-heading h3 { font-size: 1rem; margin: 0 0 .4rem; }
.cv-item-heading > span { flex-shrink: 0; font-size: .8125rem; color: var(--muted); }
.cv-document p, .cv-document li { font-size: .9375rem; }
.cv-document .cv-location { color: var(--muted); font-size: .8125rem; margin-bottom: .4rem; }
.cv-document ul { margin-top: .4rem; }
.cv-item-heading h3 a { color: inherit; text-decoration: none; }
.cv-item-heading h3 a:hover { color: var(--link); text-decoration: underline; }
@media (max-width: 800px) {
  .identity { gap: 1.75rem; }
  .portrait-link { margin-left: 0; flex-basis: 132px; }
  .portrait { width: 132px; }
  .identity-name { font-size: 3rem; }
  .identity-subtitle { font-size: 1.15rem; }
  .tile-title { font-size: 1rem; }
  .entry-heading, .cv-item-heading { flex-direction: column; gap: .15rem; }
  .entry-date { margin-bottom: .35rem; }
}
@media (max-width: 760px) {
  .project-index a { display: inline-flex; align-items: center; min-height: 44px; }
  .project-details summary { min-height: 44px; padding-top: .55rem; padding-bottom: .55rem; }
  .site-header { padding-top: 1.3rem; }
  .identity { min-height: 140px; }
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.65rem 1.5rem; }
  .tile-title { font-size: 1.1rem; }
  .navigation-row { flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
  .js .menu-toggle { display: inline-flex; }
  .js .main-navigation { display: none; width: 100%; }
  .js .main-navigation.is-open { display: flex; }
  .main-navigation { gap: .35rem 1.5rem; }
  .page-layout { padding-top: 2.1rem; }
  .cv-document { padding: 1.8rem; }
  .training-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .site-header, .page-layout, .cv-layout, .site-footer { width: calc(100% - 2.5rem); }
  .identity { flex-direction: row; gap: 1rem; }
  .identity-text { text-align: left; }
  .portrait-link { flex-basis: auto; }
  .portrait { width: 72px; }
  .identity-name { font-size: 2rem; }
  .identity-subtitle { font-size: .875rem; max-width: none; }
  .identity-affiliation { font-size: .8125rem; }
  .navigation-row { margin-top: .8rem; }
  .main-navigation { gap: .35rem 1.1rem; }
  .portfolio-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .tile-title { font-size: 1.15rem; }
  .tile-icon { width: 88px; height: 88px; }
  .intro-meta { font-size: .75rem; flex-wrap: wrap; }
  .intro-year { display: none; }
  .section-title-row > a { position: static; display: inline-block; margin: -.4rem 0 1rem; }
  .section-title-row .section-heading { padding-right: 0; margin-bottom: .8rem; }
  .vitae-table { font-size: .875rem; }
  .vitae-table td, .vitae-table th { padding-left: .4rem; padding-right: .4rem; }
  .project-meta { flex-wrap: wrap; gap: .5rem; }
  .cv-document { padding: 0; background: transparent; }
  .cv-toolbar { justify-content: flex-start; }
  .contact-links { gap: 1.5rem; }
  .contact-icon { width: 38px; height: 38px; }
  .contact-links span { font-size: .8125rem; }
}
.home-page {
  --home-gutter: clamp(12px, 3vw, 24px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
}
.home-page .site-header, .home-page .page-layout, .home-page .site-footer {
  width: calc(100% - var(--home-gutter) - var(--home-gutter));
}
.home-page .site-header { padding-top: clamp(12px, 2svh, 20px); padding-bottom: clamp(10px, 2svh, 18px); border-bottom: 1px solid var(--line); }
.home-page .identity { min-height: 0; gap: clamp(.875rem, 4vw, 3rem); }
.home-page .identity-text { min-width: 0; }
.home-page .portrait-link { flex: 0 0 auto; margin-left: 1rem; }
.home-page .portrait { width: clamp(64px, 16svh, 144px); }
.home-page .identity-name { font-size: clamp(1.5rem, 8svh, 4rem); }
.home-page .navigation-row { display: none; }
.home-page .page-layout { display: flex; min-height: 0; padding: clamp(8px, 1.8svh, 16px) 0; }
.home-page .page-content { display: flex; width: 100%; }
.home-page .portfolio-grid { flex: 1; grid-template-rows: repeat(2, minmax(min-content, 1fr)); gap: clamp(8px, 2svh, 18px) 1.5rem; padding: 0; }
.home-page .portfolio-link { justify-content: center; padding: 4px; }
.home-page .tile-icon { width: clamp(32px, 10svh, 76px); height: clamp(32px, 10svh, 76px); margin-bottom: 6px; }
.home-page .project-thumbnail { width: clamp(64px, 20svh, 152px); height: clamp(64px, 20svh, 152px); }
.home-page .tile-title { font-size: clamp(.875rem, 2.2svh, 1.1rem); line-height: 1.2; }
.home-page .tile-subtitle { font-size: .875rem; line-height: 1.25; }
.home-page .site-footer { padding: clamp(8px, 1.5svh, 14px) 0; }
.home-page .contact-links { gap: 1.75rem; }
.home-page .contact-links a { min-height: 44px; gap: 3px; }
.home-page .contact-icon { width: 30px; height: 30px; }
.home-page .contact-links span { font-size: .875rem; line-height: 1.25; }
.home-page .footer-meta { margin-top: 7px; font-size: .75rem; line-height: 1.3; }
.cursor-wave { display: none; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .35; }
@media (min-width: 761px) and (any-hover: hover) and (any-pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cursor-wave:not([hidden]) { display: block; }
}
@media (min-width: 1280px) and (min-height: 701px), (min-width: 1200px) and (min-height: 761px) {
  .home-page .site-header { max-width: 1280px; }
}
@media (min-width: 761px) and (min-height: 651px) and (max-height: 700px) {
  .home-page .site-header { padding-top: 8px; padding-bottom: 8px; }
}
@media (max-width: 760px) {
  .home-page .identity { flex-direction: row; gap: .875rem; }
  .home-page .portrait-link { margin-left: 0; }
  .home-page .portrait { width: 64px; }
  .home-page .identity-text { text-align: left; }
  .home-page .identity-name { font-size: 1.5rem; margin-bottom: 3px; }
  .home-page .identity-subtitle { font-size: .875rem; line-height: 1.25; margin-bottom: 3px; max-width: none; }
  .home-page .identity-affiliation { font-size: .75rem; line-height: 1.25; }
  .home-page .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(min-content, 1fr)); column-gap: 12px; row-gap: 8px; }
  .home-page .tile-icon { width: clamp(28px, 6svh, 48px); height: clamp(28px, 6svh, 48px); }
  .home-page .project-thumbnail { width: clamp(56px, 12svh, 96px); height: clamp(56px, 12svh, 96px); }
}
@media (max-width: 480px) {
  .home-page .tile-subtitle { display: none; }
  .home-page .contact-links { gap: 1.1rem; }
  .home-page .footer-meta { gap: .35rem .75rem; }
}
@media (max-height: 650px) {
  .home-page .tile-subtitle { display: none; }
  .home-page .identity-subtitle { font-size: .875rem; }
  .home-page .identity-affiliation { font-size: .75rem; }
}
@media (max-width: 760px) and (max-height: 760px) {
  .home-page .page-layout { padding-top: 6px; padding-bottom: 6px; }
  .home-page .portfolio-grid { row-gap: 4px; }
  .home-page .portfolio-link { padding: 2px; }
  .home-page .tile-icon { margin-bottom: 2px; }
  .home-page .tile-subtitle { display: none; }
  .home-page .site-footer { padding-top: 6px; padding-bottom: 6px; }
}
@media (max-width: 360px) and (max-height: 650px) {
  .home-page .site-header { padding-top: 4px; padding-bottom: 4px; }
  .home-page .identity { gap: .25rem; }
  .home-page .portrait { width: 48px; }
  .home-page .identity-subtitle { font-size: .75rem; font-weight: 400; }
  .home-page .site-footer { padding-top: 4px; padding-bottom: 4px; }
  .home-page .footer-meta { margin-top: 3px; }
}
@media (min-width: 761px) and (max-height: 450px) {
  .home-page .site-header { padding-top: 4px; padding-bottom: 4px; }
  .home-page .identity-name, .home-page .identity-subtitle { margin-bottom: 3px; }
  .home-page .portfolio-link { flex-direction: row; gap: 8px; text-align: left; }
  .home-page .tile-icon { margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  @page { size: A4; margin: 15mm 16mm; }
  html { font-size: 10pt; }
  body { font-size: 10pt; line-height: 1.35; color: #172332; }
  .site-header, .site-footer, .skip-link, .cv-toolbar, .cursor-wave { display: none !important; }
  .cv-layout { max-width: none; padding: 0; margin: 0; }
  .cv-document { border: 0; padding: 0; }
  .cv-header { margin-bottom: 1rem; padding-bottom: .65rem; }
  .cv-header h1 { font-size: 2.3rem; }
  .cv-document p, .cv-document li { font-size: 1rem; line-height: 1.35; }
  .cv-header p { font-size: 1rem; }
  .cv-section h2 { font-size: 1.15rem; margin-top: 1.25rem; margin-bottom: .65rem; }
  .cv-item { margin-bottom: .7rem; break-inside: avoid; }
  .cv-item-heading { flex-direction: row; gap: 1rem; margin-bottom: 0; }
  .cv-item-heading h3 { font-size: 1rem; margin-bottom: .25rem; }
  .cv-item-heading > span { font-size: .9rem; }
  .cv-document p { margin-bottom: .55rem; }
  .cv-document li { margin-bottom: .25rem; }
  .cv-document ul { margin-bottom: .55rem; }
  .cv-experience { break-before: page; }
  .cv-contact { font-size: .9rem !important; }
  a { color: #172332; text-decoration: none; }
  h2, h3 { break-after: avoid; }
}

@media print {
  body { background: #fff; }
  .cv-layout { width: 100%; }
}
