:root {
  --bg: #f6f4ef;
  --surface: #fffdf8;
  --surface-2: #ece9e1;
  --ink: #172134;
  --muted: #5d6572;
  --line: #d7d3ca;
  --accent: #1f4e79;
  --accent-2: #a65e3b;
  --accent-soft: #dfe9f2;
  --header: rgba(246, 244, 239, 0.9);
  --shadow: 0 22px 65px rgba(23, 33, 52, 0.11);
  --max: 1180px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg: #111723;
  --surface: #171f2d;
  --surface-2: #1d2737;
  --ink: #edf1f7;
  --muted: #abb5c5;
  --line: #334055;
  --accent: #8bb9df;
  --accent-2: #e4a07b;
  --accent-soft: #23364a;
  --header: rgba(17, 23, 35, 0.9);
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: radial-gradient(circle at 20% 20%, rgba(31, 78, 121, .12), transparent 32%), radial-gradient(circle at 80% 10%, rgba(166, 94, 59, .09), transparent 26%);
  z-index: -1;
}

a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }

.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.section-shell { padding: 105px 0; }
.section-muted { background: var(--surface-2); border-block: 1px solid var(--line); }

.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;
  left: 16px;
  top: -60px;
  z-index: 1000;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.nav-wrap { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-family: var(--serif); font-size: 15px; }
.brand-name { white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 23px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 650; letter-spacing: .01em; }
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav .nav-cv { color: var(--surface); background: var(--ink); padding: 7px 13px; border-radius: 999px; }
.site-nav .nav-cv:hover { color: var(--surface); background: var(--accent); }
.theme-toggle { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; }
.menu-toggle { display: none; border: 0; background: transparent; padding: 8px; }
.menu-toggle span:not(.sr-only) { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--ink); transition: .2s ease; }

.hero { padding: 118px 0 110px; min-height: calc(100vh - 76px); display: grid; align-items: center; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: clamp(52px, 8vw, 110px); align-items: center; }
.eyebrow, .section-kicker, .card-label { margin: 0 0 13px; color: var(--accent-2); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 900px; margin-bottom: 27px; font-family: var(--serif); font-size: clamp(48px, 7vw, 84px); line-height: 1.02; letter-spacing: -.045em; font-weight: 600; }
.hero-lede { max-width: 760px; color: var(--muted); font-size: clamp(19px, 2vw, 23px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 35px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 11px 19px; border-radius: 4px; text-decoration: none; font-weight: 750; font-size: 14px; transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--surface); background: var(--ink); border: 1px solid var(--ink); }
.button-primary:hover { color: var(--surface); background: var(--accent); border-color: var(--accent); }
.button-secondary { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.focus-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 34px 0 0; list-style: none; }
.focus-list li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; color: var(--muted); font-size: 13px; background: color-mix(in srgb, var(--surface) 76%, transparent); }

.hero-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; inset: auto -70px -90px auto; width: 220px; height: 220px; border-radius: 50%; border: 34px solid var(--accent-soft); opacity: .8; }
.monogram { min-height: 245px; display: grid; place-items: center; color: var(--surface); background: var(--accent); font-family: var(--serif); font-size: 86px; letter-spacing: -.08em; }
.profile-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; background: var(--accent-soft); }
.hero-card-body { position: relative; z-index: 1; padding: 31px; }
.hero-card h2 { margin-bottom: 4px; font-family: var(--serif); font-size: 34px; line-height: 1.1; }
.hero-card-body > p:not(.card-label) { color: var(--muted); }
.quick-facts { margin: 27px 0 0; }
.quick-facts div { display: grid; grid-template-columns: 90px 1fr; gap: 15px; padding: 11px 0; border-top: 1px solid var(--line); }
.quick-facts dt { color: var(--muted); font-size: 13px; }
.quick-facts dd { margin: 0; font-weight: 650; font-size: 14px; }

.two-column { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(48px, 9vw, 130px); align-items: start; }
.section-heading h2 { margin-bottom: 18px; font-family: var(--serif); font-size: clamp(38px, 5vw, 60px); line-height: 1.06; letter-spacing: -.035em; font-weight: 600; }
.section-heading > p:not(.section-kicker):not(.note) { color: var(--muted); max-width: 680px; }
.section-heading.wide { display: grid; grid-template-columns: 1fr minmax(280px, .72fr); column-gap: 70px; align-items: end; margin-bottom: 50px; }
.section-heading.wide .section-kicker { grid-column: 1 / -1; }
.section-heading.wide h2 { margin-bottom: 0; }
.section-heading.wide > p:not(.section-kicker) { margin-bottom: 7px; }
.prose { font-family: var(--serif); font-size: 21px; line-height: 1.72; }
.prose p { margin-bottom: 1.15em; }
.about-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 32px; font-family: var(--sans); font-size: 14px; font-weight: 750; }

.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.research-card { position: relative; min-height: 300px; padding: 34px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.research-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform .25s ease; }
.research-card:hover::before { transform: scaleY(1); }
.card-number { display: inline-block; color: var(--accent-2); font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.research-card h3 { margin: 36px 0 18px; font-family: var(--serif); font-size: 31px; line-height: 1.15; font-weight: 600; }
.research-card p { color: var(--muted); }
.research-card .card-meta { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 700; }

.note { color: var(--muted); font-size: 14px; }
.publication-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.publication { display: grid; grid-template-columns: 95px 1fr; gap: 34px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.publication-year { color: var(--accent-2); font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.publication p { margin-bottom: 6px; font-family: var(--serif); font-size: 22px; line-height: 1.5; }
.publication .venue { color: var(--muted); font-size: 18px; }
.publication .publication-note { color: var(--muted); font-family: var(--sans); font-size: 13px; }

.experience-layout { display: grid; grid-template-columns: 1.35fr .65fr; gap: clamp(50px, 8vw, 105px); align-items: start; }
.timeline { margin-top: 42px; border-left: 1px solid var(--line); }
.timeline-item { position: relative; padding: 0 0 44px 37px; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 7px var(--bg); }
.timeline-date, .panel-date { margin-bottom: 5px; color: var(--accent-2); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.timeline-item h3 { margin-bottom: 2px; font-family: var(--serif); font-size: 25px; line-height: 1.25; }
.timeline-org { margin-bottom: 10px; color: var(--accent); font-weight: 750; }
.timeline-item > p:last-child { color: var(--muted); }
.education-panel { position: sticky; top: 105px; padding: 34px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.education-panel h2 { font-family: var(--serif); font-size: 38px; line-height: 1.1; }
.education-panel article { padding: 27px 0; border-top: 1px solid var(--line); }
.education-panel h3 { margin-bottom: 3px; font-family: var(--serif); font-size: 24px; }
.education-panel article > p:not(.panel-date):not(.panel-detail) { color: var(--accent); font-weight: 700; }
.panel-detail { color: var(--muted); font-size: 14px; }
.text-link { display: inline-block; margin-top: 11px; font-size: 14px; font-weight: 800; text-decoration: none; }

.teaching-layout { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(55px, 9vw, 130px); align-items: start; }
.course-list { border-top: 1px solid var(--line); }
.course-list div { display: grid; grid-template-columns: 110px 1fr 130px; gap: 20px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line); }
.course-list span { color: var(--accent-2); font-size: 13px; font-weight: 800; }
.course-list strong { font-family: var(--serif); font-size: 20px; }
.course-list em { color: var(--muted); text-align: right; font-size: 13px; }

.award-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.award { min-height: 220px; padding: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.award span { color: var(--accent-2); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.award h3 { margin: 28px 0 10px; font-family: var(--serif); font-size: 23px; line-height: 1.2; }
.award p { color: var(--muted); font-size: 14px; }

.contact { padding-top: 50px; }
.contact-card { display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: end; padding: clamp(38px, 6vw, 78px); color: #f7f4ed; background: #17365d; }
.contact-card .section-kicker { color: #e4a07b; }
.contact-card h2 { max-width: 800px; margin-bottom: 14px; font-family: var(--serif); font-size: clamp(38px, 5vw, 62px); line-height: 1.05; font-weight: 600; }
.contact-card p { max-width: 700px; color: #dbe3ed; }
.contact-actions { display: flex; flex-direction: column; gap: 12px; min-width: 280px; }
.button-light { color: #17365d; background: #f7f4ed; border: 1px solid #f7f4ed; }
.button-outline-light { color: #f7f4ed; border: 1px solid rgba(247, 244, 237, .5); }
.button-outline-light:hover { color: #17365d; background: #f7f4ed; }
.site-footer { padding: 30px 0 42px; color: var(--muted); font-size: 13px; }
.footer-wrap { display: flex; justify-content: space-between; gap: 20px; }
.footer-wrap p { margin: 0; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .section-shell { padding: 82px 0; }
  .hero { min-height: auto; padding-top: 90px; }
  .hero-grid, .two-column, .experience-layout, .teaching-layout { grid-template-columns: 1fr; }
  .hero-card { max-width: 560px; }
  .section-heading.wide { display: block; }
  .section-heading.wide h2 { margin-bottom: 18px; }
  .education-panel { position: static; }
  .award-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-card { grid-template-columns: 1fr; align-items: start; }
  .contact-actions { min-width: 0; }
}

@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 15px 20px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; }
  .site-nav .nav-cv { align-self: flex-start; margin-top: 8px; padding: 7px 15px; }
  .theme-toggle { margin-top: 13px; }
  .research-grid { grid-template-columns: 1fr; }
  .publication { grid-template-columns: 70px 1fr; gap: 18px; }
  .course-list div { grid-template-columns: 85px 1fr; }
  .course-list em { grid-column: 2; text-align: left; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .container { width: min(calc(100% - 28px), var(--max)); }
  .section-shell { padding: 68px 0; }
  .hero { padding-top: 72px; }
  h1 { font-size: clamp(43px, 14vw, 62px); }
  .hero-lede { font-size: 18px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .button { width: 100%; }
  .monogram { min-height: 190px; font-size: 70px; }
  .hero-card-body { padding: 25px; }
  .section-heading h2 { font-size: 42px; }
  .prose { font-size: 19px; }
  .research-card { min-height: 0; padding: 26px; }
  .publication { display: block; }
  .publication-year { display: block; margin-bottom: 8px; }
  .publication p { font-size: 19px; }
  .award-grid { grid-template-columns: 1fr; }
  .award { min-height: 0; }
  .contact-card { padding: 34px 25px; }
  .footer-wrap { flex-direction: column; }
  .brand-name { display: none; }
}

/* SEO-friendly hero hierarchy: the person's name is the H1, while the research statement remains prominent. */
.hero-statement {
  max-width: 850px;
  margin: -10px 0 25px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.8vw, 46px);
  line-height: 1.14;
  letter-spacing: -.03em;
  color: var(--ink);
}

@media (max-width: 620px) {
  .hero-statement {
    margin-top: -7px;
    font-size: clamp(25px, 8vw, 36px);
  }
}
