/* Layout: full-bleed teal hero taken from the portrait's backdrop, then a single reading column with a narrow label rail on wide screens. */
:root {
  --paper: #f5f6f4;
  --surface: #ffffff;
  --ink: #17262b;
  --muted: #56676c;
  --rule: #d6dcdb;
  --accent: #0b5f6a;
  --hero: #02343c;
  --hero-ink: #f4f7f6;
  --hero-soft: #a9cdd0;
  --glint: #f0c46a;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f171a; --surface: #152025; --ink: #e2e9e9; --muted: #97a9ac;
    --rule: #26353b; --accent: #72c4cb; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f171a; --surface: #152025; --ink: #e2e9e9; --muted: #97a9ac;
  --rule: #26353b; --accent: #72c4cb; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-head { background: var(--hero); color: var(--hero-ink); }
.site-head .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding-block: 20px; }
.wordmark { font-family: var(--font-display); font-size: 21px; color: var(--hero-ink); text-decoration: none; letter-spacing: 0.005em; }
.wordmark span { color: var(--hero-soft); font-size: 0.8em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14.5px; }
.site-nav a { color: var(--hero-soft); text-decoration: none; padding-block: 4px; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--hero-ink); }
.site-nav a[aria-current="page"] { color: var(--hero-ink); border-bottom-color: var(--glint); }

/* Home hero: the portrait is a full-bleed banner; text sits in the open teal to the left */
.hero { position: relative; overflow: hidden; background: var(--hero); color: var(--hero-ink); }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 82% 22%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(2, 52, 60, 0.55) 0%, rgba(2, 52, 60, 0) 55%); }
.hero .wrap { position: relative; z-index: 2; max-width: none; min-height: clamp(400px, 34vw, 600px); display: flex; align-items: center; padding-block: 56px; padding-left: max(24px, calc((100% - 1040px) / 2 + 24px), env(safe-area-inset-left, 0px)); }
.hero-text { max-width: 32rem; }
.kicker { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hero-soft); margin: 0 0 18px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(48px, 7vw, 80px);
  line-height: 0.98; letter-spacing: -0.02em; margin: 0 0 26px;
}
.studies { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 28px); line-height: 1.3; margin: 0; color: var(--hero-soft); }
.studies-label { display: block; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hero-soft); margin-bottom: 8px; }
.rotator { display: block; color: var(--hero-ink); font-style: italic; min-height: 1.3em; transition: opacity 0.45s ease, transform 0.45s ease; }
.rotator.out { opacity: 0; transform: translateY(6px); }
.rotator::after { content: ""; display: block; width: 56px; height: 2px; background: var(--glint); margin-top: 14px; }

/* Page header for inner pages */
.page-head { background: var(--hero); color: var(--hero-ink); }
.page-head .wrap { padding-block: 40px 52px; }
.page-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(38px, 5.5vw, 58px); line-height: 1.05; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.page-head p { color: var(--hero-soft); font-family: var(--font-display); font-size: 21px; margin: 12px 0 0; max-width: 40ch; }

/* Sections */
.block { border-top: 1px solid var(--rule); padding-block: 56px; }
.block:first-of-type { border-top: 0; }
.block > .wrap.rail { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 40px; }
h2.label {
  font-family: var(--font-mono); font-weight: 500; font-size: 12.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin: 7px 0 0;
}
.lede { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 26px); line-height: 1.45; margin: 0 0 20px; max-width: 40ch; text-wrap: pretty; }
.prose p { margin: 0 0 1.1em; max-width: 64ch; }
.prose p:last-child { margin-bottom: 0; }
.more { font-weight: 600; font-size: 15px; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.more::after { content: "→"; transition: transform 0.2s ease; }
.more:hover::after { transform: translateX(4px); }

.now { background: var(--surface); border: 1px solid var(--rule); padding: 22px 24px; max-width: 64ch; }
.now h3 { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.now p { margin: 0; }

/* Work tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 32px 24px; list-style: none; margin: 0; padding: 0; }
.tile a { display: grid; gap: 12px; color: inherit; text-decoration: none; }
.tile .page {
  aspect-ratio: 3 / 4; overflow: hidden; background: #fff; border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule); transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tile .page img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.tile a:hover .page { transform: translateY(-4px); box-shadow: 0 10px 24px -14px rgba(2, 52, 60, 0.45); }
.tile .kind { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tile .t { font-family: var(--font-display); font-size: 18px; line-height: 1.3; margin: 2px 0 0; }
.tile a:hover .t { color: var(--accent); }
.tile .v { font-size: 13.5px; color: var(--muted); margin: 4px 0 0; font-style: italic; }

/* Research areas */
.areas { display: grid; gap: 40px; }
.area h3 { font-family: var(--font-display); font-weight: 500; font-size: 27px; line-height: 1.2; margin: 0 0 10px; }
.area p { margin: 0 0 10px; max-width: 64ch; }
.area .see { font-size: 14.5px; color: var(--muted); margin: 0; }

.facts { display: flex; flex-wrap: wrap; gap: 18px 44px; margin: 0; padding: 0; }
.fact { display: grid; gap: 2px; }
.fact dt { order: 2; font-size: 13.5px; color: var(--muted); max-width: 20ch; }
.fact dd { order: 1; margin: 0; font-family: var(--font-display); font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums; }

/* Path timeline on About */
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.path li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; padding-block: 14px; border-top: 1px solid var(--rule); }
.path li:first-child { border-top: 0; padding-top: 0; }
.path .when { font-family: var(--font-mono); font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.path .what { margin: 0; }
.path .what b { font-weight: 600; }

.bio-box { background: var(--surface); border: 1px solid var(--rule); padding: 24px; max-width: 66ch; }
.bio-box p { margin: 0 0 16px; }
.btn {
  font: 600 13.5px var(--font-body); color: var(--ink); background: transparent;
  border: 1px solid var(--rule); padding: 8px 14px; cursor: pointer;
}
.btn:hover { border-color: var(--ink); }

/* Publication lists */
.pub-group { margin-bottom: 44px; }
.pub-group:last-child { margin-bottom: 0; }
.pub-group h3 { font-family: var(--font-display); font-weight: 500; font-size: 24px; margin: 0 0 16px; }
ol.cites { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
ol.cites li { padding-left: 1.6em; text-indent: -1.6em; max-width: 72ch; font-size: 16px; overflow-wrap: anywhere; }
ol.cites .me { font-weight: 600; }
.note { font-size: 14px; color: var(--muted); margin: 0 0 20px; }

/* Talks */
.talks { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.talks li { max-width: 66ch; }
.talks .when { font-family: var(--font-mono); font-size: 13px; color: var(--muted); display: block; margin-bottom: 2px; }
.talks .title { font-family: var(--font-display); font-size: 20px; line-height: 1.35; }
.topics { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.topics li { border: 1px solid var(--rule); background: var(--surface); padding: 8px 14px; font-size: 15px; }

/* Footer / contact */
.site-foot { background: var(--hero); color: var(--hero-ink); }
.site-foot .wrap { padding-block: 52px 40px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px 48px; }
.site-foot h2 { font-family: var(--font-mono); font-weight: 500; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hero-soft); margin: 0 0 14px; }
.email-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.email { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); color: var(--hero-ink); overflow-wrap: anywhere; }
.site-foot .btn { color: var(--hero-ink); border-color: rgba(244, 247, 246, 0.35); }
.site-foot .btn:hover { border-color: var(--hero-ink); }
.site-foot p { margin: 10px 0 0; color: var(--hero-soft); max-width: 46ch; font-size: 15px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.site-foot a { color: var(--hero-ink); }
.copyright { grid-column: 1 / -1; border-top: 1px solid rgba(244, 247, 246, 0.15); padding-top: 20px; font-size: 13px; color: var(--hero-soft); }

@media (max-width: 780px) {
  .block { padding-block: 42px; }
  .block > .wrap.rail { grid-template-columns: 1fr; gap: 18px; }
  .site-foot .wrap { grid-template-columns: 1fr; }
  .path li { grid-template-columns: 1fr; gap: 2px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .tile .t { font-size: 16.5px; }
}
@media (max-width: 900px) {
  .hero-photo { position: static; height: auto; aspect-ratio: 4 / 3; object-position: 78% center; }
  .hero::before { display: none; }
  .hero .wrap { min-height: 0; padding-block: 28px 44px; padding-left: max(24px, env(safe-area-inset-left, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .rotator, .tile .page, .more::after { transition: none; }
}
