:root {
  color-scheme: light;
  --bg: #f7f7f3;
  --surface: #ffffff;
  --surface-soft: #f1f2ee;
  --ink: #101114;
  --muted: #5f6570;
  --soft: #8a9099;
  --line: #e3e3dc;
  --accent: #2457ff;
  --accent-soft: rgba(36, 87, 255, 0.12);
  --accent-cyan: #00a7b5;
  --accent-green: #16a05d;
  --accent-purple: #7657ff;
  --accent-warn: #e8a000;
  --shadow: 0 24px 80px rgba(16, 17, 20, 0.10);
  --shadow-soft: 0 14px 48px rgba(16, 17, 20, 0.08);
  --glow: rgba(36, 87, 255, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max: 1280px;
  --header-h: 74px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* High-contrast dark palette, shared by explicit and system preference. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #05060a;
  --surface: #0f1218;
  --surface-soft: #161b24;
  --ink: #f5f7fa;
  --muted: #b6bdc9;
  --soft: #8c95a4;
  --line: #2b303c;
  --accent: #6a97ff;
  --accent-soft: rgba(106, 151, 255, 0.16);
  --accent-cyan: #2bd4e0;
  --accent-green: #36cd80;
  --accent-purple: #a18bff;
  --accent-warn: #f5b945;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 16px 52px rgba(0, 0, 0, 0.42);
  --glow: rgba(106, 151, 255, 0.20);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(36, 87, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 84% 12%, rgba(0, 167, 181, 0.10), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4,
.hero-title,
.brand strong {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

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

button,
input,
textarea {
  font: inherit;
}

::selection {
  background: rgba(36, 87, 255, 0.18);
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 999;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: calc(var(--max) + 4rem);
  margin: 0 auto;
  padding: 0 2rem;
  backdrop-filter: blur(20px);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 1rem;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand img {
  width: 46px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #05070a;
}

.brand span {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.nav-item {
  position: relative;
  display: flex;
}

.nav-link,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.nav-caret {
  opacity: 0.6;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.nav-link[aria-current="page"],
.nav-trigger[aria-current="page"],
.nav-link:hover,
.nav-trigger:hover,
.nav-item.is-open .nav-trigger {
  background: var(--ink);
  color: var(--bg);
}

.nav-item.is-open .nav-caret {
  transform: rotate(180deg);
  opacity: 0.9;
}

/* ---- Liquid Glass dropdown ---- */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 50%;
  width: max-content;
  max-width: 92vw;
  transform: translate(-50%, 10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 90;
  transition: opacity 260ms ease, transform 360ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 360ms;
}

.nav-item.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition: opacity 260ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* a small hover bridge so the pointer can travel from trigger to panel */
.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.85rem;
  height: 0.95rem;
}

.nav-dropdown-inner {
  position: relative;
  z-index: 2;
  padding: 1rem;
  border-radius: var(--radius-lg);
}

/* The glass stack: refraction + tint + specular shine, layered behind content */
.liquid-glass {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 30px 70px -20px rgba(8, 12, 28, 0.55),
    0 2px 10px rgba(8, 12, 28, 0.18);
}

.liquid-glass::after {
  /* edge light + chromatic dispersion on the rim */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(125, 211, 252, 0.85),
    rgba(255, 255, 255, 0.35) 28%,
    rgba(167, 139, 250, 0.55) 62%,
    rgba(34, 211, 238, 0.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.9;
  pointer-events: none;
}

.lg-refract,
.lg-tint,
.lg-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.lg-refract {
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
}

/* Progressive enhancement: SVG displacement adds the liquid wobble where supported. */
@supports (backdrop-filter: url(#liquid-glass)) or (-webkit-backdrop-filter: url(#liquid-glass)) {
  .lg-refract {
    -webkit-backdrop-filter: blur(6px) saturate(170%) url(#liquid-glass);
    backdrop-filter: blur(6px) saturate(170%) url(#liquid-glass);
  }
}

.lg-tint {
  /* Opaque, always-readable fallback. Stays solid unless the browser can both
     blur the backdrop AND mix colors — otherwise the panel would show the page
     through it and the menu text becomes unreadable. */
  background: var(--surface);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (background: color-mix(in srgb, red, blue)) {
  .lg-tint {
    background:
      radial-gradient(120% 100% at 18% 0%, rgba(125, 211, 252, 0.12), transparent 55%),
      radial-gradient(120% 120% at 100% 100%, rgba(167, 139, 250, 0.13), transparent 55%),
      color-mix(in srgb, var(--surface) 86%, transparent);
  }
}

.lg-shine {
  background: radial-gradient(160px 160px at var(--mx, 30%) var(--my, 0%), rgba(255, 255, 255, 0.22), transparent 62%);
  box-shadow:
    inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, 0.75),
    inset -1px -1px 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 22px rgba(255, 255, 255, 0.06);
}

.lg-shine::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -20%;
  width: 55%;
  height: 220%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(8deg) translateX(-30%);
  opacity: 0;
  transition: opacity 400ms ease;
}

.nav-item.is-open .lg-shine::before {
  animation: lgSheen 1100ms cubic-bezier(0.22, 1, 0.36, 1) 120ms;
}

@keyframes lgSheen {
  0% { opacity: 0; transform: rotate(8deg) translateX(-60%); }
  35% { opacity: 0.8; }
  100% { opacity: 0; transform: rotate(8deg) translateX(360%); }
}

:root[data-theme="dark"] .lg-tint {
  background: var(--surface);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (background: color-mix(in srgb, red, blue)) {
  :root[data-theme="dark"] .lg-tint {
    background:
      radial-gradient(120% 100% at 18% 0%, rgba(125, 211, 252, 0.10), transparent 55%),
      radial-gradient(120% 120% at 100% 100%, rgba(167, 139, 250, 0.14), transparent 55%),
      color-mix(in srgb, var(--surface) 84%, transparent);
  }
}

.nav-dd-blurb {
  margin: 0 0 0.85rem;
  max-width: 30ch;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Projects mega-menu */
.nav-dd-projects {
  display: grid;
  gap: 0.25rem;
  width: 340px;
}

.nav-dd-proj {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.45rem;
  border-radius: 14px;
  transition: background-color 160ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-dd-proj:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  transform: translateX(2px);
}

.ddp-thumb {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--surface-soft);
}

.ddp-thumb img,
.ddp-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ddp-body {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.ddp-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}

.ddp-meta {
  font-size: 0.72rem;
  color: var(--soft);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dd-list {
  display: grid;
  gap: 0.15rem;
  width: 280px;
}

/* Publications mega-menu */
.nav-dd-pubs {
  display: grid;
  gap: 0.18rem;
  width: 340px;
}

.nav-dd-pub {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  transition: background-color 160ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-dd-pub:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  transform: translateX(2px);
}

.ndp-venue {
  margin-top: 0.1rem;
  display: inline-flex;
  align-items: center;
  min-width: 3.6rem;
  justify-content: center;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ndp-body { display: grid; gap: 0.06rem; min-width: 0; }

.ndp-title {
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.28;
}

.ndp-meta {
  font-size: 0.72rem;
  color: var(--soft);
  font-weight: 600;
}

.nav-dd-link {
  display: grid;
  gap: 0.1rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  transition: background-color 160ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-dd-link:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  transform: translateX(2px);
}

.ddl-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}

.ddl-desc {
  font-size: 0.74rem;
  color: var(--soft);
  font-weight: 550;
}

.nav-dd-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
}

.nav-dd-all svg {
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-dd-all:hover svg {
  transform: translateX(3px);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  border-radius: 999px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, color 200ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  color: var(--accent);
}

.theme-toggle svg {
  display: block;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.page-grid {
  width: min(100%, calc(var(--max) + 4rem));
  margin: 0 auto;
  padding: 1.8rem 2rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  align-items: start;
}

body.news-collapsed .page-grid {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.page-grid.no-news {
  grid-template-columns: minmax(0, 1fr);
}

.main-content {
  min-width: 0;
}

.news-rail {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  transition: width 220ms ease;
}

.news-rail-toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  padding: 0.5rem 0.7rem 0.5rem 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: border-color 180ms ease, transform 180ms ease;
}

.news-rail-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.news-rail-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.news-chevron {
  flex: none;
  color: var(--soft);
  transform: rotate(180deg);
  transition: transform 240ms ease;
}

body.news-collapsed .news-chevron {
  transform: rotate(0deg);
}

.news-live {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 999px;
  background: var(--accent-green);
}

.news-live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--accent-green);
  animation: livePulse 2.4s ease-out infinite;
}

@keyframes livePulse {
  0% { transform: scale(1); opacity: 0.55; }
  70% { transform: scale(3.2); opacity: 0; }
  100% { opacity: 0; }
}

.news-panel {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 60% at 100% 0%, var(--accent-soft), transparent 60%),
    color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
  padding: 1rem 0.85rem 0.9rem;
}

body.news-collapsed .news-panel {
  display: none;
}

body.news-collapsed .news-rail-toggle {
  justify-content: center;
  padding: 0.7rem 0.5rem;
}

body.news-collapsed .news-rail-title {
  writing-mode: vertical-rl;
  gap: 0.6rem;
}

.rail-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.2rem;
  padding: 0 0.15rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.news-scroll {
  position: relative;
  margin-top: 0.7rem;
  max-height: clamp(300px, 54vh, 560px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 7%, #000 92%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 7%, #000 92%, transparent 100%);
}

.news-scroll.is-scrolling .rail-news-list {
  animation: newsScroll var(--news-duration, 48s) linear infinite;
  will-change: transform;
}

.news-scroll.is-scrolling:hover .rail-news-list,
.news-scroll.is-scrolling:focus-within .rail-news-list {
  animation-play-state: paused;
}

@keyframes newsScroll {
  from { transform: translateY(0); }
  to { transform: translateY(calc(var(--news-shift, 50%) * -1)); }
}

.rail-news-list {
  list-style: none;
  padding: 0 0.15rem;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.rail-news-list li {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  padding: 0.7rem 0.8rem 0.72rem 0.95rem;
  transition: border-color 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.rail-news-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(var(--accent), var(--accent-cyan));
  opacity: 0.55;
  transition: opacity 180ms ease;
}

.rail-news-list li:hover {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--surface);
}

.rail-news-list li:hover::before {
  opacity: 1;
}

.rail-news-list time {
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rail-news-list p {
  margin: 0.22rem 0 0.1rem;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.42;
}

.rail-news-list a {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
}

.rail-more {
  display: inline-flex;
  align-items: center;
  margin-top: 0.85rem;
  padding: 0 0.15rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
}

.site-footer {
  width: min(100%, calc(var(--max) + 4rem));
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-footer strong {
  display: block;
  color: var(--ink);
}

.footer-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.footer-links a svg {
  width: 19px;
  height: 19px;
}

.footer-links a:hover {
  transform: translateY(-2px);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.4rem);
  padding-top: 0.4rem;
}

.page-title h1,
.project-hero h1,
.post-header h1 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.page-title h1 {
  font-size: clamp(2.05rem, 4.4vw, 3.15rem);
}

.project-hero h1,
.post-header h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.55rem);
}

.hero-title {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.3rem, 2.3vw, 1.85rem);
  line-height: 1.22;
  letter-spacing: -0.022em;
}

.hero-title .hero-line {
  display: block;
}

.hero-title .grad {
  background: linear-gradient(115deg, var(--accent), var(--accent-purple) 55%, var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lead {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.62;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.72rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-weight: 750;
  font-size: 0.92rem;
  transition: transform 200ms ease, background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.button:hover {
  transform: translateY(-1px);
  color: var(--bg);
  box-shadow: 0 10px 28px rgba(16, 17, 20, 0.16);
}

.button.secondary:hover {
  color: var(--accent);
}

.section {
  margin-top: 3.6rem;
}

.hero + .section {
  margin-top: 2.4rem;
}

.section.compact {
  margin-top: 3rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section-heading p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.large-text {
  font-size: clamp(1.08rem, 1.6vw, 1.35rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 880px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card,
.pub-card,
.project-card,
.news-card,
.mini-card,
.gallery-item,
.project-cover,
.spotlight-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-soft);
}

.spotlight-card::before,
.feature-card::before,
.pub-card::before,
.project-card::before,
.news-card::before,
.mini-card::before,
.blog-card::before,
.post-card::before,
.gallery-item::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 0%), var(--glow), transparent 32%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.spotlight-card:hover::before,
.feature-card:hover::before,
.pub-card:hover::before,
.project-card:hover::before,
.news-card:hover::before,
.mini-card:hover::before,
.blog-card:hover::before,
.post-card:hover::before,
.gallery-item:hover::before {
  opacity: 1;
}

.feature-card {
  padding: 1.4rem;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

a.feature-card::after {
  content: "→";
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
  transition: transform 220ms ease;
}

a.feature-card:hover::after {
  transform: translateX(5px);
}

.feature-card:hover,
.pub-card:hover,
.project-card:hover,
.news-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.feature-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(150deg, var(--ink), color-mix(in srgb, var(--ink) 82%, var(--accent)));
  color: var(--bg);
  font-weight: 850;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(16, 17, 20, 0.18);
  transition: transform 220ms ease;
}

.feature-card:hover .feature-icon {
  transform: translateY(-2px) scale(1.04);
}

.page-title {
  padding: 3rem 0 1rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 2rem 0 1.3rem;
}

.filter-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.filter-button.is-active,
.filter-button:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.pub-list,
.project-list,
.news-list {
  display: grid;
  gap: 1rem;
}

.pub-card,
.project-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.44fr) minmax(0, 0.56fr);
  gap: 0;
  transition: transform 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.pub-media,
.project-media {
  min-height: 220px;
  background: var(--surface-soft);
}

.pub-media img,
.pub-media video,
.project-media img,
.project-media video,
.project-cover img,
.project-cover video,
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pub-body,
.project-body {
  padding: 1.25rem;
  display: grid;
  align-content: start;
  gap: 0.85rem;
}

.pub-topline,
.project-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.venue-mark,
.status-pill,
.org-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.22rem 0.52rem;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.venue-mark {
  color: white;
  border-color: transparent;
  background: var(--ink);
}

.venue-cvpr { background: #2457ff; }
.venue-iccv { background: #7657ff; }
.venue-icml { background: #0e8f5a; }
.venue-neurips { background: #b24a00; }
.venue-t-pami { background: #111827; }
.venue-tits { background: #0369a1; }
.venue-tii { background: #7c2d12; }
.venue-tim { background: #475569; }
.venue-aaai { background: #1d4ed8; }
.venue-ais { background: #047857; }
.venue-arxiv { background: #b31b1b; }

.status-pill {
  background: color-mix(in srgb, var(--accent-green) 12%, var(--surface));
  color: var(--accent-green);
  border-color: color-mix(in srgb, var(--accent-green) 28%, var(--line));
}

.org-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.org-pill,
.tag {
  color: var(--muted);
  background: var(--surface-soft);
}

.pub-card h2,
.project-card h2 {
  margin: 0;
  font-size: clamp(1.12rem, 1.7vw, 1.4rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.pub-authors,
.project-meta {
  color: var(--muted);
  margin: 0;
  font-size: 0.94rem;
}

.pub-authors strong {
  color: var(--ink);
}

.pub-summary,
.project-summary {
  color: var(--muted);
  margin: 0;
}

.pub-contribution {
  margin: 0;
  color: var(--ink);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.tiny-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--surface);
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.tiny-link:hover {
  background: var(--ink);
  color: var(--bg);
}

.is-hidden {
  display: none !important;
}

/* Whole-card click target: media, title, and body all open the project. */
.project-card {
  cursor: pointer;
}

.project-card h2 .card-link {
  color: inherit;
}

.project-card h2 .card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

.project-card:hover h2 .card-link {
  color: var(--accent);
}

.project-card .project-media,
.project-card .project-body {
  position: relative;
  z-index: 1;
}

.project-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.project-card h2 .card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.project-hero {
  display: block;
}

/* Airy intro: the title is the single focal point, then a full-width banner. */
.project-hero-intro {
  max-width: 940px;
  margin: 0 auto 0 0;
  padding: clamp(0.3rem, 2vw, 1rem) 0 clamp(1.2rem, 3vw, 2rem);
}

.project-hero-intro .eyebrow {
  color: var(--accent);
}

.project-hero-intro h1 {
  margin: 0.5rem 0 0;
}

.project-hero-intro .lead {
  margin-top: 1rem;
  max-width: 840px;
  color: var(--muted);
}

/* Full-width cinematic banner under the title */
.project-banner {
  width: 100%;
  margin: 0;
  background: var(--surface-soft);
  border-radius: var(--radius-xl);
}

.project-banner img,
.project-banner video {
  width: 100%;
  height: clamp(240px, 40vw, 440px);
  object-fit: cover;
}

/* Metadata compressed into one clean strip: ACCENT label · value, divided */
.project-meta-bar {
  margin: 1.1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.7rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
}

.pm-item {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
}

.pm-item + .pm-item::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 0.15rem;
  bottom: 0.15rem;
  width: 1px;
  background: var(--line);
}

.pm-item dt {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}

.pm-item dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink);
}

.project-tags {
  margin-top: 1.2rem;
}

@media (max-width: 620px) {
  .project-meta-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem 1.2rem;
  }
  .pm-item { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .pm-item + .pm-item::before { display: none; }
}

.contribution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.mini-card {
  padding: 1rem;
}

.mini-card .index {
  display: inline-flex;
  color: var(--accent);
  font-weight: 900;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}

.mini-card p {
  margin: 0;
  color: var(--muted);
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-item {
  margin: 0;
  background: var(--surface);
}

.gallery-item img,
.gallery-item video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--surface-soft);
}

.gallery-item figcaption {
  padding: 0.75rem 0.9rem 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.prose {
  max-width: 900px;
}

.prose h2 {
  margin-top: 2.2rem;
  font-size: 1.6rem;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.prose h3 {
  margin-top: 1.5rem;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose a {
  color: var(--accent);
  font-weight: 700;
}

.prose code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0.12rem 0.32rem;
}

.post-detail,
.news-card,
.privacy-note {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: clamp(1.2rem, 4vw, 2rem);
  box-shadow: var(--shadow-soft);
}

.news-card {
  display: grid;
  gap: 0.5rem;
}

.news-card time {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.news-card h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.news-card p {
  margin: 0;
  color: var(--muted);
}

.privacy-note {
  display: flex;
  gap: 0.75rem;
  align-items: start;
  color: var(--muted);
}

.privacy-note strong {
  color: var(--ink);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal — children animate in sequence (GSAP-style stagger) */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
  transition-delay: calc(var(--i, 0) * 70ms);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .page-grid,
  body.news-collapsed .page-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .news-rail {
    position: static;
  }

  .news-scroll {
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .news-scroll.is-scrolling .rail-news-list {
    animation: none;
    transform: none;
  }

  body.news-collapsed .news-panel {
    display: block;
  }

  body.news-collapsed .news-rail-toggle {
    justify-content: space-between;
    padding: 0.5rem 0.7rem 0.5rem 0.95rem;
  }

  body.news-collapsed .news-rail-title {
    writing-mode: horizontal-tb;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 420px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .pub-card,
  .project-card {
    grid-template-columns: 1fr;
  }

  .pub-media,
  .project-media {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .section-heading {
    display: block;
  }

  .section-heading p:last-child {
    margin-top: 0.8rem;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 0 1rem;
  }

  .brand small {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(var(--header-h) - 0.2rem);
    display: none;
    border-radius: 22px;
    padding: 0.55rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    max-height: 78vh;
    overflow-y: auto;
  }

  .site-nav.is-open {
    display: grid;
    gap: 0.15rem;
  }

  .nav-item {
    display: block;
  }

  .nav-link,
  .nav-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  /* Inline, lightweight dropdowns inside the mobile panel */
  .nav-dropdown {
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
    display: none;
  }

  .nav-item.is-open .nav-dropdown {
    display: block;
    transform: none;
  }

  .nav-dropdown::before { display: none; }

  .liquid-glass { box-shadow: none; }
  .lg-refract { -webkit-backdrop-filter: none; backdrop-filter: none; }

  .nav-dropdown-inner {
    padding: 0.4rem 0.4rem 0.7rem;
    background: var(--surface-soft);
    border-radius: 16px;
  }

  .nav-dd-projects,
  .nav-dd-list { width: 100%; }

  .nav-dd-blurb { display: none; }

  .page-grid {
    padding: 2rem 1rem 3rem;
  }

  .hero {
    min-height: auto;
    padding-top: 2rem;
  }

  .hero-copy h1,
  .page-title h1,
  .project-hero h1,
  .post-header h1 {
    letter-spacing: -0.06em;
  }

  .hero-stats,
  .contribution-grid,
  .media-gallery {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 360px;
  }

  .site-footer {
    padding: 1.5rem 1rem;
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}

/* =====================================================================
   Technical module system (interactive pipelines / flow diagrams)
   Used by the merged Autonomous Lawn-Mower Robot project.
   ===================================================================== */
.lawn-modules {
  margin-top: 1rem;
}

.module-intro {
  max-width: 860px;
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.tech-modules {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.tech-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.7rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 65%, transparent);
}

.tech-tab {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tech-tab:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.tech-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-soft);
}

.tech-tab .tab-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 850;
  background: var(--surface-soft);
  color: var(--accent);
  transition: background-color 160ms ease, color 160ms ease;
}

.tech-tab.is-active .tab-index {
  background: var(--accent);
  color: #fff;
}

.tech-tab .tab-label {
  display: grid;
  line-height: 1.18;
}

.tech-tab .tab-label strong {
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.tech-tab .tab-label small {
  font-size: 0.72rem;
  color: var(--soft);
  font-weight: 650;
}

.tech-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tech-panel {
  display: none;
  padding: clamp(1.1rem, 3vw, 1.9rem);
}

.tech-panel.is-active {
  display: block;
  animation: panelIn 360ms ease;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.module-head {
  margin-bottom: 1rem;
}

.module-head h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  letter-spacing: -0.03em;
}

.module-oneliner {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 860px;
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0.32rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 750;
}

.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.sub-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.8rem 0 0.4rem;
}

.sub-head:first-child {
  margin-top: 0.4rem;
}

.sub-head .ver {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--ink);
}

.sub-head .ver.v2 {
  background: var(--accent);
}

.sub-head h4 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 1.2rem;
  align-items: start;
  margin-top: 1rem;
}

/* ---- Flow diagram ---- */
.flow {
  display: grid;
  gap: 0;
}

.flow-step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.8rem 1rem;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.flow-step:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateX(2px);
  box-shadow: var(--shadow-soft);
}

.flow-step .step-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

.flow-step h4 {
  margin: 0.3rem 0 0.4rem;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.flow-step ul {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.22rem;
}

.flow-step li {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.flow-step.is-drop {
  border-style: dashed;
  opacity: 0.7;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.02rem 0.32rem;
}

.flow-arrow {
  display: grid;
  place-items: center;
  height: 24px;
}

.flow-arrow::before {
  content: "";
  width: 2px;
  height: 11px;
  background: linear-gradient(var(--line), color-mix(in srgb, var(--accent) 60%, var(--line)));
}

.flow-arrow::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid color-mix(in srgb, var(--accent) 70%, var(--soft));
  margin-top: 1px;
}

.flow-branch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.flow-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.flow-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--soft);
  font-weight: 650;
  padding: 0.2rem 0;
}

/* ---- Scoring table ---- */
.scoring {
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.scoring table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.scoring th,
.scoring td {
  text-align: left;
  padding: 0.42rem 0.6rem;
  border-bottom: 1px solid var(--line);
}

.scoring th {
  background: var(--surface-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--soft);
}

.scoring tr:last-child td {
  border-bottom: 0;
}

.scoring .w {
  font-weight: 850;
  color: var(--accent);
  white-space: nowrap;
}

/* ---- Visualization box ---- */
.viz-box {
  position: sticky;
  top: calc(var(--header-h) + 1.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.viz-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}

.viz-head::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-green) 18%, transparent);
}

.viz-media {
  display: grid;
  gap: 0.7rem;
  padding: 0.7rem;
}

.viz-media figure {
  margin: 0;
}

.viz-media img,
.viz-media video {
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.viz-media figcaption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ---- Metric highlights ---- */
.module-highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.1rem;
}

.metric {
  flex: 1 1 130px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 0.75rem 0.9rem;
}

.metric strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.metric span {
  font-size: 0.76rem;
  color: var(--muted);
}

.ref-note {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.ref-note strong {
  color: var(--ink);
}

/* =====================================================================
   Project rich-body extras — natural figures, timeline phases,
   before/after compare, ablation table (shared by redesigned projects)
   ===================================================================== */
.proj-section {
  margin-top: 1.6rem;
}

.proj-section > .module-head {
  margin-bottom: 1rem;
}

/* Natural-aspect figures that adapt to any image / gif / video ratio */
.proj-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.proj-figure > img,
.proj-figure > video {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface-soft);
}

.proj-figure.portrait {
  display: grid;
  justify-items: center;
  background: var(--surface-soft);
}

.proj-figure.portrait > img {
  width: auto;
  max-width: 100%;
  max-height: 500px;
}

.proj-figure figcaption {
  padding: 0.7rem 1rem 0.82rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.proj-figure figcaption strong {
  color: var(--ink);
  font-weight: 700;
}

.proj-figrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}

.proj-figrow.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.proj-figrow.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Equal-height figures in a row: uniform media box keeps the trio aligned */
.proj-figrow .proj-figure {
  display: flex;
  flex-direction: column;
}

.proj-figrow .proj-figure > img,
.proj-figrow .proj-figure > video {
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: contain;
}

/* Figure size modifiers (shrink on desktop; full width on mobile for clarity) */
@media (min-width: 760px) {
  .proj-figure.is-narrow {
    max-width: 820px;
    margin-inline: auto;
  }

  .proj-figure.is-compact {
    max-width: 60%;
    margin-inline: auto;
  }
}

.viz-media figure.is-compact img {
  max-height: 260px;
  object-fit: contain;
}

/* Transparent technical diagrams: white plate keeps them legible in dark mode */
.proj-figure.on-white > img,
.viz-media figure.on-white img {
  background: #fff;
}

/* Click-to-zoom affordance on figure images */
.proj-figure > img,
.viz-media img,
.gallery-item img {
  cursor: zoom-in;
}

.proj-figstack {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

/* Timeline phases (for multi-era merged projects) */
.phase-track {
  display: grid;
  gap: 1.3rem;
  margin-top: 1.2rem;
}

.phase {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.1rem, 2.6vw, 1.7rem);
}

.phase-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.phase-step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 850;
  font-size: 0.82rem;
}

.phase-badge,
.phase-org {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.phase-badge {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.phase-org {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.phase h3 {
  margin: 0.7rem 0 0.3rem;
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  letter-spacing: -0.03em;
}

.phase-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 860px;
}

/* Before / after comparison */
.compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  align-items: stretch;
  margin-top: 1rem;
}

.compare-col {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.95rem 1rem;
}

.compare-col.before {
  opacity: 0.92;
}

.compare-col.after {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.compare-col h5 {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--soft);
}

.compare-col.after h5 {
  color: var(--accent);
}

.compare-col p {
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.compare-col .big {
  color: var(--ink);
  font-weight: 800;
  font-size: 1.02rem;
}

.compare-col.after .big {
  color: var(--accent);
}

.compare-arrow {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.compare-arrow svg {
  width: 22px;
  height: 22px;
}

/* Ablation / metric table */
.ablation {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: auto;
}

.ablation table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.ablation th,
.ablation td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.ablation th:first-child,
.ablation td:first-child {
  text-align: left;
}

.ablation thead th {
  background: var(--surface-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--soft);
}

.ablation tbody tr:last-child td {
  border-bottom: 0;
}

.ablation tr.best {
  background: color-mix(in srgb, var(--accent-green) 13%, var(--surface));
}

.ablation tr.best td {
  color: var(--accent-green);
  font-weight: 800;
}

@media (max-width: 760px) {
  .proj-figrow.two {
    grid-template-columns: 1fr;
  }

  .proj-figrow.three {
    grid-template-columns: 1fr;
  }

  .compare {
    grid-template-columns: 1fr;
  }

  .compare-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 980px) {
  .module-grid {
    grid-template-columns: 1fr;
  }

  .viz-box {
    position: static;
  }
}

@media (max-width: 620px) {
  .tech-tab {
    flex: 1 1 100%;
  }

  .flow-branch,
  .flow-inputs {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   Home hero v2 — headline + portrait/about duo
   ===================================================================== */
.hero-headline {
  max-width: 1000px;
}

.hero-cn {
  color: var(--muted);
  font-weight: 600;
}

.hero-duo {
  display: grid;
  grid-template-columns: minmax(200px, 0.68fr) minmax(0, 1.32fr);
  gap: 1.3rem;
  align-items: stretch;
}

.hero-portrait {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-self: start;
}

.portrait-frame {
  padding: 0;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: 360px;
  background:
    radial-gradient(circle at 30% 12%, var(--accent-soft), transparent 60%),
    var(--surface-soft);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-tags {
  list-style: none;
  margin: 0;
  padding: 0 0.4rem;
  text-align: center;
  line-height: 1.7;
}

.portrait-tags li {
  display: inline;
  font-family: "Snell Roundhand", "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}

.portrait-tags li:not(:last-child)::after {
  content: " · ";
  color: var(--soft);
  font-style: normal;
}

.hero-about {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.3rem, 2.6vw, 2rem);
}

.about-bio {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.1vw, 1.05rem);
  line-height: 1.66;
}

.about-bio strong {
  color: var(--ink);
}

.about-bio a {
  color: var(--accent);
  font-weight: 650;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.about-bio a:hover {
  border-bottom-color: var(--accent);
}

.about-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.4rem 0.82rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease;
}

.contact-chip svg {
  width: 17px;
  height: 17px;
}

.contact-chip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}

.contact-chip.is-copied {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.hero-about .hero-actions {
  margin-top: 0.25rem;
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.button.ghost:hover {
  color: var(--accent);
  background: var(--surface-soft);
  box-shadow: none;
}

/* =====================================================================
   Start-here cards (custom icons + collapsible detail)
   ===================================================================== */
.start-section .section-heading {
  align-items: center;
}

.inline-search {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.5rem 0.7rem 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.inline-search svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.inline-search:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.inline-search kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  padding: 0.12rem 0.4rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--soft);
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.start-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.3rem;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.start-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.start-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink);
}

.start-head:hover {
  color: var(--ink);
}

.start-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
  color: var(--accent);
}

.start-icon svg {
  width: 23px;
  height: 23px;
}

.start-titles h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.025em;
}

.start-titles small {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.start-go {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--soft);
  transition: transform 200ms ease, color 200ms ease;
}

.start-go svg {
  width: 18px;
  height: 18px;
}

.start-card:hover .start-go {
  color: var(--accent);
  transform: translateX(4px);
}

.start-card:hover .start-titles h3 {
  color: var(--accent);
}

.start-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.start-more {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.start-more summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  user-select: none;
}

.start-more summary::-webkit-details-marker {
  display: none;
}

.start-more summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  font-weight: 800;
  line-height: 1;
}

.start-more[open] summary::before {
  content: "−";
}

.start-more p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  animation: panelIn 280ms ease;
}

/* =====================================================================
   Research direction chips (publications header)
   ===================================================================== */
.direction-chips {
  list-style: none;
  margin: 1.3rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.direction-chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
}

.direction-chips li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

/* =====================================================================
   Contact channel grid
   ===================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.2rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.contact-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  color: inherit;
}

.contact-card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
  color: var(--accent);
}

.contact-card-icon svg {
  width: 22px;
  height: 22px;
}

.contact-card h3 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.contact-card.is-copied {
  border-color: var(--accent-green);
}

.contact-card.is-copied .contact-card-icon {
  color: var(--accent-green);
  border-color: color-mix(in srgb, var(--accent-green) 40%, var(--line));
}

/* =====================================================================
   Command-palette search
   ===================================================================== */
.search-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, color 200ms ease;
}

.search-toggle:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  color: var(--accent);
}

body.search-open {
  overflow: hidden;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: clamp(3rem, 12vh, 9rem) 1rem 1rem;
}

.search-modal[hidden] {
  display: none;
}

.search-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  backdrop-filter: blur(6px);
  animation: fadeIn 200ms ease;
}

.search-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: panelPop 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes panelPop {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.search-field > svg {
  flex: none;
  color: var(--soft);
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.02rem;
  outline: none;
}

.search-field kbd {
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--soft);
  cursor: pointer;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  display: grid;
  gap: 0.25rem;
}

.search-results:empty {
  display: none;
}

.search-result {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}

.search-result:hover,
.search-result.is-active {
  background: var(--surface-soft);
  border-color: var(--line);
}

.search-result .res-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.search-result .res-body {
  min-width: 0;
}

.search-result .res-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result .res-meta {
  display: block;
  font-size: 0.76rem;
  color: var(--soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-hint {
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--soft);
  font-size: 0.84rem;
  border-top: 1px solid var(--line);
}

.search-hint.is-empty {
  color: var(--muted);
}

/* =====================================================================
   Responsive — hero/start/contact/news
   ===================================================================== */
@media (max-width: 1100px) {
  .hero-duo {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    aspect-ratio: 16 / 10;
    max-height: 360px;
  }

  .start-grid,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .start-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .inline-search span {
    display: none;
  }

  .brand small {
    display: none;
  }
}

/* =====================================================================
   Image lightbox — click any figure image to zoom
   ===================================================================== */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--ink) 80%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 220ms ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  background: #fff;
  cursor: default;
  transform: scale(0.97);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox.is-open img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: clamp(0.8rem, 2vw, 1.4rem);
  right: clamp(0.8rem, 2vw, 1.4rem);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, #fff 32%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  color: #fff;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.lightbox-close:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--ink) 60%, transparent);
}

/* =====================================================================
   Cross-project navigation (detail pages) — prev/next + quick-jump strip
   Lets visitors hop between projects without returning to the index.
   ===================================================================== */
.project-nav {
  margin-top: 3.2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.project-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.project-nav-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.project-nav-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow-soft);
}

.project-nav-card.next {
  text-align: right;
  justify-items: end;
}

.project-nav-card .dir {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-nav-card .dir svg {
  width: 13px;
  height: 13px;
  transition: transform 220ms ease;
}

.project-nav-card.prev:hover .dir svg {
  transform: translateX(-3px);
}

.project-nav-card.next:hover .dir svg {
  transform: translateX(3px);
}

.project-nav-card .t {
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-nav-card:hover .t {
  color: var(--accent);
}

.project-nav-card small {
  color: var(--soft);
  font-size: 0.74rem;
}

/* Quick-jump strip — compact thumbnail chips for every project */
.more-projects {
  margin-top: 1rem;
}

.more-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
}

.more-chip {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.more-chip:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-soft);
}

.more-chip .thumb {
  width: 58px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.more-chip .thumb img,
.more-chip .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more-chip .mc-body {
  min-width: 0;
}

.more-chip .mc-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-chip:hover .mc-title {
  color: var(--accent);
}

.more-chip .mc-meta {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  color: var(--soft);
}

.more-chip.is-current {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--accent-soft);
}

.more-chip.is-current .mc-title {
  color: var(--accent);
}

@media (max-width: 760px) {
  .project-nav-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   Road-preview redesign helpers — uniform challenge row, info tables,
   and the Train → Quantize → Deploy pipeline loop.
   ===================================================================== */
.challenge-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.1rem;
}

.challenge-row figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.challenge-row img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--surface-soft);
  cursor: zoom-in;
}

.challenge-row figcaption {
  padding: 0.5rem 0.65rem 0.6rem;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .challenge-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Spec / description tables for technical sections */
.info-table {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: auto;
}

.info-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.info-table th,
.info-table td {
  padding: 0.58rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.info-table th {
  background: var(--surface-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--soft);
}

.info-table tbody tr:last-child td {
  border-bottom: 0;
}

.info-table td:first-child {
  font-weight: 750;
  color: var(--ink);
  white-space: nowrap;
}

.info-table td .mono {
  white-space: nowrap;
}

/* Train → Quantize → Deploy closed loop */
.pipeline-loop {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.pipeline-loop .stage {
  flex: 1 1 200px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.9rem 1rem;
  transition: border-color 180ms ease, transform 180ms ease;
}

.pipeline-loop .stage:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  transform: translateY(-2px);
}

.pipeline-loop .stage .step-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

.pipeline-loop .stage .k {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.pipeline-loop .stage .v {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.pipeline-loop .arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent);
}

.pipeline-loop .arrow svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 760px) {
  .pipeline-loop .arrow {
    transform: rotate(90deg);
    margin: 0 auto;
  }
}

/* Caption note under a group of evaluation figures */
.eval-note {
  margin-top: 1.1rem;
  border: 1px solid color-mix(in srgb, var(--accent-green) 30%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-green) 8%, var(--surface));
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.eval-note strong {
  color: var(--accent-green);
}

/* =====================================================================
   Logo marquee — auto-scrolling wall of review venues (Contact page)
   Uniform tiles + edge fade + hover pause; static grid on reduced motion
   ===================================================================== */
.logo-marquee {
  position: relative;
  margin-top: 1.6rem;
  overflow: hidden;
  padding: 0.3rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.logo-track {
  display: flex;
  width: max-content;
  animation: logoScroll 46s linear infinite;
  will-change: transform;
}

.logo-marquee:hover .logo-track,
.logo-marquee:focus-within .logo-track {
  animation-play-state: paused;
}

.logo-cell {
  flex: none;
  width: 210px;
  height: 104px;
  margin-right: 1rem;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.logo-cell:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.logo-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Two identical halves -> -50% scrolls exactly one set: seamless loop */
@keyframes logoScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 620px) {
  .logo-cell { width: 168px; height: 86px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
    gap: 0.8rem;
  }
  .logo-cell { margin-right: 0; }
  .logo-cell[aria-hidden="true"] { display: none; }
}

/* =====================================================================
   New-feature highlight — marks additions introduced in OneModel v2
   ===================================================================== */
.nf {
  color: var(--accent-purple);
  font-weight: 800;
  background: color-mix(in srgb, var(--accent-purple) 13%, transparent);
  border-radius: 5px;
  padding: 0 0.28em;
}

.nf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  vertical-align: middle;
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent-purple);
  border-radius: 999px;
  padding: 0.14rem 0.46rem;
  margin-left: 0.4rem;
}

/* Legend chip explaining the new-feature colour */
.nf-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--muted);
}

.nf-legend::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--accent-purple);
}

/* Stat band — headline numbers for a production system */
.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.stat-band .stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.1rem;
}

.stat-band .stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

.stat-band .stat span {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-band .stat.accent b { color: var(--accent); }
.stat-band .stat.good b { color: var(--accent-green); }

/* Feature / spec bullet list — used inside head tabs and phase cards */
.spec-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.spec-list li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.spec-list li::before {
  content: "";
  position: absolute;
  left: 0.18rem;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

.spec-list li strong {
  color: var(--ink);
  font-weight: 750;
}

/* Descriptive ablation tables (sentence cells) — allow wrapping, left align */
.ablation.wrap th,
.ablation.wrap td {
  white-space: normal;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

/* =====================================================================
   Logic Atlas — interactive 2.5D logic map (project pages)
   Self-contained dark "logic space"; theme-independent premium look.
   ===================================================================== */
.atlas {
  --at-ink: #eef2f8;
  --at-muted: #9aa6bd;
  --at-soft: #6c7791;
  --at-cyan: #38e1ef;
  --at-blue: #6e9bff;
  --at-purple: #b09bff;
  --at-green: #41d6a0;
  --at-warn: #ffce5a;
  --at-line: rgba(150, 180, 255, 0.30);
  --at-node: rgba(255, 255, 255, 0.055);
  --at-node-2: rgba(255, 255, 255, 0.02);
  --at-border: rgba(255, 255, 255, 0.14);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(258px, 318px);
  grid-template-areas: "bar bar" "stage panel";
  gap: 1.1rem 1.3rem;
  margin: 1.6rem 0;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border-radius: var(--radius-xl);
  color: var(--at-ink);
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(56, 130, 255, 0.18), transparent 55%),
    radial-gradient(110% 120% at 110% 10%, rgba(150, 110, 255, 0.16), transparent 52%),
    linear-gradient(180deg, #0a0d16, #06070d 70%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.atlas-bar {
  grid-area: bar;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.atlas-bar-head .eyebrow { color: var(--at-cyan); }
.atlas-bar-head h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  letter-spacing: -0.03em;
  color: #fff;
}
.atlas-caption {
  margin: 0.4rem 0 0;
  max-width: 60ch;
  color: var(--at-muted);
  font-size: 0.9rem;
}

.atlas-tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--at-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--at-ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.atlas-tour-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.atlas-tour-btn .ico-pause { display: none; }
.atlas.is-touring .atlas-tour-btn .ico-play { display: none; }
.atlas.is-touring .atlas-tour-btn .ico-pause { display: inline; color: var(--at-cyan); }

/* ---- Stage ---- */
.atlas-stage {
  grid-area: stage;
  position: relative;
  min-height: 320px;
  perspective: 1500px;
}

.atlas-scene {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.atlas-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.atlas-edges path {
  fill: none;
  stroke: var(--at-line);
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: stroke 220ms ease, stroke-width 220ms ease, opacity 220ms ease;
}
.atlas-edges path.kind-dashed { stroke-dasharray: 2 6; opacity: 0.7; }
.atlas-edges path.kind-flow { stroke-dasharray: 5 9; animation: atlasFlow 1.05s linear infinite; }
@keyframes atlasFlow { to { stroke-dashoffset: -28; } }
.atlas-edges.has-dim path { opacity: 0.14; }
.atlas-edges path.is-lit {
  opacity: 1;
  stroke: var(--at-cyan);
  stroke-width: 2.6;
  filter: drop-shadow(0 0 5px rgba(56, 225, 239, 0.55));
}
.atlas-edges .edge-head { fill: var(--at-line); transition: fill 220ms ease; }
.atlas-edges .edge-head.is-lit { fill: var(--at-cyan); }
.atlas-edges.has-dim .edge-head:not(.is-lit) { opacity: 0.14; }

/* ---- Node grid ---- */
.atlas-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--atlas-cols, 4), minmax(0, 1fr));
  grid-auto-rows: minmax(72px, auto);
  gap: clamp(0.7rem, 2.2vw, 1.5rem) clamp(0.8rem, 2.4vw, 1.7rem);
}

.atlas-node {
  --nc: var(--at-cyan);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.22rem;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--at-border);
  background: linear-gradient(160deg, var(--at-node), var(--at-node-2));
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  color: var(--at-ink);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 26px -16px rgba(0, 0, 0, 0.8);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), border-color 240ms ease,
    box-shadow 240ms ease, opacity 240ms ease, background-color 240ms ease;
}
.atlas-node .node-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nc);
}
.atlas-node .node-title {
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.18;
  color: #fff;
}
.atlas-node .node-desc {
  font-size: 0.72rem;
  color: var(--at-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.atlas-node .node-score {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 22px;
  margin-top: 0.45rem;
}
.atlas-node .node-score .ns-bar {
  width: 6px;
  min-height: 3px;
  border-radius: 2px;
  background: var(--nc);
  opacity: 0.45;
  transition: opacity 220ms ease;
}
.atlas-node:hover .node-score .ns-bar,
.atlas-node.is-active .node-score .ns-bar,
.atlas-node.is-lit .node-score .ns-bar { opacity: 0.92; }
.atlas-node .node-spark {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--nc);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--nc) 70%, transparent);
}
.atlas-node.is-start .node-spark { animation: atlasPulse 2.4s ease-in-out infinite; }
.atlas-node.is-pulse .node-spark { animation: atlasPulse 2.1s ease-in-out infinite; }
@keyframes atlasPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--nc) 60%, transparent); }
  50% { box-shadow: 0 0 0 7px transparent; }
}

.atlas-node:hover,
.atlas-node:focus-visible,
.atlas-node.is-lit {
  transform: translateZ(34px) scale(1.05);
  border-color: color-mix(in srgb, var(--nc) 70%, var(--at-border));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 44px -18px color-mix(in srgb, var(--nc) 60%, transparent),
    0 0 0 1px color-mix(in srgb, var(--nc) 30%, transparent);
  outline: none;
}
.atlas-node.is-active {
  transform: translateZ(48px) scale(1.08);
  border-color: var(--nc);
  background: linear-gradient(160deg, color-mix(in srgb, var(--nc) 18%, var(--at-node)), var(--at-node-2));
}
.atlas-grid.has-dim .atlas-node:not(.is-lit):not(.is-active) {
  opacity: 0.32;
  filter: saturate(0.6);
}

/* accent map */
.atlas-node.acc-cyan { --nc: var(--at-cyan); }
.atlas-node.acc-blue { --nc: var(--at-blue); }
.atlas-node.acc-purple { --nc: var(--at-purple); }
.atlas-node.acc-green { --nc: var(--at-green); }
.atlas-node.acc-warn { --nc: var(--at-warn); }
.atlas-node.acc-ink { --nc: #cfd8ea; }

/* ---- Info panel ---- */
.atlas-panel {
  grid-area: panel;
  align-self: start;
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--at-border);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.ap-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.ap-dot {
  margin-top: 0.3rem;
  width: 9px; height: 9px;
  flex: none;
  border-radius: 999px;
  background: var(--at-cyan);
  box-shadow: 0 0 10px color-mix(in srgb, var(--at-cyan) 70%, transparent);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}
.ap-tag {
  margin: 0;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--at-muted);
}
.ap-title {
  margin: 0.12rem 0 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.25;
}
.ap-io { margin: 0; display: grid; gap: 0.5rem; }
.ap-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 0.6rem;
  align-items: baseline;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.ap-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ap-row dt {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--at-soft);
}
.ap-row dd {
  margin: 0;
  font-size: 0.84rem;
  color: var(--at-ink);
  line-height: 1.35;
}
.ap-give dd { color: var(--at-green); font-weight: 650; }
.ap-rel { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; }
.ap-rel-group { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; color: var(--at-muted); }
.ap-rel-group b { font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.6rem; color: var(--at-soft); }
.ap-rel-group span { color: var(--at-ink); font-weight: 600; }
.ap-media { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--at-border); }
.ap-media video, .ap-media img { display: block; width: 100%; height: auto; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .atlas {
    grid-template-columns: 1fr;
    grid-template-areas: "bar" "stage" "panel";
  }
  .atlas-panel { position: static; }
}
@media (max-width: 640px) {
  .atlas-grid {
    grid-template-columns: 1fr !important;
  }
  .atlas-node {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  .atlas-edges { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-edges path.kind-flow { animation: none; stroke-dasharray: 0; }
  .atlas-edges path.kind-loop { animation: none; }
  .atlas-node.is-start .node-spark { animation: none; }
  .atlas-scene { transition: none; }
}

/* Reflective first-person note inside the atlas panel (no label, by design) */
.ap-note {
  margin: 0;
  padding: 0.6rem 0.7rem 0.62rem;
  border-radius: 11px;
  border-left: 2px solid var(--at-cyan);
  background: rgba(255, 255, 255, 0.045);
  color: var(--at-muted);
  font-size: 0.8rem;
  line-height: 1.5;
  font-style: italic;
}

/* Glowing closed-loop edge + flowing dashes */
.atlas-edges path.kind-loop {
  stroke: var(--at-cyan);
  stroke-width: 2;
  stroke-dasharray: 4 8;
  opacity: 0.92;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--at-cyan) 55%, transparent));
  animation: atlasFlow 1.1s linear infinite;
}
.atlas-edges path.kind-loop.is-lit { stroke-width: 3; }
.atlas-edges .edge-head.kind-loop { fill: var(--at-cyan); }

/* Near-black "noir" atlas variant for the blog — cyan→violet→amber only on accents */
.atlas.is-noir {
  --at-cyan: #22d3ee;
  --at-blue: #818cf8;
  --at-purple: #a78bfa;
  --at-green: #34d399;
  --at-warn: #fcd34d;
  --at-ink: #f4f4f5;
  --at-muted: #a1a1aa;
  --at-soft: #71717a;
  --at-line: rgba(255, 255, 255, 0.16);
  --at-node: rgba(255, 255, 255, 0.06);
  --at-node-2: rgba(255, 255, 255, 0.015);
  --at-border: rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(120% 70% at 50% -8%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(90% 60% at 92% 108%, rgba(167, 139, 250, 0.08), transparent 60%),
    #07070a;
  border-color: rgba(255, 255, 255, 0.07);
}
.atlas.is-noir .atlas-bar-head .eyebrow { color: var(--at-cyan); }
.atlas.is-noir .atlas-node.is-active {
  background: linear-gradient(160deg, color-mix(in srgb, var(--nc) 22%, var(--at-node)), var(--at-node-2));
}

/* Mobile: stack the panel under the stage and let dense maps scroll sideways
   instead of being crushed into unreadable columns. */
@media (max-width: 760px) {
  .atlas {
    grid-template-columns: 1fr;
    grid-template-areas: "bar" "stage" "panel";
  }
  .atlas-stage {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.4rem;
  }
  .atlas-scene { min-width: 560px; }
  .atlas-panel { min-width: 0; }
}

/* =====================================================================
   Project body layout + slim sticky "Contents" rail (top, full-width)
   ===================================================================== */
.project-body {
  display: block;
  margin-top: 2rem;
}
.project-body-main { min-width: 0; }

/* A pill-shaped contents rail pinned to the top — never steals body width. */
.proj-toc {
  position: sticky;
  top: calc(var(--header-h) + 0.5rem);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.7rem;
  padding: 0.34rem 0.4rem 0.34rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  box-shadow: var(--shadow-soft);
}

.proj-toc-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.7rem 0.32rem 0.55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.proj-toc-toggle .toc-title {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.toc-chevron { transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1); color: var(--soft); }
.proj-toc.is-collapsed .toc-chevron { transform: rotate(-90deg); }

.proj-toc-nav {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.4rem, #000 calc(100% - 1.4rem), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 1.4rem, #000 calc(100% - 1.4rem), transparent);
  border-left: 1px solid var(--line);
  padding-left: 0.5rem;
}
.proj-toc-nav::-webkit-scrollbar { display: none; }
.proj-toc.is-collapsed .proj-toc-nav { display: none; }

.proj-toc-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.2rem;
}
.proj-toc-nav li { flex: none; }
.proj-toc-nav a {
  display: block;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}
.proj-toc-nav a.lvl-3 { font-size: 0.74rem; font-weight: 550; opacity: 0.82; }
.proj-toc-nav a:hover { color: var(--ink); background: var(--surface-soft); }
.proj-toc-nav a.is-current {
  color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 720px) {
  .proj-toc { gap: 0.3rem; }
  .proj-toc-toggle { padding-right: 0.5rem; }
}

.project-body-main h2,
.project-body-main h3[id] { scroll-margin-top: calc(var(--header-h) + 4rem); }

/* Project section headings + compact before/after contrast cards */
.lawn-modules .lawn-h2 {
  margin: 2.8rem 0 1rem;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  letter-spacing: -0.03em;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}
.why-card {
  display: grid;
  gap: 0.4rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 200ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.why-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-2px); }
.why-x {
  font-size: 0.82rem;
  color: var(--soft);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--accent-warn) 70%, transparent);
}
.why-y { display: flex; gap: 0.45rem; font-size: 0.93rem; font-weight: 700; color: var(--ink); }
.why-y::before { content: "→"; color: var(--accent-green); font-weight: 800; }

/* Two-up media row (alias used by several project pages) */
.media-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}
.media-duo .proj-figure { display: flex; flex-direction: column; margin: 0; }
.media-duo .proj-figure > img,
.media-duo .proj-figure > video { aspect-ratio: 16 / 10; height: auto; object-fit: contain; }
@media (max-width: 640px) {
  .media-duo { grid-template-columns: 1fr; }
}

/* =====================================================================
   Blog: ArtiFixer reading — hero, contribution layer, media, takeaways
   ===================================================================== */
.bx { max-width: 1180px; margin-inline: auto; display: block; }

.bx-hero {
  position: relative;
  margin: 0.4rem 0 1.4rem;
  padding: clamp(1.6rem, 4vw, 2.9rem);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #07070a;
  color: #f4f4f5;
}
.bx-hero-media { position: absolute; inset: 0; z-index: 0; }
.bx-hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.34; }
.bx-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(7, 7, 10, 0.5), rgba(7, 7, 10, 0.85) 72%, #07070a),
    radial-gradient(120% 80% at 50% -10%, rgba(34, 211, 238, 0.12), transparent 60%);
}
.bx-hero-inner, .bx-lede { position: relative; z-index: 2; }
.bx-hero-inner .eyebrow { color: #7ee8f5; }
.bx-hero-inner h1 {
  margin: 0.55rem 0 0;
  color: #fff;
  font-size: clamp(1.7rem, 4.4vw, 2.9rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.bx-byline { margin: 0.9rem 0 0; max-width: 62ch; color: #c9ccd3; font-size: 1rem; line-height: 1.6; }
.bx-lede {
  margin: 1.5rem 0 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 2px solid #22d3ee;
  max-width: 76ch;
  color: #d6d6db;
  font-size: 1.03rem;
  line-height: 1.75;
}

.bx-shell { display: block; margin-top: 1.4rem; }
.bx-body { min-width: 0; }

.bx-section { margin-top: 2.6rem; }
.bx-section > h2 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.bx-note-line { color: var(--muted); max-width: 82ch; margin: 0 0 1.1rem; line-height: 1.65; }

.bx-callout {
  margin: 0;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 82ch;
}

.bx-contribs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.bx-contrib {
  display: grid;
  gap: 0.28rem;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.bx-contrib:hover, .bx-contrib:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent-cyan) 50%, var(--line));
  box-shadow: var(--shadow);
  outline: none;
}
.bx-cnum { font-family: var(--font-display); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.1em; color: var(--accent-cyan); }
.bx-contrib h3 { margin: 0.1rem 0 0; font-size: 1.04rem; letter-spacing: -0.01em; }
.bx-src { margin: 0.2rem 0 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }
.bx-res { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.bx-res span { color: var(--accent-green); font-weight: 800; }

.bx-media { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.bx-fig {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.bx-fig img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--surface-soft); cursor: zoom-in; }
.bx-fig figcaption { padding: 0.7rem 0.9rem 0.82rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.bx-fig figcaption strong { color: var(--ink); }

.bx-takeaways { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.7rem; max-width: 84ch; }
.bx-takeaways li {
  position: relative;
  padding: 0.95rem 1.15rem 1rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.75;
}
.bx-takeaways li::before {
  content: "";
  position: absolute;
  left: 1.1rem;
  top: 1.45rem;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-cyan) 18%, transparent);
}

@media (max-width: 760px) {
  .bx-contribs, .bx-media { grid-template-columns: 1fr; }
}

/* ============================================================
   Blog diagrams — shared components for the long-form notes
   (videos, equation line, impossible triangle, nested layers,
   vicious cycle, two-column compare). Restrained, reuse tokens.
   ============================================================ */

/* Video container: full frame, no crop (clips are diagrams, not covers). */
.bx-video {
  margin: 1.4rem auto;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.bx-video.is-wide { max-width: 1000px; }
.bx-video video { width: 100%; height: auto; display: block; background: #0a0d14; }
.bx-video figcaption {
  padding: 0.68rem 0.95rem 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.bx-video figcaption strong { color: var(--ink); }

/* Headline equation / tagline line. */
.bx-eq {
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 2.3vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.45;
  text-align: center;
  color: var(--ink);
}
.bx-eq b { color: var(--accent); }
.bx-eq .eq-cyan { color: var(--accent-cyan); }
.bx-eq .eq-arrow { color: var(--soft); font-weight: 500; margin: 0 0.15em; }

/* Impossible triangle. */
.tri {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.5rem;
  align-items: center;
  margin: 1.3rem 0;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.tri svg { width: 168px; height: auto; display: block; }
.tri-v { font-size: 0.74rem; font-weight: 700; fill: var(--ink); }
.tri-edge { stroke: var(--accent); stroke-width: 2; fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.tri-dot { fill: var(--accent); }
.tri-note { margin: 0; color: var(--muted); line-height: 1.75; }
.tri-note b { color: var(--ink); }
@media (max-width: 600px) { .tri { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* Nested four-layer framework (prompt ⊂ context ⊂ harness ⊂ loop). */
.nest-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 330px);
  gap: 1.3rem;
  align-items: start;
  margin: 1.4rem 0;
}
.nest { display: block; }
.nlayer {
  --nl-c: var(--accent);
  position: relative;
  padding: 2.7rem 0.85rem 0.95rem;
  border: 1.5px solid color-mix(in srgb, var(--nl-c) 42%, var(--line));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--nl-c) 7%, var(--surface));
  cursor: pointer;
  transition: box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
}
.nlayer + .nlayer, .nlayer .nlayer { margin-top: 0; }
.nl-loop { --nl-c: var(--accent-green); }
.nl-harness { --nl-c: var(--accent-purple); }
.nl-context { --nl-c: var(--accent); }
.nl-prompt { --nl-c: var(--accent-cyan); padding-bottom: 0.85rem; }
.nl-head {
  position: absolute;
  top: 0.6rem;
  left: 0.85rem;
  right: 0.85rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.nl-k { font-family: var(--font-display); font-weight: 800; font-size: 0.82rem; color: var(--nl-c); }
.nl-t { font-weight: 750; letter-spacing: -0.01em; }
.nl-s { color: var(--muted); font-size: 0.8rem; margin-left: auto; }
.nlayer.is-sel { border-color: var(--nl-c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nl-c) 16%, transparent); }
.nest-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.2rem;
  position: sticky;
  top: calc(var(--header-h) + 12px);
}
.nest-block { display: none; }
.nest-block.is-on { display: block; }
.nest-block h4 { margin: 0 0 0.2rem; font-size: 1.02rem; }
.nest-block .nb-tag { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nbc, var(--accent)); }
.nest-dl { margin: 0.7rem 0 0; display: grid; gap: 0.55rem; }
.nest-dl > div { border-top: 1px solid var(--line); padding-top: 0.5rem; }
.nest-dl dt { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
.nest-dl dd { margin: 0.12rem 0 0; color: var(--muted); line-height: 1.55; font-size: 0.92rem; }
@media (max-width: 820px) { .nest-wrap { grid-template-columns: 1fr; } .nest-panel { position: static; } }

/* Vicious cycle / compact step flow. */
.cyc { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.2rem 0; }
.cyc-step {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 600;
}
.cyc-step.is-fail { border-color: var(--accent-warn); color: var(--accent-warn); }
.cyc-arr { color: var(--accent-warn); font-weight: 800; }
.cyc-back { width: 100%; margin: 0.35rem 0 0; color: var(--soft); font-size: 0.82rem; }

/* Two-column blocks (RECAP steps, train vs infer). */
.duo2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin: 1.2rem 0; }
.duo2 > div {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.1rem;
}
.duo2 h4 { margin: 0 0 0.5rem; font-size: 0.98rem; }
.duo2 .d2-tag { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-cyan); }
.duo2 p { margin: 0.4rem 0 0; color: var(--muted); line-height: 1.6; font-size: 0.92rem; }
.duo2 .pos { color: var(--accent-green); font-weight: 700; }
.duo2 .neg { color: var(--accent-warn); font-weight: 700; }
@media (max-width: 640px) { .duo2 { grid-template-columns: 1fr; } }

/* Compact compare table. */
.cmp-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 540px; }
table.cmp th, table.cmp td { padding: 0.62rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.5; }
table.cmp thead th { background: var(--surface-soft); font-family: var(--font-display); letter-spacing: -0.01em; }
table.cmp tbody td:first-child { color: var(--soft); font-weight: 700; white-space: nowrap; }
table.cmp tr:last-child td { border-bottom: 0; }
.cmp-foot { margin: 0.7rem 0 0; padding-left: 0.2rem; color: var(--muted); font-size: 0.86rem; line-height: 1.6; }
.cmp-foot b { color: var(--ink); }

/* ============================================================
   Blog index — accent-coded cards (thumb + text), topic-filterable
   ============================================================ */
/* ---- Blog: topic-organized vertical cards ---- */
.kind-ref { display:inline-flex; align-items:center; padding:0.04em 0.5em; border-radius:999px; font-size:0.84em; font-weight:800; line-height:1.5; border:1px solid var(--line); }
.kind-ref.kind-note { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.kind-ref.kind-talk { color: var(--accent-purple); background: color-mix(in srgb, var(--accent-purple) 10%, transparent); border-color: color-mix(in srgb, var(--accent-purple) 28%, var(--line)); }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.25rem; }
.post-card {
  --cat: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 240ms cubic-bezier(.2,.7,.2,1), border-color 240ms ease, box-shadow 240ms ease;
}
.post-card[data-accent="cyan"]   { --cat: var(--accent-cyan); }
.post-card[data-accent="green"]  { --cat: var(--accent-green); }
.post-card[data-accent="purple"] { --cat: var(--accent-purple); }
.post-card[data-accent="warn"]   { --cat: var(--accent-warn); }
.post-card[data-accent="accent"] { --cat: var(--accent); }
.post-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--cat) 50%, var(--line)); box-shadow: var(--shadow); }
.post-card.is-hidden { display: none; }

.post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: color-mix(in srgb, var(--cat) 12%, var(--surface-soft));
  border-bottom: 1px solid var(--line);
}
.post-card-media img,
.post-card-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 500ms cubic-bezier(.2,.7,.2,1);
}
.post-card:hover .post-card-media img,
.post-card:hover .post-card-media video { transform: scale(1.04); }
.post-glyph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: color-mix(in srgb, var(--cat) 65%, transparent); }

.post-kind {
  position: absolute; top: 0.7rem; left: 0.7rem; z-index: 2;
  font-size: 0.64rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 0.24rem 0.55rem; border-radius: 999px; color: #fff;
  background: color-mix(in srgb, #07070a 52%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
}
.post-play {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 54px;
  transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 999px;
  background: color-mix(in srgb, #07070a 50%, transparent); color: #fff;
  backdrop-filter: blur(6px); padding-left: 3px; z-index: 2;
  transition: transform 220ms ease;
}
.post-card:hover .post-play { transform: translate(-50%, -50%) scale(1.08); }

.post-card-body { padding: 1rem 1.15rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.post-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.post-cat { font-size: 0.68rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cat); }
.post-card-top time { font-size: 0.74rem; font-weight: 700; color: var(--soft); white-space: nowrap; }
.post-card-body h2 { margin: 0; font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.28; letter-spacing: -0.02em; }
.post-card-body h2 a { color: inherit; }
.post-card-body h2 a:hover { color: var(--cat); }
.post-card-body > p { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.55; }

@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Talk post — one explainer video per page
   ============================================================ */
.talk-hero { max-width: 80ch; margin: 0.4rem 0 1.4rem; }
.talk-hero h1 { margin: 0.55rem 0 0; font-size: clamp(1.7rem, 4.4vw, 2.9rem); line-height: 1.16; letter-spacing: -0.02em; }
.talk-byline { margin: 0.9rem 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.talk-meta { margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.talk-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.28rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.talk-chip svg { color: var(--accent-cyan); }
.talk-stage { margin: 0; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--line); background: #07070a; box-shadow: var(--shadow); }
.talk-stage video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #07070a; cursor: pointer; }
.talk .bx-section { max-width: 84ch; }

/* ============================================================
   Lock screen — passcode gate for encrypted project pages.
   The real page is shipped as ciphertext; this styles the
   standalone gate that the build-time encryptor writes.
   ============================================================ */
.lock-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(1200px 620px at 50% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.lock-screen { width: 100%; max-width: 33rem; }
.lock-card {
  text-align: center;
  padding: clamp(1.8rem, 4vw, 2.9rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.lock-icon {
  display: inline-grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
}
.lock-card .eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.lock-card h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  letter-spacing: -0.02em;
}
.lock-desc { margin: 0 auto 1.4rem; max-width: 30rem; color: var(--muted); line-height: 1.6; }
.lock-form { display: flex; gap: 0.6rem; max-width: 22rem; margin: 0 auto; }
.lock-form input {
  flex: 1;
  min-width: 0;
  padding: 0.72rem 0.95rem;
  font: inherit;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.lock-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lock-form button {
  padding: 0.72rem 1.3rem;
  font: inherit;
  font-weight: 750;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}
.lock-form button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.lock-form button:active { transform: translateY(0); }
.lock-busy { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.86rem; }
.lock-error { margin: 0.9rem 0 0; color: #d64545; font-size: 0.88rem; font-weight: 650; }
:root[data-theme="dark"] .lock-error { color: #ff8b8b; }
.lock-note { margin: 1.5rem auto 0; max-width: 28rem; color: var(--soft); font-size: 0.8rem; line-height: 1.55; }
.lock-note a { color: var(--accent); }
.lock-back {
  display: inline-block;
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}
.lock-back:hover { color: var(--accent); }
@media (max-width: 460px) {
  .lock-form { flex-direction: column; }
  .lock-form button { width: 100%; }
}
