/* Light, professional theme */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f4f6f5;
  --ink: #1c2b33;
  --ink-soft: #52616a;
  --accent: #1f5c46;
  --gold: #b8860b;
  --rule: #e2e6e4;

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --measure: 66ch;
  --gutter: clamp(1.25rem, 5vw, 4rem);

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem var(--gutter);
  background: #ffffff;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.monogram { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: .04em; }
.site-header nav { display: flex; gap: clamp(.75rem, 3vw, 2rem); flex-wrap: wrap; justify-content: flex-end; }
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-weight: 500;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  line-height: 1.05; letter-spacing: -.015em;
  margin: 0 0 1.25rem;
}
.role { font-family: var(--sans); font-size: 1.02rem; line-height: 1.55; color: var(--ink-soft); margin: 0 0 1.5rem; padding-left: 1rem; border-left: 3px solid var(--gold); }
.lede { font-size: 1.2rem; max-width: 42ch; margin: 0 0 2rem; }
.facts { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 0; }
.facts div { min-width: 7rem; }
.facts dt { font-family: var(--sans); font-size: .85rem; color: var(--ink-soft); }
.facts dd { margin: .1rem 0 0; font-size: 1.6rem; font-weight: 500; color: var(--accent); }
.hero-photo { margin: 0; justify-self: end; width: min(100%, 20rem); }
.hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; box-shadow: 0 1px 2px rgba(28,43,51,.08), 0 12px 32px rgba(28,43,51,.10); }

/* Sections */
.block {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
  gap: 1rem clamp(1.5rem, 5vw, 4rem);
  padding: clamp(3rem, 7vw, 5rem) var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.block:nth-of-type(odd) { background: var(--bg-alt); }
.block > h2 { font-weight: 500; font-size: 1.6rem; line-height: 1.2; margin: .2rem 0 0; grid-row: span 3; }
.block > :not(h2) { grid-column: 2; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }

/* Research */
.crops { margin: 0; max-width: 72rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 2.25rem 3rem; }
.crops div { border-top: 2px solid var(--accent); padding-top: .9rem; }
.crops dt { font-weight: 700; font-size: 1.2rem; margin-bottom: .35rem; }
.crops dt i { font-weight: 400; color: var(--ink-soft); margin-left: .35em; }
.crops dd { margin: 0; max-width: 46ch; }

/* Publications */
.note { font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); margin: 0 0 2rem; }
.timeline + .note { margin: 2.5rem 0 0; }
.timeline { list-style: none; margin: 0; padding: 0; max-width: 60rem; }
.timeline > li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1.5rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.timeline > li:first-child { border-top: 0; padding-top: 0; }
.year { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.entries article + article { margin-top: 1.4rem; }
.entries h3 { font-size: 1.1rem; font-weight: 500; line-height: 1.4; margin: 0 0 .3rem; max-width: 62ch; }
.entries h3 a { color: var(--ink); text-decoration-color: var(--rule); }
.entries h3 a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.entries p { font-family: var(--sans); font-size: .93rem; line-height: 1.5; color: var(--ink-soft); margin: 0; max-width: 70ch; }
.entries p b { color: var(--ink); font-weight: 600; }

/* Milestones */
.milestones { list-style: none; margin: 2rem 0 0; padding: 0; max-width: var(--measure); font-family: var(--sans); font-size: .95rem; line-height: 1.5; }
.milestones li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--rule); }
.milestones span { font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }

/* Ph.D. guidance */
.theses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.5rem 2.5rem; max-width: 60rem; margin: 0 0 2rem; }
.theses article { border-top: 2px solid var(--accent); padding-top: .9rem; }
.theses h3 { font-size: 1.1rem; font-weight: 500; line-height: 1.4; margin: 0 0 .4rem; }
.theses p { font-family: var(--sans); font-size: .93rem; line-height: 1.5; color: var(--ink-soft); margin: 0; }
.theses p b { color: var(--ink); font-weight: 600; }
#students > .note { max-width: var(--measure); }

/* Photos */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 15rem)); gap: clamp(1rem, 2.5vw, 1.5rem); }
.gallery figure { margin: 0; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; }

/* Footer */
.site-footer { padding: 2.5rem var(--gutter) 3rem; font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); background: var(--bg); }
.site-footer p { margin: 0; max-width: 60ch; }

/* Long titles and links never force sideways scroll */
h1, h2, h3, .entries p, .theses p { overflow-wrap: break-word; }
img { max-width: 100%; }

@media (max-width: 820px) {
  html { scroll-padding-top: 3.75rem; }
  .site-header { padding: 0 var(--gutter); gap: .75rem; min-height: 3.25rem; }
  .site-header nav {
    flex: 1 1 auto; min-width: 0;
    flex-wrap: nowrap; justify-content: flex-start; gap: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter);
    mask-image: linear-gradient(to right, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; padding: .9rem .6rem; font-size: .9rem; }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-top: 2rem; padding-bottom: 2.5rem; }
  .hero-photo { order: -1; justify-self: start; width: min(45%, 11rem); }
  .hero h1 { font-size: clamp(2.1rem, 9vw, 2.75rem); margin-bottom: 1rem; }
  .role { font-size: .95rem; }
  .lede { font-size: 1.1rem; margin-bottom: 1.5rem; }
  .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
  .facts div { min-width: 0; }
  .facts dt { font-size: .75rem; line-height: 1.3; }
  .facts dd { font-size: 1.15rem; line-height: 1.25; }

  .block { grid-template-columns: minmax(0, 1fr); padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .block > h2 { grid-row: auto; margin-bottom: .75rem; font-size: 1.45rem; }
  .block > :not(h2) { grid-column: 1; }
  .crops { gap: 1.75rem; }
  .timeline > li { grid-template-columns: 1fr; gap: .4rem; }
  .entries h3, .theses h3 { font-size: 1.05rem; }
  .milestones li { grid-template-columns: 1fr; gap: .15rem; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 36rem; }
  .site-footer { padding: 2rem var(--gutter) 2.5rem; }
}
@media (max-width: 480px) {
  .monogram { display: none; }
  .facts { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; }
  .site-header nav { margin-left: calc(-.6rem); }
  .gallery { gap: .6rem; }
}
