:root {
  --bg: #f8f5ef;
  --bg-subtle: #f0ece3;
  --text: #202c3a;
  --text-muted: #535b62;
  --text-light: #676d70;
  --border: #dedcd3;
  --accent: #85512f;
  --accent-soft: #f0e9dd;
  --maxw: 1020px;
  --radius: 6px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 2px; }
[id] { scroll-margin-top: 104px; }
main:focus { outline: none; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.skip-link {
  position: fixed;
  top: 12px;
  left: 20px;
  padding: 10px 18px;
  z-index: 200;
  background: var(--text);
  color: white;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* A quiet, shared navigation across the five pages. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 80px; gap: 24px; }
.brand { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; color: var(--text); letter-spacing: -.025em; }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { font-size: .82rem; color: var(--text-muted); padding: 27px 0 24px; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }

/* Homepage introduction. */
.hero { padding: 76px 0 68px; border-bottom: 1px solid var(--border); }
.hero-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 58px; align-items: start; }
.avatar { display: block; width: 190px; height: 190px; object-fit: cover; border-radius: var(--radius); }
.sidebar-note { font-size: .71rem; line-height: 1.65; color: var(--text-light); margin: 17px 0 20px; }
.contact-links { display: flex; flex-direction: column; gap: 6px; list-style: none; padding: 0; }
.contact-links a { display: inline-flex; align-items: center; gap: 10px; font-size: .79rem; min-height: 32px; color: var(--text-muted); }
.contact-links a:hover { color: var(--accent); }
.contact-icon { width: 15px; height: 15px; flex: 0 0 15px; }
.eyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: .13em; color: var(--text-light); font-size: .65rem; line-height: 1.5; margin-bottom: 13px; }
.hero-bio h1 { font-family: var(--serif); font-size: clamp(2.3rem, 4.8vw, 3.5rem); font-weight: 500; line-height: 1.12; letter-spacing: -.055em; margin-bottom: 14px; }
.name-period { color: var(--accent); }
.affiliation { color: var(--text-muted); font-size: .86rem; line-height: 1.7; margin-bottom: 27px; }
.hero-bio > p:not(.eyebrow) { margin-bottom: 18px; max-width: 62ch; }
.hero-bio .hero-intro { font-size: 1.15rem; line-height: 1.65; letter-spacing: -.02em; }
.hero-bio > p:not(.eyebrow):not(.hero-intro) { color: var(--text-muted); font-size: .93rem; }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 500; }
.text-link span { transition: transform .18s ease; }
.text-link:hover span { transform: translate(2px, -2px); }

/* Research and engineering stay as plain, readable lists. */
.section { padding: 48px 0; border-bottom: 1px solid var(--border); }
.section-title { font-family: var(--serif); font-size: 1.65rem; line-height: 1.3; font-weight: 500; letter-spacing: -.035em; margin-bottom: 25px; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 29px; }
.section-heading .section-title { margin-bottom: 0; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-heading > a { padding-bottom: 3px; white-space: nowrap; }
.entry-list, .thread-list, .info-list { display: flex; flex-direction: column; }
.entry-item, .thread-item, .project-entry, .pub-item { border-top: 1px solid var(--border); padding: 27px 0; display: flex; flex-direction: column; gap: 8px; }
.entry-item:last-child, .thread-item:last-child, .project-entry:last-child, .pub-item:last-child { padding-bottom: 0; }
.entry-title, .thread-item h3, .project-name, .pub-title, .info-item-title { font-family: var(--serif); font-size: 1.23rem; font-weight: 500; letter-spacing: -.025em; color: var(--text); line-height: 1.4; }
.entry-meta, .project-badge, .pub-venue, .info-item-meta { color: var(--text-light); font-size: .76rem; line-height: 1.65; }
.entry-desc, .project-desc, .pub-desc, .thread-item p, .info-item-desc { color: var(--text-muted); font-size: .91rem; max-width: 72ch; line-height: 1.8; }
.entry-links, .pub-links { display: flex; flex-wrap: wrap; gap: 10px 23px; font-size: .76rem; margin-top: 5px; }
.entry-links a, .pub-links a { display: inline-flex; gap: 6px; align-items: center; min-height: 28px; }
.entry-item--highlight { padding: 27px 0 0; }
.entry-highlight-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; align-items: start; }
.entry-highlight-text { display: flex; flex-direction: column; gap: 9px; }
.entry-highlight-text .entry-title { font-size: 1.6rem; }
.entry-header-row { display: flex; align-items: center; gap: 8px; }
.entry-org-logo { width: 23px; height: 23px; object-fit: contain; }
.photo-preview { display: block; color: var(--text-light); }
.hackathon-photo-thumb { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.photo-caption { display: flex; justify-content: space-between; font-size: .7rem; padding-top: 8px; }
.photo-preview:hover { color: var(--accent); }

/* Subpages share the same rhythm and type. */
.page-head { padding: 64px 0 34px; border-bottom: 1px solid var(--border); }
.page-head h1 { font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 500; line-height: 1.15; letter-spacing: -.045em; margin-bottom: 16px; }
.page-head > p { color: var(--text-muted); font-size: 1rem; max-width: 63ch; line-height: 1.75; }
.page-index { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 25px; font-size: .8rem; }
.page-index a { display: inline-flex; gap: 9px; min-height: 28px; }
.statement-body p, .bio-body p { max-width: 72ch; margin-bottom: 18px; color: var(--text-muted); font-size: .96rem; }
.statement-body p:last-child, .bio-body p:last-child { margin-bottom: 0; }
.project-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; }
.project-badge { text-align: right; }
.project-tags, .tag-grid { display: flex; gap: 7px 10px; flex-wrap: wrap; margin-top: 6px; }
.tag { border: 1px solid var(--border); background: transparent; border-radius: 3px; padding: 3px 9px; color: var(--text-muted); font-size: .69rem; line-height: 1.65; }
.tag-grid { max-width: 800px; gap: 10px; }
.tag-grid .tag { padding: 7px 12px; font-size: .78rem; }
.project-link { margin-top: 6px; }
.thread-item > a { font-size: .78rem; align-self: flex-start; margin-top: 4px; }
.note-box { background: var(--accent-soft); border-left: 2px solid var(--accent); color: var(--text-muted); font-size: .86rem; padding: 17px 20px; margin-bottom: 32px; }
.pub-authors { font-size: .85rem; }
.pub-authors strong { font-weight: 500; }
.pub-venue { font-style: normal; }

/* Background and credentials. */
.info-card { display: flex; gap: 22px; align-items: flex-start; border-top: 1px solid var(--border); padding: 26px 0 0; }
.info-card-logo { width: 66px; height: 66px; object-fit: contain; flex: 0 0 66px; }
.info-card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.cert-card { display: flex; align-items: center; gap: 18px; padding: 20px 0; border-top: 1px solid var(--border); }
.cert-card:hover { text-decoration: none; }
.cert-card:hover .cert-verify { text-decoration: underline; }
.cert-badge { width: 64px; height: 64px; flex: 0 0 64px; object-fit: contain; }
.cert-info { display: flex; flex-direction: column; gap: 6px; }
.cert-name { font-family: var(--serif); font-size: 1.05rem; line-height: 1.4; color: var(--text); }
.cert-issuer { color: var(--text-muted); font-size: .76rem; }
.cert-verify { color: var(--accent); font-size: .73rem; }
.contact-note { color: var(--text-muted); margin-bottom: 22px; max-width: 65ch; }
.contact-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: .88rem; }
.contact-list strong { display: inline-block; width: 80px; font-size: .8rem; font-weight: 500; }
.contact-list a { overflow-wrap: anywhere; }
.site-footer { padding: 30px 0 36px; color: var(--text-light); font-size: .73rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.site-footer a { color: var(--text-muted); }

/* Native dialog provides keyboard focus containment and Escape handling. */
.lightbox { width: calc(100% - 40px); max-width: 1500px; height: calc(100% - 40px); max-height: 1100px; padding: 0; border: 1px solid #4b4d4d; border-radius: 8px; background: #171c21; color: #eee; overflow: hidden; }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgba(12, 17, 22, .88); }
.lightbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: .75rem; z-index: 1; }
.lightbox-controls { display: flex; gap: 5px; flex-shrink: 0; }
.lightbox button { border: 1px solid #636a71; border-radius: 4px; color: white; background: transparent; cursor: pointer; min-width: 40px; height: 40px; padding: 0 9px; font-size: 1rem; }
.lightbox button:hover { background: #363f48; }
.lightbox button[data-zoom="reset"] { font-size: .75rem; }
.lightbox button:focus-visible { outline-color: #efcfae; }
.lightbox-img-container { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; overflow: hidden; touch-action: none; }
.lightbox-img-container img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox-img-container.is-zoomed { cursor: grab; }
.lightbox-img-container.is-dragging { cursor: grabbing; }
.lightbox-hint { font-size: .7rem; color: #b7bec6; text-align: center; padding: 12px 16px; }

@media (max-width: 820px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 5px; padding-top: 16px; }
  .nav-links { gap: 24px; width: 100%; }
  .nav-links a { padding: 9px 0 15px; }
  .hero-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 35px; }
  .avatar { width: 160px; height: 160px; }
  .hero-bio h1 { font-size: 2.5rem; }
  .entry-highlight-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; }
  .project-header { flex-direction: column; gap: 5px; }
  .project-badge { text-align: left; }
}
@media (max-width: 620px) {
  .container { padding: 0 24px; }
  .nav-links { gap: 22px; }
  .nav-links a { font-size: .77rem; }
  .hero { padding: 36px 0 40px; }
  .hero-layout { grid-template-columns: 1fr; gap: 27px; }
  .hero-sidebar { display: grid; grid-template-columns: 112px 1fr; column-gap: 22px; align-items: center; }
  .avatar { width: 112px; height: 112px; grid-row: 1 / 3; }
  .sidebar-note { grid-column: 1 / -1; grid-row: 3; margin: 12px 0 0; }
  .sidebar-note br { display: none; }
  .sidebar-note br::after { content: " "; }
  .contact-links { grid-column: 2; grid-row: 1 / 3; gap: 0; }
  .contact-links a { min-height: 28px; }
  .hero-bio h1 { font-size: clamp(2.1rem, 7.5vw, 3rem); }
  .affiliation { margin-bottom: 21px; }
  .hero-bio .hero-intro { font-size: 1.09rem; }
  .section { padding: 36px 0; }
  .section-title { font-size: 1.45rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 20px; }
  .section-heading .eyebrow { margin-bottom: 7px; }
  .entry-item, .thread-item, .project-entry, .pub-item { padding-top: 23px; padding-bottom: 23px; }
  .entry-highlight-layout { grid-template-columns: 1fr; gap: 22px; }
  .photo-preview { max-width: 400px; }
  .page-head { padding: 38px 0 28px; }
  .cert-grid { grid-template-columns: 1fr; gap: 0; }
  .info-card { gap: 16px; }
  .info-card-logo { width: 50px; height: 50px; flex-basis: 50px; }
  .contact-list strong { display: block; width: auto; margin-bottom: 2px; }
  .lightbox { width: calc(100% - 16px); height: calc(100% - 16px); }
  .lightbox-toolbar { flex-direction: column-reverse; align-items: stretch; }
  .lightbox-controls { align-self: flex-end; }
  .lightbox-hint { font-size: .65rem; }
}
@media (max-width: 360px) {
  .container { padding: 0 18px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: .73rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
