/* ==========================================================================
   Vedant Mohapatra — portfolio stylesheet
   White background, orange accent, one quiet type scale.
   ========================================================================== */

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

:root {
  --bg: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.92);
  --surface: #f6f6f4;          /* panels behind renders, code, callouts */
  --surface-2: #efefec;
  --heading: #111111;
  --text: #1c1c1e;
  --body: #3f3f46;
  --dim: #52525b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.18);
  --rule: rgba(0, 0, 0, 0.07);

  /* Orange accent. --accent is for fills, borders and marks; --accent-text
     is the darker step that keeps small text readable on white. */
  --accent: #ea580c;
  --accent-text: #c2410c;
  --accent-soft: #fff4ec;
  --accent-line: rgba(234, 88, 12, 0.35);

  --nav-h: 64px;

  --fs-0: 11px;
  --fs-1: 12px;
  --fs-2: 13px;
  --fs-3: 14px;
  --fs-4: 15px;
  --fs-5: 17px;
  --fs-6: 21px;
  --fs-7: 30px;
  --fs-8: clamp(34px, 5vw, 48px);
  --fs-code: 12.5px;

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semi: 600;

  --lh-tight: 1.25;
  --lh-snug: 1.55;
  --lh-relaxed: 1.7;
  --lh-loose: 1.8;

  --radius: 6px;
}

html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }

body {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 100%;
  background: var(--bg);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  font-weight: var(--fw-light);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(234, 88, 12, 0.18); }

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

/* ---------- type roles ---------- */
.t-display {
  font-size: var(--fs-8);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--heading);
}

h1, .t-h1 {
  font-size: var(--fs-7);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  color: var(--heading);
}

h2, .t-h2 {
  font-size: var(--fs-6);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--heading);
}
h2 { margin-bottom: 14px; }

h3, .t-h3 {
  font-size: var(--fs-5);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--heading);
}
h3 { margin: 36px 0 14px; }

h4, .t-h4 {
  font-size: var(--fs-4);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  color: var(--heading);
}
h4 { margin: 26px 0 10px; }

h6, .t-label {
  font-size: var(--fs-0);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}
h6 { margin-bottom: 14px; }

.t-eyebrow {
  font-size: var(--fs-0);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.t-lead {
  font-size: var(--fs-5);
  font-weight: var(--fw-light);
  line-height: var(--lh-relaxed);
  color: var(--dim);
}

p, .t-body {
  font-size: var(--fs-4);
  font-weight: var(--fw-light);
  line-height: var(--lh-loose);
  color: var(--body);
}

li, .t-body-sm {
  font-size: var(--fs-3);
  font-weight: var(--fw-light);
  line-height: var(--lh-relaxed);
  color: var(--body);
}

.t-strong {
  font-size: var(--fs-3);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--text);
}

.t-ui {
  font-size: var(--fs-3);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.t-meta {
  font-size: var(--fs-2);
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
  color: var(--muted);
}

figcaption, .t-caption {
  font-size: var(--fs-1);
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
  color: var(--muted);
}

pre, code, .t-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-code);
  line-height: 1.65;
  color: var(--dim);
}

strong, b { font-weight: var(--fw-medium); color: var(--text); }

.prose p + p { margin-top: 14px; }
.prose p a, .prose li a, a.inline {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.prose p a:hover, .prose li a:hover, a.inline:hover { text-decoration-color: var(--accent); }

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.logo {
  text-decoration: none;
  font-size: var(--fs-4);
  font-weight: var(--fw-medium);
  color: var(--heading);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.site-nav ul { display: flex; align-items: center; gap: 12px; list-style: none; }
.site-nav a.t-ui {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  position: relative;
  background-color: transparent;
  transition: background-color 0.22s ease, color 0.22s ease;
}
.site-nav a.t-ui.active { color: var(--heading); }
.site-nav a.t-ui:hover,
.site-nav a.t-ui:focus-visible {
  background-color: var(--accent);
  color: #fff;
  outline: none;
}
.site-nav a.t-ui.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  transition: background-color 0.22s ease;
}
.site-nav a.t-ui.active:hover::after,
.site-nav a.t-ui.active:focus-visible::after { background: #fff; }

/* ---------- page shell ---------- */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9vh 48px 80px;
}
.inner { width: 100%; max-width: 620px; }
.inner.wide { max-width: 800px; }
.inner.xwide { max-width: 1040px; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 14px 48px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- home ---------- */
.home h1 { margin-bottom: 10px; }
.home-sub { margin-bottom: 26px; }
.home-desc { margin-bottom: 34px; }
.home-desc p + p { margin-top: 6px; }

.home-topics { border-left: 2px solid var(--accent); padding-left: 20px; }
.home-topics h6 { margin-bottom: 12px; }
.home-topics ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.home-section { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--rule); }

.links-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* ---------- list rows (home highlights, projects index) ---------- */
.row-list { list-style: none; border-top: 1px solid var(--rule); }
.row-item { border-bottom: 1px solid var(--rule); }
.row-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  padding: 20px 0;
  text-decoration: none;
}
.row-link .t-h4 { transition: color 0.2s; }
.row-link:hover .t-h4 { color: var(--accent-text); }
.row-link .row-role { grid-column: 1; }
.row-link .row-desc { grid-column: 1; max-width: 480px; }
.row-link .row-year { grid-column: 2; grid-row: 1; white-space: nowrap; }
.row-arrow { display: inline-block; transition: transform 0.2s; color: var(--accent); }
.row-link:hover .row-arrow { transform: translateX(3px); }

/* project cards (projects page) */
.project-list { display: flex; flex-direction: column; gap: 22px; list-style: none; }
.project-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 26px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  background: var(--bg);
}
.project-card:hover {
  border-color: var(--accent-line);
  box-shadow: 0 6px 24px rgba(17, 17, 17, 0.06);
  transform: translateY(-1px);
}
.project-thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.project-thumb img { width: 100%; height: 100%; object-fit: contain; }
.project-card .t-h4 { margin: 0 0 4px; transition: color 0.2s; }
.project-card:hover .t-h4 { color: var(--accent-text); }
.project-card .t-meta + p { margin-top: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-size: var(--fs-0);
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  color: var(--dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
}
.tag.accent { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }

/* ---------- pills / buttons ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.pill:hover { border-color: var(--accent); color: var(--accent-text); }
.pill.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.primary:hover { background: var(--accent-text); border-color: var(--accent-text); color: #fff; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 8px; }

/* ---------- project detail ---------- */
.back-link {
  display: block;
  width: fit-content;
  margin-bottom: 28px;
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent-text); }
.detail-title { margin-bottom: 10px; }
.detail-meta { margin-bottom: 18px; }
.detail-lede { margin-bottom: 30px; max-width: 640px; }

.detail-section {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}
.detail-section > .t-eyebrow { display: block; margin-bottom: 10px; }
.section-lede { margin: -4px 0 22px; color: var(--dim); }

figure { margin: 26px 0; }
figure img, figure video { width: 100%; border-radius: var(--radius); }
figure figcaption { margin-top: 8px; }
figure.panel img { background: var(--surface); }
figure.fig-sm { max-width: 420px; }
figure.fig-md { max-width: 560px; }
figure.center { margin-left: auto; margin-right: auto; }
figure.center figcaption { text-align: center; }
figure.bordered img { border: 1px solid var(--border); }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 26px 0; }
.media-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.media-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.media-grid figure { margin: 0; display: flex; flex-direction: column; }
.media-grid figure.fit img { flex: 1; max-height: 380px; object-fit: contain; background: var(--surface); padding: 10px; }
.media-grid.align-end { align-items: end; }

ul.plain, ul.ticks { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; }
ul.ticks li { position: relative; padding-left: 18px; }
ul.ticks li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.72em;
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--accent);
}
ul.awards { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 18px 0 4px; }
ul.awards li { padding-left: 12px; border-left: 2px solid var(--accent); }

.note {
  margin: 22px 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}
.note strong { color: var(--accent-text); }

pre.code-block {
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto;
  white-space: pre;
}

/* placeholder blocks used on template pages */
.ph {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(0, 0, 0, 0.025) 10px 20px),
    var(--surface);
  border: 1px dashed var(--border-strong);
  color: var(--faint);
  font-size: var(--fs-1);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
}
.ph.wide { aspect-ratio: 16 / 9; }
.ph.video::before { content: "▶"; display: block; font-size: 18px; margin-bottom: 6px; color: var(--faint); }

/* ---------- robot page: stats, hero explorer, contents ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0 8px;
}
.stat { padding: 16px 18px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat-num {
  display: block;
  font-size: 26px;
  font-weight: var(--fw-regular);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--heading);
}
.stat-num em { font-style: normal; color: var(--accent); }

.explorer {
  margin: 40px 0 18px;
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-areas: "chips stage" ". note";
  gap: 0 24px;
  align-items: center;
}
.explorer .explorer-stage { grid-area: stage; }
.explorer .explorer-chips { grid-area: chips; flex-direction: column; align-items: stretch; margin-top: 0; }
.explorer .explorer-chips .chip { justify-content: flex-start; border-radius: 8px; padding: 9px 13px; }
.explorer .explorer-note { grid-area: note; margin-top: 10px; }
.explorer-hint {
  flex-basis: 100%;
  margin-bottom: 4px;
  font-size: var(--fs-2);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  color: var(--accent-text);
}
.explorer-hint::after { content: " ↓"; }
.explorer-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, var(--surface) 70%);
  border: 1px solid var(--border);
  overflow: hidden;
}
.explorer-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.28s ease;
}
.explorer-stage img.is-hidden { opacity: 0; }
.explorer-label {
  position: absolute;
  left: 18px; bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}
.explorer-label .t-eyebrow { min-height: 1em; }
.explorer-label .t-h3 { margin: 0; }
.explorer-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font: inherit;
  font-size: var(--fs-2);
  font-weight: var(--fw-regular);
  color: var(--dim);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.chip .chip-num { font-size: var(--fs-0); color: var(--faint); font-weight: var(--fw-medium); }
.chip:hover, .chip:focus-visible, .chip.is-active {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
  outline: none;
}
.chip:hover .chip-num, .chip.is-active .chip-num { color: var(--accent); }

.contents {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 28px;
  margin-top: 6px;
}
.contents h6 { margin-bottom: 10px; }
.contents ol { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.contents a {
  display: flex;
  gap: 10px;
  text-decoration: none;
  font-size: var(--fs-3);
  line-height: var(--lh-relaxed);
  color: var(--body);
  transition: color 0.2s;
}
.contents a span { color: var(--faint); font-size: var(--fs-1); min-width: 18px; padding-top: 2px; }
.contents a:hover { color: var(--accent-text); }

.sub-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; }
.sub-head .num { font-size: var(--fs-2); color: var(--accent); font-weight: var(--fw-medium); }

.spec-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 22px;
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.spec-list dt { font-size: var(--fs-1); font-weight: var(--fw-medium); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.spec-list dd { font-size: var(--fs-3); line-height: var(--lh-relaxed); color: var(--text); }

/* keep reading width comfortable inside the extra-wide robot page */
.inner.xwide .prose,
.inner.xwide .section-lede,
.inner.xwide .detail-lede,
.inner.xwide > .detail-section > ul.ticks,
.inner.xwide .timeline,
.inner.xwide .spec-list,
.inner.xwide .compare,
.inner.xwide > .detail-section > .math,
.inner.xwide .sw-block > .math,
.inner.xwide .sw-block > .prose { max-width: 760px; }
.inner.xwide .prose figure:not(.fig-md):not(.fig-sm) { max-width: 760px; }

/* CAD renders sit on a soft panel */
img[src*="/iso_"], img[src*="/hero_back"] { background: var(--surface); }

/* iteration timeline */
.timeline { list-style: none; margin: 22px 0; border-left: 2px solid var(--surface-2); }
.timeline > li { position: relative; padding: 0 0 26px 24px; }
.timeline > li:last-child { padding-bottom: 4px; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -7px; top: 5px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline > li.final::before { background: var(--accent); }
.timeline .tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.timeline .tl-head .t-h4 { margin: 0; }
.timeline .tl-body { display: grid; grid-template-columns: 1fr 200px; gap: 18px; align-items: start; }
.timeline .tl-body.no-img { grid-template-columns: 1fr; }
.timeline .tl-body img {
  width: 200px;
  height: 150px;
  object-fit: contain;
  object-position: center;
  justify-self: center;
  border-radius: var(--radius);
}

/* turret rotation viewer */
.turret-viewer { margin: 26px 0; max-width: 760px; }
.turret-stage { border-radius: 12px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.turret-stage img { width: 100%; height: auto; border-radius: 0; }
.turret-controls { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.turret-controls label { white-space: nowrap; color: var(--accent-text); font-weight: var(--fw-medium); }
.turret-controls output { min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.turret-controls input[type="range"] { flex: 1; accent-color: var(--accent); cursor: grab; }
.turret-controls input[type="range"]:active { cursor: grabbing; }
.timeline ul { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.timeline ul li { padding-left: 14px; position: relative; }
.timeline ul li::before { content: "–"; position: absolute; left: 0; color: var(--faint); }
.timeline ul li.pro::before { content: "+"; color: #15803d; }
.timeline ul li.con::before { content: "−"; color: #b91c1c; }
.badge {
  font-size: var(--fs-0);
  font-weight: var(--fw-semi);
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--dim);
}
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }

/* math blocks */
.math {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: 15px;
  color: var(--text);
}
.math .katex-display { margin: 0.2em 0; }
.math-label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--fs-0);
  font-weight: var(--fw-medium);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.math dl.vars {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 14px;
  margin-top: 8px;
  font-size: var(--fs-2);
  color: var(--body);
}
.math dl.vars dt { color: var(--text); }

/* software sub-blocks */
.sw-block { margin-top: 44px; }
.sw-block:first-of-type { margin-top: 28px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.two-col > * { min-width: 0; }
.two-col figure { margin-top: 0; }

/* FSM diagram */
.fsm { width: 100%; height: auto; margin: 10px 0 4px; }
.fsm text { font-family: 'DM Sans', sans-serif; }

/* comparison table */
.compare {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: var(--fs-3);
}
.compare th, .compare td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare th { font-size: var(--fs-1); font-weight: var(--fw-medium); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.compare td { color: var(--body); line-height: var(--lh-relaxed); font-weight: var(--fw-light); }
.compare td:first-child { color: var(--text); font-weight: var(--fw-regular); }

/* lightbox */
.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  display: none;
}
.lightbox.open { display: block; }
.lb-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-out;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-viewport img {
  flex: none;
  max-width: none;
  max-height: none;
  border-radius: var(--radius);
  box-shadow: 0 6px 30px rgba(17, 17, 17, 0.12);
  transform-origin: center center;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox.is-zoomed .lb-viewport img:active { cursor: grabbing; }
.lb-toolbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 18px rgba(17, 17, 17, 0.1);
  z-index: 2;
}
.lb-toolbar button {
  font: inherit;
  font-size: var(--fs-3);
  font-weight: var(--fw-medium);
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.lb-toolbar button:hover { background: var(--accent); color: #fff; }
.lb-zoom { min-width: 52px; text-align: center; font-size: var(--fs-2); color: var(--dim); font-variant-numeric: tabular-nums; }
.lb-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: var(--fs-1);
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 680px) { .lb-hint { white-space: normal; text-align: center; width: 90%; } }

/* scroll-to-top */
.to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--dim);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
  z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--accent-text); border-color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .contents { grid-template-columns: repeat(2, 1fr); }
  .media-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  :root { --fs-7: 26px; }
  .site-nav { padding: 0 20px; }
  .site-nav ul { gap: 4px; }
  .site-nav a.t-ui { padding: 6px 10px; }
  .page { padding: 6vh 20px 64px; }
  .site-footer { padding: 14px 20px; flex-direction: column; gap: 4px; }
  .media-grid, .media-grid.cols-2 { grid-template-columns: 1fr; }
  .media-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .project-card { grid-template-columns: 1fr; }
  .contents { grid-template-columns: 1fr; }
  .explorer { grid-template-columns: 1fr; grid-template-areas: "stage" "chips" "note"; }
  .explorer .explorer-chips { flex-direction: row; flex-wrap: wrap; margin-top: 14px; }
  .explorer .explorer-chips .chip { border-radius: 999px; padding: 6px 12px; }
  .timeline .tl-body { grid-template-columns: 1fr; }
  .timeline .tl-body img { max-width: 260px; }
  .row-link { grid-template-columns: 1fr; }
  .row-link .row-year { grid-column: 1; grid-row: auto; }
  .explorer-label { left: 12px; bottom: 10px; }
  .spec-list { grid-template-columns: 1fr; gap: 2px; }
  .spec-list dd { margin-bottom: 8px; }
}

/* footer emblem */
.site-footer { align-items: center; }
.footer-mark { display: inline-flex; color: var(--accent); }
.footer-mark svg { width: 22px; height: 22px; fill: currentColor; }

/* turret viewer with vertical hood slider */
.turret-body { display: flex; gap: 14px; align-items: stretch; }
.turret-body .turret-stage { flex: 1; min-width: 0; }
.hood-control { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; }
.hood-control label { color: var(--accent-text); font-weight: var(--fw-medium); }
input[type="range"].vertical {
  writing-mode: vertical-lr;
  direction: rtl;
  flex: 1;
  width: 24px;
  accent-color: var(--accent);
  cursor: grab;
}
.ll-viewer { margin: 0; }
.ll-viewer .turret-controls label { white-space: normal; }

/* media row: match video + news card */
.media-row { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; margin: 30px 0 0; align-items: stretch; }
.video-embed { margin: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.news-card {
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 22px; border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; text-decoration: none; background: var(--accent-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.news-card:hover { box-shadow: 0 6px 24px rgba(17, 17, 17, 0.06); }
.news-title { font-size: var(--fs-5); line-height: var(--lh-tight); color: var(--heading); font-weight: var(--fw-regular); }
.news-card .t-meta { color: var(--accent-text); }
@media (max-width: 680px) { .media-row { grid-template-columns: 1fr; } }

/* publication card (research pages) */
.pub-card {
  margin: 8px 0 26px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pub-card .pub-title { font-size: var(--fs-4); font-weight: var(--fw-medium); color: var(--heading); line-height: var(--lh-snug); }
.pub-card .pub-authors { font-size: var(--fs-3); color: var(--body); line-height: var(--lh-snug); }
.pub-card .pub-authors strong { color: var(--heading); }
.pub-card .pub-venue { font-size: var(--fs-2); color: var(--muted); line-height: var(--lh-snug); }
.pub-card .cta-row { margin: 10px 0 0; }
.pub-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* home: publications list */
.pub-list { list-style: none; border-top: 1px solid var(--rule); }
.pub-list li { border-bottom: 1px solid var(--rule); }
.pub-list a { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; padding: 18px 0; text-decoration: none; }
.pub-list a:hover .t-h4 { color: var(--accent-text); }
.pub-list .t-h4 { margin: 0; transition: color 0.2s; }
.pub-list .pub-year { grid-column: 2; grid-row: 1; white-space: nowrap; }
.pub-list .t-meta em { font-style: normal; color: var(--dim); }

/* accuracy table with inline bars */
.acc-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: var(--fs-3); }
.acc-table th { text-align: left; font-size: var(--fs-1); font-weight: var(--fw-medium); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.acc-table td { padding: 6px 10px; border-bottom: 1px solid var(--rule); color: var(--body); font-weight: var(--fw-light); vertical-align: middle; }
.acc-table td.crop { color: var(--text); font-weight: var(--fw-regular); }
.acc-table tr.group-start td { border-top: 1px solid var(--border); }
.bar { position: relative; height: 18px; min-width: 120px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--accent-line); }
.bar.gpu span { background: rgba(17, 17, 17, 0.16); }
.bar b { position: relative; z-index: 1; font-size: var(--fs-1); font-weight: var(--fw-medium); color: var(--text); padding-left: 6px; line-height: 18px; }
.legend { display: flex; gap: 16px; font-size: var(--fs-2); color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 6px; background: var(--accent-line); }
.legend i.gpu { background: rgba(17, 17, 17, 0.16); }
@media (max-width: 680px) {
  .bar { min-width: 70px; }
  .acc-table th, .acc-table td { padding: 6px 6px; }
  .pub-list a { grid-template-columns: 1fr; }
  .pub-list .pub-year { grid-column: 1; grid-row: auto; }
}

/* larger images in a timeline (robot iterations) */
.timeline.big-img .tl-body { grid-template-columns: 1fr 300px; }
.timeline.big-img .tl-body img { width: 300px; height: 240px; }
@media (max-width: 680px) { .timeline.big-img .tl-body img { width: 100%; max-width: 320px; height: auto; } }

/* home: contact buttons under the subtitle */
.home .home-sub { margin-bottom: 14px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.pill.accent {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: var(--fw-medium);
}
.pill.accent:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.contact-row .pill { transition: border-color 0.2s, background 0.2s, color 0.2s; }
.contact-row .pill.primary { font-weight: var(--fw-medium); }

/* the last publication's bottom border already separates the two home sections */
.home-section.pubs + .home-section { border-top: 0; padding-top: 0; }

/* highlighted key component */
.feature-box {
  margin-top: 40px;
  padding: 28px 30px 30px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.feature-box > .t-eyebrow { display: block; }
.feature-box .compare th, .feature-box .compare td { border-bottom-color: rgba(234, 88, 12, 0.18); }
.feature-box .math { background: rgba(255, 255, 255, 0.75); border-color: var(--accent-line); }
.feature-box .timeline { border-left-color: rgba(234, 88, 12, 0.22); }
.feature-box .timeline > li::before { background: var(--accent-soft); }
.feature-box .timeline > li.final::before { background: var(--accent); }
.feature-box .badge { background: rgba(255, 255, 255, 0.8); }
@media (max-width: 680px) { .feature-box { padding: 20px 16px 22px; } }
.bezier-fig { width: 100%; height: auto; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--accent-line); border-radius: 10px; }
.sw-block .feature-box { margin-top: 30px; }
.math-stack { max-width: 760px; }

/* animated Bézier path demo */
.bz-demo { margin: 14px 0 24px; max-width: 760px; }
.bz-stage { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--accent-line); background: #fff; }
.bz-stage svg { display: block; width: 100%; height: auto; }
.bz-step {
  position: absolute; left: 12px; top: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--accent-line);
  font-size: var(--fs-2); font-weight: var(--fw-medium); color: var(--text);
}
.bz-step-num {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: var(--fs-1); font-weight: var(--fw-semi);
}
.bz-replay {
  position: absolute; right: 12px; bottom: 12px;
  font: inherit; font-size: var(--fs-1); font-weight: var(--fw-medium);
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.92); color: var(--accent-text); border: 1px solid var(--accent-line);
  transition: background 0.2s, color 0.2s;
}
.bz-replay:hover { background: var(--accent); color: #fff; }

/* ---------- left "on this page" navigation (robot pages) ---------- */
.side-nav { display: none; }
.jump-inline { margin: -14px 0 26px; }
@media (min-width: 1200px) {
  body.has-side-nav .page { padding-left: 270px; }
  .jump-inline { display: none; }
  .side-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: calc(var(--nav-h) + 28px);
    left: 28px;
    width: 200px;
    max-height: calc(100vh - var(--nav-h) - 56px);
    overflow-y: auto;
    padding: 18px 16px 18px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    z-index: 50;
  }
  .side-nav-title {
    font-size: var(--fs-0); font-weight: var(--fw-semi); letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 10px;
  }
  .side-jump {
    display: block; text-align: center; text-decoration: none;
    padding: 7px 10px; margin-bottom: 14px; border-radius: 999px;
    background: var(--accent); color: #fff;
    font-size: var(--fs-2); font-weight: var(--fw-medium);
    transition: background-color 0.2s;
  }
  .side-jump:hover { background: var(--accent-text); }
  .side-group {
    font-size: var(--fs-0); font-weight: var(--fw-semi); letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent-text); margin: 10px 0 4px;
  }
  .side-nav ol { list-style: none; display: flex; flex-direction: column; border-left: 1px solid var(--border); }
  .side-nav ol a {
    display: block; padding: 3px 0 3px 12px; margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: var(--fs-2); line-height: 1.45; color: var(--dim); text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
  }
  .side-nav ol a:hover { color: var(--accent-text); }
  .side-nav ol li.key a::after { content: " ★"; color: var(--accent); font-size: var(--fs-1); }
  .side-nav ol a.is-active { color: var(--accent-text); border-left-color: var(--accent); font-weight: var(--fw-medium); background: var(--accent-soft); }
}

/* demo with a step list beside it */
.bz-demo { max-width: none; }
.bz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; align-items: center; }
.bz-steps { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.bz-steps li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid transparent;
  opacity: 0.4;
  transition: opacity 0.35s ease, background-color 0.35s ease, border-color 0.35s ease;
}
.bz-steps li b { display: block; font-size: var(--fs-3); font-weight: var(--fw-medium); color: var(--heading); line-height: 1.3; }
.bz-steps li small { display: block; font-size: var(--fs-1); color: var(--dim); line-height: 1.35; margin-top: 2px; }
.bz-n {
  flex: none; display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: var(--fs-1); font-weight: var(--fw-semi);
  background: var(--surface-2); color: var(--dim);
  transition: background-color 0.35s ease, color 0.35s ease;
}
.bz-steps li.is-done { opacity: 0.75; }
.bz-steps li.is-done .bz-n { background: var(--accent-soft); color: var(--accent-text); }
.bz-steps li.is-active { opacity: 1; background: #fff; border-color: var(--accent-line); box-shadow: 0 4px 14px rgba(234, 88, 12, 0.12); }
.bz-steps li.is-active .bz-n { background: var(--accent); color: #fff; }
@media (max-width: 860px) {
  .bz-layout { grid-template-columns: 1fr; }
  .bz-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
}

/* ---------- step-by-step pipeline (research pages) ---------- */
.pipeline { list-style: none; margin: 24px 0; max-width: 760px; }
.pipeline > li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px; padding-bottom: 14px; }
.pipeline > li::before {
  content: ""; position: absolute; left: 16px; top: 0; bottom: 0; width: 2px;
  background: var(--accent-line);
}
.pipeline > li:first-child::before { top: 17px; }
.pipeline > li:last-child::before { bottom: auto; height: 17px; }
.pipeline .pl-num {
  position: relative; z-index: 1; align-self: start;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-size: var(--fs-3); font-weight: var(--fw-semi);
  box-shadow: 0 0 0 4px var(--bg);
}
.pipeline .pl-body { border: 1px solid var(--border); border-radius: 12px; padding: 11px 16px 12px; background: var(--bg); }
.pipeline .pl-body.loop { background: var(--accent-soft); border-color: var(--accent-line); }
.pipeline .pl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pipeline .pl-head .t-h4 { margin: 0; }
.pipeline .pl-body p { margin-top: 4px; font-size: var(--fs-2); line-height: var(--lh-relaxed); color: var(--body); }
.pipeline > li.pl-phase { display: block; padding: 2px 0 12px 50px; }
.pipeline > li.pl-phase span {
  font-size: var(--fs-0); font-weight: var(--fw-semi); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-text);
}
.pipeline > li.pl-phase:first-child::before { top: 12px; }
