/* ==========================================================================
   Jay Vakil — site styles
   Dark by default (follows the OS until the visitor picks a theme).
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-raised: #121214;
  --fg: #ededee;
  --fg-2: #a6a6ad;
  --fg-3: #7f7f87;
  --line: rgb(255 255 255 / 0.08);
  --line-2: rgb(255 255 255 / 0.15);
  --accent: #ff5a1f;
  --accent-text: #ff7a45;
  --glow: rgb(255 255 255 / 0.05);
  --media-bg: #16161a;

  /* Read by the robot viewer (assets/js/fr3-viewer.js). */
  --stage-grid: 255 255 255;
  --stage-grid-alpha: 0.14;
  --stage-shadow: 0.55;

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --max: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f6f6f4;
    --bg-raised: #ffffff;
    --fg: #111113;
    --fg-2: #4d4d54;
    --fg-3: #6b6b73;
    --line: rgb(0 0 0 / 0.08);
    --line-2: rgb(0 0 0 / 0.15);
    --accent: #f0551a;
    --accent-text: #c2410c;
    --glow: rgb(255 255 255 / 0.9);
    --media-bg: #ebebe8;
    --stage-grid: 0 0 0;
    --stage-grid-alpha: 0.11;
    --stage-shadow: 0.22;
  }
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f6f4;
  --bg-raised: #ffffff;
  --fg: #111113;
  --fg-2: #4d4d54;
  --fg-3: #6b6b73;
  --line: rgb(0 0 0 / 0.08);
  --line-2: rgb(0 0 0 / 0.15);
  --accent: #f0551a;
  --accent-text: #c2410c;
  --glow: rgb(255 255 255 / 0.9);
  --media-bg: #ebebe8;
  --stage-grid: 0 0 0;
  --stage-grid-alpha: 0.11;
  --stage-shadow: 0.22;
}

/* ---------------------------------------------------------------- base -- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, video, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, ul, ol, figure, h1, h2, h3 { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.label { font: 500 11.5px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.icon { width: 16px; height: 16px; fill: currentColor; flex: none; }

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 100;
  padding: 10px 14px; border-radius: 8px;
  background: var(--fg); color: var(--bg); font-weight: 500;
  transform: translateY(-160%); transition: transform 0.2s var(--ease);
}
.skip:focus { transform: none; }

.link {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
.link:hover { text-decoration-color: var(--accent); color: var(--fg); }

.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--fg-2); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--fg-3); }

/* ----------------------------------------------------------------- nav -- */

.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: 64px;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.is-scrolled, .nav.is-open {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; margin-right: auto; }
.brand svg { width: 22px; height: 22px; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 7px 12px; border-radius: 999px;
  font-size: 14px; color: var(--fg-2);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--fg); background: var(--line); }
.nav-link.is-active { color: var(--fg); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.theme-toggle .i-sun, :root[data-theme-resolved='light'] .theme-toggle .i-moon { display: none; }
:root[data-theme-resolved='light'] .theme-toggle .i-sun { display: block; }
.menu-toggle { display: none; }
.menu-toggle .i-close, .nav.is-open .menu-toggle .i-menu { display: none; }
.nav.is-open .menu-toggle .i-close { display: block; }

/* ---------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  min-height: clamp(660px, 100svh, 980px);
  display: flex; align-items: center;
  isolation: isolate;
  overflow: clip;
}

.stage { position: absolute; inset: 0; z-index: 0; --stage-shift: 0.21; }
.stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(46% 58% at 70% 56%, var(--glow), transparent 72%);
}
.stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.2s var(--ease);
  touch-action: pan-y; cursor: crosshair; outline: none;
}
.stage[data-state='ready'] canvas { opacity: 1; }

.stage-loader, .stage-fallback {
  position: absolute; left: 71%; top: 54%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
.stage-loader { opacity: 0; }
.stage[data-state='loading'] .stage-loader { opacity: 1; }
.stage[data-state='error'] .stage-loader { transition: none; }
.loader-bar { width: 180px; height: 1px; background: var(--line-2); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: calc(var(--progress, 0) * 100%); background: var(--accent); transition: width 0.25s linear; }
.stage-fallback { display: none; max-width: 300px; color: var(--fg-3); font-size: 14px; }
.stage[data-state='error'] .stage-fallback { display: flex; }

.hero-copy { position: relative; z-index: 1; max-width: 580px; padding-block: 120px 96px; }
.identity { display: flex; align-items: center; gap: clamp(20px, 2.4vw, 32px); margin-bottom: 28px; }
.portrait {
  position: relative; flex: none; padding: 0; cursor: pointer;
  width: clamp(136px, 12.5vw, 184px); aspect-ratio: 4 / 5;
  border-radius: 18px; border: 1px solid var(--line-2); overflow: hidden;
  background: var(--media-bg);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s var(--ease); }
.portrait.is-swapping img { opacity: 0; }
.portrait-hint {
  position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 999px; background: rgb(0 0 0 / 0.55); color: #fff; font-size: 14px;
  opacity: 0; transition: opacity 0.2s;
}
.portrait:hover .portrait-hint, .portrait:focus-visible .portrait-hint { opacity: 1; }
.identity-role { color: var(--fg-2); margin-bottom: 14px; }

.hero-title { font-size: clamp(44px, 6vw, 84px); line-height: 0.95; letter-spacing: -0.045em; font-weight: 600; }
.hero-lead { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.45; letter-spacing: -0.01em; color: var(--fg); margin-bottom: 14px; text-wrap: pretty; }
.hero-bio { color: var(--fg-2); font-size: 16px; max-width: 520px; text-wrap: pretty; }
.hero-bio a { color: var(--fg); }

.hero-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; font-size: 15px; }
.hero-links a {
  display: inline-flex; align-items: center; gap: 7px; padding-bottom: 2px;
  color: var(--fg); border-bottom: 1px solid var(--line-2); transition: border-color 0.2s;
}
.hero-links a:hover { border-color: var(--accent); }
.hero-links .icon { width: 14px; height: 14px; color: var(--fg-3); transition: color 0.2s; }
.hero-links a:hover .icon { color: var(--fg); }

/* HUD overlaid on the robot stage, aligned to the page grid. */
.hud { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hud-inner {
  height: 100%; max-width: var(--max); margin-inline: auto;
  padding: 92px var(--gutter) 28px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
}
.hud-chip { display: inline-flex; align-items: center; gap: 10px; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.live-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--fg-3); }
.stage[data-state='ready'] .live-dot { background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

.hud-panel {
  display: grid; gap: 7px; justify-items: end;
  font: 400 11px/1.4 var(--mono); color: var(--fg-3);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.8s var(--ease) 0.4s, transform 0.8s var(--ease) 0.4s;
}
.stage[data-state='ready'] .hud-panel { opacity: 1; transform: none; }
.hud-head { display: flex; align-items: center; gap: 14px; }
.hud-mode { font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg); }
.stage[data-mode='auto'] .hud-mode { color: var(--accent-text); }
.hud-status { color: var(--fg-2); white-space: nowrap; min-width: 9ch; }
.hud-rate { color: var(--fg-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hud-telemetry { display: flex; align-items: center; gap: 16px; font-variant-numeric: tabular-nums; }
.hud-joints { display: flex; gap: 12px; }
.hud-joints li { display: inline-flex; align-items: center; gap: 5px; }
.hud-joints b { position: relative; width: 18px; height: 1px; background: var(--line-2); }
.hud-joints i { position: absolute; top: -2px; left: calc(var(--v, 0.5) * 100%); width: 5px; height: 5px; border-radius: 999px; background: var(--fg-2); transform: translateX(-50%); }
.hud-joints em { font-style: normal; color: var(--fg-2); }
.hud-grip { white-space: nowrap; }
.hud-grip span { color: var(--fg-2); }
.hud-hint { color: var(--fg-3); }
/* Phones and touch screens get a hands-off demo: no input, no reset, page scrolls freely. */
.hint-auto { display: none; }
.stage[data-interactive='false'] canvas { pointer-events: none; cursor: default; }
.stage[data-interactive='false'] .hud-btn, .stage[data-interactive='false'] .hint-pointer { display: none; }
.stage[data-interactive='false'] .hint-auto { display: inline; }
.hud-btn {
  pointer-events: auto; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg) 70%, transparent);
  font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2);
  cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.hud-btn:hover { color: var(--fg); border-color: var(--fg-3); }
.hud-btn .icon { width: 11px; height: 11px; }

/* ------------------------------------------------------------- sections -- */

.section { padding-block: clamp(56px, 7vw, 88px); border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-title { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.1; letter-spacing: -0.03em; }
.section-aside { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--fg-2); transition: color 0.2s; white-space: nowrap; }
.section-aside:hover { color: var(--fg); }
.section-aside .icon { width: 12px; height: 12px; }
.section-note { color: var(--fg-3); font-size: 13px; margin: -12px 0 18px; }

/* White tiles so full-colour logos read the same in both themes. */
.logo-tile {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; overflow: hidden;
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-text { font: 800 20px/1 var(--sans); letter-spacing: -0.03em; color: #111; }

/* Publications */
.pubs { border-top: 1px solid var(--line); }
.pub {
  display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px);
  padding-block: 26px; border-bottom: 1px solid var(--line);
}
.pub-media {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 10; border-radius: var(--radius);
  background: var(--media-bg); border: 1px solid var(--line);
}
.pub-media img, .pub-media video { width: 100%; height: 100%; object-fit: cover; }
.pub-media[data-fit='contain'] img { object-fit: contain; }
.pub-media[data-bg='white'] { background: #fff; }
.pub-media[data-bg='black'] { background: #000; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.venue { font: 500 12px/1 var(--mono); letter-spacing: 0.04em; color: var(--fg); }
.award { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--mono); letter-spacing: 0.02em; color: var(--accent-text); }
.award::before { content: ''; width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.pending { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--mono); letter-spacing: 0.02em; color: var(--fg-3); }
.pending::before { content: ''; width: 5px; height: 5px; border-radius: 999px; border: 1px solid currentColor; }
.pub h3 { font-size: 18px; line-height: 1.35; letter-spacing: -0.015em; margin-bottom: 8px; text-wrap: balance; }
.pub h3 a { transition: color 0.2s; }
.pub h3 a:hover { color: var(--accent-text); }
.pub-summary { color: var(--fg-2); font-size: 15px; margin-bottom: 8px; max-width: 66ch; }
.authors { color: var(--fg-3); font-size: 13.5px; line-height: 1.55; max-width: 76ch; }
.authors .me { color: var(--fg); font-weight: 500; }
.authors.is-clamped { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.authors-toggle { margin-top: 4px; padding: 0; border: 0; background: none; cursor: pointer; font: 500 12px/1.4 var(--mono); color: var(--fg-3); }
.authors-toggle:hover { color: var(--fg); }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2);
  font: 500 12px/1 var(--mono); color: var(--fg-2);
  transition: color 0.2s, border-color 0.2s;
}
a.chip:hover { color: var(--fg); border-color: var(--fg-3); }
.chip .icon { width: 11px; height: 11px; }

/* Placeholder art for papers without a teaser */
.traj { width: 100%; height: 100%; color: var(--fg-3); }

/* Experience */
.roles { border-top: 1px solid var(--line); }
.role {
  display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: clamp(18px, 3vw, 32px);
  padding-block: 24px; border-bottom: 1px solid var(--line); align-items: start;
}
.role .logo-tile { height: 76px; }
.role-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.role h3 { font-size: 18px; line-height: 1.35; letter-spacing: -0.01em; }
.role-when { font: 400 13px/1.5 var(--mono); color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.role-title { color: var(--fg); font-size: 15px; margin-top: 2px; }
.role-desc { color: var(--fg-2); font-size: 15px; margin-top: 8px; max-width: 70ch; }

/* In the news */
.news-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.news-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised);
  transition: border-color 0.2s;
}
.news-card:hover { border-color: var(--fg-3); }
.news-card .logo-tile { height: 86px; flex: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 22px; }
.news-body { display: grid; gap: 6px; align-content: start; padding: 14px 16px 16px; }
.news-outlet { font: 500 11px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.news-title { font-size: 14.5px; line-height: 1.45; color: var(--fg); transition: color 0.2s; text-wrap: pretty; }
.news-card:hover .news-title { color: var(--accent-text); }

/* Teaching & service */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 80px); }
.panel-title { font-size: 18px; letter-spacing: -0.015em; margin-bottom: 14px; }
.course-list { border-top: 1px solid var(--line); }
.course-list li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.course-code { font: 500 13px/1.5 var(--mono); color: var(--fg); }
.course-name { color: var(--fg-2); }
.panel-note { color: var(--fg-3); font-size: 14px; margin-top: 12px; }
.review-list { border-top: 1px solid var(--line); }
.review-list li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.review-year { font: 500 13px/1.5 var(--mono); color: var(--fg); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--line-2); font: 500 12px/1 var(--mono); color: var(--fg-2); }

/* Affiliations */
.affil-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.affil { display: grid; gap: 10px; text-align: center; }
.affil .logo-tile { height: 104px; padding: 16px 20px; }
.affil figcaption { font-size: 13px; line-height: 1.4; color: var(--fg-2); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: 48px 36px; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; align-items: flex-start; }
.footer-name { font-size: 20px; letter-spacing: -0.02em; font-weight: 600; }
.footer-tag { color: var(--fg-2); margin-top: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.footer-links a { color: var(--fg-2); border-bottom: 1px solid var(--line-2); padding-bottom: 1px; transition: color 0.2s, border-color 0.2s; }
.footer-links a:hover { color: var(--fg); border-color: var(--accent); }
.footer-note { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; color: var(--fg-3); font-size: 13px; }
.footer-note p { max-width: 72ch; }
.footer-note a { color: var(--fg-2); }
.footer-note a:hover { color: var(--fg); }

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 1240px) {
  .hud-telemetry { display: none; }
}

@media (max-width: 1100px) {
  .stage { --stage-shift: 0.17; }
  .hero-copy { max-width: 500px; }
  .stage-loader, .stage-fallback { left: 74%; }
  .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0s linear 0.2s;
  }
  .nav.is-open .nav-links { transform: none; opacity: 1; visibility: visible; transition: opacity 0.2s, transform 0.2s var(--ease); }
  .nav-link { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav-link:hover { background: none; }
  .menu-toggle { display: inline-grid; }
  .nav-links.nav-links-inline {
    position: static; flex-direction: row; padding: 0; gap: 2px;
    background: none; border: 0; transform: none; opacity: 1; visibility: visible;
  }
  .nav-links-inline .nav-link { padding: 7px 10px; border: 0; border-radius: 999px; font-size: 14px; }

  .hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-copy { max-width: none; padding-block: 20px 12px; }
  .stage { position: relative; inset: auto; margin-top: 64px; height: clamp(390px, 100vw, 560px); --stage-shift: 0; --stage-zoom: 0.8; --stage-lift: 0.08; }
  .stage::before { background: radial-gradient(60% 60% at 50% 55%, var(--glow), transparent 72%); }
  .stage-loader, .stage-fallback { left: 50%; top: 50%; }
  .hud-inner { padding: 14px var(--gutter) 16px; }
  .hud-telemetry, .hud-rate { display: none; }

  .pub { grid-template-columns: 1fr; gap: 16px; }
  .pub-media { max-width: 520px; }
  .role { grid-template-columns: 96px minmax(0, 1fr); }
  .role .logo-tile { height: 60px; padding: 8px 10px; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .affil-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .hero-title { font-size: 48px; }
  .portrait { width: 116px; border-radius: 16px; }
  .identity-role { margin-bottom: 8px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card { flex-direction: row; }
  .news-card .logo-tile { width: 112px; height: auto; min-height: 76px; border-bottom: 0; border-right: 1px solid var(--line); padding: 12px; }
  .news-card .logo-text { font-size: 14px; }
  .affil-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-list li, .review-list li { grid-template-columns: 90px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage[data-state='ready'] .live-dot { animation: none; }
}
