/* RIM Lab website — light theme built on the RIM brand palette (config/brand.json). */

:root {
  /* brand */
  --ink: #0b0c0f;
  --bone: #f5f4f0;
  --indigo-50: #eef1fd;
  --indigo-100: #dde3fb;
  --indigo-200: #a0adf1;
  --indigo-300: #8b98d9;
  --indigo-500: #4765df;
  --indigo-700: #222b5a;
  --indigo-900: #141b3a;
  --amber-100: #fff3db;
  --amber-300: #ffd98a;
  --amber-500: #ffb13b;

  /* roles */
  --bg: var(--bone);
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --text: #1a1d26;
  --text-muted: #5d6170;
  --text-soft: #8a8e9b;
  --heading: var(--indigo-900);
  --accent: var(--indigo-500);
  --accent-ink: var(--indigo-700);
  --spark: var(--amber-500);
  --line: rgba(34, 43, 90, 0.1);
  --line-strong: rgba(34, 43, 90, 0.18);

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(20, 27, 58, 0.06), 0 2px 8px rgba(20, 27, 58, 0.04);
  --shadow: 0 2px 6px rgba(20, 27, 58, 0.05), 0 12px 32px rgba(20, 27, 58, 0.08);
  --shadow-lg: 0 8px 20px rgba(20, 27, 58, 0.08), 0 30px 60px rgba(20, 27, 58, 0.12);

  /* serif for headings (academic), sans for UI and body text */
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Noto Serif SC", "Songti SC", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-serif);
  --font-ui: var(--font-sans);
  --font-body: var(--font-sans);
  --container: 1200px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--heading); line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.005em; font-optical-sizing: auto; }
p { margin: 0 0 1em; }
::selection { background: var(--amber-300); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; position: relative; }
.section--tight { padding: 48px 0; }
.section--white { background: var(--surface); }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- section headings ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-ui); font-weight: 600; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 10px;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--spark); box-shadow: 0 0 0 4px rgba(255, 177, 59, 0.2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; padding-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.section-head h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 0; }
.section-head p { max-width: 600px; margin: 8px 0 0; color: var(--text-muted); font-size: 15.5px; }
.link-arrow { font-family: var(--font-ui); font-size: 14.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.link-arrow svg { transition: transform 0.25s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(245, 244, 240, 0.72);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(245, 244, 240, 0.88); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-family: var(--font-ui); font-weight: 500; font-size: 14.5px; color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.nav a:hover { background: rgba(71, 101, 223, 0.08); color: var(--accent-ink); }
.nav a.is-active { background: var(--indigo-700); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--heading); }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 16px 20px; background: rgba(245, 244, 240, 0.97); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: 0.25s var(--ease);
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 16px; font-size: 17px; }
}

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 20px; border-radius: 999px;
  font-family: var(--font-ui); font-weight: 600; font-size: 14.5px; border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.2s, color 0.2s; cursor: pointer;
}
.btn--primary { background: var(--indigo-700); color: #fff; box-shadow: 0 8px 22px rgba(34, 43, 90, 0.22); }
.btn--primary:hover { color: #fff; background: var(--indigo-900); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(34, 43, 90, 0.28); }
.btn--ghost { background: rgba(255, 255, 255, 0.7); color: var(--heading); border-color: var(--line-strong); }
.btn--ghost:hover { color: var(--heading); background: #fff; transform: translateY(-2px); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; background: var(--indigo-50); color: var(--accent-ink); white-space: nowrap;
}
.chip--amber { background: var(--amber-100); color: #8a5300; }
.chip--ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--text-muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.filter-bar button {
  font: 500 14px var(--font-body); padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text-muted); border: 1px solid var(--line-strong); transition: 0.2s;
}
.filter-bar button:hover { color: var(--accent-ink); border-color: var(--indigo-200); }
.filter-bar button.is-active { background: var(--indigo-700); color: #fff; border-color: var(--indigo-700); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 36px 0 40px; overflow: hidden; isolation: isolate; }
.hero-canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(160, 173, 241, 0.35), transparent 60%),
    radial-gradient(600px 400px at 10% 90%, rgba(255, 217, 138, 0.28), transparent 60%);
}
.hero .container { display: grid; grid-template-columns: 1fr 1.08fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(32px, 3.6vw, 50px); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; margin-bottom: 16px; }
.hero h1 .grad { font-style: italic; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--indigo-500) 10%, var(--indigo-300) 55%, var(--amber-500) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 17px; color: var(--text-muted); max-width: 540px; margin-bottom: 24px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.hero-stat { display: flex; align-items: baseline; gap: 8px; }
.hero-stat .stat-value { font: 600 30px/1 var(--font-serif); color: var(--heading); }
.hero-stat .stat-label { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-media {
  position: relative; aspect-ratio: 16 / 11; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); background: var(--indigo-100);
}
.hero-media::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img, .hero-slide video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 7s linear; }
.hero-slide.is-active img { transform: scale(1); }
.hero-caption {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 14px; color: #fff;
  background: rgba(20, 27, 58, 0.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-ui); font-weight: 500; font-size: 14px;
}
.hero-caption a { color: #fff; }
.hero-dots { display: flex; gap: 6px; flex-shrink: 0; }
.hero-dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(255, 255, 255, 0.45); cursor: pointer; transition: 0.3s; }
.hero-dots button.is-active { width: 22px; border-radius: 4px; background: var(--spark); }
.hero-float {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow);
  font: 600 13px var(--font-ui); color: var(--heading); animation: float 6s ease-in-out infinite;
}
.hero-float .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--indigo-50); color: var(--accent); }
.hero-float--a { top: 22px; left: -18px; }
.hero-float--b { top: 38%; right: -16px; animation-delay: -3s; }
.hero-float--b .dot { background: var(--amber-100); color: #b26b00; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hero-media-wrap { position: relative; }
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero-float--a { left: 12px; top: 12px; }
  .hero-float--b { right: 12px; }
}

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--surface); overflow: hidden; padding: 12px 0; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: inline-flex; align-items: center; gap: 12px; font: italic 500 18px var(--font-serif); color: var(--heading); white-space: nowrap; }
.marquee-item .spark { color: var(--spark); font-size: 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- about + stats ---------- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: start; }
.about-text p { font-size: 16.5px; color: var(--text); }
.about-text .eyebrow + p { font: 400 21px/1.5 var(--font-serif); color: var(--heading); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat { padding: 26px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stat-value { font: 600 40px/1 var(--font-serif); color: var(--heading); letter-spacing: -0.02em; }
.stat-value .plus { color: var(--spark); }
.stat-label { margin-top: 8px; color: var(--text-muted); font-size: 14px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- research cards ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.topic-card {
  position: relative; padding: 22px 22px 20px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); overflow: hidden; color: var(--text);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.topic-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.35s;
  background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 0%), rgba(71, 101, 223, 0.1), transparent 70%);
}
.topic-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--indigo-200); color: var(--text); }
.topic-card:hover::before { opacity: 1; }
.topic-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--indigo-50), var(--indigo-100)); color: var(--accent);
}
.topic-card:nth-child(3n + 2) .topic-icon { background: linear-gradient(135deg, var(--amber-100), #ffe7b8); color: #c27800; }
.topic-num { position: absolute; top: 18px; right: 20px; font: italic 500 15px var(--font-serif); color: var(--text-soft); }
.topic-card h3 { font-size: 18.5px; margin-bottom: 8px; position: relative; }
.topic-card p { color: var(--text-muted); font-size: 14.5px; line-height: 1.55; margin: 0; position: relative; }

/* ---------- project cards ---------- */
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .project-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .project-grid, .project-grid--3 { grid-template-columns: 1fr; } }
.project-card {
  display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); overflow: hidden; color: var(--text);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); color: var(--text); }
.project-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--indigo-50); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.project-card:hover .project-thumb img { transform: scale(1.05); }
.project-thumb .chip { position: absolute; top: 14px; left: 14px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); }
.project-thumb .play {
  position: absolute; right: 14px; bottom: 14px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: var(--accent-ink);
}
.project-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-venue { font: 600 12px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #b26b00; }
.project-body h3 { font-size: 19.5px; margin: 0; }
.project-body p { color: var(--text-muted); font-size: 15px; margin: 0; }
.project-body .chip-row { margin-top: auto; padding-top: 6px; }

/* featured (home): first card large */
.feature-grid { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto auto; gap: 24px; }
.feature-grid .project-card:first-child { grid-row: span 2; }
.feature-grid .project-card:first-child .project-thumb { aspect-ratio: auto; flex: 1; min-height: 340px; }
.feature-grid .project-card:not(:first-child) { flex-direction: row; }
.feature-grid .project-card:not(:first-child) .project-thumb { aspect-ratio: auto; width: 42%; flex-shrink: 0; }
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid .project-card:first-child { grid-row: auto; }
  .feature-grid .project-card:not(:first-child) { flex-direction: column; }
  .feature-grid .project-card:not(:first-child) .project-thumb { width: 100%; aspect-ratio: 16 / 10; }
}

/* ---------- link pills (paper / code / ...) ---------- */
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.links a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text-muted); }
.links a:hover { color: var(--accent); }
.links svg { width: 15px; height: 15px; }

/* ---------- research page ---------- */
.page-hero { padding: 40px 0 28px; margin-bottom: 8px; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.55;
  background-image: radial-gradient(rgba(71, 101, 223, 0.22) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000); mask-image: linear-gradient(90deg, transparent 35%, #000);
}
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(700px 300px at 90% 0%, rgba(160, 173, 241, 0.3), transparent 65%);
}
.page-hero h1 { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 10px; }
.page-hero p { font-size: 16.5px; color: var(--text-muted); max-width: 720px; margin: 0; }

.topic-index { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.topic-index li { border-bottom: 1px solid var(--line); }
.topic-index a { display: grid; grid-template-columns: 64px 1fr 1.4fr 24px; gap: 20px; align-items: center; padding: 15px 4px; color: var(--text); transition: background 0.2s, padding 0.3s var(--ease); }
.topic-index a:hover { background: var(--surface); padding-left: 16px; color: var(--text); }
.topic-index .n { font: italic 500 18px var(--font-serif); color: var(--accent); }
.topic-index .t { font: 600 17.5px var(--font-serif); color: var(--heading); }
.topic-index .d { color: var(--text-muted); font-size: 15px; }
.topic-index svg { color: var(--text-soft); }
@media (max-width: 760px) {
  .topic-index a { grid-template-columns: 40px 1fr 20px; }
  .topic-index .d { display: none; }
}
.topic-section { padding: 48px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 12px); }
.topic-section-head { display: grid; grid-template-columns: 64px 1fr; gap: 20px; margin-bottom: 32px; }
.topic-section-head .n { font: italic 500 30px/1 var(--font-serif); color: var(--accent); padding-top: 4px; }
.topic-section-head h2 { font-size: 26px; margin-bottom: 8px; }
.topic-section-head p { color: var(--text-muted); max-width: 760px; margin: 0; }
.topic-section .project-grid { margin-left: 84px; }
@media (max-width: 760px) { .topic-section-head { grid-template-columns: 1fr; gap: 8px; } .topic-section .project-grid { margin-left: 0; } }
.empty-note { padding: 28px; border-radius: var(--radius); border: 1px dashed var(--line-strong); color: var(--text-muted); text-align: center; background: rgba(255, 255, 255, 0.5); }

/* ---------- project detail ---------- */
.detail-hero { position: relative; height: min(52vh, 520px); min-height: 340px; overflow: hidden; background: var(--indigo-900); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 27, 58, 0) 35%, rgba(20, 27, 58, 0.78) 100%); }
.detail-hero .container { position: absolute; left: 0; right: 0; bottom: 44px; z-index: 2; }
.detail-hero h1 { color: #fff; font-size: clamp(28px, 3.6vw, 44px); max-width: 900px; margin-bottom: 12px; }
.detail-hero p { color: rgba(255, 255, 255, 0.86); font-size: 17px; max-width: 760px; margin: 0; }
.detail-hero .chip { background: rgba(255, 255, 255, 0.18); color: #fff; backdrop-filter: blur(8px); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, 0.85); font-weight: 500; margin-bottom: 18px; }
.back-link:hover { color: #fff; }
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 56px; align-items: start; }
.detail-main h2 { font-size: 23px; margin: 40px 0 16px; }
.detail-main h2:first-child { margin-top: 0; }
.detail-main p { font-size: 16.5px; }
.detail-main ul.highlights { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.detail-main ul.highlights li { padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; display: flex; gap: 10px; align-items: center; }
.detail-main ul.highlights li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--spark); flex-shrink: 0; }
.detail-aside { position: sticky; top: calc(var(--header-h) + 24px); padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.detail-aside h4 { font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-soft); margin: 0 0 10px; }
.detail-aside > div + div { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.detail-aside .links { flex-direction: column; gap: 10px; }
.placeholder-note { margin-top: 16px; font-size: 13px; color: var(--text-soft); }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } .detail-aside { position: static; } }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.prev-next a { padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--heading); transition: 0.3s var(--ease); }
.prev-next a:hover { border-color: var(--indigo-200); transform: translateY(-3px); box-shadow: var(--shadow); }
.prev-next small { display: block; color: var(--text-soft); font-size: 13px; margin-bottom: 4px; }
.prev-next strong { font-family: var(--font-serif); font-size: 17px; }
.prev-next .next { text-align: right; }

/* ---------- video ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.detail-main .video-grid { grid-template-columns: 1fr; } /* project pages: one large player per row */
.video-card { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--indigo-900); }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video-frame video { object-fit: contain; } /* show the whole frame, e.g. wide experiment dashboards */
.video-frame .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.3s; }
.video-frame button.play-btn {
  position: absolute; inset: 0; margin: auto; width: 70px; height: 70px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.92); color: var(--accent-ink); display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2); transition: transform 0.3s var(--ease);
}
.video-frame:hover button.play-btn { transform: scale(1.08); }
.video-frame:hover .poster { opacity: 1; }
.video-info { padding: 16px 20px 20px; }
.video-info h3 { font-size: 18px; margin: 0 0 4px; }
.video-info p { margin: 0; color: var(--text-soft); font-size: 14px; }

/* ---------- gallery + lightbox ---------- */
.gallery { columns: 3 280px; column-gap: 18px; }
.gallery figure { margin: 0 0 18px; break-inside: avoid; border-radius: var(--radius); overflow: hidden; position: relative; cursor: zoom-in; background: var(--indigo-50); }
.gallery img { width: 100%; transition: transform 0.6s var(--ease); }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 14px; color: #fff; font-size: 14px; font-weight: 500; background: linear-gradient(transparent, rgba(20, 27, 58, 0.7)); opacity: 0; transition: opacity 0.3s; }
.gallery figure:hover figcaption { opacity: 1; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 27, 58, 0.88); backdrop-filter: blur(6px); display: none; place-items: center; padding: 32px; cursor: zoom-out; }
.lightbox.is-open { display: grid; }
.lightbox img { max-height: 84vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox p { color: #fff; text-align: center; margin-top: 14px; }

/* ---------- news ---------- */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-list time { font: 600 13.5px var(--font-ui); color: var(--accent); padding-top: 2px; }
.news-list div { color: var(--text); }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 64px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 48px; } }
.aff-list { display: grid; gap: 12px; }
.aff {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: 0.3s var(--ease);
}
a.aff:hover { border-color: var(--indigo-200); transform: translateX(4px); color: var(--text); }
.aff-badge { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--indigo-50); color: var(--accent-ink); font: 700 13px var(--font-ui); flex-shrink: 0; overflow: hidden; }
.aff-badge img { width: 100%; height: 100%; object-fit: contain; }
.aff strong { display: block; font-family: var(--font-display); color: var(--heading); }
.aff span { font-size: 14px; color: var(--text-muted); }

/* ---------- publications ---------- */
.pub-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 46px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-soft);
}
.search input { border: 0; outline: 0; flex: 1; font: 15px var(--font-body); background: transparent; color: var(--text); }
.pub-year { display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.pub-year > h2 { font-size: 26px; font-style: italic; color: var(--indigo-300); position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
.pub { padding: 0 0 22px; }
.pub + .pub { padding-top: 22px; border-top: 1px dashed var(--line); }
.pub-title { font: 600 17.5px/1.4 var(--font-serif); color: var(--heading); margin-bottom: 4px; }
.pub-authors { color: var(--text-muted); font-size: 15px; }
.pub-authors b { color: var(--text); font-weight: 600; }
.pub-venue { font-style: italic; color: var(--text); font-size: 15px; margin: 2px 0 8px; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
@media (max-width: 640px) { .pub-year { grid-template-columns: 1fr; gap: 8px; } .pub-year > h2 { position: static; } }

/* ---------- people ---------- */
.people-group { margin-bottom: 48px; }
.people-group > h2 { font-size: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.people-grid--pi { grid-template-columns: 1fr; }
.person { text-align: center; padding: 22px 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: 0.35s var(--ease); }
.person:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.avatar {
  width: 104px; height: 104px; margin: 0 auto 14px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--indigo-100), var(--indigo-50)); color: var(--accent);
  font: 500 32px var(--font-serif); box-shadow: 0 0 0 5px #fff, 0 0 0 6px var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { font-size: 17px; margin-bottom: 2px; }
.person .role { color: var(--accent); font-size: 14px; font-weight: 500; }
.person .interests { color: var(--text-muted); font-size: 13.5px; margin: 8px 0 0; }
.person .links { justify-content: center; margin-top: 12px; }
.person--pi { display: grid; grid-template-columns: 200px 1fr; gap: 36px; text-align: left; padding: 32px; align-items: center; }
.person--pi { grid-template-columns: 160px 1fr; }
.person--pi .avatar { width: 160px; height: 160px; margin: 0; font-size: 48px; }
.person--pi h3 { font-size: 24px; }
.person--pi .links { justify-content: flex-start; }
.person--pi .bio { color: var(--text-muted); margin: 12px 0 0; }
@media (max-width: 640px) { .person--pi { grid-template-columns: 1fr; text-align: center; } .person--pi .avatar { margin: 0 auto; } .person--pi .links { justify-content: center; } }
.is-placeholder { opacity: 0.7; }
.is-placeholder .avatar { background: repeating-linear-gradient(45deg, var(--indigo-50), var(--indigo-50) 8px, #fff 8px, #fff 16px); }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.contact-card { padding: 32px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.contact-card h3 { font-size: 20px; }
.contact-card p { color: var(--text-muted); }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */
.cta {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 40px 44px;
  background: linear-gradient(120deg, var(--indigo-700), var(--indigo-500) 70%, var(--indigo-300));
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.cta::after { content: ""; position: absolute; width: 360px; height: 360px; right: -80px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 177, 59, 0.55), transparent 65%); }
.cta h2 { color: #fff; font-size: clamp(22px, 2.6vw, 30px); margin: 0 0 8px; position: relative; }
.cta p { color: rgba(255, 255, 255, 0.82); margin: 0; max-width: 580px; position: relative; }
.cta .btn { background: #fff; color: var(--indigo-900); position: relative; z-index: 1; }
.cta .btn:hover { background: var(--amber-300); color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { margin-top: 72px; background: var(--indigo-900); color: rgba(255, 255, 255, 0.7); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; }
.site-footer img { height: 44px; margin-bottom: 18px; }
.site-footer h4 { color: #fff; font-family: var(--font-ui); font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer a { color: rgba(255, 255, 255, 0.78); }
.site-footer a:hover { color: var(--amber-300); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal.no-anim { transition: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 52px 0; }
  .cta { padding: 40px 24px; }
}

/* grid children may shrink below their content width (prevents horizontal overflow on phones) */
.hero .container > *, .about-grid > *, .split > *, .detail-layout > *, .footer-grid > *, .contact-grid > *, .feature-grid > * { min-width: 0; }
.hero h1, .page-hero h1, .detail-hero h1 { overflow-wrap: break-word; }
