/* =========================================================
   Maryam Kameli: personal site
   Everything you might want to change lives in :root below.
   ========================================================= */

:root {
  /* ---- colors (light) ---- */
  --paper:      #fcfbf9;
  --paper-alt:  #f5f2ec;
  --ink:        #16181d;
  --ink-2:      #3f434b;
  --muted:      #666b73;   /* 4.8:1 on --paper-alt, passes WCAG AA */
  --line:       #e4e0d8;
  --accent:     #4239b8;
  --accent-soft:#ecebfa;
  --stage:      #1b1d22;   /* backdrop behind videos, same in both themes */

  /* ---- type ---- */
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;

  /* ---- layout ---- */
  --wrap: 1080px;
  --narrow: 720px;
  --pad: 24px;
  --radius: 10px;

  color-scheme: light;
}

/* dark, following the visitor's system setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0f1116;
    --paper-alt:  #151821;
    --ink:        #e9eaef;
    --ink-2:      #bcc1cb;
    --muted:      #878d98;
    --line:       #242833;
    --accent:     #a5abff;
    --accent-soft:#1c1f33;
    color-scheme: dark;
  }
}
/* dark, when the visitor clicks the toggle */
:root[data-theme="dark"] {
  --paper:      #0f1116;
  --paper-alt:  #151821;
  --ink:        #e9eaef;
  --ink-2:      #bcc1cb;
  --muted:      #878d98;
  --line:       #242833;
  --accent:     #a5abff;
  --accent-soft:#1c1f33;
  color-scheme: dark;
}

/* ---------------------------------------------------------
   base
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
video { display: block; }
sub, sup { line-height: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

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

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 6px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

/* ---------------------------------------------------------
   nav
   --------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad);
  height: 62px; display: flex; align-items: center; gap: 20px;
}

.nav-name {
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 600; letter-spacing: .1px;
  color: var(--ink); white-space: nowrap;
}
.nav-name:hover { text-decoration: none; color: var(--accent); }

.nav-links { margin-left: auto; display: flex; gap: 22px; }
.nav-links a {
  font-size: .885rem; font-weight: 500; color: var(--ink-2);
  padding: 4px 0; position: relative;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--ink-2); cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--paper-alt); color: var(--ink); }
.icon-btn svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.menu-btn { display: none; }

/* theme icon swap */
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------------------------------------------------------
   hero and bio
   --------------------------------------------------------- */
.hero { padding: 60px 0 64px; }

.hero-grid {
  display: grid; grid-template-columns: 190px 1fr;
  gap: 44px; align-items: start;
}

.portrait img {
  width: 190px; height: 190px; border-radius: 14px;
  object-fit: cover; border: 1px solid var(--line);
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.3rem);
  font-weight: 500; line-height: 1.08;
  letter-spacing: -.5px; margin: 0 0 10px;
}
.hero-role {
  font-size: 1.06rem; font-weight: 500; color: var(--ink-2);
  margin: 0 0 6px;
}
.hero-aff { color: var(--muted); font-size: .95rem; margin: 0 0 22px; }
.hero-aff a { color: var(--ink-2); }
.hero-aff a:hover { color: var(--accent); }

.links { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.links a {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .875rem; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; background: var(--paper);
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.links a:hover {
  text-decoration: none; color: var(--accent);
  border-color: var(--accent); background: var(--accent-soft);
}
.links svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* avoid one-word last lines where the browser supports it */
.prose p, .pub-summary, .row-body p, .news-body, .feature-text p, .proj-text p, figcaption { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }

.prose { max-width: var(--narrow); }
.hero .prose { margin-top: 34px; }
.prose p { margin: 0 0 16px; color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }
.prose .lead {
  font-family: var(--font-display);
  font-size: 1.28rem; line-height: 1.5; color: var(--ink);
  margin-bottom: 18px;
}
.prose .status {
  margin-top: 22px; padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent);
  color: var(--ink); font-weight: 500;
}

/* ---------------------------------------------------------
   sections
   --------------------------------------------------------- */
.section { padding: 62px 0; }
.section.alt { background: var(--paper-alt); }

.h-section {
  font-family: var(--font-display);
  font-size: 1.62rem; font-weight: 500; letter-spacing: -.2px;
  margin: 0 0 30px; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* small group label inside a section, e.g. "Also in progress" */
.h-sub {
  font-family: var(--font-body);
  font-size: .78rem; font-weight: 600; letter-spacing: .9px;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 4px;
}
.rows + .h-sub, .h-sub-gap { margin-top: 44px; }

/* ---------------------------------------------------------
   featured research
   --------------------------------------------------------- */
.feature { padding: 4px 0 48px; }
.feature + .feature { border-top: 1px solid var(--line); padding-top: 44px; }

.eyebrow {
  font-size: .76rem; font-weight: 600; letter-spacing: .7px;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 8px;
}
.feature-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 1.95rem);
  font-weight: 500; line-height: 1.18; letter-spacing: -.3px;
  margin: 0 0 20px; color: var(--ink);
}

.feature-grid {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 44px; margin-top: 28px; align-items: start;
}
.feature-text p { margin: 0 0 14px; color: var(--ink-2); font-size: .97rem; }
.feature-text p:last-child { margin-bottom: 0; }

.facts { margin: 0; display: grid; gap: 14px; font-size: .9rem; }
.facts > div { border-top: 1px solid var(--line); padding-top: 10px; }
.facts dt {
  font-size: .72rem; font-weight: 600; letter-spacing: .7px;
  text-transform: uppercase; color: var(--muted); margin: 0 0 3px;
}
.facts dd { margin: 0; color: var(--ink-2); line-height: 1.55; }

.link-row { display: flex; flex-wrap: wrap; gap: 6px 8px; padding-top: 2px; }
.link-row a,
.proj-links a,
.proj-links button {
  font: inherit; font-size: .82rem; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 11px;
  background: var(--paper); cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.link-row a:hover,
.proj-links a:hover,
.proj-links button:hover,
.proj-links button[aria-expanded="true"] {
  text-decoration: none; color: var(--accent);
  border-color: var(--accent); background: var(--accent-soft);
}

/* ---------------------------------------------------------
   comparison video (drag the handle)
   --------------------------------------------------------- */
.wipe { margin: 0; }
.wipe-stage {
  --pos: 50%;
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 12px; background: var(--stage);
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  cursor: ew-resize; isolation: isolate;
  box-shadow: 0 0 0 1px var(--line);
}
/* The file is two 16:9 frames stacked (8:9 overall). Showing it at
   double height leaves only the top frame, full color, in view. */
.wipe-stage video {
  position: absolute; top: 0; left: 0; width: 100%; height: 200%;
}
.wipe-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.wipe-line {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
  pointer-events: none;
}
.wipe-knob {
  position: absolute; top: 50%; left: var(--pos);
  width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%; background: #fff; color: #23252b;
  display: grid; place-items: center; cursor: ew-resize;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.wipe-knob svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.wipe-knob:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 50%; }
.wipe-label {
  position: absolute; top: 12px; z-index: 1;
  font-size: .72rem; font-weight: 600; letter-spacing: .4px;
  padding: 4px 9px; border-radius: 6px; pointer-events: none;
}
.wipe-label-l { left: 12px; color: #fff; background: rgba(15, 17, 22, .62); }
.wipe-label-r { right: 12px; color: #16181d; background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }

/* play / pause button shared by all looping videos */
.vid-toggle {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgba(15, 17, 22, .62);
  transition: background .18s ease;
}
.vid-toggle:hover { background: rgba(15, 17, 22, .85); }
.vid-toggle svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.vid-toggle .i-play { fill: currentColor; stroke-width: 1.4; display: none; }
.vid-toggle.is-paused .i-play { display: block; }
.vid-toggle.is-paused .i-pause { display: none; }

.wipe figcaption,
.ladder-fig figcaption,
.fig figcaption,
.clip figcaption {
  margin-top: 10px; font-size: .8rem; line-height: 1.5; color: var(--muted);
}

/* ---------------------------------------------------------
   realism ladder (four renderings of one person)
   --------------------------------------------------------- */
.ladder-fig { margin: 0; }
.ladder {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
}
.ladder img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.ladder p { margin: 9px 0 0; font-size: .82rem; line-height: 1.35; color: var(--muted); }
.ladder b { display: block; font-size: .9rem; font-weight: 600; color: var(--ink); }

.ladder-axis {
  position: relative; display: flex; justify-content: space-between;
  margin-top: 14px; padding-top: 9px;
  font-size: .72rem; font-weight: 600; letter-spacing: .6px;
  text-transform: uppercase; color: var(--muted);
}
.ladder-axis::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ink-2), color-mix(in srgb, var(--accent) 70%, transparent));
}

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

.news-item {
  display: grid; grid-template-columns: 92px 1fr;
  gap: 22px; padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.news-item:last-child { border-bottom: none; }
.news-item[hidden] { display: none; }

.news-date {
  font-size: .8rem; font-weight: 600; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted);
  padding-top: 4px; white-space: nowrap;
}
.news-body { color: var(--ink-2); font-size: .96rem; }
.news-body strong { color: var(--ink); font-weight: 600; }
.news-body em { font-style: italic; }

.more-btn {
  margin-top: 22px; font: inherit; font-size: .875rem; font-weight: 500;
  color: var(--accent); background: none;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.more-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------
   publications
   --------------------------------------------------------- */
.pubs { list-style: none; padding: 0; margin: 0; }

.pub {
  display: grid; grid-template-columns: 92px 1fr;
  gap: 22px; padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.pub:first-child { padding-top: 4px; }
.pub:last-child { border-bottom: none; }

.pub-year {
  font-size: .8rem; font-weight: 600; letter-spacing: .4px;
  color: var(--muted); padding-top: 5px;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 600; line-height: 1.35;
  margin: 0 0 7px; color: var(--ink);
}
.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--accent); }
.pub-authors { margin: 0 0 4px; font-size: .93rem; color: var(--ink-2); }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-venue { margin: 0 0 10px; font-size: .93rem; font-style: italic; color: var(--muted); }
.pub-summary { margin: 0 0 12px; font-size: .93rem; color: var(--ink-2); }

.badge {
  display: inline-block; margin-left: 7px; vertical-align: 1px;
  font-family: var(--font-body); font-style: normal;
  font-size: .705rem; font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 5px; padding: 3px 8px;
}

.pub-links { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pub-links a,
.pub-links .bib-btn {
  font: inherit; font-size: .8rem; font-weight: 500; color: var(--ink-2);
  background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 11px;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.pub-links a:hover,
.pub-links .bib-btn:hover,
.pub-links .bib-btn[aria-expanded="true"] {
  text-decoration: none; color: var(--accent);
  border-color: var(--accent); background: var(--accent-soft);
}

.bib {
  position: relative; margin: 12px 0 0;
  background: var(--paper-alt); border: 1px solid var(--line); border-radius: 8px;
}
.section.alt .bib { background: var(--paper); }
.bib[hidden] { display: none; }
.bib pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem; line-height: 1.55; color: var(--ink-2);
}
.bib-copy {
  position: absolute; top: 8px; right: 8px;
  font: inherit; font-size: .74rem; font-weight: 500; color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 9px; cursor: pointer;
}
.bib-copy:hover { color: var(--accent); border-color: var(--accent); }
.pub-note { margin: 28px 0 0; font-size: .74rem; line-height: 1.5; color: var(--muted); }

/* ---------------------------------------------------------
   rows (research, engineering, teaching)
   --------------------------------------------------------- */
.rows { display: flex; flex-direction: column; }

.row {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 32px; padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }

.row-title h3,
.row-title h4 {
  font-family: var(--font-display);
  font-size: 1.06rem; font-weight: 600; line-height: 1.35;
  margin: 0 0 5px; color: var(--ink);
}
.row-meta {
  margin: 0; font-size: .8rem; font-weight: 500;
  color: var(--muted); letter-spacing: .2px;
}
.row > * { min-width: 0; }
.row-body p { margin: 0; font-size: .93rem; color: var(--ink-2); }
.row-body .row-links { margin-top: 10px; font-size: .88rem; color: var(--muted); }

.tags { margin-top: 12px !important; display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  font-size: .745rem; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 9px;
}

.row-figure { margin: 16px 0 0; max-width: 460px; }
.row-figure img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.row-figure figcaption { margin-top: 8px; font-size: .775rem; line-height: 1.5; color: var(--muted); }

/* render strip */
.gallery {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin-top: 14px;
}
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); background: #fff;
}

.row-clip { margin-top: 14px; max-width: 560px; }
.row-body > .row-clip, .row-body > .media-pair { margin-top: 14px; }

.gallery-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery a { display: block; border-radius: 6px; }
.gallery-dark img { object-fit: contain; background: #10141c; border-color: #1f2430; }
.gallery-caption { margin: 8px 0 0 !important; font-size: .8rem !important; line-height: 1.5; color: var(--muted) !important; }
.media-pair { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; max-width: 760px; }
.media-pair .row-clip { max-width: none; }
.clip-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* inline diagram (segmentation project) */
.diagram { margin: 16px 0 0; max-width: 680px; overflow-x: auto; }
.diagram svg { width: 100%; min-width: 560px; height: auto; display: block; }
.dg text { fill: var(--ink); font-family: var(--font-body); font-size: 13px; }
.dg .dg-label { fill: var(--muted); font-size: 12px; }
.dg-box { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.dg-a { fill: color-mix(in srgb, var(--accent) 12%, var(--paper)); stroke: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.dg-b { fill: color-mix(in srgb, #1f9e89 14%, var(--paper)); stroke: color-mix(in srgb, #1f9e89 50%, var(--line)); }
.dg-c { fill: color-mix(in srgb, #d97706 12%, var(--paper)); stroke: color-mix(in srgb, #d97706 45%, var(--line)); }
.dg-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.diagram figcaption { margin-top: 8px; font-size: .8rem; color: var(--muted); }

/* expandable detail (segmentation diagram) */
.more { margin-top: 14px; max-width: 680px; }
.more summary {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: .88rem; font-weight: 500; color: var(--accent); list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before {
  content: ""; width: 6px; height: 6px; margin-top: -2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .2s ease;
}
.more[open] summary::before { transform: rotate(45deg); margin-top: -5px; }
.more .diagram { margin-top: 10px; }

/* two images side by side at equal height (flex values = aspect ratios) */
.pair-fit { display: flex; gap: 10px; margin-top: 14px; max-width: 760px; align-items: flex-start; }
.pair-fit a { display: block; min-width: 0; }
.pair-fit img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 6px; }

/* renders of the HD-EMG boards: small thumbnails, click to enlarge */
.renders-small { max-width: 560px; }
.renders-small img { border-color: #1f2430; background: #10141c; }

/* video + image side by side at equal height (flex values = aspect ratios) */
.media-fit { display: flex; gap: 12px; align-items: flex-start; max-width: 760px; margin-top: 14px; }
.media-fit > figure { min-width: 0; margin: 0; max-width: none; }

/* result plots (selective classification) */
.plot { margin: 14px 0 0; max-width: 760px; }
.plot > a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.plot > a img { width: 100%; height: auto; display: block; }
.plot figcaption { margin-top: 8px; font-size: .8rem; line-height: 1.5; color: var(--muted); }
.plot-narrow { max-width: 600px; }
:root[data-theme="dark"] .plot img { filter: brightness(.92); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .plot img { filter: brightness(.92); }
}

/* small coursework cards */
.minis {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.minis li {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; background: var(--paper);
}
.minis h4 {
  font-family: var(--font-display); font-size: 1.02rem; font-weight: 600;
  line-height: 1.35; margin: 0 0 3px; color: var(--ink);
}
.minis .row-meta { margin-bottom: 8px; }
.minis p:last-child { margin: 0; font-size: .9rem; color: var(--ink-2); }
.minis li:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------------------------------------------------------
   service
   --------------------------------------------------------- */
.service { list-style: none; padding: 0; margin: 0; }
.service li {
  display: grid; grid-template-columns: 254px 1fr 92px;
  gap: 20px; align-items: baseline;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.service li:last-child { border-bottom: none; }

.svc-role { font-weight: 600; font-size: .95rem; color: var(--ink); }
.svc-where { font-size: .93rem; color: var(--ink-2); }
.svc-note { margin-left: 6px; font-weight: 500; font-size: .84rem; color: var(--muted); white-space: nowrap; }
.svc-when {
  font-size: .8rem; font-weight: 600; letter-spacing: .3px;
  color: var(--muted); text-align: right; white-space: nowrap;
}

/* ---------------------------------------------------------
   project pages (npr.html, avatars.html)
   --------------------------------------------------------- */
.proj-head { padding: 46px 0 30px; }
.back { display: inline-block; font-size: .86rem; font-weight: 500; color: var(--muted); margin-bottom: 22px; }
.back:hover { color: var(--accent); }
.proj-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 500; line-height: 1.15; letter-spacing: -.4px;
  margin: 0 0 16px; max-width: 900px;
}
.proj-authors { margin: 0 0 4px; font-size: 1rem; color: var(--ink-2); }
.proj-authors strong { color: var(--ink); font-weight: 600; }
.proj-venue { margin: 0 0 18px; font-size: .95rem; font-style: italic; color: var(--muted); }
.proj-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.proj-links a, .proj-links button { font-size: .86rem; padding: 6px 14px; }

.proj-section { padding: 40px 0; border-top: 1px solid var(--line); }
.proj-section > h2 {
  font-family: var(--font-display);
  font-size: 1.45rem; font-weight: 500; letter-spacing: -.2px;
  margin: 0 0 16px;
}
.proj-text { max-width: var(--narrow); }
.proj-text p { margin: 0 0 14px; color: var(--ink-2); }
.proj-text p:last-child { margin-bottom: 0; }
.proj-text ol, .proj-text ul { margin: 0 0 14px; padding-left: 1.25em; color: var(--ink-2); }
.proj-text li { margin: 0 0 6px; }

.clips {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; margin-top: 22px;
}
.clip { margin: 0; }
.clip-media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 10px; background: var(--stage);
  box-shadow: 0 0 0 1px var(--line);
}
.clip-media video { width: 100%; height: 100%; object-fit: cover; }
.clip figcaption { font-size: .86rem; color: var(--ink-2); }
.clip figcaption b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

.split {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 36px; align-items: start; margin-top: 6px;
}

.fig { margin: 22px 0 0; }
.fig img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.fig-link { display: block; border-radius: 8px; }

.player {
  position: relative; border-radius: 12px; overflow: hidden;
  background: var(--stage); aspect-ratio: 16 / 9;
}
.player video { width: 100%; height: 100%; }

.proj-bib { max-width: 760px; }
.proj-bib .bib { margin-top: 0; }

/* ---------------------------------------------------------
   footer
   --------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 30px 0 40px; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 26px; font-size: .875rem;
}
.footer-inner p { margin: 0; }
.footer-inner a { display: inline-block; padding: 6px 0; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--accent); }
.footer-note { margin-left: auto !important; color: var(--muted); }

/* ---------------------------------------------------------
   responsive
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; gap: 24px; }
  .split { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 860px) {
  .row { grid-template-columns: 1fr; gap: 8px; }
  .service li { grid-template-columns: 1fr; gap: 3px; }
  .svc-when { text-align: left; }
}

@media (max-width: 720px) {
  .menu-btn { display: grid; }
  .nav-actions { margin-left: auto; }

  .nav-links {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 6px var(--pad) 14px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a::after { display: none; }

  .hero { padding: 36px 0 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; }
  .portrait img { width: 120px; height: 120px; }
  .hero .prose { margin-top: 28px; }
  .prose .lead { font-size: 1.18rem; }

  .section { padding: 46px 0; }
  .news-item, .pub { grid-template-columns: 1fr; gap: 5px; }
  .news-date, .pub-year { padding-top: 0; }
  .footer-note { margin-left: 0 !important; width: 100%; }

  .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-3 { grid-template-columns: 1fr; }
  .media-pair { grid-template-columns: 1fr; }
  .media-fit { flex-direction: column; }
  .media-fit > figure { flex: none !important; width: 100%; }
  .minis { grid-template-columns: 1fr; }
  .clips { grid-template-columns: 1fr; gap: 22px; }
  .wipe-stage { border-radius: 8px; }
  .wipe-knob { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .wipe-label { top: 8px; font-size: .66rem; padding: 3px 7px; }
  .wipe-label-l { left: 8px; }
  .wipe-label-r { right: 8px; }
  .proj-head { padding: 30px 0 22px; }
}

@media (max-width: 420px) {
  :root { --pad: 16px; }
}

/* ---------------------------------------------------------
   print
   --------------------------------------------------------- */
@media print {
  .nav, .more-btn, .skip, .bib-btn, .bib, .vid-toggle, .wipe-knob { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section, .section.alt { background: #fff; padding: 18px 0; }
  .news-item[hidden] { display: grid !important; }
}
