/* ==========================================================================
   Md Zarif Hossain — academic portfolio
   ========================================================================== */

:root {
  --bg: #f7f5f0;
  --surface: #fffdf9;
  --surface-2: #efebe3;
  --ink: #1b1a17;
  --ink-2: #4a4740;
  --ink-3: #7b766c;
  --line: #e2ddd2;
  --accent: #b4401b;
  --accent-soft: #f6e3da;
  --accent-ink: #fff;
  --fig-bg: #ffffff;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 8px 24px -12px rgba(27, 26, 23, .12);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --surface: #1a1a18;
    --surface-2: #232320;
    --ink: #eeebe4;
    --ink-2: #bdb8ad;
    --ink-3: #8a857a;
    --line: #2e2d29;
    --accent: #f08a5d;
    --accent-soft: #3a2219;
    --accent-ink: #1b1a17;
    --fig-bg: #f4f2ee;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211;
  --surface: #1a1a18;
  --surface-2: #232320;
  --ink: #eeebe4;
  --ink-2: #bdb8ad;
  --ink-3: #8a857a;
  --line: #2e2d29;
  --accent: #f08a5d;
  --accent-soft: #3a2219;
  --accent-ink: #1b1a17;
  --fig-bg: #f4f2ee;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong, b { font-weight: 600; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 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: -48px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.muted { color: var(--ink-3); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  font: 500 12px/1 var(--mono); letter-spacing: .06em;
  padding: 7px 8px; border-radius: 7px; background: var(--ink); color: var(--bg);
}
.brand-name { font: 500 15px/1 var(--sans); opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; }
.site-header.is-scrolled .brand-name { opacity: 1; transform: none; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav ul { display: flex; gap: 2px; }
.nav a { display: block; padding: 7px 11px; border-radius: 8px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a.is-current { color: var(--ink); background: var(--surface-2); }
.nav a.nav-cv { color: var(--accent); font-weight: 500; }
.theme-toggle, .nav-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2);
  cursor: pointer; transition: color .15s, border-color .15s;
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .nav ul {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav ul.is-open { display: flex; }
  .nav a { padding: 12px 8px; font-size: 16px; }
  .brand-name { opacity: 1; transform: none; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(32px, 5vw, 56px); }
.hero h1 { font: 400 clamp(42px, 6.4vw, 72px)/1.02 var(--serif); letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { margin-top: 12px; font-size: 15.5px; color: var(--ink-2); }
.hero-sub a { color: inherit; }
.hero-tag { margin-top: 6px; font: 500 12.5px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* Photo floats left; the bio wraps around it and continues underneath. */
.hero-flow { max-width: 880px; margin-top: 32px; font: 400 18px/1.62 var(--serif); color: var(--ink-2); }
.hero-flow::after { content: ""; display: table; clear: both; }
.hero-flow > p + p { margin-top: 14px; }
.hero-flow a { color: var(--ink); }
.hero-flow strong { color: var(--ink); font-weight: 600; }
.lede { font-size: clamp(20px, 2.2vw, 23px); line-height: 1.5; color: var(--ink); letter-spacing: -0.005em; }
.lede em { color: var(--accent); }
.portrait { float: left; width: 250px; margin: 6px 32px 14px 0; shape-outside: margin-box; }
.portrait img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface-2);
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 14.5px/1 var(--sans); text-decoration: none;
  transition: transform .15s, border-color .15s, background .15s, color .15s;
}
.btn:hover { color: var(--ink); border-color: var(--ink-3); transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.scholar-btn { margin-top: 24px; }

.contact { display: grid; gap: 8px; margin-top: 30px; font-size: 15px; }
.contact > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: baseline; gap: 12px; }
.contact dt { font: 500 11.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.contact dd { margin: 0; color: var(--ink); }
.email-copy {
  padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: copy; text-align: left;
  border-bottom: 1px dashed var(--line); transition: color .15s, border-color .15s;
}
.email-copy span { color: var(--ink-3); }
.email-copy:hover { color: var(--accent); border-bottom-color: var(--accent); }
.email-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.copy-note { margin-left: 10px; font: 500 12px/1 var(--mono); color: var(--accent); opacity: 0; transition: opacity .2s; }
.copy-note.is-shown { opacity: 1; }
.socials { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 22px; font: 400 13.5px/1.4 var(--mono); }
.socials a { color: var(--ink-3); text-decoration: none; }
.socials a::after { content: " ↗"; opacity: .6; }
.socials a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .hero-flow { font-size: 16.5px; }
  .portrait { width: 42%; max-width: 200px; margin-right: 18px; }
}
@media (max-width: 340px) {
  .portrait { float: none; width: 160px; margin: 0 0 18px; }
}

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding-block: 0;
}
.stat { padding: 22px 18px 22px 0; display: grid; gap: 4px; }
.stat + .stat { padding-left: 22px; border-left: 1px solid var(--line); }
.stat-n { font: 400 clamp(32px, 4vw, 44px)/1 var(--serif); letter-spacing: -0.02em; }
.stat-l { font-size: 13px; color: var(--ink-3); }
@media (max-width: 720px) {
  .stat { padding-right: 10px; }
  .stat + .stat { padding-left: 14px; }
  .stat-l { font-size: 12px; }
}

/* ---------- Sections ---------- */
.section { padding-top: clamp(40px, 5.5vw, 64px); }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 32px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-num { font: 500 12.5px/1 var(--mono); color: var(--accent); letter-spacing: .04em; }
.section-head h2 { font: 400 clamp(30px, 4vw, 42px)/1.1 var(--serif); letter-spacing: -0.025em; }
.section-aside { margin-left: auto; font: 400 13px/1 var(--mono); color: var(--ink-3); text-decoration: none; }

/* Interests */
.interests { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.interest {
  padding: 22px 20px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  counter-increment: int; position: relative; transition: border-color .2s, transform .2s;
}
.interest:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.interest::before { content: counter(int, decimal-leading-zero); display: block; font: 500 11.5px/1 var(--mono); color: var(--ink-3); margin-bottom: 26px; }
.interests { counter-reset: int; }
.interest h3 { font: 500 21px/1.2 var(--serif); letter-spacing: -0.01em; margin-bottom: 10px; }
.interest p { font-size: 14.5px; color: var(--ink-2); }
@media (max-width: 960px) { .interests { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .interests { grid-template-columns: 1fr; } }

/* ---------- News ---------- */
.news { display: grid; }
.news li {
  display: grid; grid-template-columns: 96px 1fr; gap: 20px;
  padding: 15px 0; border-bottom: 1px dashed var(--line);
}
.news li:last-child { border-bottom: 0; }
.news time { font: 400 13px/1.7 var(--mono); color: var(--ink-3); white-space: nowrap; }
.news p { color: var(--ink-2); max-width: 78ch; }
.news strong { color: var(--ink); font-weight: 500; }
.news.is-collapsed li:nth-child(n+7) { display: none; }
.tag {
  display: inline-block; margin-right: 6px; padding: 2px 7px 1px; border-radius: 5px; vertical-align: 1px;
  font: 500 10.5px/1.5 var(--mono); letter-spacing: .05em; text-transform: uppercase;
  background: var(--surface-2); color: var(--ink-2);
}
.tag-hot { background: var(--accent-soft); color: var(--accent); }
.more {
  margin-top: 16px; padding: 9px 14px; border-radius: 9px; border: 1px solid var(--line); background: transparent;
  font: 500 13.5px/1 var(--sans); color: var(--ink-2); cursor: pointer;
}
.more:hover { color: var(--ink); border-color: var(--ink-3); }
@media (max-width: 560px) {
  .news li { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Selected research ---------- */
/* Per-project tone: matches each teaser's own highlight color. --tone is for text on the page,
   --glow tints the light that spills out from behind the screen. */
.tone-coral { --tone: #d4503a; --glow: #ff7a66; }
.tone-blue  { --tone: #2a72c9; --glow: #4aa8ff; }
.tone-green { --tone: #1d8a5f; --glow: #5fd39a; }
.tone-accent { --tone: var(--accent); --glow: #f08a5d; }
.tone-teal  { --tone: #13877f; --glow: #2fc7bd; }
:root[data-theme="dark"] .tone-coral { --tone: #ff8a76; }
:root[data-theme="dark"] .tone-blue  { --tone: #6cb6ff; }
:root[data-theme="dark"] .tone-green { --tone: #6fdcaa; }
:root[data-theme="dark"] .tone-teal  { --tone: #4fd6cc; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tone-coral { --tone: #ff8a76; }
  :root:not([data-theme="light"]) .tone-blue  { --tone: #6cb6ff; }
  :root:not([data-theme="light"]) .tone-green { --tone: #6fdcaa; }
  :root:not([data-theme="light"]) .tone-teal  { --tone: #4fd6cc; }
}

.works { display: grid; gap: clamp(40px, 5vw, 60px); }
.work {
  display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.38fr);
  gap: clamp(28px, 4.5vw, 56px); align-items: center;
}

.work-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 400 12.5px/1.4 var(--mono); color: var(--ink-3); }
.work-idx { color: var(--tone); font-weight: 500; }
.venue-tag { padding: 3px 8px; border-radius: 6px; background: var(--ink); color: var(--bg); font-weight: 500; letter-spacing: .02em; }
.work-name {
  margin-top: 14px; font: italic 400 clamp(28px, 3vw, 36px)/1.15 var(--serif); letter-spacing: -0.03em; color: var(--tone);
}
.work h3 { margin-top: 10px; font: 500 clamp(18px, 1.7vw, 21px)/1.3 var(--serif); letter-spacing: -0.01em; }
.work .authors { margin-top: 10px; font-size: 14px; color: var(--ink-3); }
.work .authors b { color: var(--ink); font-weight: 600; }
.work-sum { margin-top: 14px; font-size: 15px; color: var(--ink-2); }

.work-stats {
  margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.work-stats div { padding: 14px 12px 14px 0; }
.work-stats div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.work-stats dt { font: 400 clamp(22px, 2.4vw, 28px)/1 var(--serif); letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
.work-stats dd { margin: 6px 0 0; font: 400 11.5px/1.35 var(--mono); color: var(--ink-3); }
.work-stats sub { font-size: .8em; }
.work-stats dt small { font-size: .55em; color: var(--ink-3); letter-spacing: 0; }

.links { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.links a {
  font: 500 12.5px/1 var(--mono); padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  text-decoration: none; color: var(--ink-2); background: var(--surface);
}
.links a::after { content: " ↗"; }
.links a:hover { color: var(--tone); border-color: var(--tone); }

/* The "screen": a dark bezel the teaser plays in, with its color spilling onto the page. */
.screen {
  position: relative; margin: 0; isolation: isolate;
  border-radius: 16px; background: #0a1226; padding: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 30px 60px -30px rgba(10, 18, 38, .55);
}
.screen::before {
  content: ""; position: absolute; inset: 14% 8% -6%; z-index: -1; border-radius: 50%;
  background: var(--glow); opacity: .28; filter: blur(48px); transition: opacity .5s;
}
.work:hover .screen::before, .screen.is-playing::before { opacity: .42; }
.screen video, .screen img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 11px; background: #0a1226;
}
.screen-paper { background: #fff; padding: clamp(12px, 2vw, 22px); border: 1px solid var(--line); box-shadow: var(--shadow); }
.screen-paper img { aspect-ratio: auto; object-fit: contain; border-radius: 4px; background: #fff; }

.screen-ui {
  position: absolute; inset: auto 18px 18px 18px; display: flex; justify-content: space-between; align-items: center;
  pointer-events: none;
}
.screen-btn {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(10,18,38,.62); color: #eef2fb;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 500 11.5px/1 var(--mono); letter-spacing: .03em; cursor: pointer;
  opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s, background .2s;
}
.screen-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
.screen:hover .screen-btn, .screen:focus-within .screen-btn, .screen:not(.is-playing) .screen-btn { opacity: 1; transform: none; }
.screen-btn:hover { background: rgba(10,18,38,.85); }
.i-play { margin-left: 3px; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; }
.screen.is-playing .i-play { margin-left: 0; width: 8px; height: 10px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.screen:fullscreen { padding: 0; border-radius: 0; background: #000; display: grid; place-items: center; }
.screen:fullscreen video { border-radius: 0; height: 100%; object-fit: contain; }
.screen:fullscreen::before { display: none; }

@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; gap: 24px; }
  .screen { order: -1; }
  .screen::before { inset: 20% 12% -2%; opacity: .2; }
  .screen-btn { opacity: 1; transform: none; }
}
@media (max-width: 480px) {
  .work-stats dt { font-size: 20px; }
  .screen-ui { inset: auto 12px 12px 12px; }
}

/* ---------- Funders ---------- */
.funders { margin-top: clamp(56px, 7vw, 88px); padding-block: 40px clamp(48px, 7vw, 72px); border-top: 1px solid var(--line); }
.funders h2 { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.funder-row { margin-top: 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.funder {
  height: 92px; display: flex; align-items: center; justify-content: center; padding: 16px 20px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.funder:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.funder img { width: 100%; height: 100%; object-fit: contain; }
/* NAIRR banner: shown whole, on a gradient matching its own background */
.funder-dark { padding: 10px 14px; background: linear-gradient(90deg, #1c3a76, #08112f); border-color: #0c1a3a; }
@media (max-width: 760px) { .funder-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .funder { height: 76px; padding: 12px 14px; } }

/* ---------- Publications ---------- */
.pub-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; min-width: 260px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3);
}
.search:focus-within { border-color: var(--accent); }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 14px var(--sans); width: 100%; }
.search input::placeholder { color: var(--ink-3); }
@media (max-width: 560px) { .search { min-width: 0; width: 100%; } }
.pub-note { font-size: 13px; color: var(--ink-3); }
.star { color: var(--accent); }

.pub-year {
  font: 400 15px/1 var(--mono); color: var(--ink-3); padding: 28px 0 10px;
  position: sticky; top: 64px; background: var(--bg); z-index: 2;
}
.pub-group { display: grid; }
.pub {
  display: grid; grid-template-columns: 96px 1fr; gap: 20px; padding: 16px 0;
  border-top: 1px solid var(--line);
}
.pub-venue {
  align-self: start; justify-self: start; margin-top: 3px;
  font: 500 11.5px/1 var(--mono); letter-spacing: .03em; padding: 6px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.pub[data-first] .pub-venue { background: var(--accent-soft); color: var(--accent); }
.pub-title { font: 500 18px/1.35 var(--serif); letter-spacing: -0.005em; }
.pub-authors { margin-top: 4px; font-size: 14px; color: var(--ink-3); }
.pub-authors b { color: var(--ink); }
.pub-where { margin-top: 2px; font-size: 14px; color: var(--ink-2); font-style: italic; }
.pub-where .badge { font-style: normal; }
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 5px; vertical-align: 1px;
  font: 500 11px/1.6 var(--mono); background: var(--accent-soft); color: var(--accent);
}
.badge-muted { background: var(--surface-2); color: var(--ink-3); }
.pub-links { margin-top: 8px; display: flex; gap: 12px; }
.pub-links a { font: 500 12.5px/1 var(--mono); color: var(--accent); text-decoration: none; }
.pub-links a::after { content: " ↗"; }
.pub-links a:hover { text-decoration: underline; }
.pub[hidden], .pub-year[hidden], .pub-group[hidden] { display: none; }
.pub-empty { padding: 32px 0; color: var(--ink-3); }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 560px) {
  .pub { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Experience ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); }
.col-title { font: 500 12.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
.col-title:not(:first-child) { margin-top: 48px; }
.timeline { position: relative; display: grid; gap: 28px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline > li { position: relative; }
.timeline > li::before {
  content: ""; position: absolute; left: -22px; top: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--ink-3);
}
.timeline > li:first-child::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-when { font: 400 12.5px/1 var(--mono); color: var(--ink-3); }
.timeline h4 { margin-top: 8px; font: 500 19px/1.3 var(--serif); letter-spacing: -0.01em; }
.tl-where { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.tl-meta { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }
.timeline ul { margin-top: 10px; display: grid; gap: 6px; }
.timeline ul li { position: relative; padding-left: 16px; font-size: 14.5px; color: var(--ink-2); }
.timeline ul li::before { content: ""; position: absolute; left: 2px; top: .75em; width: 6px; height: 1px; background: var(--ink-3); }

.awards { display: grid; gap: 2px; }
.awards li { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.awards li:first-child { border-top: 0; padding-top: 0; }
.aw-year { font: 400 12.5px/1.8 var(--mono); color: var(--ink-3); }
.awards strong { font-weight: 500; }
.awards p { font-size: 14px; color: var(--ink-3); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project {
  display: flex; flex-direction: column; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s;
}
.project:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.project-status { align-self: flex-start; font: 500 10.5px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 5px; margin-bottom: 14px; }
.project h3 { font: 500 20px/1.25 var(--serif); letter-spacing: -0.01em; margin-bottom: 10px; }
.project p { font-size: 14.5px; color: var(--ink-2); }
.project .project-tags { margin-top: auto; padding-top: 16px; font: 400 12px/1.5 var(--mono); color: var(--ink-3); }
/* Lead project spans the full row with its own two-column layout */
.project-lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 12px 40px; padding: 28px; }
.project-lead h3 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 6px; }
.project-sub { font: 400 15px/1.45 var(--serif) !important; font-style: italic !important; color: var(--ink-2); }
.project-lead p + p { margin-top: 10px; }
.project-lead .project-tags { padding-top: 16px; }
@media (max-width: 760px) { .project-lead { grid-template-columns: 1fr; padding: 22px; } }
@media (max-width: 960px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .projects { grid-template-columns: 1fr; } }


/* ---------- See-also cards (links to sub-pages) ---------- */
.see-also { display: grid; gap: 12px; margin-top: 48px; }
.see-card {
  position: relative; display: grid; gap: 4px; padding: 18px 48px 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, transform .2s;
}
.see-card:hover { color: inherit; border-color: var(--accent); transform: translateY(-2px); }
.see-k { font: 500 20px/1.2 var(--serif); }
.see-t { font-size: 14px; color: var(--ink-3); }
.see-arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--accent); transition: transform .2s; }
.see-card:hover .see-arrow { transform: translate(4px, -50%); }

/* ---------- Highlights carousel ---------- */
.car-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; align-self: center; }
.car-count { margin-right: 8px; font: 400 13px/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.car-count b { font-weight: 500; color: var(--ink); }
.car-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 16px; line-height: 1; cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.car-btn:hover { color: var(--ink); border-color: var(--ink-3); }

.carousel { display: grid; gap: 16px; }
.car-viewport { overflow: hidden; border-radius: 18px; touch-action: pan-y; }
.car-track { display: flex; transition: transform .75s cubic-bezier(.65,0,.25,1); will-change: transform; }
.shot { flex: 0 0 100%; min-width: 0; margin: 0; position: relative; }
.shot-frame {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9; max-height: 620px; width: 100%;
  background: #141412; cursor: zoom-in; isolation: isolate;
}
/* Blurred copy fills the frame; the real photo sits on top, uncropped. */
.shot-blur { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(32px) saturate(1.15) brightness(.7); z-index: -1; }
.shot-img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.04); transition: transform 6s ease-out; }
.shot.is-active .shot-img { transform: scale(1); }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 64px clamp(18px, 3vw, 32px) clamp(18px, 2.6vw, 28px);
  display: grid; gap: 4px; color: #fff; font-size: 14px; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
}
.shot figcaption > * { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.shot.is-active figcaption > * { opacity: 1; transform: none; }
.shot.is-active figcaption strong { transition-delay: .3s; }
.shot.is-active figcaption span:last-child { transition-delay: .4s; }
.shot.is-active figcaption .shot-cat { transition-delay: .2s; }
.shot figcaption strong { font: 400 clamp(22px, 2.6vw, 30px)/1.15 var(--serif); letter-spacing: -0.01em; }
.shot figcaption span { color: rgba(255,255,255,.82); }
.shot .shot-cat { justify-self: start; margin-bottom: 4px; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); font: 500 10.5px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #fff; }

.car-thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; }
.car-thumb {
  position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; height: clamp(52px, 7vw, 80px);
  background: var(--surface-2); cursor: pointer; opacity: .5; transition: opacity .3s;
}
.car-thumb img { width: 100%; height: 100%; object-fit: cover; }
.car-thumb:hover, .car-thumb.is-active { opacity: 1; }
.car-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.car-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.car-thumb.is-active .car-progress { animation: car-fill var(--car-delay, 6s) linear forwards; }
.carousel.is-paused .car-thumb.is-active .car-progress { animation-play-state: paused; }
@keyframes car-fill { to { transform: scaleX(1); } }

@media (max-width: 640px) {
  .shot-frame { aspect-ratio: 4 / 5; }
  .car-count { display: none; }
  .car-thumbs { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .car-track, .shot-img, .shot figcaption > * { transition: none; }
  .car-thumb.is-active .car-progress { animation: none; transform: scaleX(1); }
}

.lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background: rgba(10,10,9,.9); opacity: 0; pointer-events: none; transition: opacity .25s;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox figure { margin: 0; max-width: min(1100px, 100%); display: grid; gap: 12px; }
.lightbox img { max-height: 78vh; width: auto; margin-inline: auto; border-radius: 10px; }
.lightbox figcaption { color: #eeebe4; text-align: center; font-size: 14px; }
.lightbox .shot-cat { display: block; font: 500 10.5px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #c9c4b8; }
.lightbox figcaption strong { font: 500 20px/1.3 var(--serif); display: block; }
.lightbox button { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font-size: 22px; cursor: pointer; }

/* ---------- Sub-pages ---------- */
.page-hero { padding-top: clamp(48px, 8vw, 96px); padding-bottom: 8px; }
.crumb { font: 400 13px/1 var(--mono); color: var(--ink-3); text-decoration: none; }
.page-hero h1 { margin-top: 20px; font: 400 clamp(44px, 7vw, 80px)/1 var(--serif); letter-spacing: -0.035em; }
.page-hero h1 em { color: var(--accent); }
.page-hero .lede { max-width: 52ch; }

.honor { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.honor:first-child { border-top: 0; padding-top: 0; }
.honor-year { font: 400 clamp(30px, 4vw, 40px)/1 var(--serif); color: var(--ink-3); }
.honor-kind { font: 500 11px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.honor h3 { margin-top: 6px; font: 500 clamp(22px, 2.6vw, 28px)/1.2 var(--serif); letter-spacing: -0.015em; }
.honor p { margin-top: 8px; color: var(--ink-2); max-width: 66ch; }
.honor.is-major h3::after { content: "★"; margin-left: 10px; font-size: .7em; color: var(--accent); vertical-align: .15em; }
@media (max-width: 600px) { .honor { grid-template-columns: 1fr; gap: 8px; } }

.mentees { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mentee { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.mentee strong { font: 500 18px/1.3 var(--serif); }
.mentee p { margin-top: 4px; font-size: 14.5px; color: var(--ink-2); }
.mentee .out { margin-top: 10px; display: inline-block; font: 500 11px/1.5 var(--mono); padding: 2px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); }
@media (max-width: 680px) { .mentees { grid-template-columns: 1fr; } }

.review-list { display: grid; }
.review-list li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.review-list li:first-child { border-top: 0; }
.review-list .rv-meta { font: 400 12.5px/1.6 var(--mono); color: var(--ink-3); white-space: nowrap; }

/* ---------- Service ---------- */
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.panel h3 { font: 500 22px/1.2 var(--serif); margin-bottom: 14px; }
.panel h3.mt { margin-top: 26px; }
.panel > p { font-size: 14.5px; color: var(--ink-2); margin-bottom: 12px; }
.panel-sub { font: 500 11px/1 var(--mono) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3) !important; margin: 18px 0 10px !important; }
.panel-sub:first-of-type { margin-top: 0 !important; }
.plain { display: grid; gap: 8px; }
.plain li { position: relative; padding-left: 16px; font-size: 14.5px; color: var(--ink-2); }
.plain li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .7; }
.panel .skills { font: 400 13px/1.8 var(--mono); color: var(--ink-2); }
@media (max-width: 960px) { .three-col { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 22px; font-size: 13px; color: var(--ink-3); }
.footer-inner a { color: var(--ink-3); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .pub-tools, .more, .actions, .screen, .carousel, .car-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .news.is-collapsed li { display: grid !important; }
  .section { padding-top: 24px; }
}
.subpage .brand-name { opacity: 1; transform: none; }
.intro { max-width: 70ch; color: var(--ink-2); margin-bottom: 24px; }

/* A* venue marker */
.astar { color: var(--accent); font-size: 1.05em; line-height: 1; }
.venue-tag .astar { color: #f5a97f; }
:root[data-theme="dark"] .venue-tag .astar { color: #b4401b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .venue-tag .astar { color: #b4401b; } }

/* Selected publications → full list */
.read-more { margin-top: 28px; }
.read-more span { transition: transform .15s; }
.read-more:hover span { transform: translateX(3px); }
.section-tight { padding-top: 32px; }
.see-also:first-child { margin-top: 0; }
.subpage main { padding-bottom: clamp(64px, 9vw, 104px); }
