/* ============================================================
   Editorial design system (mock 3a/4a/4b)
   Newsreader (serif) + Hanken Grotesk (sans), warm paper tones,
   single accent variable recolors the whole site.
   ============================================================ */

:root {
  --accent: #3a5a78;
  --accent-soft: #e8eef4;
  --accent-underline: #b8c9da;
  --ink: #282420;
  --body: #4b443c;
  --muted: #5f574d;
  --faint: #6f665c;
  --fainter: #8a7f72;
  --icon-muted: #a89a86;
  --paper: #fffdf9;
  --paper-outside: #eae3d8;
  --sidebar-bg: #f1ece2;
  --card-bg: #ffffff;
  --border: #e7e0d3;
  --hairline: #eee4d6;
  --divider: #e3dbcc;
  --chip-bg: #efe8dd;
  --btn-border: #d9cebd;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--paper-outside);
  font-family: var(--sans);
  color: var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- background montage (page margins) ---------- */

.ed-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.ed-bg__col {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc((100% - 1160px) / 2);
  display: grid;
  gap: 3px;
  background: #241f1b;
}

.ed-bg__col--left { left: 0; grid-template-rows: repeat(6, 1fr); }
.ed-bg__col--right { right: 0; grid-template-rows: repeat(5, 1fr); }

.ed-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 0;
  filter: saturate(.75) brightness(.9);
}

.ed-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(28, 24, 20, .5);
}

/* ---------- page frame ---------- */

.ed-frame {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  display: grid;
  grid-template-columns: 300px 1fr;
  box-shadow: 0 0 12px rgba(0, 0, 0, .1), 0 0 70px rgba(40, 36, 32, .35);
}

/* ---------- sidebar ---------- */

.ed-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 42px 34px;
}

.ed-sidebar__inner {
  position: sticky;
  top: 42px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.ed-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .09);
}

.ed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ed-name {
  font: 500 27px/1.05 var(--serif);
  color: var(--ink);
  letter-spacing: -.01em;
}

.ed-role {
  font: 500 13.5px/1.4 var(--sans);
  color: var(--accent);
  margin-top: 6px;
}

.ed-side-facts {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font: 400 13.5px/1.4 var(--sans);
  color: var(--muted);
}

.ed-side-facts > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ed-side-facts svg { color: var(--icon-muted); flex: none; }

.ed-side-rule { height: 1px; background: var(--divider); }

.ed-side-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font: 500 13.5px/1 var(--sans);
}

.ed-side-links a {
  color: #3a342d;
  text-decoration: none;
  display: flex;
  gap: 11px;
  align-items: center;
}

.ed-side-links a:hover { color: var(--accent); }
.ed-side-links svg { color: var(--accent); flex: none; }

.ed-cv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font: 600 13.5px var(--sans);
  padding: 12px 16px;
  border-radius: 8px;
}

.ed-cv-btn:hover { filter: brightness(1.08); }
.ed-cv-btn svg { color: #fff; flex: none; }

/* ---------- main column ---------- */

.ed-main { padding: 46px 48px 56px; min-width: 0; }

.ed-nav {
  display: flex;
  gap: 22px;
  justify-content: flex-end;
  font: 600 13px var(--sans);
  color: var(--fainter);
  margin-bottom: 38px;
}

.ed-nav a { text-decoration: none; }
.ed-nav a:hover { color: var(--ink); }

.ed-nav a.active {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.ed-eyebrow {
  font: 600 11.5px/1.5 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.ed-h1 {
  font: 400 44px/1.08 var(--serif);
  color: var(--ink);
  margin: 0 0 24px;
  letter-spacing: -.015em;
  text-wrap: pretty;
}

.ed-lede {
  font: 400 15.5px/1.65 var(--sans);
  color: var(--muted);
  max-width: 560px;
  margin: 0;
}

.ed-h2 {
  font: 500 24px var(--serif);
  color: var(--ink);
  margin: 40px 0 16px;
  font-weight: 500;
}

/* ---------- home: intro ---------- */

.ed-intro {
  font: 400 16px/1.75 var(--sans);
  color: var(--body);
  max-width: 566px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ed-intro p { margin: 0; }

.ed-intro a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-underline);
}

/* ---------- home: before-stanford callout ---------- */

.ed-callout {
  margin-top: 30px;
  padding: 20px 22px;
  background: var(--sidebar-bg);
  border-radius: 10px;
  font: 400 14.5px/1.7 var(--sans);
  color: var(--muted);
  max-width: 566px;
}

.ed-callout .ed-callout__lead {
  font: italic 500 15px var(--serif);
  color: var(--ink);
}

.ed-callout a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-underline);
}

/* ---------- research: publications ---------- */

.ed-pubs { display: flex; flex-direction: column; }

.ed-pub {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
}

.ed-pub:last-child { border-bottom: 1px solid var(--hairline); }

.ed-pub__type {
  font: 600 10.5px var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 4px;
}

.ed-pub__title {
  font: 500 17px/1.35 var(--serif);
  color: var(--ink);
  margin-bottom: 5px;
}

.ed-pub__meta {
  font: 400 13.5px/1.5 var(--sans);
  color: var(--faint);
  margin-bottom: 11px;
}

.ed-pub__meta strong, .ed-pub__meta b { color: #3a342d; }

.ed-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 12px var(--sans);
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--btn-border);
  padding: 6px 11px;
  border-radius: 7px;
}

.ed-btn:hover { border-color: var(--accent); }

/* ---------- research: project cards ---------- */

.ed-projects { display: flex; flex-direction: column; gap: 15px; }

.ed-proj {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  background: var(--card-bg);
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.ed-proj__body { flex: 1; min-width: 0; }

.ed-proj__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
  flex-wrap: wrap;
}

.ed-chip {
  background: var(--chip-bg);
  color: var(--faint);
  font: 600 11px var(--sans);
  padding: 4px 9px;
  border-radius: 6px;
}

.ed-ongoing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2f7d54;
  font: 600 11px var(--sans);
}

.ed-ongoing::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #37a06a;
}

.ed-proj__title {
  font: 500 18px/1.3 var(--serif);
  color: var(--ink);
  margin-bottom: 4px;
}

.ed-proj__lab {
  font: 600 12.5px var(--sans);
  color: var(--accent);
  margin-bottom: 8px;
}

.ed-proj__desc {
  font: 400 14px/1.6 var(--sans);
  color: var(--muted);
}

.ed-proj__links { display: flex; gap: 10px; margin-top: 12px; }

.ed-proj__img {
  width: 190px;
  height: 130px;
  border-radius: 9px;
  flex: none;
  object-fit: cover;
}

/* ---------- research: course project grid ---------- */

.ed-course-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ed-course {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 17px 18px;
  background: var(--card-bg);
}

.ed-course__eyebrow {
  font: 600 10.5px var(--sans);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.ed-course__title {
  font: 500 15.5px/1.3 var(--serif);
  color: var(--ink);
  margin-bottom: 6px;
}

.ed-course__desc {
  font: 400 12.5px/1.5 var(--sans);
  color: var(--faint);
}

.ed-course__links { display: flex; gap: 14px; margin-top: 10px; }

.ed-link {
  font: 600 11.5px var(--sans);
  color: var(--accent);
  text-decoration: none;
}

.ed-link:hover { text-decoration: underline; }

/* ---------- teaching ---------- */

.ed-award {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-underline);
  border-radius: 12px;
  margin-bottom: 14px;
}

.ed-award__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.ed-award__icon svg { color: #fff; }

.ed-award__title {
  font: 500 18px/1.3 var(--serif);
  color: var(--ink);
  margin-bottom: 4px;
}

.ed-award__desc {
  font: 400 13.5px/1.55 var(--sans);
  color: var(--muted);
}

.ed-teach-note {
  font: 400 15px/1.6 var(--sans);
  color: var(--muted);
  margin: 22px 0 8px;
}

.ed-courses { display: flex; flex-direction: column; }

.ed-courserow {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}

.ed-courserow:last-child { border-bottom: 1px solid var(--hairline); }

.ed-courserow__term {
  font: 600 12px var(--sans);
  color: var(--fainter);
  padding-top: 4px;
}

.ed-courserow__title {
  font: 500 19px/1.3 var(--serif);
  color: var(--ink);
  margin-bottom: 3px;
}

.ed-courserow__instructor {
  font: 600 12.5px var(--sans);
  color: var(--accent);
  margin-bottom: 8px;
}

.ed-courserow__desc {
  font: 400 14px/1.6 var(--sans);
  color: var(--muted);
}

.ed-courserow__links { margin-top: 10px; }

/* ---------- responsive ---------- */

@media (max-width: 1200px) {
  /* frame fills (almost) the viewport — montage margins are not visible */
  .ed-bg { display: none; }
}

@media (max-width: 900px) {
  .ed-frame { grid-template-columns: 1fr; }

  .ed-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 34px 28px;
  }

  .ed-sidebar__inner {
    position: static;
    align-items: center;
    text-align: center;
  }

  .ed-side-facts > div, .ed-side-links a { justify-content: center; }
  .ed-side-rule { width: 100%; }
  .ed-cv-btn { width: 100%; max-width: 300px; }

  .ed-main { padding: 34px 26px 48px; }
  .ed-nav { justify-content: center; margin-bottom: 30px; }
  .ed-h1 { font-size: 36px; }
  .ed-course-grid { grid-template-columns: 1fr; }

  .ed-proj { flex-direction: column; }
  .ed-proj__img { width: 100%; height: auto; max-height: 220px; }

  .ed-pub { grid-template-columns: 1fr; gap: 6px; }
  .ed-courserow { grid-template-columns: 1fr; gap: 6px; }
}
