/* ==========================================================================
   Dr. Nitesh Kumar — site stylesheet ("Helix" design system)
   Night sky + observatory amber. Glass is used only over real imagery;
   reading surfaces stay solid for legibility and print.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-var.woff2") format("woff2"); font-weight: 500 800; font-stretch: 70% 100%; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-500.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

/* ---------- Design tokens ---------- */
:root {
  /* Reading surfaces (light) — all text pairs ≥ 4.5:1 */
  --paper: #F2F0EB;
  --surface: #FBFAF7;
  --ink: #161412;           /* headings          */
  --text: #24211E;          /* body       14.1:1 */
  --muted: #5D5852;         /* secondary   6.2:1 */
  --line: #DDD8CF;
  --accent: #8A4F06;        /* amber text  5.8:1 */
  --accent-line: #D99A3A;   /* amber rules / underlines (decorative) */
  /* Night surfaces */
  --night: #0C0A0B;
  --on-night: #F6F2EC;
  --on-night-muted: #D9D1C5;
  --amber: #E9A23B;         /* on night    9.1:1 */
  --on-amber: #1A1206;      /* on amber    8.6:1 */
  /* Glass */
  --glass-tint: rgba(16, 12, 10, .46);
  --glass-hi: rgba(255, 255, 255, .10);
  --glass-lo: rgba(255, 255, 255, .03);
  --glass-border: rgba(255, 255, 255, .15);
  --glass-blur: 18px;
  /* Type */
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Layout */
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --section: clamp(64px, 9vw, 120px);
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F0D0C; --surface: #181514; --ink: #F3EEE6; --text: #ECE6DD; --muted: #ABA399; --line: #2C2724;
    --accent: #E9A23B; --accent-line: #B97C24; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F0D0C; --surface: #181514; --ink: #F3EEE6; --text: #ECE6DD; --muted: #ABA399; --line: #2C2724;
  --accent: #E9A23B; --accent-line: #B97C24; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 clamp(1rem, .97rem + .18vw, 1.075rem)/1.7 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--display); font-stretch: 88%; color: var(--ink); margin: 0; line-height: 1.08; letter-spacing: -.015em; font-weight: 680; text-wrap: balance; }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); }
h3 { font-size: clamp(1.2rem, 1.1rem + .45vw, 1.45rem); font-weight: 640; }
h4 { font-size: 1.05rem; font-weight: 640; }
p { margin: 0; }
p + p { margin-top: 1em; }
ul, ol { margin: 0; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a:hover { color: var(--accent); text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(233, 162, 59, .35); }
b, strong { font-weight: 600; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 200; background: var(--amber); color: var(--on-amber); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.prose { max-width: 68ch; }
.prose p { color: var(--text); }
.muted { color: var(--muted); }

/* ---------- Glass ---------- */
.glass {
  position: relative; color: var(--on-night);
  background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)), var(--glass-tint);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 30px 60px -30px rgba(0, 0, 0, .7);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: rgba(18, 14, 12, .9); } }
@media (prefers-reduced-transparency: reduce) { .glass { background: rgba(18, 14, 12, .94); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.glass h1, .glass h2, .glass h3, .glass h4 { color: var(--on-night); }
.glass a { text-decoration-color: rgba(233, 162, 59, .6); }
.glass a:hover { color: var(--amber); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; font: 600 .95rem/1 var(--sans); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-amber { background: var(--amber); color: var(--on-amber); }
.btn-amber:hover { background: #F4B862; color: var(--on-amber); }
.btn-ghost { border-color: rgba(255, 255, 255, .35); color: var(--on-night); background: rgba(255, 255, 255, .04); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--accent); color: var(--paper); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Header ---------- */
.site-header { position: fixed; top: 12px; left: 0; right: 0; z-index: 60; pointer-events: none; }
.bar { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 6px 8px 6px 16px; border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-night); min-height: 44px; }
.brand:hover { color: var(--on-night); }
.brand svg { width: 34px; height: 22px; flex: none; }
.brand b { font: 700 1.08rem/1 var(--display); font-stretch: 92%; letter-spacing: -.01em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 2px; }
.nav ul a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px; border-radius: 999px; color: var(--on-night-muted); text-decoration: none; font-weight: 500; font-size: .93rem; transition: background-color .2s, color .2s; }
.nav ul a:hover { color: var(--on-night); background: rgba(255, 255, 255, .08); }
.nav ul a[aria-current="page"] { color: var(--on-amber); background: var(--amber); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); color: var(--on-night); cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--amber); color: var(--amber); }
.icon-btn svg { width: 19px; height: 19px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .sun { display: none; } :root:not([data-theme="light"]) .theme .moon { display: block; } }
.menu-btn { display: none; width: auto; gap: 8px; padding: 0 16px; font: 600 .9rem var(--sans); }
.nav-panel .btn { display: none; }
@media (max-width: 1040px) {
  .js .menu-btn { display: inline-flex; align-items: center; }
  .js .nav-panel { position: fixed; left: var(--gutter); right: var(--gutter); top: 84px; padding: 10px; border-radius: 22px; display: none; max-height: calc(100vh - 110px); max-height: calc(100svh - 110px); overflow: auto; }
  .js .nav-panel.open { display: block; }
  .js .nav ul { flex-direction: column; gap: 2px; }
  .js .nav ul a { min-height: 54px; font: 640 1.3rem var(--display); font-stretch: 90%; padding: 0 18px; border-radius: 14px; color: var(--on-night); }
  .js .nav-panel .btn { display: flex; width: 100%; margin-top: 8px; }
  /* No-JS fallback: links wrap under the brand */
  html:not(.js) .bar { flex-wrap: wrap; border-radius: 22px; }
  html:not(.js) .nav ul { flex-wrap: wrap; }
}

/* ---------- Home hero ---------- */
.hero { position: relative; min-height: min(100vh, 940px); min-height: min(100svh, 940px); display: flex; align-items: center; background: var(--night); color: var(--on-night); overflow: hidden; isolation: isolate; padding: 120px 0; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; z-index: -1; background: linear-gradient(transparent, rgba(12, 10, 11, .55)); }
.hero-card { max-width: 640px; padding: clamp(24px, 3.4vw, 44px); }
.who { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.who img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px rgba(233, 162, 59, .85), 0 0 0 6px rgba(255, 255, 255, .06); }
.who p { font-size: .93rem; line-height: 1.45; color: var(--on-night-muted); }
.who strong { color: var(--on-night); display: block; }
.hero h1 { color: var(--on-night); font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem); font-weight: 760; font-stretch: 84%; letter-spacing: -.025em; line-height: .98; }
.statement { margin-top: 20px; font-size: clamp(1.08rem, 1rem + .45vw, 1.28rem); line-height: 1.6; color: var(--on-night); }
.statement em { font-style: italic; color: var(--amber); }
.hero .btn-row { margin-top: 28px; }
.profiles { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); }
.profiles a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; margin-left: -10px; margin-right: 6px; font: 500 .8rem var(--mono); color: var(--on-night-muted); text-decoration: none; border-radius: 8px; }
.profiles a:hover { color: var(--amber); background: rgba(255, 255, 255, .06); }
.hero-curve { position: absolute; left: 0; right: 0; bottom: 56px; height: 70px; z-index: -1; pointer-events: none; }
.hero-curve path { fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; opacity: .9; stroke-dasharray: 3200; stroke-dashoffset: 3200; animation: draw 2.6s cubic-bezier(.3, .6, .2, 1) .4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.credit { position: absolute; right: var(--gutter); bottom: 16px; max-width: calc(100% - 2 * var(--gutter)); text-align: right; font: 500 .68rem/1.5 var(--mono); color: rgba(246, 242, 236, .66); }
.credit a { color: inherit; text-decoration: none; }
.credit a:hover { color: var(--amber); text-decoration: underline; }

/* ---------- Sub-page hero ---------- */
.page-hero { position: relative; background: var(--night); color: var(--on-night); isolation: isolate; overflow: hidden; padding: 128px 0 56px; }
.page-hero .hero-bg img { object-position: 80% 45%; opacity: .9; }
.page-hero .glass { padding: clamp(22px, 3vw, 36px); max-width: 760px; }
.page-hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.4vw, 4rem); font-weight: 740; font-stretch: 84%; letter-spacing: -.022em; }
.page-hero .lede { margin-top: 14px; color: var(--on-night-muted); font-size: clamp(1.02rem, .98rem + .3vw, 1.15rem); max-width: 60ch; }
.page-hero .credit { bottom: 10px; }
.kicker { display: block; font: 500 .78rem var(--mono); color: var(--accent); margin-bottom: 14px; letter-spacing: .02em; }
.glass .kicker, .night .kicker, .page-hero .kicker { color: var(--amber); }

/* ---------- Editorial section layout ---------- */
.block { padding: var(--section) 0; }
.block.tight { padding-top: 0; }
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 72px); }
.split-head { position: sticky; top: 100px; align-self: start; }
.split-head > p { color: var(--muted); margin-top: 16px; max-width: 34ch; }
.split-head .more { display: inline-block; margin-top: 20px; font-weight: 600; }
.split-head .btn-row { margin-top: 24px; }
.sub-h { margin: 56px 0 18px; font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); }
.sub-h:first-child { margin-top: 0; }

/* Research areas (home + research page) */
.areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.area { display: flex; flex-direction: column; gap: 12px; padding: 28px 28px 30px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; position: relative; }
.area:hover { color: inherit; }
.area:nth-child(odd) { border-right: 1px solid var(--line); }
.area:nth-child(even) { padding-left: 28px; padding-right: 0; }
.num { font: 800 3rem/1 var(--display); font-stretch: 70%; color: transparent; -webkit-text-stroke: 1.2px var(--accent-line); letter-spacing: -.02em; transition: color .25s; }
.area:hover .num, .area:focus-visible .num { color: var(--accent-line); }
.area p { color: var(--muted); font-size: .97rem; }
.topics { font: 500 .76rem/1.6 var(--mono); color: var(--muted); }
.go { font-weight: 600; font-size: .92rem; color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 4px; margin-top: auto; }

/* Theme detail (research page) */
.theme-detail { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 24px; padding: 32px 0; border-top: 1px solid var(--line); }
.theme-detail:last-child { border-bottom: 1px solid var(--line); }
.theme-detail .num { grid-row: span 3; }
.theme-detail p { color: var(--text); margin-top: 10px; max-width: 64ch; }
.theme-detail ul { margin-top: 14px; padding-left: 1.1em; color: var(--muted); font-size: .95rem; }
.theme-detail li + li { margin-top: 6px; }

/* Night band */
.night { position: relative; background: var(--night); color: var(--on-night); isolation: isolate; overflow: hidden; }
.night-bg { position: absolute; inset: 0; z-index: -1; }
.night-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.night h2, .night h3 { color: var(--on-night); }
.night .split-head > p { color: var(--on-night-muted); }

/* Teaching cards (home) */
.teach-cards { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.sims { padding: 8px; }
.sims header { padding: 18px 18px 12px; }
.sims header p { font-size: .92rem; color: var(--on-night-muted); margin-top: 6px; }
.sims ol { list-style: none; margin: 0; padding: 0; counter-reset: u; }
.sims li a { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 14px; border-radius: 12px; text-decoration: none; color: var(--on-night); transition: background-color .2s; }
.sims li a:hover { background: rgba(255, 255, 255, .08); color: var(--on-night); }
.sims li a::before { counter-increment: u; content: counter(u); width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(233, 162, 59, .6); font: 500 .78rem var(--mono); color: var(--amber); }
.sims li.all a::before { content: "★"; }
.sims .t { font-weight: 500; }
.sims .arr { margin-left: auto; color: var(--amber); }
.side { display: grid; gap: 16px; align-content: start; }
.side .glass { padding: 22px 24px; }
.side h3 { font-size: 1.15rem; margin-bottom: 8px; }
.side p { font-size: .94rem; color: var(--on-night-muted); }
.plain-list { margin: 10px 0 0; padding: 0; list-style: none; font-size: .93rem; }
.plain-list li { padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.plain-list li:first-child { border-top: 0; }

/* Dated rows (news) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rows time, .rows .w { font: 500 .82rem/1.9 var(--mono); color: var(--accent); }
.rows b { color: var(--ink); }
.rows .row-link { margin-left: 6px; font-weight: 600; white-space: nowrap; }

/* Events */
.ev-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ev-card { position: relative; display: block; border-radius: var(--radius); overflow: hidden; isolation: isolate; min-height: 340px; color: var(--on-night); text-decoration: none; background: var(--night); }
.ev-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .6s ease; }
.ev-card:hover > img { transform: scale(1.03); }
.ev-card .glass { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 16px 18px; border-radius: 14px; }
.ev-card h3 { font-size: 1.15rem; }
.ev-card p { font: 500 .78rem var(--mono); color: var(--amber); margin-bottom: 6px; }
.ev-card:hover { color: var(--on-night); }
.ev-more { margin-top: 16px; }
.ev-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ev { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 8px 24px; padding: 32px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 96px; }
.ev time { font: 500 .82rem/1.9 var(--mono); color: var(--accent); }
.ev h3 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); }
.ev .ev-sum { color: var(--muted); margin-top: 8px; max-width: 64ch; }
.role { display: inline-block; margin-top: 12px; font: 500 .72rem var(--mono); letter-spacing: .04em; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--accent-line); color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; margin-top: 18px; list-style: none; padding: 0; }
.gallery.lead { grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; }
.gallery.lead li:first-child { grid-row: span 2; }
.gallery a { display: block; border-radius: 12px; overflow: hidden; background: var(--line); height: 100%; }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; transition: transform .4s ease, opacity .3s; }
.gallery.lead li:first-child img { aspect-ratio: auto; min-height: 100%; }
.gallery .tall img { aspect-ratio: 3 / 4; object-position: top; }
.gallery a:hover img { transform: scale(1.03); }
.photo-credit { margin-top: 18px; font: 500 .74rem var(--mono); color: var(--muted); }

/* Lightbox (native <dialog>) */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; color: var(--on-night); }
.lightbox::backdrop { background: rgba(8, 6, 6, .92); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; place-items: center; }
.lightbox figure { margin: 0; display: grid; place-items: center; width: 100%; height: 100%; padding: 64px 64px 8px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; border-radius: 10px; }
.lightbox figcaption { padding: 8px 24px 24px; text-align: center; color: var(--on-night-muted); font-size: .92rem; max-width: 80ch; }
.lb-btn { position: fixed; z-index: 2; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
.lb-btn:hover { border-color: var(--amber); color: var(--amber); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Publications */
.tabs { display: flex; gap: 4px 20px; flex-wrap: wrap; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.tab { -webkit-appearance: none; appearance: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; min-height: 46px; display: inline-flex; align-items: center; font-weight: 500; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { color: var(--ink); border-color: var(--accent-line); }
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.pub[hidden] { display: none; }
.pub h3 { font: 600 1.08rem/1.4 var(--sans); letter-spacing: 0; text-wrap: pretty; }
.pub h3 a { text-decoration: none; }
.pub h3 a:hover { text-decoration: underline; }
.pub .by { grid-column: 1; color: var(--muted); font-size: .93rem; }
.pub .by b { color: var(--text); }
.pub .yr { grid-row: 1 / 3; grid-column: 2; font: 500 .9rem var(--mono); color: var(--accent); text-align: right; }
.pub .links { grid-column: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 18px; font: 500 .8rem var(--mono); }
.pub .links a { min-height: 36px; display: inline-flex; align-items: center; }
.status { margin-top: 14px; font-size: .88rem; color: var(--muted); }

/* Simple year lists */
.ylist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ylist li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .96rem; }
.ylist .w { font: 500 .8rem/1.9 var(--mono); color: var(--accent); }

/* Tools */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.tool { padding: 26px 24px 28px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.tool + .tool { padding-left: 24px; border-left: 1px solid var(--line); }
.tool p { color: var(--muted); font-size: .96rem; }
.tool .links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; font-weight: 600; font-size: .92rem; }
.tool .meta { font: 500 .74rem var(--mono); color: var(--accent); }

/* Facts / definition grid (CV, research) */
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); border-top: 1px solid var(--line); margin: 0; }
.facts dt, .facts dd { padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0; }
.facts dt { font: 500 .8rem/1.9 var(--mono); color: var(--accent); padding-right: 16px; }
.facts dd small { display: block; color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* CV + contact panels (night band) */
.cc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cc > .glass { padding: clamp(24px, 3vw, 40px); }
.cc h2 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); }
.cc .lede { color: var(--on-night-muted); margin-top: 10px; }
.tl { list-style: none; margin: 22px 0 26px; padding: 0; }
.tl li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .96rem; }
.tl .w { font: 500 .78rem/1.9 var(--mono); color: var(--amber); }
.contact { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; }
.contact li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; }
.contact svg { width: 20px; height: 20px; color: var(--accent); margin-top: 4px; }
.glass .contact svg { color: var(--amber); }
.contact .lab { display: block; font: 500 .7rem var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.glass .contact .lab { color: var(--on-night-muted); }
.mail { overflow-wrap: anywhere; }
.copy { margin-left: 10px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--accent); font: 500 .75rem var(--mono); cursor: pointer; }
.glass .copy { border-color: rgba(255, 255, 255, .25); color: var(--amber); }
html:not(.js) .copy { display: none; }

/* Cite (BibTeX) */
.cite { display: inline-block; min-width: 0; max-width: 100%; }
.cite[open] { flex-basis: 100%; width: 100%; }
.cite summary { list-style: none; cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; color: inherit; text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.cite summary::-webkit-details-marker { display: none; }
.cite summary::after { content: " ▾"; color: var(--accent); }
.cite[open] summary::after { content: " ▴"; }
.cite summary:hover { color: var(--accent); }
.cite-box { max-width: 100%; min-width: 0; margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cite-box pre { margin: 0 0 10px; overflow-x: auto; font: 400 .74rem/1.55 var(--mono); color: var(--text); white-space: pre; }
.cite-box .copy { margin-left: 0; }

/* Teaching resource library */
.library-controls { display: grid; gap: 14px; margin-bottom: 24px; }
.search { width: 100%; min-height: 50px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.search:focus { outline: 3px solid var(--amber); outline-offset: 1px; border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 .88rem var(--sans); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.course { margin-top: 36px; }
.course:first-of-type { margin-top: 0; }
.course > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.course > header .code { font: 500 .78rem var(--mono); color: var(--accent); }
.res-list { list-style: none; margin: 0; padding: 0; }
.res { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.res[hidden] { display: none; }
.res .rt { font-weight: 500; color: var(--ink); }
.res .rk { display: block; font: 500 .72rem var(--mono); color: var(--muted); margin-top: 2px; }
.res-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.res-actions a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font: 500 .8rem var(--mono); text-decoration: none; color: var(--accent); background: var(--surface); }
.res-actions a:hover { border-color: var(--accent-line); }
.empty { padding: 24px 0; color: var(--muted); }
.semesters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.semesters > li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.semesters .w { font: 500 .8rem/1.9 var(--mono); color: var(--accent); }
.semesters ul { padding-left: 1.1em; }
.semesters ul li + li { margin-top: 4px; }
.mentees { list-style: none; padding: 0; margin: 0; }
.mentees > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.mentees b { color: var(--ink); }
.mentees span { color: var(--muted); }
.level { font: 500 .78rem var(--mono); color: var(--accent); margin: 22px 0 4px; }

/* Approach cards */
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.cols3 > div { padding: 22px 22px 24px 0; border-bottom: 1px solid var(--line); }
.cols3 > div + div { padding-left: 22px; border-left: 1px solid var(--line); }
.cols3 ul { padding-left: 1.1em; margin-top: 10px; color: var(--muted); font-size: .95rem; }

/* Footer */
.foot { background: var(--night); color: var(--on-night-muted); padding: 48px 0 32px; font-size: .9rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.foot-name { font: 700 1.4rem var(--display); font-stretch: 88%; color: var(--on-night); }
.foot h2 { font: 500 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: 10px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot ul a { display: inline-flex; min-height: 36px; align-items: center; }
.foot a { color: var(--on-night-muted); }
.foot a:hover { color: var(--amber); }
.foot-meta { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: .8rem; }

/* Reveal (subtle; disabled for reduced motion and without JS) */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-head { position: static; }
  .split-head > p { max-width: 60ch; }
  .teach-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .tools, .cols3 { grid-template-columns: minmax(0, 1fr); }
  .tool, .tool + .tool, .cols3 > div, .cols3 > div + div { padding: 22px 0; border-left: 0; }
  .cc { grid-template-columns: minmax(0, 1fr); }
  .ev-feature-grid { grid-template-columns: minmax(0, 1fr); }
  .ev { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .hero { flex-direction: column; align-items: stretch; padding: 96px 0 20px; min-height: 0; }
  .hero-bg img { object-position: 50% 0; height: 62%; }
  .hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, var(--night) 62%); }
  .hero-card { margin-top: 180px; padding: 22px; }
  .who img { width: 60px; height: 60px; }
  .hero .btn-row .btn, .split-head .btn-row .btn { flex: 1 1 100%; }
  .hero-curve { display: none; }
  .credit { position: static; display: block; padding: 14px var(--gutter) 0; text-align: left; }
  .page-hero { padding: 104px 0 44px; }
  .page-hero .credit { position: static; padding-top: 18px; }
  .areas { grid-template-columns: minmax(0, 1fr); }
  .area, .area:nth-child(odd), .area:nth-child(even) { padding: 24px 0; border-right: 0; }
  .num { font-size: 2.4rem; }
  .theme-detail { grid-template-columns: minmax(0, 1fr); }
  .theme-detail .num { grid-row: auto; }
  .pub { grid-template-columns: minmax(0, 1fr); }
  .pub .yr { grid-row: auto; grid-column: 1; text-align: left; order: -1; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .tab { flex: none; }
  .rows > li, .ylist li, .semesters > li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .res { grid-template-columns: minmax(0, 1fr); }
  .res-actions { justify-content: flex-start; }
  .gallery.lead { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery.lead li:first-child { grid-row: auto; grid-column: 1 / -1; }
  .gallery.lead li:first-child img { aspect-ratio: 3 / 2; }
  .ev-card { min-height: 300px; }
  .lightbox figure { padding: 72px 12px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  .bar { padding-left: 14px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .brand b { font-size: 1rem; }
  .menu-btn .lbl { display: none; }
  .menu-btn { width: 44px; padding: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero-curve path { stroke-dashoffset: 0; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .hero-bg, .hero-curve, .night-bg, .tabs, .chips, .search, .copy, .lightbox, .skip { display: none !important; }
  body, .hero, .page-hero, .night, .foot { background: #fff !important; color: #000 !important; }
  .glass { background: #fff !important; color: #000 !important; border: 1px solid #ccc; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass h1, .glass h2, .glass h3, .hero h1, .statement, .who strong { color: #000 !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  a { text-decoration: underline; }
}
