/* ============================================================
   Design system
   Type      — Inter Tight (display) · Inter (body) · Roboto Mono (labels)
               [after brianjabarian.org's Neue Haas Grotesk pairing]
   Color     — near-black ink on white, one electric-blue accent (#0600fe),
               hairline rules (#e3e4e8)  [brianjabarian.org]
   Frame     — hairline section dividers + small mono eyebrows  [auyonsiddiq.com]
   Motion    — staggered hero glide: hello ↓ · name ↑ · photo ←  [chu-li.me]
   ============================================================ */

:root {
  --font-display: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --ink: #1a1a1a;
  --ink-deep: #000000;
  --ink-soft: #55585e;
  --ink-faint: #6b6d73;
  --rule: #e3e4e8;
  --rule-strong: #b2bbca;
  --accent: #0600fe;
  --accent-wash: #f3f3ff;
  --lbs-red: #c8102e;
}

html[data-theme="dark"] {
  --bg: #101013;
  --ink: #e4e4e8;
  --ink-deep: #ffffff;
  --ink-soft: #a6a8b1;
  --ink-faint: #83858e;
  --rule: #26272c;
  --rule-strong: #3b3c44;
  --accent: #8a93ff;
  --accent-wash: #191927;
  --lbs-red: #ff6b7d;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html {
  font-size: 62.5%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.7rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* The hero scroll-drift translates text past the right edge —
     clip it so it never creates a horizontal scrollbar */
  overflow-x: clip;
}

.page {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  flex: 1;
}

@media (max-width: 640px) {
  body { font-size: 1.6rem; }
  .page { padding: 0 22px; }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink-deep);
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 0.4rem;
}

p {
  margin: 0 0 1.5rem;
  text-wrap: pretty;
}

em, i, cite, dfn { font-style: normal; }
strong, b { font-weight: 600; color: var(--ink-deep); }

/* Small mono label — the site's recurring micro-texture */
.mono-label {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Links: underline grows on hover, turns blue ---------- */
a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.18s ease;
}

main a {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 96%;
  transition: color 0.18s ease, background-size 0.28s ease;
}
main a:hover {
  color: var(--accent);
  background-size: 100% 1px;
}

/* ---------- Top nav ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.7rem 40px;
  display: flex;
  align-items: center;
  gap: 3.2rem;
  font-size: 1.5rem;
}

.topbar .brand {
  font-family: var(--font-display);
  color: var(--ink-deep);
  margin-right: auto;
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
}
.topbar .brand:hover { color: var(--accent); }

.topbar nav {
  display: flex;
  gap: 2.8rem;
  align-items: center;
}

.topbar nav a {
  color: var(--ink-soft);
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  background-position: 0 100%;
  transition: color 0.18s ease, background-size 0.28s ease;
}
.topbar nav a:hover {
  color: var(--ink-deep);
  background-size: 100% 1.5px;
}
.topbar nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  padding: 4px 6px;
  line-height: 0;
  transition: color 0.2s;
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}
.theme-toggle:hover { color: var(--accent); }

@media (max-width: 640px) {
  .topbar-inner { padding: 1.4rem 22px; gap: 1.6rem; font-size: 1.4rem; }
  .topbar nav { gap: 1.8rem; }
  .topbar .brand { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding-top: 8rem;
  padding-bottom: 3.6rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 6rem;
  /* Top-aligned so the photo's top edge sits on "hello"'s cap line */
  align-items: start;
}

.hero-sub {
  grid-template-columns: 1fr;
  padding-top: 6.4rem;
  padding-bottom: 1.6rem;
}

.hero-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-hello {
  font-family: var(--font-display);
  font-size: clamp(4.4rem, 7vw, 6.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  margin: 0 0 1.2rem 0.2rem;
  /* Scroll drift — composes with the entrance animation's transform */
  translate: var(--hello-shift, 0px) 0;
}

.hero-name {
  font-size: clamp(4.4rem, 7vw, 6.8rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 3rem;
  translate: var(--name-shift, 0px) 0;
}
.hero-name .dot { color: var(--accent); }

.hero-sub h1 {
  font-size: clamp(3.6rem, 5.5vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
}

.hero .affil {
  color: var(--ink-soft);
  font-size: 2.1rem;
  line-height: 1.45;
  margin: 0 0 3.2rem;
  max-width: 70ch;
}
.hero .affil .role { display: block; }
.hero .affil .role.title {
  color: var(--ink-deep);
  font-weight: 500;
}
.hero .affil a { color: var(--ink-soft); }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.6rem;
  font-size: 1.55rem;
  font-weight: 500;
}
.hero-links a { color: var(--ink); }
.hero-links a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.8em;
  color: var(--ink-faint);
}
.hero-links a:hover::after { color: var(--accent); }

.headshot-frame { margin: 0.8rem 0 0; }
.headshot {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  /* Circular portrait — sanctioned exception to the sharp-corner rule;
     echoes the site's other circles (globe, dots) */
  border-radius: 50%;
}
html[data-theme="dark"] .headshot { filter: brightness(0.92); }

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 3.2rem;
    padding-top: 4.4rem;
    padding-bottom: 2.4rem;
  }
  .hero-name { margin-bottom: 2.2rem; }
  .hero .affil { font-size: 1.8rem; margin-bottom: 2.4rem; }
  .hero-links { gap: 0.8rem 2.2rem; }
  .headshot-frame { margin-top: 0; }
  .headshot { max-width: 280px; }
}

/* ---------- Hero entrance (chu-li.me glide) ----------
   hello glides down · name glides up · photo slides in from
   the right · meta and links rise — staggered, soft ease.   */
html.js [data-intro] {
  opacity: 0;
  animation: 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}
html.js [data-intro="hello"] { animation-name: intro-down;  animation-delay: 0.08s; }
html.js [data-intro="name"]  { animation-name: intro-up;    animation-delay: 0.22s; }
html.js [data-intro="photo"] { animation-name: intro-slide; animation-delay: 0.40s; }
html.js [data-intro="meta"]  { animation-name: intro-rise;  animation-delay: 0.52s; }
html.js [data-intro="links"] { animation-name: intro-rise;  animation-delay: 0.64s; }

@keyframes intro-down {
  from { opacity: 0; transform: translateY(-45%); }
  to   { opacity: 1; transform: none; }
}
@keyframes intro-up {
  from { opacity: 0; transform: translateY(32%); }
  to   { opacity: 1; transform: none; }
}
@keyframes intro-slide {
  from { opacity: 0; transform: translateX(7%); }
  to   { opacity: 1; transform: none; }
}
@keyframes intro-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Sections: hairline rule + mono eyebrow ---------- */
section.block {
  border-top: 1px solid var(--rule);
  padding: 4rem 0 2.8rem;
}

section.block > h2 {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 2.6rem;
}

/* Two-level header for major sections: mono eyebrow + display title */
section.block > .eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
section.block > h2.section-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--ink-deep);
  margin: 0 0 3rem;
}

/* ---------- About ---------- */
.body-copy, .about-wide {
  max-width: 76ch;
}
.about-wide p {
  font-size: 1.75rem;
  line-height: 1.75;
  margin-bottom: 1.6rem;
}
.about-wide p:first-child {
  font-size: 2rem;
  line-height: 1.6;
  color: var(--ink-deep);
}

/* About: copy left, interests card in the right rail on wide screens */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.8rem; }
}

/* Research-interests card (jasmineyang.marketing) — left-accent language,
   matching the conference detail card */
.interests {
  border-left: 3px solid var(--accent);
  padding: 0.4rem 0 0.4rem 2.2rem;
}
.interests .int-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.interests p {
  margin: 0;
  font-size: 1.65rem;
  color: var(--ink);
}

/* ---------- News ---------- */
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2.4rem;
  padding: 1.3rem 0;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
}
.news-item:last-child { border-bottom: none; }

.news-date {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 1.3rem;
  white-space: nowrap;
}

.news-body {
  font-size: 1.65rem;
  line-height: 1.6;
  max-width: 74ch;
}

.news-body .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 1rem;
  vertical-align: 1px;
}

.hidden-news { display: none; }
.news-list.expanded .hidden-news { display: grid; }

.news-more { margin-top: 1.8rem; }
.news-more button {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.18s;
}
.news-more button:hover { color: var(--accent); }

@media (max-width: 640px) {
  .news-item { grid-template-columns: 1fr; gap: 4px; padding: 1.1rem 0; }
}

/* ---------- Globe section ---------- */
.globe-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}
.globe-col, .conf-col { min-width: 0; }
.conf-col { padding-top: 0.5rem; }

#globe-wrap { width: 100%; }
#globe-mount {
  width: 100%;
  height: 600px;
  min-height: 480px;
  background: transparent;
  cursor: grab;
}
#globe-mount:active { cursor: grabbing; }
#globe-mount canvas { display: block; }

.globe-legend {
  display: flex;
  gap: 2.4rem;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--ink-soft);
}
.globe-legend .dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 0;
}
.globe-legend .dot.upcoming { background: var(--accent); }
.globe-legend .dot.past { background: var(--ink-soft); }

/* Keyboard-accessible entry point to the conference tour */
.globe-browse {
  background: none;
  border: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 0.8rem 1.6rem;
  margin-top: 1.6rem;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.globe-browse:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Conference index — table of contents shown when no conference is selected.
   Clicking a row selects it on the globe; the detail card replaces the list. */
.conf-index {
  list-style: none;
  margin: 0;
  padding: 0;
}
.conf-index li { border-bottom: 1px solid var(--rule); }
.conf-index li:last-child { border-bottom: none; }
.conf-index button {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1.4rem;
  width: 100%;
  background: none;
  border: none;
  padding: 1.15rem 0.2rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--ink);
  text-align: left;
}
.conf-index .ci-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  align-self: center;
}
.conf-index .ci-dot.upcoming { background: var(--accent); }
.conf-index .ci-dot.past { background: var(--ink-soft); }
.conf-index .ci-name {
  font-weight: 500;
  transition: color 0.18s ease;
}
.conf-index button:hover .ci-name { color: var(--accent); }
.conf-index .ci-year {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--ink-faint);
}

/* Conference detail card */
.cd-card {
  padding: 1.6rem 0 0 2.6rem;
  border-left: 3px solid var(--accent);
}
.cd-status {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 1.4rem;
  display: inline-block;
}
.cd-row {
  padding: 1.4rem 0;
  border-top: 1px solid var(--rule);
}
.cd-row:last-of-type { padding-bottom: 0.4rem; }
.cd-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.cd-val {
  display: block;
  color: var(--ink-deep);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.45;
}

.cd-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-top: 2.4rem;
}
.cd-nav button {
  background: none;
  border: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.cd-nav button:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.cd-count {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--ink-faint);
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.fade-in { animation: cd-fade 0.45s ease both; }
.fade-out { animation: cd-fade 0.45s ease reverse both; }
@keyframes cd-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .globe-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  #globe-mount { height: 480px; }
}

/* ---------- Editorial page mastheads ---------- */
.research-masthead,
.teaching-masthead {
  padding: 7rem 0 5.6rem;
}

.research-masthead-copy,
.teaching-masthead-copy {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(340px, 1.2fr);
  gap: 6rem;
  align-items: end;
}

.research-masthead h1,
.teaching-masthead h1 {
  font-size: clamp(5.2rem, 7vw, 7.4rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.research-deck,
.teaching-deck {
  max-width: 56ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 2rem;
  line-height: 1.55;
}

.research-dashboard,
.teaching-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 6rem;
  align-items: center;
  margin-top: 5rem;
  padding: 3.2rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.research-dashboard-notice { grid-template-columns: minmax(0, 1fr); }

.research-redaction-note {
  margin: 0;
  color: var(--lbs-red);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  line-height: 1.6;
}

.teaching-masthead-copy-solo {
  grid-template-columns: minmax(0, 1fr);
}

.research-stats,
.teaching-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4rem;
  margin: 0;
}

.research-stats div,
.teaching-stats div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.research-stats dd,
.teaching-stats dd {
  order: -1;
  margin: 0;
  color: var(--rule-strong);
  font-family: var(--font-display);
  font-size: clamp(5.4rem, 8vw, 7.6rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.research-stats dt,
.teaching-stats dt {
  margin-top: 1.2rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.research-focus,
.teaching-focus {
  padding-left: 3rem;
  border-left: 1px solid var(--rule);
}

.research-micro-label,
.teaching-micro-label {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.research-focus > p,
.teaching-focus > p {
  margin: 0;
  max-width: 48ch;
  font-size: 1.65rem;
  line-height: 1.6;
}

.research-focus .research-note {
  margin-top: 1.2rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  line-height: 1.55;
}

.research-section,
.teaching-section {
  padding: 5.8rem 0 1rem;
  scroll-margin-top: 8rem;
}

.research-section-head,
.teaching-section-head {
  display: flex;
  gap: 2rem;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.research-section-head h2,
.teaching-section-head h2 {
  color: var(--accent);
  font-size: clamp(3.8rem, 5.5vw, 5.6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
}

.research-section-head > span,
.teaching-section-head > span {
  flex: 0 0 auto;
  padding-bottom: 0.4rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.research-columns,
.research-paper {
  display: grid;
  grid-template-columns: 4.8rem minmax(0, 1.25fr) minmax(280px, 0.85fr);
  gap: 2.8rem;
}

.research-columns {
  padding: 1.4rem 0 0.8rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.research-catalog {
  margin: 0;
  padding: 0;
  list-style: none;
}

.research-paper {
  align-items: start;
  padding: 2.8rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}

.research-paper-number {
  padding-top: 0.5rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  transition: color 0.18s ease;
}

.research-paper-main h3 {
  margin: 0;
  color: var(--ink-deep);
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.015em;
  transition: color 0.18s ease;
}

.research-coauthors {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-size: 1.55rem;
  line-height: 1.55;
}

.research-paper-meta {
  padding-top: 0.3rem;
}

.research-paper-meta .research-micro-label:not(:first-child) {
  margin-top: 1.6rem;
}

.research-status,
.research-presentations {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.55;
}

.research-status { color: var(--accent); }
.research-status span { font-weight: 500; }
.research-presentations { color: var(--ink-soft); }

.research-paper:hover .research-paper-number,
.research-paper:hover .research-paper-main h3 {
  color: var(--accent);
}

@media (max-width: 820px) {
  .research-masthead-copy,
  .research-dashboard,
  .teaching-masthead-copy,
  .teaching-dashboard {
    grid-template-columns: 1fr;
    gap: 3.6rem;
  }

  .research-deck,
  .teaching-deck { max-width: 62ch; }

  .research-focus,
  .teaching-focus {
    padding: 2.8rem 0 0;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .research-columns,
  .research-paper {
    grid-template-columns: 3.4rem minmax(0, 1fr);
    gap: 0 1.6rem;
  }

  .research-columns { display: none; }
  .research-paper-meta {
    grid-column: 2;
    margin-top: 2rem;
    padding-top: 0;
  }
}

@media (max-width: 520px) {
  .research-masthead,
  .teaching-masthead { padding: 4.8rem 0 4.2rem; }
  .research-masthead-copy,
  .teaching-masthead-copy { gap: 2.4rem; }
  .research-masthead h1,
  .teaching-masthead h1 { font-size: 4.8rem; }
  .research-deck,
  .teaching-deck { font-size: 1.8rem; line-height: 1.55; }
  .research-dashboard,
  .teaching-dashboard { gap: 3rem; margin-top: 3.8rem; padding: 2.8rem 0; }
  .research-stats,
  .teaching-stats { gap: 2rem; }
  .research-stats dd,
  .teaching-stats dd { font-size: 5.4rem; }
  .research-stats dt,
  .teaching-stats dt { font-size: 1.1rem; }
  .research-section,
  .teaching-section { padding-top: 5rem; }
  .research-section-head,
  .teaching-section-head { display: block; }
  .research-section-head h2,
  .teaching-section-head h2 { font-size: 3.8rem; line-height: 1.06; }
  .research-section-head > span,
  .teaching-section-head > span { display: block; margin-top: 1.2rem; padding: 0; }
  .research-paper { padding: 2.4rem 0 2.6rem; }
  .research-paper-main h3 { font-size: 2.05rem; }
  .research-coauthors { font-size: 1.5rem; }
  .research-status,
  .research-presentations { font-size: 1.45rem; }
}

/* Full-width, small-type teaching philosophy note below the page title */
.teaching-masthead { padding-bottom: 0; }

.teaching-philosophy {
  max-width: 90ch;
  margin-top: 5rem;
  padding-top: 3.2rem;
  border-top: 1px solid var(--rule);
}

.teaching-philosophy h2 {
  margin: 0 0 1rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.teaching-philosophy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.4rem;
  line-height: 1.7;
}

@media (max-width: 520px) {
  .teaching-philosophy { margin-top: 3.8rem; padding-top: 2.8rem; }
  .teaching-philosophy p { font-size: 1.35rem; }
}

/* Redacted title segments — visual blank without screen-reader noise */
.redacted {
  display: inline-block;
  width: 12em;
  max-width: 100%;
  height: 0.85em;
  border-bottom: 1.5px solid var(--ink-soft);
  vertical-align: baseline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Teaching: course-card index ---------- */
.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
  gap: 1.8rem;
  margin: 2.4rem 0 0;
  padding: 0;
  list-style: none;
}

.teaching-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 22rem;
  padding: 2.6rem;
  border: 1px solid var(--rule);
  transition: border-color 0.18s ease;
}

.teaching-card:hover { border-color: var(--rule-strong); }

.teaching-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.6rem;
  margin-bottom: 3rem;
}

.teaching-card-number,
.teaching-card-term,
.teaching-card-role {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.teaching-card-number { color: var(--ink-faint); }
.teaching-card-term { color: var(--accent); text-align: right; }

.teaching-card-body h3 {
  margin: 0;
  color: var(--ink-deep);
  font-size: 2.3rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  transition: color 0.18s ease;
}

.teaching-card:hover .teaching-card-body h3 { color: var(--accent); }
.teaching-card-body h3 a { color: inherit; }

.teaching-card-institution {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-size: 1.5rem;
  line-height: 1.5;
}

.teaching-card-description {
  margin: 1.4rem 0 0;
  color: var(--ink-soft);
  font-size: 1.5rem;
  line-height: 1.6;
}

.teaching-card-role {
  display: block;
  margin-top: auto;
  padding-top: 2.4rem;
  color: var(--ink-soft);
}

.teaching-card-role.accent { color: var(--accent); }
.teaching-card-compact { min-height: 19rem; }
.teaching-resource-card { min-height: 21rem; }

@media (max-width: 640px) {
  .teaching-grid { grid-template-columns: 1fr; }
  .teaching-card,
  .teaching-card-compact,
  .teaching-resource-card { min-height: 0; padding: 2.3rem; }
  .teaching-card-meta { margin-bottom: 2.4rem; }
  .teaching-card-body h3 { font-size: 2.1rem; }
}

/* ---------- CV items ---------- */
.teaching-item, .research-item {
  padding: 0.4rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.2rem;
}
.teaching-item:last-child, .research-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.teaching-item .meta, .research-item .authors {
  display: block;
  color: var(--ink-soft);
  font-size: 1.5rem;
  margin: 0 0 0.2rem;
}
.teaching-item .venue, .research-item .venue {
  display: block;
  color: var(--ink-soft);
  font-size: 1.5rem;
  margin: 0.3rem 0 0;
  max-width: 90ch;
  line-height: 1.55;
}

/* ---------- Footer ---------- */
footer.site-foot {
  width: 100%;
  max-width: 1120px;
  margin: 7rem auto 0;
  padding: 2.6rem 40px 4rem;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-self: center;
  border-top: 1px solid var(--rule);
}
@media (max-width: 640px) {
  footer.site-foot { padding: 2rem 22px 3rem; flex-direction: column; gap: 6px; }
}

/* ---------- Scroll reveal ----------
   Hidden only when JS is present (site.js adds html.js) —
   without JS every section stays visible. */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Selection & focus ---------- */
::selection { background: var(--accent); color: #ffffff; }
html[data-theme="dark"] ::selection { background: var(--accent); color: #101013; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, [data-intro] { opacity: 1; transform: none; transition: none; animation: none; }
  .hero-hello, .hero-name { translate: none; }
  * { animation: none !important; transition: none !important; }
}
