/* Typography and visual consistency pass — November 2026.
   Content, routes, component structure, and data are unchanged. */
:root {
  --ui-ink: #1d2e41;
  --ui-copy: #45586e;
  --ui-secondary: #617287;
  --ui-border: #e2e9f0;
  --ui-accent: #b81238;
  --ui-soft: #fafbfc;
  --ui-display: "Manrope", "Inter", sans-serif;
  --ui-body: "Inter", Arial, sans-serif;
}
html { text-rendering: optimizeLegibility; }
body {
  font-family: var(--ui-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ui-ink);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6,
.pub-explorer-heading h4,
.atlas-panel-title h4 {
  font-family: var(--ui-display);
  font-optical-sizing: auto;
  letter-spacing: -.028em;
}
p { text-wrap: pretty; }
h1,h2,h3,h4,h5,h6 { text-wrap: balance; }

/* Navigation: readable without dominating the page */
nav .text-xl {
  font-family: var(--ui-display);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -.035em;
}
nav .hidden.space-x-8 a {
  font-family: var(--ui-body);
  font-size: 11.5px;
  letter-spacing: .028em;
  font-weight: 700;
}
nav .text-\[10px\] { font-size: 10.5px; letter-spacing: .17em; }
.glass-nav { box-shadow: 0 5px 24px rgba(16,34,54,.035); }

/* A consistent heading hierarchy across sections */
#about .grid h3 {
  font-family: var(--ui-display);
  font-size: clamp(2.85rem, 5.4vw, 4.7rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.055em;
  text-transform: none;
}
#awards h3.text-5xl,
#Research h3,
#publications h3.text-5xl,
#Teaching h3.text-5xl,
#supervision h2.text-5xl,
#research-impact .atlas-head h3 {
  font-family: var(--ui-display);
  font-size: clamp(2rem, 3.7vw, 3.1rem);
  line-height: 1.16;
  letter-spacing: -.045em;
  font-weight: 800;
  text-transform: none;
}
#supervision h2.text-5xl { margin-bottom: 0; }
section h2.text-xs,
#supervision h3.text-xs,
#Teaching h4.text-xs {
  font-size: 11px;
  letter-spacing: .17em;
  font-weight: 750;
  line-height: 1.5;
}

/* More legible description copy; stop using ultra-light weights */
#about p.font-light,
#Research p.font-light,
#Teaching p.font-light,
#supervision p.font-light,
footer#contact p.font-light {
  font-weight: 400;
}
#about .grid .text-lg {
  color: var(--ui-copy);
  line-height: 1.79;
  font-size: 1.035rem;
}
#Research .text-slate-500,
#supervision .text-slate-500,
#Teaching .text-slate-500,
#publications .text-slate-500 {
  color: var(--ui-secondary);
}
#Research .research-topic-grid article p,
#Research .research-project-grid article p,
#Teaching .card-modern p {
  color: var(--ui-copy);
  line-height: 1.73;
}
#Research .research-topic-grid h4,
#Research .research-project-grid h4 {
  font-family: var(--ui-display);
  font-weight: 750;
  line-height: 1.38;
  letter-spacing: -.025em;
}
#Research .research-project-grid h4 { font-size: 1.1rem; }
#Teaching .card-modern h5 {
  font-size: 1.1rem;
  font-weight: 750;
  line-height: 1.42;
  letter-spacing: -.025em;
}
#Teaching .card-modern span[class*="text-[10px]"] {
  font-size: 11px;
  letter-spacing: .035em;
  color: #57677c;
}
#Teaching .card-modern p { font-size: 13.5px; }

/* Softer, less decorative cards; consistent corners and borders */
.card-modern {
  border-color: var(--ui-border);
  box-shadow: 0 3px 14px rgba(21,40,59,.025);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card-modern:hover {
  border-color: #dbabba;
  transform: translateY(-2px);
  box-shadow: 0 13px 30px rgba(21,40,59,.065);
}
#Research .research-project-grid .card-modern { border-radius: 20px; }
#Teaching .card-modern { border-radius: 19px; }
#awards .award-card { border-radius: 18px; }
#awards .award-card h4 {
  font-family: var(--ui-display);
  font-size: 16.5px;
  letter-spacing: -.015em;
  line-height: 1.43;
}
#awards .award-card p:last-child {
  color: var(--ui-copy);
  font-size: 13px;
  line-height: 1.73;
}
#awards .award-card h4 + p {
  color: #68798e;
  font-size: 11px;
  letter-spacing: .045em;
}
#supervision .research-people-group .card-modern h4,
#supervision .research-people-group .card-modern h5 {
  font-family: var(--ui-display);
  letter-spacing: -.018em;
  font-weight: 750;
}
#supervision .research-people-group .card-modern p[class*="text-[10px]"] {
  font-size: 11px;
  letter-spacing: .045em;
  color: #637489;
}
#supervision .pill {
  font-size: 10px;
  letter-spacing: .035em;
}
.about-career-card h5 {
  font-family: var(--ui-display);
  font-weight: 750;
  letter-spacing: -.018em;
}
.about-career-place { color: #53667b; }
.about-career-date { color: #a51f42; }

/* Publication and research metrics: visual hierarchy, not extra panels */
#publications .pub-explorer-heading h4 {
  font-size: 1.55rem;
  letter-spacing: -.035em;
}
#publications .pub-item h5 {
  font-family: var(--ui-display);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 750;
}
#publications .pub-item p {
  font-size: 12.5px;
  color: #607188;
}
#publications .pub-search input,
#publications .pub-filter select {
  font-family: var(--ui-body);
  font-size: 13px;
}
#research-impact .impact-compare-header h4,
#research-impact .atlas-panel-title h4 {
  font-family: var(--ui-display);
  font-weight: 750;
  letter-spacing: -.028em;
}
#research-impact .impact-compare tbody td,
#research-impact .atlas-metric strong {
  font-family: var(--ui-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.038em;
}
#research-impact .atlas-tabs button {
  font-family: var(--ui-body);
  font-weight: 700;
  letter-spacing: 0;
}
#research-impact .impact-hint,
#research-impact .impact-detail,
#research-impact .impact-source-note {
  line-height: 1.75;
  color: #52667b;
}

/* Footer and keyboard focus */
footer#contact h3 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  text-transform: none;
  line-height: 1.18;
  letter-spacing: -.04em;
}
footer#contact p { line-height: 1.7; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 3px;
}

/* Preserve the mobile layout while preventing oversized headings */
@media(max-width: 1023px) {
  nav .text-xl { font-size: 1.02rem; }
  section h2.text-xs { letter-spacing: .13em; }
  #Teaching .card-modern { padding: 23px; }
}
@media(max-width: 640px) {
  #about .grid h3 { font-size: clamp(2.45rem, 10vw, 3.1rem); line-height: 1.1; }
  #Research h3,
  #awards h3.text-5xl,
  #publications h3.text-5xl,
  #Teaching h3.text-5xl,
  #supervision h2.text-5xl,
  #research-impact .atlas-head h3 {
    font-size: clamp(1.95rem, 8vw, 2.45rem);
    line-height: 1.15;
  }
  #about .grid .text-lg { font-size: 1rem; line-height: 1.73; }
  #Research .research-project-grid h4 { font-size: 1.06rem; }
  #Teaching .card-modern h5 { font-size: 1.07rem; }
  #Teaching .card-modern { padding: 21px; }
  #awards .award-card p:last-child { font-size: 12.5px; }
}
@media(prefers-reduced-motion: reduce) {
  .card-modern { transition: none; transform: none; }
  .card-modern:hover { transform: none; }
}


/* Unified editorial heading system across main sections */
#awards .site-section-heading,
#supervision .site-section-heading,
#Research .site-section-heading,
#Teaching .site-section-heading,
#publications .site-section-heading {
  text-align: left;
}
.site-section-heading { 
  margin-bottom: clamp(34px, 4vw, 58px);
}
.site-section-heading > h2.text-xs,
.site-section-heading > .site-section-eyebrow,
.site-section-heading > div > h2.text-xs,
#research-impact .atlas-kicker {
  display: block;
  margin-bottom: 13px;
  color: #b81238;
  font-family: var(--ui-body);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.site-section-heading > h3,
.site-section-heading > h2.text-5xl,
.site-section-heading > div > h3,
#research-impact .atlas-head h3 {
  margin-top: 0;
  font-family: var(--ui-display);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.15;
  text-align: left;
}
.site-section-heading > p:not(.site-section-eyebrow) {
  margin-left: 0;
  margin-right: 0;
  max-width: 780px;
  text-align: left;
}
#publications .site-section-heading {
  align-items: flex-start;
}
#publications .site-section-heading > a {
  align-self: flex-start;
}
#research-impact .atlas-head {
  align-items: flex-start;
  text-align: left;
}
#research-impact .atlas-head h3 {
  text-align: left;
}
@media(max-width: 767px){
  #publications .site-section-heading > a {
    margin-top: 20px;
  }
}


/* Academic section background rhythm — white and mist gray.
   Alternation is intentional; keep the existing red accents and white content cards. */
:root { --ui-section-white: #ffffff; --ui-section-mist: #f8f9fb; }

#about,
#supervision,
#publications,
#Teaching {
  background: var(--ui-section-white);
}
#awards,
#Research,
#research-impact {
  background: var(--ui-section-mist);
}
footer#contact {
  background: var(--ui-section-mist);
  color: var(--ui-ink);
  border-top: 1px solid var(--ui-border);
}
/* White cards retain contrast against the pale-gray sections. */
#awards .award-card,
#Research .card-modern,
#research-impact .impact-viz,
#research-impact .impact-compare,
#research-impact .atlas-metric,
#Teaching .card-modern,
#supervision .card-modern {
  background-color: #fff;
}
/* Keep the gray footer fully legible without changing any of its content. */
footer#contact .text-slate-300 { color: #495d73; }
footer#contact .text-slate-500,
footer#contact .text-slate-600,
footer#contact .text-slate-700 { color: #617287; }
footer#contact .border-white\/5 { border-color: var(--ui-border); }
footer#contact .fab,
footer#contact .fas.fa-university { color: #5b6f83; }


/* Mobile navigation and narrow-screen usability */
@media (max-width: 1023px) {
  #mobile-menu {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(80px, env(safe-area-inset-top)) 22px max(32px, env(safe-area-inset-bottom));
    gap: 0;
    justify-content: safe center;
    -webkit-overflow-scrolling: touch;
  }
  #mobile-menu .mobile-link {
    display: block;
    width: min(100%, 340px);
    padding: 11px 8px;
    margin: 0 auto;
    font-size: clamp(1rem, 3.5vw, 1.35rem);
    line-height: 1.45;
    letter-spacing: -.015em;
    text-wrap: balance;
  }
  #menu-close { position: fixed; top: max(18px, env(safe-area-inset-top)); right: 22px; }
  nav .max-w-7xl { gap: 14px; }
}
@media (max-width: 430px) {
  nav .text-xl { font-size: clamp(.86rem, 4vw, 1rem); }
  nav .flex-col > .text-\[10px\] { font-size: 9px; letter-spacing: .12em; }
  #about .lg\:col-span-8 h3 { overflow-wrap: break-word; }
  #research-impact .impact-compare th,
  #research-impact .impact-compare td { padding-inline: 8px; }
  #Research .research-topic-grid h4 { overflow-wrap: anywhere; }
}
@media (max-height: 620px) and (max-width: 1023px) {
  #mobile-menu { justify-content: flex-start; }
  #mobile-menu .mobile-link { padding-block: 8px; }
}
