/* rohamzn.com — single stylesheet. No inline styles anywhere (CSP: style-src 'self'). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable.woff2") format("woff2");
}

/* ---------- tokens (spec §5) ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --ink: #1f2328;
  --ink-2: #4f5963;
  --ink-3: #818b98;
  --rule: #d1d9e0;
  --accent: #e8620e;
  --accent-ink: #c2410c;
  --slam-pt: #6e7781;
  --slam-pt-new: #3d444d;
  --slam-traj: #4b535d;
  --slam-acc: #e8620e;
  --slam-w-op: .8;
  --slam-wedge-op: .11;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(16px, 4vw, 32px);
  --col: 760px;
  --wide: 1120px;
  --nav-h: 60px;
  --radius: 12px;
  --img-dim: none;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-soft: #151b23;
    --ink: #e6edf3;
    --ink-2: #b1bac4;
    --ink-3: #6e7681;
    --rule: #3d444d;
    --accent: #ff8f4a;
    --accent-ink: #ff8f4a;
    --slam-pt: #7d8590;
    --slam-pt-new: #c9d1d9;
    --slam-traj: #b7bfc8;
    --slam-acc: #ff8f4a;
    --slam-w-op: .62;
    --slam-wedge-op: .14;
    --img-dim: brightness(.88) contrast(1.04);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-soft: #151b23;
  --ink: #e6edf3;
  --ink-2: #b1bac4;
  --ink-3: #6e7681;
  --rule: #3d444d;
  --accent: #ff8f4a;
  --accent-ink: #ff8f4a;
  --slam-pt: #7d8590;
  --slam-pt-new: #c9d1d9;
  --slam-traj: #b7bfc8;
  --slam-acc: #ff8f4a;
  --slam-w-op: .62;
  --slam-wedge-op: .14;
  --img-dim: brightness(.88) contrast(1.04);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  /* keep keyboard focus clear of the sticky header (WCAG 2.4.11) */
  scroll-padding-top: calc(var(--nav-h) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
/* key phrases: primary ink + 600 so they stand out of secondary (--ink-2) copy in both themes */
strong { font-weight: 600; color: var(--ink); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* In-text links keep the text colour (--ink in body copy, --ink-2 in secondary copy) with an
   accent underline (>= 3:1 against the page in both themes); the accent colour only appears on hover / keyboard focus.
   Zero specificity (:where) so buttons, nav and icon links keep their own styling. */
:where(a) {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
  transition: text-decoration-color .15s ease, color .15s ease;
}
:where(a:hover, a:focus-visible) { color: var(--accent-ink); text-decoration-color: var(--accent); }
:where(a:hover, a:focus-visible) strong { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 4px;
}
main:focus { outline: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.date {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--ink-2);
  white-space: nowrap;
}
.sep { color: var(--ink-3); padding: 0 .15em; }
.print-only { display: none; }
.nw { white-space: nowrap; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 500; font-size: 14px;
}
.skip:focus { top: 12px; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: border-color .2s ease;
}
html.js .site-header:not(.is-scrolled) { border-bottom-color: transparent; }
.nav {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex; align-items: center; gap: 24px;
}
.nav-name {
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  margin-right: auto;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  position: relative; display: block;
  padding: 6px 10px; border-radius: 6px;
  font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -11px;
  height: 2px; border-radius: 1px; background: var(--accent);
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-right: -8px;
  border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.theme-toggle:hover { color: var(--ink); background: var(--bg-soft); }
.theme-toggle .ic { width: 18px; height: 18px; }
/* reserve the toggle's slot from first paint (html.js is set by theme-init.js); site.js reveals it, so the nav never shifts */
html.js .theme-toggle[hidden] { display: inline-flex !important; visibility: hidden; }
.ic-sun { display: none; }
:root[data-theme="dark"] .ic-sun { display: block; }
:root[data-theme="dark"] .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-sun { display: block; }
  :root:not([data-theme="light"]) .ic-moon { display: none; }
}

/* ---------- hero ---------- */
.hero {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 72px var(--gutter) 48px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: center;
}
/* the hero is a full-bleed banner band in both themes: near-black with its own (dark) tokens,
   so text, buttons, links and the SLAM colours adapt; light mode #0d1117, dark mode a deeper #010409 */
.hero {
  --band: #0d1117;
  --bg: var(--band);
  --bg-soft: #151b23;
  --ink: #e6edf3;
  --ink-2: #b1bac4;
  --ink-3: #6e7681;
  --rule: #3d444d;
  --accent: #ff8f4a;
  --accent-ink: #ff8f4a;
  --slam-pt: #7d8590;
  --slam-pt-new: #c9d1d9;
  --slam-traj: #b7bfc8;
  --slam-acc: #ff8f4a;
  --slam-w-op: .62;
  --slam-wedge-op: .14;
  color-scheme: dark;
  color: var(--ink);
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
  padding-top: 64px;
  padding-bottom: 64px;
}
/* dark mode: a deeper band than the page, closed by a full-bleed hairline */
:root[data-theme="dark"] .hero {
  --band: #010409;
  box-shadow: 0 0 0 100vmax var(--band), 0 1px 0 100vmax #21262d;
  clip-path: inset(0 -100vmax -1px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero {
    --band: #010409;
    box-shadow: 0 0 0 100vmax var(--band), 0 1px 0 100vmax #21262d;
    clip-path: inset(0 -100vmax -1px);
  }
}
.hero h1 {
  font-size: clamp(2rem, 1.1rem + 2.7vw, 3.25rem);
  line-height: 1.06;
  font-weight: 650;
  letter-spacing: -0.028em;
  color: var(--ink);
}
/* the surname moves to its own line as one unit, but can still wrap under text-spacing or large default fonts (WCAG 1.4.10 / 1.4.12) */
.hero h1 .nw { display: inline-block; white-space: normal; }
.tagline {
  margin-top: 16px;
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
  line-height: 1.45;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.tagline .dot { color: var(--accent); padding: 0 .2em; }
.roles {
  margin-top: 24px;
  padding-left: 14px;
  border-left: 2px solid var(--rule);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}
.roles li + li { margin-top: 4px; }
.roles .org { color: var(--ink); font-weight: 600; white-space: nowrap; }
.hero-loc { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.btns { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, opacity .15s ease;
}
.btn .ic { color: var(--ink-2); transition: color .15s ease; }
.btn:hover { border-color: var(--ink-3); background: var(--bg-soft); }
.btn:hover .ic { color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary .ic, .btn-primary:hover .ic { color: var(--bg); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); opacity: .86; }
.profiles { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 20px; }

.hero-figure { min-width: 0; position: relative; }
.slam-pause {
  position: absolute; right: -6px; bottom: -4px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.slam-pause:hover { color: var(--ink); background: var(--bg-soft); }
.slam-pause .ic { width: 14px; height: 14px; }
.slam-pause .ic-play, .slam-pause[aria-pressed="true"] .ic-pause { display: none; }
.slam-pause[aria-pressed="true"] .ic-play { display: block; }
/* JS adds .has-pause when the control is shown: the caption makes room for it on the right */
.hero-figure.has-pause .slam-caption { padding-right: 30px; }
/* no JS, or the SLAM scripts failed to load (site.js adds .no-slam): drop the empty figure */
html:not(.js) .hero-figure, html.no-slam .hero-figure { display: none; }

/* the hero visual follows the theme: light → SfM turntable (SVG), dark → SLAM run (canvas) */
.hero-tt { display: none; width: 100%; height: auto; }
:root[data-theme="light"] .hero-tt { display: block; }
:root[data-theme="light"] .hero-figure .slam,
:root[data-theme="light"] .hero-figure .slam-caption,
:root[data-theme="light"] .hero-figure #slam-pause { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero-tt { display: block; }
  :root:not([data-theme="dark"]) .hero-figure .slam,
  :root:not([data-theme="dark"]) .hero-figure .slam-caption,
  :root:not([data-theme="dark"]) .hero-figure #slam-pause { display: none; }
}
/* the turntable's pause control (WCAG 2.2.2): shown only with the turntable, i.e. in light mode */
.hero-figure .tt-pause { display: none; }
:root[data-theme="light"] .hero-figure .tt-pause { display: inline-flex; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero-figure .tt-pause { display: inline-flex; }
}
html:not(.js) .hero, html.no-slam .hero { grid-template-columns: minmax(0, 1fr); }
.slam {
  display: block;
  width: 100%;
  aspect-ratio: 1.8 / 1;
  height: auto;
}
.slam-caption {
  margin-top: 8px;
  min-height: 1.5em;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.slam-caption .live::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; margin-right: 8px; border-radius: 50%;
  background: var(--accent); vertical-align: 1px;
}

/* ---------- sections ---------- */
.section {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 72px var(--gutter) 0;
  /* adds to html's scroll-padding-top: nav jumps land where they did before it */
  scroll-margin-top: -36px;
}
.hero { scroll-margin-top: 0; }
.section > h2 {
  font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 24px;
}
.section > h2::before {
  content: ""; display: block;
  width: 28px; height: 2px; margin-bottom: 14px; border-radius: 1px;
  background: var(--accent);
}
.sub-h {
  margin: 40px 0 4px;
  font-size: 15px; font-weight: 600; color: var(--ink);
}

/* about */
.about {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.portrait img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--bg-soft);
}
/* soften bright photos on the dark page; full brightness on hover */
.portrait img, .pub-thumb, .proj-thumb { filter: var(--img-dim); transition: filter .2s ease; }
.proj:hover .proj-thumb { filter: none; }
.bio p { color: var(--ink); }
.bio p + p { margin-top: 14px; }
.edu li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.edu li:first-child { border-top: 1px solid var(--rule); }
.edu-degree { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.edu-degree strong { color: var(--ink); }
.meta { margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.meta .date { font-size: 12.5px; }

/* cards */
.card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
}

/* news */
.news li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
  padding: 7px 0;
}
.news .date { line-height: 1.65; padding-top: 1px; }
.news p { font-size: 15.5px; line-height: 1.6; }
html.js .news:not(.is-open) .is-extra { display: none; }
.more {
  justify-self: start;
  margin-top: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--bg);
  font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.more:hover { border-color: var(--ink-3); background: var(--bg-soft); }
.more::after {
  content: ""; width: 6px; height: 6px; margin: -3px 2px 0 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.more[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }

/* publications */
.pub { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.pub.has-thumb { grid-template-columns: minmax(0, 1fr) 216px; }
.pub + .pub { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--rule); }
.pub-title { font-size: 16.5px; line-height: 1.45; font-weight: 600; letter-spacing: -0.005em; }
.pub-authors { margin-top: 6px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.pub-authors strong { color: var(--ink); }
.pub-venue { margin-top: 2px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.pub-venue strong { color: var(--ink); }
.pub-award {
  position: relative; margin-top: 8px; padding-left: 15px;
  font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--ink);
}
.pub-award::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pub-summary { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.pub-thumb {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--bg-soft);
  margin-top: 4px;
}

.links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.lk {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 0;
  font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--ink-2); text-decoration: none;
  transition: color .15s ease;
}
.lk .ic { width: 15px; height: 15px; }
.lk:hover { color: var(--accent-ink); }
/* small icon-only LinkedIn link after an organisation name (24 px target, WCAG 2.5.8) */
.lk-in {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin: -4px 0; vertical-align: middle;
  color: var(--ink-2); text-decoration: none; border-radius: 4px;
  transition: color .15s ease;
}
.lk-in .ic { width: 15px; height: 15px; }
.lk-in:hover { color: var(--accent-ink); }
@media (pointer: coarse) {
  .lk { min-height: 44px; }
  .links, .profiles { row-gap: 0; }
  .links { margin-top: 4px; }
  .proj .links { padding-top: 4px; }
  .profiles { margin-top: 6px; }
  .slam-pause { width: 44px; height: 44px; right: -14px; bottom: -12px; }
  .media-pause { width: 44px; height: 44px; right: 6px; bottom: 7px; }
  .lk-in { width: 44px; height: 44px; margin: -14px -8px; }
  .slam-pause .ic { width: 16px; height: 16px; }
  .hero-figure.has-pause .slam-caption { padding-right: 40px; }
  .theme-toggle { width: 44px; height: 44px; margin-right: -12px; }
  .more { height: 44px; }
}

/* experience */
.org + .org { margin-top: 40px; }
.org-h { font-size: 16.5px; line-height: 1.45; font-weight: 600; letter-spacing: -0.005em; }
.org-sub { font-size: 14.5px; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.roles-tl { position: relative; margin-top: 14px; padding-left: 26px; }
.roles-tl::before {
  content: ""; position: absolute; left: 4px; top: 12px; bottom: 6px;
  width: 1px; background: var(--rule);
}
.role { position: relative; }
.role + .role { margin-top: 18px; }
.role::before {
  content: ""; position: absolute; left: -26px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--ink-3);
}
.role.is-current::before { background: var(--accent); border-color: var(--accent); }
.role-h {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px;
  font-size: 15.5px; line-height: 1.5; font-weight: 600;
}
.role-h .date { font-weight: 400; }
.bul { margin-top: 6px; }
.bul li {
  position: relative; padding-left: 16px;
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
}
.bul li + li { margin-top: 6px; }
.bul li::before {
  content: ""; position: absolute; left: 1px; top: .8em;
  width: 7px; height: 1px; background: var(--ink-3);
}

/* projects */
.proj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.proj { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s ease; }
.proj:hover { border-color: var(--ink-3); }
.proj-thumb {
  display: block;
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-bottom: 1px solid var(--rule); background: var(--bg-soft);
}
/* looping demo videos (LeMonkey, Digital Twin): poster until in view; site.js plays it only while visible, never under reduced motion */
.proj-media { position: relative; }
.proj-video { height: auto; }
.media-pause {
  position: absolute; right: 8px; bottom: 9px;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; cursor: pointer;
  background: var(--bg); background: color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--ink);
  transition: background-color .15s ease;
}
.media-pause:hover { background: var(--bg); }
.media-pause .ic { width: 14px; height: 14px; }
.media-pause .ic-play, .media-pause[aria-pressed="true"] .ic-pause { display: none; }
.media-pause[aria-pressed="true"] .ic-play { display: block; }
.proj-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 16px; }
.proj-title { font-size: 15.5px; line-height: 1.4; font-weight: 600; letter-spacing: -0.005em; }
.proj-ctx { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.proj-ctx .sep { display: none; }
.proj-ctx .date { display: block; margin-top: 2px; font-size: 12.5px; }
.proj-desc { margin-top: 10px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.proj .links { margin-top: auto; padding-top: 12px; }
/* five cards: the newest spans both columns (thumbnail left, text right), the other four form a 2 × 2 grid */
.proj-wide { grid-column: 1 / -1; flex-direction: row; }
.proj-wide .proj-thumb {
  flex: 0 0 calc(50% - 8px); width: calc(50% - 8px); height: auto; min-height: 100%; align-self: stretch;
  aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--rule);
}
.proj-wide .proj-body { padding: 18px 22px 16px; }
.proj-wide > .proj-media { flex: 0 0 calc(50% - 8px); width: calc(50% - 8px); border-right: 1px solid var(--rule); }
.proj-wide > .proj-media .proj-thumb { width: 100%; height: 100%; aspect-ratio: auto; border: 0; }

/* teaching, awards */
.rows li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px 32px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}
.rows li:first-child { border-top: 1px solid var(--rule); }
.row-main { min-width: 0; }
.row-title { font-size: 15.5px; line-height: 1.5; font-weight: 600; }
.row-sub { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.row-date { text-align: right; line-height: 1.7; }
.row-date span { display: block; white-space: nowrap; }

/* skills */
.skills > div {
  display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 4px 24px;
  padding: 13px 0; border-bottom: 1px solid var(--rule);
}
.skills > div:first-child { border-top: 1px solid var(--rule); }
.skills dt { font-size: 14.5px; line-height: 1.6; font-weight: 600; }
.skills dd { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }

/* footer */
.site-footer {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 96px auto 0;
  padding: 0 var(--gutter) 48px;
}
.footer-inner {
  padding-top: 24px; border-top: 1px solid var(--rule);
  font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
}
.footer-inner p + p { margin-top: 2px; }
.footer-inner .fi { white-space: nowrap; }

/* 404: left-aligned with the nav name at every width */
.nf, .page-404 .site-footer { max-width: calc(var(--wide) + 2 * var(--gutter)); }
.nf {
  margin: 0 auto;
  padding: 18vh var(--gutter) 0;
  min-height: 60vh;
}
.nf > *, .page-404 .footer-inner { max-width: var(--col); }
@media (min-width: 1100px) {
  .page-404 .footer-inner { display: block; }
}
.nf .code {
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--ink-2);
}
.nf h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem); line-height: 1.1; font-weight: 650; letter-spacing: -0.025em;
}
.nf h1::before {
  content: ""; display: block; width: 28px; height: 2px; margin-bottom: 18px; border-radius: 1px;
  background: var(--accent);
}
.nf p.lead { margin-top: 14px; font-size: 17px; color: var(--ink-2); }

/* ---------- reveal (JS-gated; content is visible without JS) ---------- */
html.js .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s cubic-bezier(.2, .65, .3, 1), transform .6s cubic-bezier(.2, .65, .3, 1);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- wide: headings in a left rail aligned with the hero, text keeps a 760 px measure ---------- */
@media (min-width: 1100px) {
  .section {
    max-width: calc(var(--wide) + 2 * var(--gutter));
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    column-gap: 32px;
    padding-top: 88px;
  }
  .section > * { grid-column: 2; max-width: 880px; }
  .section > h2 {
    grid-column: 1;
    grid-row: 1 / span 12;
    align-self: start;
    position: sticky;
    top: calc(var(--nav-h) + 32px);
    margin: -16px 0 0;
  }
  .site-footer { max-width: calc(var(--wide) + 2 * var(--gutter)); }
  .footer-inner {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    column-gap: 32px;
  }
  .footer-inner p { grid-column: 2; }
  .footer-inner p + p { margin-top: 2px; }
}

/* ---------- responsive ---------- */
/* below the rail layout, left-align sections with the hero and nav; text keeps the 760 px measure */
@media (max-width: 1099px) {
  .section, .site-footer { max-width: calc(var(--wide) + 2 * var(--gutter)); }
  .section > *, .footer-inner { max-width: var(--col); }
}
@media (min-width: 880px) and (max-width: 1099px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
  /* the text column is ~380 px here: keep the three buttons on one row */
  .btns { gap: 6px; }
  .btn { gap: 6px; padding: 0 11px; }
}
@media (max-width: 879px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 48px;
    padding-bottom: 16px;
  }
  /* the canvas box already matches the map's aspect; keep the caption tight under it */
  .slam-caption { margin-top: 2px; }
}
@media (max-width: 719px) {
  .nav-links { display: none; }
  .nav { gap: 12px; }
}
@media (max-width: 639px) {
  :root { --nav-h: 56px; }
  .hero { padding-top: 36px; }
  .roles { font-size: 14.5px; }
  .btn { height: 36px; padding: 0 12px; font-size: 13.5px; }
  .section { padding-top: 56px; }
  .section > h2 { margin-bottom: 20px; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .portrait { width: 144px; }
  .proj-grid { grid-template-columns: minmax(0, 1fr); }
  .proj-wide { flex-direction: column; }
  .proj-wide .proj-thumb { width: 100%; flex: none; min-height: 0; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--rule); }
  .proj-wide .proj-body { padding: 16px 18px 16px; }
  .proj-wide > .proj-media { flex: none; width: 100%; border-right: 0; border-bottom: 1px solid var(--rule); }
  .proj-wide > .proj-media .proj-thumb { height: auto; aspect-ratio: 16 / 10; }
  .pub.has-thumb { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pub-thumb { order: -1; margin-top: 0; }
  .rows li { flex-direction: column; gap: 2px; }
  .row-date { text-align: left; white-space: normal; }
  .skills > div { grid-template-columns: minmax(0, 1fr); }
  .site-footer { margin-top: 72px; }
}
@media (max-width: 479px) {
  .btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btns li:first-child { grid-column: 1 / -1; }
  .btn { width: 100%; justify-content: center; }
  .footer-inner .sep { display: none; }
  .footer-inner .fi { display: block; }
  .footer-inner .fi a { display: inline-block; padding: 2px 0; }
  .news li { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 8px 0; }
  /* one-line tagline down to 360 px */
  .tagline { font-size: 16px; }
}

@media (max-width: 359px) {
  .btn { gap: 6px; padding: 0 8px; font-size: 13px; }
  .btn .ic { width: 15px; height: 15px; }
  /* clean two-line tagline, no orphan separator: "SLAM · 3D vision" / "egocentric perception" */
  .tagline .dot:nth-last-child(2) { display: none; }
  .tagline .nw:last-child { display: block; }
}

/* ---------- print: clean one-column, light, no canvas ---------- */
@media print {
  :root:not(.__print) {
    --bg: #ffffff; --bg-soft: #ffffff; --ink: #000000; --ink-2: #333333; --ink-3: #777777;
    --rule: #cccccc; --accent: #c2410c; --accent-ink: #000000;
    color-scheme: light;
  }
  @page { margin: 16mm 16mm 18mm; }
  body { font-size: 10.5pt; line-height: 1.5; }
  .site-header, .skip, .sprite, .hero-figure, .btns, .profiles, .slam-pause, .more, .theme-toggle,
  .portrait, .pub-thumb, .proj-thumb, .media-pause { display: none !important; }
  .print-only { display: block; }
  .hero, .section, .site-footer { max-width: none; padding-left: 0; padding-right: 0; }
  .hero { display: block; padding-top: 0; padding-bottom: 0; background: none; box-shadow: none; clip-path: none; border: 0;
    --bg: #ffffff; --ink: #000000; --ink-2: #333333; --ink-3: #777777; --rule: #cccccc; --accent: #c2410c; --accent-ink: #000000; color-scheme: light; }
  .hero h1 { font-size: 22pt; }
  .tagline { margin-top: 4pt; font-size: 12pt; }
  .roles { margin-top: 8pt; font-size: 10.5pt; }
  .hero .print-only { margin-top: 8pt; font-size: 10pt; color: var(--ink-2); }
  .section { padding-top: 16pt; }
  .section > h2 { font-size: 13pt; margin-bottom: 8pt; break-after: avoid; }
  .section > h2::before { margin-bottom: 6pt; }
  .about { display: block; }
  .proj-grid { display: block; }
  .card { border: 0; border-radius: 0; background: none; padding: 0; overflow: visible; }
  .proj, .proj-body { display: block; }
  .proj + .proj { margin-top: 10pt; }
  .proj-body { padding: 0; }
  .pub.has-thumb { display: block; }
  html.js .news .is-extra { display: grid !important; }
  html.js .reveal { opacity: 1 !important; transform: none !important; }
  a { color: inherit; text-decoration: none; }
  .links { display: none; }
  .section > h2, .org-h, .role-h { break-inside: avoid; break-after: avoid; }
  .role, .pub, .proj, .rows li, .skills > div, .news li, .edu li { break-inside: avoid; }
  .site-footer { margin-top: 18pt; break-inside: avoid; }
  .footer-inner p + p { display: none; }
}
