/* ==========================================================================
   Ishab Poudel, Ph.D. — site styles
   Design: "Proceedings" (see _brief/DESIGN.md). Plain CSS, no build step.

   Contents
   01. Design tokens (light) + dark theme
   02. Base / reset
   03. Typography
   04. Layout: container, grid, sections, marginalia
   05. Utilities (visually hidden, skip link, icons)
   06. Buttons and links
   07. Site header and navigation
   08. Hero: text, figure plate, credential card
   09. Stats row
   10. Section heads and sub-blocks
   11. Services
   12. Who I work with
   13. Approach
   14. About: bio, timeline, education, chips
   15. Tags
   16. Research: references, funding table, honors
   17. Contact: band, form, status panels, correspondence
   18. Site footer
   19. Secondary pages (publications, thanks, 404)
   20. Motion (opt-in, no-preference only)
   21. Reduced motion safety net
   22. Forced colors
   23. Print
   24. Secondary pages — additions (publications filter, report links,
       thanks / 404 mark), appended last
   ========================================================================== */


/* --------------------------------------------------------------------------
   01. Design tokens
   -------------------------------------------------------------------------- */

/* Metric-adjusted local fallbacks: if Google Fonts is slow or blocked,
   Georgia / Arial are scaled to the Source faces' widths so line breaks
   (and page height) stay close to the web-font layout. */
@font-face { font-family: "Source Serif 4 Fallback"; src: local("Georgia"); font-weight: 400; font-style: normal; size-adjust: 96.8%; }
@font-face { font-family: "Source Serif 4 Fallback"; src: local("Georgia Italic"), local("Georgia-Italic"); font-weight: 400; font-style: italic; size-adjust: 96.8%; }
@font-face { font-family: "Source Serif 4 Fallback"; src: local("Georgia Bold"), local("Georgia-Bold"); font-weight: 600 700; font-style: normal; size-adjust: 84.2%; }
@font-face { font-family: "Source Sans 3 Fallback"; src: local("Arial"), local("ArialMT"); font-weight: 400; font-style: normal; size-adjust: 94%; }
@font-face { font-family: "Source Sans 3 Fallback"; src: local("Arial Italic"), local("Arial-ItalicMT"); font-weight: 400; font-style: italic; size-adjust: 94%; }
@font-face { font-family: "Source Sans 3 Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 600 700; font-style: normal; size-adjust: 89.7%; }

:root {
  color-scheme: light dark;

  /* Color — light (default) */
  --bg: #F8F5EE;              /* eggshell paper */
  --surface: #FFFFFF;
  --surface-2: #EFEAE0;       /* contact band */
  --text: #1A1F1C;            /* ink */
  --text-muted: #555C57;
  --border: #D8D1C3;          /* decorative hairlines only */
  --border-strong: #857F72;   /* UI boundaries */
  --rule: var(--text);
  --primary: #1E4D3A;         /* pine */
  --primary-hover: #163B2C;
  --primary-active: #0F2E22;
  --primary-contrast: #FFFFFF;
  --primary-tint: #E3ECE6;
  --accent: #E0A526;          /* yolk amber: fills and marks only */
  --accent-contrast: #1A1F1C;
  --accent-ink: #8A5300;      /* amber when it must be text */
  --accent-tint: #FBF0D9;
  --focus: #B4540A;
  --error: #A32A1F;
  --error-tint: #FBECE9;
  --success: #1F6B3E;
  --success-tint: #E5F1E9;
  --selection: #F6DE9C;
  --plate: #FFFFFF;
  --rim: var(--primary);
  --motif: #B9C7BE;
  --portrait-placeholder: #DDE5FC;
  --shadow-card: 0 1px 0 rgb(26 31 28 / .04), 0 12px 24px -16px rgb(26 31 28 / .28);

  /* Type families */
  --font-serif: "Source Serif 4", "Source Serif 4 Fallback", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", "Source Sans 3 Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Type scale (fluid) */
  --fs-h1: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);
  --fs-h2: clamp(1.875rem, 1.45rem + 1.6vw, 2.75rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  --fs-h4: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
  --fs-lead: clamp(1.1875rem, 1.07rem + 0.55vw, 1.4375rem);
  --fs-body: clamp(1.0625rem, 1.02rem + 0.15vw, 1.125rem);
  --fs-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --fs-eyebrow: 0.8125rem;
  --fs-label: 0.8125rem;
  --fs-stat: clamp(2.25rem, 1.7rem + 2.2vw, 3.5rem);

  /* Spacing (8px base, 4px half-step) */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;
  --space-11: 6rem;
  --space-12: 8rem;
  --section-y: clamp(4rem, 2.6rem + 5vw, 7.5rem);

  /* Shape */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-egg: 50% 50% 50% 50% / 60% 60% 40% 40%;

  /* Widths */
  --container: 72.5rem;
  --measure: 66ch;
  --measure-lead: 36em;
  --page-pad: clamp(1rem, 4vw, 2.5rem);
  --gutter: clamp(1rem, .6rem + 1.2vw, 1.5rem);
  --header-h: 56px;

  /* Motion */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 900ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-std: cubic-bezier(.4, 0, .2, 1);
}

@media (min-width: 1100px) {
  :root { --header-h: 68px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111513;
    --surface: #181E1B;
    --surface-2: #202824;
    --text: #ECE6DA;
    --text-muted: #A9B0A8;
    --border: #2F3934;
    --border-strong: #75817A;
    --primary: #8FC9A8;
    --primary-hover: #A9D8BD;
    --primary-active: #76B391;
    --primary-contrast: #0D1A13;
    --primary-tint: #1D2E25;
    --accent: #E6B04A;
    --accent-contrast: #1A1406;
    --accent-ink: #E6B04A;
    --accent-tint: #2B2414;
    --focus: #F0B455;
    --error: #F08C7E;
    --error-tint: #2C1916;
    --success: #8DD3A6;
    --success-tint: #16261D;
    --selection: #4A3D14;
    --plate: #181E1B;
    --motif: #3A4A41;
    --shadow-card: none;
  }
}


/* --------------------------------------------------------------------------
   02. Base / reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
}

p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

table {
  border-collapse: collapse;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

::selection {
  background: var(--selection);
  color: var(--text);
}

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

#main:focus {
  outline: none;
}


/* --------------------------------------------------------------------------
   03. Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--fs-h4);
  line-height: 1.3;
  letter-spacing: -0.005em;
}

p,
li,
dd,
td {
  text-wrap: pretty;
}

b,
strong {
  font-weight: 600;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.lead {
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.45;
  max-width: var(--measure-lead);
}

.prose {
  max-width: var(--measure);
}

.eyebrow {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
}

.label {
  margin: 0 0 var(--space-3);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-label);
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mono-label {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}


/* --------------------------------------------------------------------------
   04. Layout
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--page-pad), var(--container));
  margin-inline: auto;
}

/* Generic grid: 4 / 6 / 12 columns */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
}

.grid > * {
  min-width: 0;
}

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* Sections */
.section {
  padding-top: var(--section-y);
}

.section__rule {
  border-top: 2px solid var(--rule);
  padding-top: var(--space-5);
}

/* Anchor jumps land with the section's 2px rule about 16px below the
   header, instead of a full --section-y of empty padding. Beats [id]. */
.section[id] {
  scroll-margin-top: calc(var(--header-h) + var(--space-4) - var(--section-y));
}

/* Marginalia layout: label in columns 1–3, content in 4–12 (≥1100px).
   Below 1100px everything stacks at full width, margin content first. */
.split > * {
  min-width: 0;
}

@media (min-width: 1100px) {
  .split {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .split > * {
    grid-column: 4 / -1;
  }

  .split > .split__margin {
    grid-column: 1 / 4;
  }
}


/* --------------------------------------------------------------------------
   05. Utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--primary);
  color: var(--primary-contrast);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  transform: none;
}

.nowrap {
  white-space: nowrap;
}

.scroll-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.icon {
  display: inline-block;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: middle;
}

.icon--14 { width: 14px; height: 14px; }
.icon--16 { width: 16px; height: 16px; }
.icon--20 { width: 20px; height: 20px; }
.icon--24 { width: 24px; height: 24px; }
.icon--32 { width: 32px; height: 32px; }


/* --------------------------------------------------------------------------
   06. Buttons and links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn--lg {
  min-height: 48px;
  padding: 0 24px;
  font-size: 1rem;
}

.btn--md {
  min-height: 44px;
  padding: 0 18px;
  font-size: 1rem;
}

.btn--sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: .9375rem;
}

/* Touch widths: every target at least 44px tall, as elsewhere on the site */
@media (max-width: 767.98px) {
  .btn--sm { min-height: 44px; }
}

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
}

.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-contrast);
}

.btn--primary:active {
  background: var(--primary-active);
  border-color: var(--primary-active);
  transform: translateY(1px);
}

.btn--secondary {
  background: transparent;
  border-color: var(--text);
  color: var(--text);
}

.btn--secondary:hover {
  background: var(--text);
  color: var(--bg);
}

.btn--secondary:active {
  background: var(--text);
  color: var(--bg);
  transform: translateY(1px);
}

.btn:hover .icon-arrow,
.link-arrow:hover .icon-arrow {
  transform: translateX(3px);
}

.link-arrow:hover .icon-arrow--back {
  transform: translateX(-3px);
}

/* Busy state (form submit) */
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn--primary[aria-disabled="true"]:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* Ghost link */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.link-arrow:hover {
  text-decoration-thickness: 2px;
}


/* --------------------------------------------------------------------------
   07. Site header and navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}

.site-header[data-scrolled] {
  border-bottom-color: var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  min-height: var(--header-h);
}

/* Brand (shared by header and footer) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: var(--primary-contrast);
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: .04em;
}

.brand__name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1rem, .9rem + .4vw, 1.125rem);
  line-height: 1.2;
  white-space: nowrap;
}

.brand:hover .brand__name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

@media (min-width: 600px) {
  .brand__mark {
    width: 36px;
    height: 36px;
  }
}

/* Small header CTA: 600–1099px only */
.site-header__cta {
  display: none;
}

@media (min-width: 600px) {
  .site-header__cta { display: inline-flex; }
}

/* Menu button */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--text);
}

.nav-toggle__close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__open {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__close {
  display: inline-block;
}

/* Navigation links (base = small screens) */
.site-nav__links {
  list-style: none;
}

.site-nav__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.site-nav__link:hover {
  color: var(--primary);
}

.site-nav__link[aria-current] {
  color: var(--primary);
}

.site-nav__cta {
  width: 100%;
  margin-top: var(--space-5);
}

/* No-JS, small screens: links wrap in a row under the brand */
.no-js .nav-toggle {
  display: none;
}

.no-js .site-nav {
  flex-basis: 100%;
  padding-bottom: var(--space-2);
}

.no-js .site-nav__links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
}

.no-js .site-nav__link {
  min-height: 44px;
  font-family: var(--font-sans);
  font-size: 1rem;
  border-bottom: 0;
}

.no-js .site-nav__cta {
  display: none;
}

/* JS, small screens: disclosure panel below the bar */
.js .site-nav__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 8px var(--page-pad) 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
}

.js .site-header.nav-open .site-nav__panel {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.js .site-header.nav-open {
  border-bottom-color: var(--border);
}

/* ≥1100px: full inline navigation */
@media (min-width: 1100px) {
  .site-header__inner {
    flex-wrap: nowrap;
    column-gap: 28px;
  }

  .site-header__cta,
  .nav-toggle,
  .no-js .nav-toggle {
    display: none;
  }

  .site-nav,
  .no-js .site-nav {
    flex-basis: auto;
    padding-bottom: 0;
  }

  .site-nav__panel,
  .js .site-nav__panel {
    position: static;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0;
    background: none;
    border: 0;
    max-height: none;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .site-nav__links,
  .no-js .site-nav__links {
    display: flex;
    gap: 28px;
  }

  .site-nav__link,
  .no-js .site-nav__link {
    display: inline-flex;
    min-height: 44px;
    font-family: var(--font-sans);
    font-size: .9375rem;
    font-weight: 600;
    border-bottom: 0;
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
  }

  .site-nav__link:hover {
    color: var(--text);
    text-decoration-color: currentColor;
  }

  .site-nav__link[aria-current] {
    color: var(--text);
    text-decoration-color: var(--primary);
    text-decoration-thickness: 2px;
  }

  .site-nav__cta,
  .no-js .site-nav__cta {
    display: inline-flex;
    width: auto;
    margin-top: 0;
    min-height: 44px;
    padding: 0 18px;
  }
}

/* 600–1099px: the small header CTA is already visible, so the open panel
   does not repeat it. */
@media (min-width: 600px) and (max-width: 1099.98px) {
  .site-nav__cta { display: none; }
}

/* Phone-only sticky contact bar (index.html). main.js adds .is-visible
   between the hero CTAs and #contact; it never covers the form or footer. */
.mobile-cta { display: none; }

@media (max-width: 599.98px) {
  .js .mobile-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 12px var(--page-pad) calc(12px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
    visibility: hidden;
    opacity: 0;
    transform: translateY(100%);
  }

  .js .mobile-cta.is-visible {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .js .site-header.nav-open ~ .mobile-cta {
    visibility: hidden;
    opacity: 0;
  }

  .mobile-cta__btn {
    width: 100%;
    justify-content: center;
  }

  .js {
    scroll-padding-bottom: 5rem;
  }
}

@media (max-width: 599.98px) and (prefers-reduced-motion: no-preference) {
  .js .mobile-cta {
    transition:
      transform var(--dur-2) var(--ease-out),
      opacity var(--dur-2) var(--ease-out),
      visibility var(--dur-2);
  }
}


/* --------------------------------------------------------------------------
   08. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-top: clamp(2.5rem, 6vw, 6rem);
  overflow-x: clip;
}

.hero__grid {
  display: grid;
  gap: var(--space-8);
}

.hero__grid > * {
  min-width: 0;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: center;
  }

  .hero__text { grid-column: 1 / 8; padding-right: 2rem; }
  .hero__figure { grid-column: 8 / 13; }
}

.eyebrow--hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-5);
}

.eyebrow__mark {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--accent);
}

.hero__title {
  max-width: 16ch;
}

.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--primary);
}

.hero__intro {
  margin-top: var(--space-5);
  color: var(--text);
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: var(--space-6);
}

@media (max-width: 399.98px) {
  .hero__ctas .btn {
    width: 100%;
  }
}

.hero__meta {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.5;
  color: var(--text-muted);
}

/* Figure plate */
.hero__figure {
  position: relative;
  margin: 0;
  max-width: 22rem;
}

@media (min-width: 900px) {
  .hero__figure { max-width: none; }
}

.plate {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--plate);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--motif);
}

.plate__motif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
}

.plate__motif .iso-dot {
  fill: var(--accent);
}

.plate__motif .scalebar {
  stroke: var(--text-muted);
  opacity: .55;
}

/* Phones: the credential card overlaps the plate's lower right, so the
   scale bar would peek out beside the card edge. */
@media (max-width: 599.98px) {
  .plate__motif .scalebar { display: none; }
}

.plate__egg {
  position: absolute;
  left: 16.6667%;
  top: 16.6667%;
  width: 66.6667%;
  height: 66.6667%;
  border-radius: var(--radius-egg);
  overflow: hidden;
  background: var(--portrait-placeholder);
  box-shadow: 0 0 0 1.5px var(--rim);
}

.plate__egg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* Credential card = figcaption */
.cred-card {
  position: relative;
  display: grid;
  gap: 2px;
  width: min(19rem, calc(100% - 2rem));
  margin: -2.5rem 0 0 1rem;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

@media (prefers-color-scheme: dark) {
  .cred-card { border-color: var(--border-strong); border-top-color: var(--primary); }
}

/* 600–899px: the card sits beside the plate, overlapping its right edge,
   so the figure fills the row instead of leaving an empty right half. */
@media (min-width: 600px) and (max-width: 899.98px) {
  .hero__figure {
    display: grid;
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    align-items: end;
    max-width: none;
  }

  .cred-card {
    width: auto;
    max-width: 19rem;
    margin: 0 0 3.5rem -2.5rem;
  }
}

@media (min-width: 900px) {
  .cred-card {
    position: absolute;
    left: -2rem;
    bottom: 3.5rem;
    width: min(17rem, 72%);
    margin: 0;
  }
}

.cred-card__fig {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  color: var(--text-muted);
}

.cred-card__name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--text);
}

.cred-card__creds {
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--text-muted);
}

/* ≥900px the narrow card puts each credential on its own line, so the
   middle dot would dangle at the end of line 1. */
@media (min-width: 900px) {
  .cred-card__creds .nowrap { display: block; }
  .cred-card__sep { display: none; }
}


/* --------------------------------------------------------------------------
   09. Stats row
   -------------------------------------------------------------------------- */
.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--space-8);
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.stats > li {
  min-width: 0;
  padding: var(--space-5) 0 var(--space-5) var(--space-5);
  border-left: 1px solid var(--border);
}

.stats > li:nth-child(odd) {
  padding-left: 0;
  border-left: 0;
}

.stats > li:nth-child(n + 3) {
  border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats > li:nth-child(odd) {
    padding-left: var(--space-5);
    border-left: 1px solid var(--border);
  }

  .stats > li:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .stats > li:nth-child(n + 3) {
    border-top: 0;
  }
}

.stat__num {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-stat);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text);
}

.stat__label {
  display: block;
  max-width: 22ch;
  margin-top: var(--space-2);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-muted);
}

.stats sup,
.stats-notes li::before {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--accent-ink);
}

.stats sup {
  margin-left: 2px;
  font-size: .7em;
  line-height: 0;
  vertical-align: super;
}

.stats-notes {
  list-style: none;
  counter-reset: note;
  display: grid;
  gap: var(--space-1) var(--space-6);
  margin-top: var(--space-3);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-muted);
}

.stats-notes li {
  counter-increment: note;
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
}

.stats-notes li::before {
  content: counter(note);
  font-size: .8em;
  padding-top: .15em;
}

@media (min-width: 900px) {
  .stats-notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* --------------------------------------------------------------------------
   10. Section heads and sub-blocks
   -------------------------------------------------------------------------- */
.section-head {
  margin-bottom: var(--space-8);
}

.section-head h2 {
  max-width: 28ch;
}

.section-head__intro {
  max-width: 60ch;
  margin-top: var(--space-5);
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--text);
}

@media (min-width: 1100px) {
  .section-head > .eyebrow {
    margin-bottom: 0;
    padding-top: .55em;
  }
}

/* Sub-blocks (About, Research): h3 above content, or in the margin ≥1100 */
.subblock {
  margin-top: var(--space-9);
}

.subblock--first {
  margin-top: 0;
}

.subhead {
  margin-bottom: var(--space-5);
  font-size: var(--fs-h3);
}

@media (min-width: 1100px) {
  .subhead {
    margin: 0;
    padding-top: .3em;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--fs-eyebrow);
    line-height: 1.4;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--primary);
  }
}


/* --------------------------------------------------------------------------
   11. Services
   -------------------------------------------------------------------------- */

/* Service index: jump links below 1100, sticky margin list at ≥1100 */
.service-index {
  margin-bottom: var(--space-8);
}

.service-index__list {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 600px) {
  .service-index__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.service-index a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  height: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.service-index a:hover {
  border-color: var(--primary);
}

.service-index__letter {
  flex: none;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  color: var(--text-muted);
}

.service-index__title {
  flex: 1 1 auto;
  min-width: 0;
}

/* Each index link doubles as a compact overview: title + keyword line */
.service-index a { align-items: flex-start; }
.service-index__letter { padding-top: .2em; }
.service-index__arrow { flex: none; margin-top: .2em; }
.service-index__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.service-index__title { flex: none; }
.service-index__keys { font-weight: 400; font-size: var(--fs-small); line-height: 1.4; color: var(--text-muted); }

.service-index__arrow {
  color: var(--primary);
}

.services-layout > * {
  min-width: 0;
}

@media (min-width: 1100px) {
  .services-layout {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .service-index {
    grid-column: 1 / 4;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    align-self: start;
    margin-bottom: 0;
  }

  .services-list {
    grid-column: 4 / -1;
  }

  .service-index__list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .service-index a {
    min-height: 0;
    padding: 8px 0 8px 12px;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    color: var(--text-muted);
    font-weight: 400;
    font-size: var(--fs-small);
  }

  .service-index a:hover {
    color: var(--text);
    border-left-color: var(--text-muted);
  }

  .service-index a[aria-current] {
    color: var(--text);
    border-left: 2px solid var(--primary);
    padding-left: 11px;
  }

  .service-index__arrow {
    display: none;
  }

  .service-index__keys { font-size: var(--fs-eyebrow); }
}

/* Service article */
.service {
  padding-block: var(--space-8);
  border-top: 1px solid var(--border);
}

.service:first-child {
  padding-top: 0;
  border-top: 0;
}

.service:last-child {
  padding-bottom: 0;
}

/* Head: icon beside letter + title; the promise runs full width on phones
   and joins the text column from 600px. .service__heading is a plain
   wrapper, so display: contents lets its children join this grid. */
.service__head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 20px;
  align-items: start;
}

.service__heading {
  display: contents;
}

.service__icon {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.service__letter {
  grid-column: 2;
  grid-row: 1;
}

.service__title {
  grid-column: 2;
  grid-row: 2;
}

.service__promise {
  grid-column: 1 / -1;
  grid-row: 3;
}

@media (min-width: 600px) {
  .service__icon { grid-row: 1 / span 3; }
  .service__promise { grid-column: 2; }
}

.service__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--primary);
}

.service__icon svg {
  stroke-width: 1.25;
}

.service__letter {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  color: var(--text-muted);
}

.service__title {
  margin-top: var(--space-1);
}

.service__title-sub {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  font-size: .8em;
  color: var(--text-muted);
}

.service__promise {
  max-width: 60ch;
  margin-top: var(--space-3);
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.45;
}

/* Note callout (service D) */
.note {
  margin-top: var(--space-5);
  padding: 16px 20px;
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text);
}

.note__label {
  margin-bottom: var(--space-1);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* Service body */
.service__body {
  display: grid;
  row-gap: var(--space-6);
  margin-top: var(--space-6);
}

.service__body > * {
  min-width: 0;
}

.service__who p {
  max-width: var(--measure);
}

@media (min-width: 900px) {
  .service__body {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "who receive"
      "included receive"
      "foot foot";
    column-gap: var(--space-8);
  }

  .service__who { grid-area: who; }
  .service__included { grid-area: included; }
  .service__receive { grid-area: receive; align-self: start; }
  .service__foot { grid-area: foot; }
}

@media (min-width: 1100px) {
  .service__body {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  }
}

/* Square-marker list */
.list-square {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

.list-square li {
  position: relative;
  padding-left: 18px;
}

.list-square li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .6em;
  width: 6px;
  height: 6px;
  background: var(--primary);
}

.service__included .list-square { max-width: var(--measure); }

/* Deliverables box */
.deliverables-box {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-md);
}

@media (max-width: 899.98px) {
  .deliverables-box { max-width: var(--measure); }
}

.deliverables {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

.deliverables li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.deliverables .icon {
  margin-top: .2em;
  color: var(--primary);
}

/* Foot row: Grounded in + CTA */
.service__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.service__grounded p {
  max-width: 72ch;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--text);
}

.service__foot .btn {
  flex: none;
}

@media (min-width: 900px) {
  .service__foot {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
  }
}


/* --------------------------------------------------------------------------
   12. Who I work with
   -------------------------------------------------------------------------- */
.audience {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.audience__item {
  min-width: 0;
  padding: 20px;
  background: var(--bg);
}

.audience__item .icon {
  color: var(--primary);
}

.audience__title {
  margin-top: var(--space-2);
  font-size: var(--fs-h4);
  line-height: 1.3;
}

.audience__item p {
  margin-top: var(--space-1);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-muted);
}

@media (min-width: 600px) {
  .audience { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audience__item { padding: 24px; }
}

@media (min-width: 900px) {
  .audience { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* --------------------------------------------------------------------------
   13. Approach
   -------------------------------------------------------------------------- */
.steps {
  list-style: none;
  display: grid;
  gap: 0;
}

/* Below 600px: vertical list on a left rule */
.step {
  position: relative;
  min-width: 0;
  padding: 0 0 var(--space-6) 24px;
  border-left: 1px solid var(--border-strong);
}

.step:last-child {
  padding-bottom: 0;
}

.step::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: .9rem;
  width: 8px;
  height: 8px;
  background: var(--primary);
}

.step__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.step__num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text);
}

.step__top .icon {
  color: var(--text-muted);
}

.step__title {
  margin-top: var(--space-3);
  font-size: var(--fs-h4);
  line-height: 1.3;
}

.step p {
  margin-top: var(--space-2);
}

@media (min-width: 600px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-7) var(--gutter);
  }

  .step {
    padding: 20px 0 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .step::before {
    left: 0;
    top: -4.5px;
  }
}

@media (min-width: 1100px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Engagement strip */
.engagement {
  margin-top: var(--space-8);
}

@media (min-width: 1100px) {
  .engagement > .mono-label {
    margin: 0;
    padding-top: 18px;
  }
}

.spec-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-block: 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.spec-strip li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.4;
}

.spec-strip .icon {
  color: var(--primary);
}

/* Closing CTA row */
.closing-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: var(--space-7);
}

.closing-cta__text {
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.45;
}


/* --------------------------------------------------------------------------
   14. About
   -------------------------------------------------------------------------- */
.bio {
  max-width: 64ch;
}

.bio p + p {
  margin-top: var(--space-4);
}

.bio p:first-child {
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.45;
}

@media (min-width: 1100px) {
  .split > .bio { grid-column: 4 / 11; }
}

/* Experience timeline */
.timeline {
  list-style: none;
  position: relative;
  display: grid;
  gap: var(--space-6);
}

.timeline::before {
  content: "";
  position: absolute;
  top: .5rem;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: var(--border-strong);
}

.timeline__item {
  position: relative;
  min-width: 0;
  padding-left: 28px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4.6px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 1.5px solid var(--primary);
}

.timeline__item--current::before {
  background: var(--primary);
}

.timeline__date {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text-muted);
}

.timeline__body {
  min-width: 0;
}

.timeline__role {
  margin-top: var(--space-1);
  font-size: var(--fs-h4);
  line-height: 1.3;
}

.timeline__role .tag {
  margin-left: 6px;
  vertical-align: 2px;
}

.timeline__org {
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.timeline__desc {
  max-width: 66ch;
  margin-top: var(--space-2);
}

@media (min-width: 900px) {
  .timeline::before {
    left: calc(11rem - .5px);
  }

  .timeline__item {
    display: grid;
    grid-template-columns: 10rem 2rem minmax(0, 1fr);
    padding-left: 0;
  }

  .timeline__item::before {
    left: calc(11rem - 4.5px);
    top: 8.5px;
  }

  .timeline__date {
    grid-column: 1;
    padding-top: 5px;
  }

  .timeline__body {
    grid-column: 3;
  }

  .timeline__role {
    margin-top: 0;
  }
}

/* Education */
.education {
  list-style: none;
  display: grid;
  gap: var(--space-6);
}

.edu {
  min-width: 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.edu__degree {
  font-size: var(--fs-h4);
}

.edu__full {
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.edu__inst {
  margin-top: var(--space-1);
}

.edu__year {
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text-muted);
}

.edu__label {
  margin-top: var(--space-3);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.edu__title {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-small);
  line-height: 1.5;
}

/* Three across, with subgrid rows so the year, label and title line up
   between cards. Degree, full name and institution share one head row so a
   card without a full-name line doesn't get a gap inside its heading block.
   Browsers without subgrid fall back harmlessly. */
@media (min-width: 900px) {
  .education { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, auto); column-gap: var(--gutter); row-gap: 0; }
  .edu { display: grid; grid-row: span 4; grid-template-rows: subgrid; align-content: start; }
  .edu__head { grid-row: 1; } .edu__year { grid-row: 2; } .edu__label { grid-row: 3; } .edu__title { grid-row: 4; }
}

/* Expertise & tools chips */
.chip-groups {
  display: grid;
  gap: var(--space-6);
}

.chip-group {
  min-width: 0;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  line-height: 1.3;
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  .chip { border-color: var(--border-strong); }
}

@media (min-width: 600px) {
  .chip-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); }
}

@media (min-width: 1100px) {
  .chip-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* --------------------------------------------------------------------------
   15. Tags
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

.tag--first {
  color: var(--primary);
  background: var(--primary-tint);
}

.tag--press {
  color: var(--accent-ink);
  background: var(--accent-tint);
}

.tag--pi {
  color: var(--primary-contrast);
  background: var(--primary);
}

.tag--outline {
  color: var(--text);
  background: transparent;
  border-color: var(--border-strong);
}


/* --------------------------------------------------------------------------
   16. Research
   -------------------------------------------------------------------------- */

/* Reference list */
.refs {
  list-style: none;
}

.ref {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  padding-block: 20px;
  border-top: 1px solid var(--border);
}

.ref:first-child {
  padding-top: 0;
  border-top: 0;
}

.ref__num {
  padding-top: .3em;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ref__body {
  min-width: 0;
}

.ref__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-h4);
  line-height: 1.3;
  text-wrap: pretty;
}

.ref__authors {
  margin-top: 6px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-muted);
}

.ref__authors b {
  font-weight: 600;
  color: var(--text);
}

/* Keep "Poudel, I." / "I. Poudel" on one line */
.ref__authors b,
.ref__authors strong {
  white-space: nowrap;
}

.ref__source {
  margin-top: 4px;
  font-size: var(--fs-small);
  line-height: 1.7;
}

.ref__source .tag {
  margin-left: 4px;
}

.ref__year {
  font-variant-numeric: lining-nums tabular-nums;
}

.ref__doi-line {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-small);
  line-height: 1.5;
}

/* 12px of invisible padding makes a 44px-class tap target without
   changing the line height (the negative margin cancels it). */
.ref__doi {
  display: inline-block;
  padding-block: 12px;
  margin-block: -12px;
  overflow-wrap: anywhere;
}

.ref__doi .icon {
  margin-left: 6px;
  vertical-align: -1px;
}

.pubs-more {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-4);
}

@media (min-width: 1100px) {
  .subblock--pubs {
    grid-template-rows: auto 1fr;
  }

  .subblock--pubs > .subhead {
    grid-row: 1;
  }

  .subblock--pubs > .refs {
    grid-row: 1 / 3;
  }

  .subblock--pubs > .pubs-more {
    grid-column: 1 / 4;
    grid-row: 2;
    align-self: start;
    margin-top: var(--space-3);
  }
}

/* Funded research table */
.funding {
  width: 100%;
  font-size: var(--fs-body);
  line-height: 1.5;
}

.funding th {
  padding: 0 16px 12px 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-label);
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-muted);
  border-bottom: 1px solid var(--rule);
}

.funding td {
  padding: 16px 16px 16px 0;
  vertical-align: top;
  border-top: 1px solid var(--border);
}

.funding tbody tr:first-child td {
  border-top: 0;
}

.funding .funding__role {
  width: 5rem;
}

.funding .funding__year {
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text-muted);
}

.funding .funding__amount {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
}

.funding td.funding__amount {
  font-family: var(--font-serif);
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}

.funding__funder {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

@media (max-width: 599.98px) {
  .funding thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .funding,
  .funding tbody {
    display: block;
  }

  .funding tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "role amount"
      "award award"
      "year year";
    gap: 6px 12px;
    padding-block: 16px;
    border-top: 1px solid var(--border);
  }

  .funding tbody tr:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .funding td {
    display: block;
    padding: 0;
    border: 0;
  }

  .funding td.funding__role { grid-area: role; width: auto; }
  .funding td.funding__amount { grid-area: amount; }
  .funding td.funding__award { grid-area: award; }
  .funding td.funding__year { grid-area: year; font-family: var(--font-mono); font-size: var(--fs-eyebrow); }

  /* No year: a lone "—" line under the award reads as a stray rule */
  .funding td.funding__year--none { display: none; }
}

/* Honors ledger */
.ledger {
  list-style: none;
  border-bottom: 1px solid var(--border);
}

.ledger li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  padding-block: 12px;
  border-top: 1px solid var(--border);
}

.ledger li:first-child {
  border-top: 0;
  padding-top: 0;
}

.ledger__year {
  padding-top: .2em;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-small);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text-muted);
}

.training__label {
  margin-top: var(--space-6);
}

.inline-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  row-gap: 4px;
  font-size: var(--fs-small);
  line-height: 1.6;
}

.inline-list li:not(:last-child)::after {
  content: "\00B7";
  margin-inline: 8px;
  color: var(--text-muted);
}

/* Phones: one item per line, without trailing separators */
@media (max-width: 599.98px) {
  .inline-list { display: grid; }
  .inline-list li:not(:last-child)::after { content: none; }
}

/* Peer review + teaching */
.duo {
  display: grid;
  margin-top: var(--space-9);
}

.duo > .subblock {
  margin-top: 0;
}

.duo > .subblock + .subblock {
  margin-top: var(--space-8);
}

@media (min-width: 900px) and (max-width: 1099.98px) {
  .duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-8);
  }

  .duo > .subblock + .subblock {
    margin-top: 0;
  }
}


/* --------------------------------------------------------------------------
   17. Contact
   -------------------------------------------------------------------------- */
.section--band {
  margin-top: var(--section-y);
  padding-block: var(--section-y);
  background: var(--surface-2);
}

.contact__shortcut {
  margin-top: var(--space-4);
  font-size: var(--fs-small);
}

.contact__shortcut a {
  overflow-wrap: anywhere;
}

@media (min-width: 900px) {
  .contact__shortcut { display: none; }
}

.contact__grid {
  display: grid;
  gap: var(--space-8);
}

.contact__grid > * {
  min-width: 0;
}

@media (min-width: 900px) {
  .contact__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .contact__form-wrap { grid-column: 1 / 8; }
  .correspondence { grid-column: 8 / 13; align-self: start; }
}

@media (min-width: 1100px) {
  .contact__form-wrap { grid-column: 4 / 10; }
  .correspondence { grid-column: 10 / 13; }
}

/* Form */
.form-note {
  margin-bottom: var(--space-5);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  gap: 24px;
}

.form-grid > * {
  min-width: 0;
}

@media (min-width: 600px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .field--full {
    grid-column: 1 / -1;
  }
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
}

.req {
  margin-left: 2px;
  color: var(--error);
}

.control {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.4;
}

.control::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.control:hover {
  border-color: var(--text-muted);
}

textarea.control {
  min-height: 10rem;
  resize: vertical;
}

.control[aria-invalid="true"] {
  border: 2px solid var(--error);
  padding: 11px 13px;
}

.select {
  position: relative;
  color: var(--text-muted);
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  cursor: pointer;
}

.select select[aria-invalid="true"] {
  padding-right: 43px;
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-75%) rotate(45deg);
  pointer-events: none;
}

.field__help {
  margin-top: 8px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-muted);
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--error);
}

.field__error .icon {
  margin-top: .15em;
}

/* Error status (above the submit button). Empty = no box. */
.form-status:not(:empty) {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--error-tint);
  border-left: 3px solid var(--error);
  border-radius: var(--radius-md);
  color: var(--text);
}

.form-status .icon {
  margin-top: .15em;
  color: var(--error);
}

.form-status a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.form-next {
  margin-top: var(--space-5);
  font-size: var(--fs-small);
  color: var(--text-muted);
  max-width: var(--measure);
}

.form-actions {
  margin-top: 24px;
}

.form-actions .btn {
  width: 100%;
}

@media (min-width: 600px) {
  .form-actions .btn { width: auto; }
}

.form-privacy {
  margin-top: 12px;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* Success panel (replaces the form) */
.form-success {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 20px 24px;
  background: var(--success-tint);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-md);
  color: var(--text);
}

.form-success .icon {
  margin-top: .15em;
  color: var(--success);
}

.form-success__title {
  font-size: var(--fs-h4);
  line-height: 1.3;
}

.form-success p {
  margin-top: var(--space-1);
}

/* Correspondence aside */
.correspondence {
  padding-top: 16px;
  border-top: 2px solid var(--rule);
}

.correspondence__row {
  padding-block: 16px;
  border-top: 1px solid var(--border);
}

.correspondence__row:first-child {
  padding-top: 0;
  border-top: 0;
}

.correspondence dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.correspondence dt .icon {
  color: var(--primary);
}

.correspondence dd {
  margin-top: 8px;
}

.correspondence__email {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.correspondence__line {
  display: block;
}


/* --------------------------------------------------------------------------
   18. Site footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 64px 0 32px;
  background: var(--bg);
  border-top: 4px double var(--rule);
}

.site-footer__grid {
  display: grid;
  gap: 32px;
}

.site-footer__grid > * {
  min-width: 0;
}

@media (min-width: 900px) {
  .site-footer__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .site-footer__brand { grid-column: span 5; }
  .site-footer__nav { grid-column: span 3; }
  .site-footer__contact { grid-column: span 4; }
}

.site-footer .brand {
  margin-right: 0;
}

.site-footer__tagline {
  max-width: 44ch;
  margin-top: var(--space-3);
  color: var(--text-muted);
}

.site-footer__nav ul {
  list-style: none;
}

.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-small);
  color: var(--text);
  text-decoration: none;
}

.site-footer__nav a:hover,
.site-footer__nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.site-footer__profiles a,
.correspondence__line a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.site-footer__contact p + p {
  margin-top: var(--space-1);
}

.site-footer__email {
  overflow-wrap: anywhere;
}

/* Stand-alone email links get the same 44px target as other links */
.site-footer__email,
.correspondence__email {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-footer__fine {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--text-muted);
}

.site-footer__fine p {
  max-width: 80ch;
}

.site-footer__fine p + p {
  margin-top: var(--space-2);
}

.site-footer__top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}


/* --------------------------------------------------------------------------
   19. Secondary pages (publications, thanks, 404)
   -------------------------------------------------------------------------- */
.page-head {
  padding-top: clamp(2.5rem, 6vw, 6rem);
}

.page-head h1 {
  max-width: 18ch;
}

.page-head .lead {
  margin-top: var(--space-5);
}

/* Summary bar: the stats row with whole-cell links */
.stats--links > li {
  position: relative;
}

.stats--links a {
  color: inherit;
  text-decoration: none;
}

.stats--links a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.stats--links a:hover .stat__label {
  text-decoration: underline;
  text-underline-offset: .2em;
}

.stats--links a:focus-visible {
  outline: none;
}

.stats--links a:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.page-note {
  margin-top: var(--space-3);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* Simple branded pages */
.simple-page {
  padding-block: var(--section-y);
}

.simple-page__grid {
  display: grid;
  gap: var(--space-8);
}

.simple-page__grid > * {
  min-width: 0;
}

.simple-page__text h1 {
  max-width: 16ch;
}

.simple-page__text p:not(.eyebrow) {
  max-width: var(--measure);
  margin-top: var(--space-5);
}

.simple-page__art {
  display: none;
  width: 160px;
  color: var(--motif);
}

@media (min-width: 900px) {
  .simple-page__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .simple-page__text { grid-column: 1 / 8; }
  .simple-page__art { display: block; grid-column: 9 / 13; align-self: start; }
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: var(--space-6);
}


/* --------------------------------------------------------------------------
   20. Motion (only when the visitor has no reduced-motion preference)
   -------------------------------------------------------------------------- */
@keyframes iso-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .btn,
  .nav-toggle,
  .control,
  .service-index a {
    transition:
      color var(--dur-1) var(--ease-std),
      background-color var(--dur-1) var(--ease-std),
      border-color var(--dur-1) var(--ease-std),
      text-decoration-color var(--dur-2) var(--ease-std),
      transform 60ms var(--ease-std);
  }

  .icon-arrow {
    transition: transform var(--dur-1) var(--ease-std);
  }

  .site-header {
    transition: border-color var(--dur-2) var(--ease-std);
  }

  .js .site-nav__panel {
    transition:
      opacity var(--dur-2) var(--ease-out),
      transform var(--dur-2) var(--ease-out),
      visibility 0s linear var(--dur-2);
  }

  .js .site-header.nav-open .site-nav__panel {
    transition:
      opacity var(--dur-2) var(--ease-out),
      transform var(--dur-2) var(--ease-out),
      visibility 0s linear 0s;
  }

  /* Hero isolines draw once per load; default CSS shows them fully drawn */
  .plate__motif .iso-1,
  .plate__motif .iso-2 {
    stroke-dasharray: 1 1;
    animation: iso-draw var(--dur-3) var(--ease-out) both;
  }

  .plate__motif .iso-1 { animation-delay: 200ms; }
  .plate__motif .iso-2 { animation-delay: 350ms; }

  .plate__motif .iso-3 {
    animation: fade-in 600ms var(--ease-std) 500ms both;
  }

  .plate__motif .iso-dot {
    animation: fade-in 300ms var(--ease-std) 1100ms both;
  }

  .form-status:not(:empty),
  .form-success {
    animation: fade-in var(--dur-2) var(--ease-std);
  }
}


/* --------------------------------------------------------------------------
   21. Reduced motion safety net
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* --------------------------------------------------------------------------
   22. Forced colors (Windows high contrast)
   -------------------------------------------------------------------------- */
@media (forced-colors: active) {
  .plate {
    border-color: CanvasText;
  }

  .plate__egg {
    outline: 1px solid CanvasText;
  }

  .brand__mark,
  .tag,
  .chip {
    border: 1px solid CanvasText;
  }

  .list-square li::before,
  .step::before,
  .eyebrow__mark,
  .timeline__item--current::before {
    background: CanvasText;
  }

  .btn {
    border: 1px solid ButtonText;
  }

  :focus-visible {
    outline: 3px solid Highlight;
  }
}


/* --------------------------------------------------------------------------
   23. Print
   -------------------------------------------------------------------------- */
@media print {
  :root {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #FFFFFF;
    --text: #000000;
    --text-muted: #333333;
    --border: #BBBBBB;
    --border-strong: #666666;
    --primary: #1E4D3A;
    --primary-contrast: #FFFFFF;
    --primary-tint: #FFFFFF;
    --accent-tint: #FFFFFF;
    --plate: #FFFFFF;
    --shadow-card: none;
  }

  html,
  body,
  .section--band,
  .site-footer {
    background: #FFFFFF !important;
    color: #000000;
  }

  .site-header {
    position: static;
    border: 0;
  }

  .skip-link,
  .nav-toggle,
  .site-nav,
  .site-header__cta,
  .hero__ctas,
  .closing-cta,
  .service__foot .btn,
  .service-index,
  .plate__motif,
  .contact__form-wrap,
  .contact__shortcut,
  .site-footer__nav,
  .site-footer__top,
  .mobile-cta {
    display: none !important;
  }

  .section {
    padding-top: 2rem;
  }

  .section--band {
    margin-top: 0;
    padding-block: 2rem;
  }

  .hero__figure {
    max-width: 12rem;
  }

  .cred-card {
    position: static;
    width: auto;
    margin: .5rem 0 0;
  }

  .service,
  .ref,
  .timeline__item,
  .edu,
  .audience__item,
  .step,
  .correspondence__row {
    break-inside: avoid;
  }

  h2,
  h3,
  h4 {
    break-after: avoid;
  }

  a {
    color: #000000;
  }
}


/* ==========================================================================
   24. Secondary pages — additions (publications, thanks, 404)
   Appended after the core sheet so nothing above is restructured. Builds on
   section 19 (.page-head, .stats--links, .page-note, .simple-page,
   .link-row) and section 16 (.refs, .ref, .funding).
   ========================================================================== */

/* Publications: my name in author lists is <strong> on this page */
.ref__authors strong {
  font-weight: 600;
  color: var(--text);
}

/* Groups sit a little closer together than the home page sections */
.pubs-group {
  --group-y: clamp(3rem, 2.2rem + 3vw, 5rem);
  padding-top: var(--group-y);
}

/* Same anchor landing as .section[id], for this page's shorter padding */
.pubs-group[id] {
  scroll-margin-top: calc(var(--header-h) + var(--space-4) - var(--group-y));
}

.pubs-group .section-head {
  margin-bottom: var(--space-7);
}

.group-sub {
  max-width: 60ch;
  margin-top: var(--space-3);
  color: var(--text-muted);
}

/* Technical report links: "View report (PDF)" ghost link */
.ref__link-line {
  margin-top: 2px;
}

.ref__report .icon {
  color: var(--primary);
}

/* When the filter hides the first item, the first match takes its place */
.refs > .ref.is-first-match {
  padding-top: 0;
  border-top: 0;
}

.funding tbody tr.is-first-match td {
  border-top: 0;
}

@media (max-width: 599.98px) {
  .funding tbody tr.is-first-match {
    padding-top: 0;
    border-top: 0;
  }
}

/* Search filter. It carries the [hidden] attribute in the markup and
   main.js reveals it, so without JS it never shows. */
.pub-filter {
  max-width: 40rem;
  margin-top: var(--space-7);
}

.pub-filter__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
}

.pub-filter__row {
  display: flex;
  gap: 12px;
}

.pub-filter__row .control {
  flex: 1 1 auto;
  min-width: 0;
}

.pub-filter__row .btn {
  flex: none;
  min-height: 48px;
}

/* One clear control only: the visible "Clear" button */
.pub-filter__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.pub-filter__status {
  min-height: 1.5em;
  margin-top: 8px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-muted);
}

.filter-empty {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

/* Closing back link */
.page-end {
  padding-top: var(--space-8);
  padding-bottom: var(--section-y);
}

/* Back arrows nudge left on hover (buttons too, not only ghost links) */
.btn:hover .icon-arrow--back {
  transform: translateX(-3px);
}

/* Thanks / 404: keep the footer from riding up on tall screens */
.simple-page {
  min-height: 62vh;
}

/* Thanks / 404: the egg-isoline mark */
.simple-page__art svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.simple-page__dot {
  fill: var(--accent);
}

@media (min-width: 900px) {
  .simple-page__art {
    justify-self: end;
  }
}

@media print {
  .pub-filter,
  .page-end,
  .link-row,
  .simple-page__art,
  .mobile-cta {
    display: none !important;
  }

  .stats--links a::after {
    content: none;
  }

  /* Printed copies keep the report addresses */
  .ref__report::after {
    content: " " attr(href);
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: .8125rem;
    overflow-wrap: anywhere;
  }

  .ref__report .icon {
    display: none;
  }
}
