:root {
  /* Surfaces */
  --bg: #f7f9fc;
  --bg-2: #ffffff;
  --panel: rgba(15, 23, 42, 0.028);
  --panel-2: rgba(15, 23, 42, 0.055);
  --stroke: rgba(15, 23, 42, 0.10);
  --stroke-2: rgba(15, 23, 42, 0.18);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.94);

  /* Text */
  --ink: #0b1220;
  --ink-soft: #475569;
  --muted: #64748b;

  /* Brand accents - cool primaries + a warm rose tertiary for accent hits */
  --blue: #2563eb;
  --blue-2: #3b82f6;
  --cyan: #0891b2;
  --aqua: #14b8a6;
  --violet: #7c3aed;
  --magenta: #db2777;
  --rose: #ec4899;
  --rose-2: #f472b6;
  --orange: #f97316;
  --lime: #65a30d;
  --grad: linear-gradient(135deg, #2563eb 0%, #0891b2 35%, #7c3aed 70%, #ec4899 100%);
  --grad-warm: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #7c3aed 100%);

  /* Layout / motion */
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1320px;
  --shadow-hi: 0 30px 60px rgba(15, 23, 42, 0.10), 0 10px 24px rgba(15, 23, 42, 0.05);
  --shadow-lo: 0 8px 24px rgba(15, 23, 42, 0.07);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.64, 1);
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 220ms;
  --dur-base: 380ms;
  --dur-slow: 720ms;
  --marquee-speed: 1;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient aurora + grid backdrop, fixed to viewport */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background:
    radial-gradient(60% 45% at calc(12% + var(--aurora-x, 0px)) calc(8% + var(--aurora-y, 0px)), rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(45% 40% at calc(88% - var(--aurora-x, 0px)) calc(18% + var(--aurora-y, 0px)), rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(50% 45% at calc(92% + var(--aurora-x, 0px)) calc(78% + var(--aurora-y, 0px)), rgba(236, 72, 153, 0.10), transparent 60%),
    radial-gradient(55% 50% at calc(50% + var(--aurora-x, 0px)) calc(110% - var(--aurora-y, 0px)), rgba(139, 92, 246, 0.08), transparent 60%),
    linear-gradient(180deg, #f7f9fc, #eef3fb 40%, #fff5f8);
  transition: background-position 400ms var(--ease);
}
body::after {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 30%, black 40%, transparent 80%);
  opacity: 0.5;
}

/* Hero interactive particle canvas */
.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 900ms var(--ease);
}
.hero-shell { position: relative; }
.hero-shell.is-ready .hero-particles { opacity: 1; }
.hero-shell > .hero-copy,
.hero-shell > .hero-visual { position: relative; z-index: 1; }

/* Tilt + shine */
.tilt {
  transform-style: preserve-3d;
  transform: perspective(1100px) rotateX(var(--tiltY, 0deg)) rotateY(var(--tiltX, 0deg)) translateZ(0);
  transition: transform 300ms var(--ease);
  will-change: transform;
}
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--shineX, 50%) var(--shineY, 50%), rgba(255, 255, 255, 0.12), transparent 55%);
  opacity: 0;
  transition: opacity 300ms var(--ease);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}
.tilt.is-hot::after { opacity: 1; }

/* Magnetic buttons - damped pull toward cursor */
.magnetic {
  transition: transform 280ms var(--ease), box-shadow 200ms var(--ease);
  will-change: transform;
}

/* Cursor glow follower */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 55%);
  filter: blur(30px);
  opacity: 0;
  transition: opacity 300ms ease;
  transform: translate3d(var(--cx, 50vw), var(--cy, 50vh), 0);
  will-change: transform;
}
body.is-ready .cursor-glow { opacity: 1; }

/* Top scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  background: var(--grad);
  z-index: 50;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.55);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.site-header,
.hero-shell,
.about-section,
.research-section,
.papers-section,
.lab-section,
.process-section,
.portfolio-section,
.tools-section,
.evidence-section,
.stack-section,
.contact-section,
.site-footer {
  margin-inline: auto;
  max-width: var(--max);
  padding-inline: 32px;
  position: relative;
}

/* ================= HEADER ================= */
.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  position: sticky;
  top: 12px;
  z-index: 40;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 6px 16px;
  border-radius: 18px;
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--stroke);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  z-index: -1;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  transition: transform 220ms var(--ease);
}
.brand:hover { transform: translateY(-1px); }
.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.04);
  box-shadow: 0 14px 34px rgba(96, 165, 250, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  white-space: nowrap;
}
.brand-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.site-nav {
  align-items: center;
  display: flex;
  gap: 2px;
  padding: 4px;
  flex-shrink: 1;
  min-width: 0;
}
.site-nav a {
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 7px 11px;
  white-space: nowrap;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}
.site-nav a:hover { color: var(--ink); background: var(--panel-2); }

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}
.header-cta:hover {
  transform: translateY(-1px);
  background: #1e293b;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}
.header-cta .arrow { transition: transform 180ms var(--ease); flex-shrink: 0; }
.header-cta:hover .arrow { transform: translate(2px, -2px); }

/* Hide brand subtitle when space is tight */
@media (max-width: 1280px) {
  .brand-sub { display: none; }
}
/* Tighten nav further on medium screens */
@media (max-width: 1180px) {
  .site-nav a { padding: 7px 9px; font-size: 0.8rem; }
}

.nav-toggle {
  display: none;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
  cursor: pointer;
}

/* ================= HERO ================= */
.hero-shell {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  padding-block: 44px 80px;
  align-items: center;
}

.hero-copy {
  padding: 8px 8px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 10px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  width: fit-content;
  margin-bottom: 26px;
  backdrop-filter: blur(10px);
}
.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.6);
  animation: pulse 1.8s ease-in-out infinite;
}

.eyebrow,
.kicker {
  color: var(--blue-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.hero-copy h1 {
  color: var(--ink);
  font-size: clamp(2.1rem, 4.4vw, 3.8rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 22px;
  font-weight: 700;
  max-width: 18ch;
}
.hero-copy h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}
.hero-copy h1 .rotator {
  display: inline-block;
  min-width: 8ch;
  position: relative;
  vertical-align: baseline;
}
.hero-copy h1 .rotator span {
  display: inline-block;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: fadeSlide 420ms var(--ease) both;
}

.hero-lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 560px;
  margin: 0 0 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 600;
  font-size: 0.92rem;
  gap: 10px;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease), border-color 200ms var(--ease);
  position: relative;
  overflow: hidden;
}
.button.primary {
  background: var(--ink);
  color: var(--bg);
}
.button.primary:hover {
  transform: translateY(-2px);
  background: #1e293b;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}
.button.secondary {
  background: var(--panel);
  border-color: var(--stroke-2);
  color: var(--ink);
  backdrop-filter: blur(10px);
}
.button.secondary:hover {
  background: var(--panel-2);
  border-color: rgba(96, 165, 250, 0.5);
  transform: translateY(-2px);
}
.button .arrow { transition: transform 220ms var(--ease); }
.button:hover .arrow { transform: translate(3px, -3px); }

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.hero-proof span {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  backdrop-filter: blur(10px);
}

/* Hero visual: bento of portrait + live signal */
.hero-visual {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
}

.bento {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  position: relative;
  overflow: hidden;
  transition: transform 400ms var(--ease), border-color 400ms var(--ease);
}
.bento::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.35), transparent 40%, transparent 60%, rgba(139, 92, 246, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 500ms var(--ease);
  pointer-events: none;
}
.bento:hover::before { opacity: 1; }

.bento-portrait {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 340px;
  aspect-ratio: 4 / 5;
}
.bento-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.92) contrast(1.02);
}
.bento-portrait .portrait-info {
  position: absolute;
  inset: auto 0 0 0;
  padding: 60px 20px 18px;
  background: linear-gradient(180deg, transparent, rgba(11, 18, 32, 0.88));
}
.bento-portrait .portrait-info strong {
  display: block;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.bento-portrait .portrait-info span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 500;
}

.bento-signal {
  grid-column: 2;
  grid-row: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
}
.signal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.signal-header .live {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--lime);
}
.signal-header .live .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  animation: pulse 1.4s ease-in-out infinite;
}

.map-stage {
  flex: 1;
  border-radius: 12px;
  background: radial-gradient(100% 80% at 50% 0%, rgba(59, 130, 246, 0.10), transparent 70%), rgba(15, 23, 42, 0.03);
  border: 1px solid var(--stroke);
  overflow: hidden;
  position: relative;
}
.map-stage svg { display: block; width: 100%; height: 100%; }
.grid-path { fill: none; stroke: rgba(15, 23, 42, 0.08); stroke-width: 1; }
.route {
  fill: none;
  filter: url("#softGlow");
  stroke: url("#routeBlue");
  stroke-dasharray: 10 8;
  stroke-linecap: round;
  stroke-width: 3;
}
.route-one { animation: routeDash 9s linear infinite; }
.route-two { animation: routeDash 12s linear reverse infinite; opacity: 0.65; }
.pin circle {
  fill: var(--blue-2);
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.6));
}
.pin.active circle { fill: var(--cyan); filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.9)); }
.pin text {
  fill: var(--ink-soft);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.bento-stats {
  grid-column: 2;
  grid-row: 2;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 8px;
}
.bento-stats article { text-align: left; }
.bento-stats strong {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.bento-stats span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

.bento-tags {
  grid-column: 1 / -1;
  grid-row: 3;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.bento-tags .label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-right: 6px;
}
.bento-tags .chip {
  padding: 6px 11px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}
.bento-tags .chip.gis {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(34, 211, 238, 0.10));
  border-color: rgba(37, 99, 235, 0.35);
  color: #1e40af;
}
.bento-tags .chip.gis:hover {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.28), rgba(34, 211, 238, 0.20));
  border-color: rgba(37, 99, 235, 0.55);
  color: #1d4ed8;
  transform: translateY(-1px);
}
.bento-tags .chip.oss,
.about-badges .chip.oss {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(34, 211, 238, 0.10));
  border-color: rgba(124, 58, 237, 0.35);
  color: #6d28d9;
  position: relative;
  padding-left: 22px;
}
.bento-tags .chip.oss::before,
.about-badges .chip.oss::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.7);
  transform: translateY(-50%);
}

/* ================= SECTIONS ================= */
.lab-section,
.portfolio-section,
.evidence-section,
.stack-section,
.contact-section {
  padding-block: 80px;
  scroll-margin-top: 100px;
}

.section-heading {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.5fr);
  margin-bottom: 40px;
  align-items: end;
}
.section-heading h2 {
  color: var(--ink);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
  font-weight: 700;
  max-width: 24ch;
}
.chapter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  margin: 0 0 14px;
  text-transform: uppercase;
  color: var(--blue-2);
}
.chapter .chapter-num {
  color: var(--muted);
  padding: 3px 8px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  letter-spacing: 0.1em;
}
.section-heading h2 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.section-heading p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  max-width: 440px;
}

/* ================= PROTOTYPE LAB ================= */
.prototype-lab {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-hi);
}

.lab-screen {
  background: linear-gradient(135deg, #ffffff, #e6edf8);
  min-height: 520px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--stroke);
}
.screen-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(180deg, #ffffff, #f3f6fc);
}
.screen-topbar .left {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}
.screen-topbar .left .traffic {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.screen-topbar .left .traffic span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--stroke-2);
  display: block;
}
.screen-topbar .left .traffic span:nth-child(1) { background: #ff5f57; }
.screen-topbar .left .traffic span:nth-child(2) { background: #febc2e; }
.screen-topbar .left .traffic span:nth-child(3) { background: #28c840; }
.screen-topbar #active-category {
  font-size: 0.78rem;
  color: var(--ink);
  font-weight: 600;
  margin-left: 10px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-topbar #active-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--blue);
  padding: 4px 10px;
  border: 1px solid rgba(37, 99, 235, 0.30);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lab-screen img {
  width: 100%;
  height: calc(100% - 49px);
  object-fit: cover;
  transition: opacity 300ms var(--ease), transform 500ms var(--ease);
}
.lab-screen.is-swapping img { opacity: 0; transform: scale(1.02); }

.lab-copy {
  display: grid;
  align-content: center;
  gap: 20px;
  padding: 38px;
}
.lab-copy h3 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
  font-weight: 700;
}
.lab-copy #active-description {
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0;
}

.active-meta {
  display: grid;
  gap: 14px;
  margin: 6px 0 0;
}
.active-meta div {
  border-left: 2px solid var(--blue-2);
  padding-left: 14px;
}
.active-meta dt {
  color: var(--blue-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.active-meta dd {
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.active-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.active-stack span {
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 12px;
}

.lab-tabs {
  grid-column: 1 / -1;
  border-top: 1px solid var(--stroke);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.025);
}
.prototype-tab {
  align-items: center;
  background: transparent;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 38px;
  padding: 0 14px;
  transition: all 180ms var(--ease);
}
.prototype-tab:hover {
  background: var(--panel-2);
  color: var(--ink);
  border-color: var(--stroke-2);
}
.prototype-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ================= PORTFOLIO ================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filter-chip {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 40px;
  padding: 0 16px;
  transition: all 180ms var(--ease);
  backdrop-filter: blur(10px);
}
.filter-chip:hover { color: var(--ink); border-color: var(--stroke-2); }
.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

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

.project-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 400ms var(--ease), border-color 300ms var(--ease), box-shadow 400ms var(--ease);
  backdrop-filter: blur(14px);
  position: relative;
  display: flex;
  flex-direction: column;
}
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(96, 165, 250, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 300ms var(--ease);
  pointer-events: none;
}
.project-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.10), 0 0 0 1px rgba(37, 99, 235, 0.10) inset;
  transform: translateY(-4px);
}
.project-card:hover::after { opacity: 1; }
.project-card.featured {
  grid-column: span 2;
  flex-direction: row;
}
.project-card.featured > .card-media { flex: 1.1; }
.project-card.featured > .card-body { flex: 0.95; min-width: 320px; }
.project-card.is-hidden { display: none; }

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.project-card.featured .card-media { aspect-ratio: auto; }
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease), filter 400ms var(--ease);
  filter: saturate(0.9) contrast(1.02);
}
.project-card:hover .card-media img {
  transform: scale(1.05);
  filter: saturate(1.05);
}
.card-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(255, 255, 255, 0.55));
  z-index: 1;
  pointer-events: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 24px;
}
.card-body .tag {
  align-self: flex-start;
  color: var(--blue-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 999px;
}
.card-body h3 {
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.card-body p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}
.card-cta {
  margin-top: auto;
  padding-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.75;
  transition: opacity 200ms var(--ease), gap 200ms var(--ease);
}
.project-card:hover .card-cta { opacity: 1; gap: 12px; }

/* ================= EVIDENCE ================= */
.track-board {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.track-board article {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(10px);
  position: relative;
  transition: transform 300ms var(--ease), border-color 300ms var(--ease);
  overflow: hidden;
}
.track-board article::before {
  content: attr(data-idx);
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.track-board article:hover {
  transform: translateY(-3px);
  border-color: rgba(96, 165, 250, 0.3);
}
.track-board strong {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding-right: 40px;
}
.track-board span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ================= STACK ================= */
.stack-panel {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 44px;
  backdrop-filter: blur(14px);
  align-items: center;
}
.stack-intro h2 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0;
  font-weight: 700;
}
.stack-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stack-grid article {
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 300ms var(--ease), border-color 300ms var(--ease);
}
.stack-grid article:hover {
  transform: translateY(-3px);
  border-color: rgba(96, 165, 250, 0.35);
}
.stack-grid .icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: var(--blue-2);
}
.stack-grid strong {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.stack-grid span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ================= CONTACT ================= */
.contact-panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 48px;
  backdrop-filter: blur(18px);
  text-align: left;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 40px;
}
@media (max-width: 900px) {
  .contact-panel { grid-template-columns: 1fr; padding: 32px 24px; gap: 28px; }
}
.contact-panel .chapter { justify-content: flex-start !important; margin-bottom: 14px; }
.contact-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.45), transparent 40%, transparent 60%, rgba(236, 72, 153, 0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.contact-panel .eyebrow { margin: 0 auto 16px; }
.contact-panel h2 {
  margin: 0 0 16px;
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 700;
}
.contact-panel h2 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.contact-intro > p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 540px;
}

/* ---- Contact meta cards ---- */
.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}
.cm-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 10px;
}
.cm-item > svg { color: var(--blue-2); flex-shrink: 0; margin-top: 2px; }
.cm-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-item strong { color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.cm-item span { color: var(--muted); font-size: 0.78rem; }
.cm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  margin-top: 7px;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
  animation: pulse 1.8s ease-out infinite;
}

/* ---- Contact actions (buttons) ---- */
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.contact-actions .button { gap: 8px; }
.contact-actions .button svg { flex-shrink: 0; }

/* ---- Contact links row (LinkedIn / GitHub / Scholar / ORCID) ---- */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke);
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}
.contact-links a:hover {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.45);
  color: var(--ink);
}
.contact-links a svg { opacity: 0.85; }

/* ---- Compact contact form ---- */
.contact-form {
  padding: 18px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), var(--panel-2) 64%);
  border: 1px solid rgba(96, 165, 250, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  scroll-margin-top: 104px;
}
.contact-form header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-2);
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-form label span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  padding: 10px 11px;
  outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}
.contact-form textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}
.contact-form input:focus,
.contact-form textarea:focus {
  background: var(--surface-strong);
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.contact-submit {
  width: 100%;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
  cursor: pointer;
}
.contact-submit[disabled] {
  cursor: wait;
  opacity: 0.72;
}
.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-form-status {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.contact-form-status.is-success {
  color: #047857;
}
.contact-form-status.is-error {
  color: #be185d;
}

/* ---- Best-fit card ---- */
.contact-fit {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.fit-card {
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
}
.fit-card header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding: 4px 10px 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
}
.fit-best header {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(5, 150, 105, 0.35);
  color: #047857;
}
.fit-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fit-card li {
  position: relative;
  padding-left: 20px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.fit-best li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #047857;
  font-weight: 700;
}

/* ================= FOOTER ================= */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 32px 48px;
  border-top: 1px solid var(--stroke);
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-links { display: flex; gap: 18px; }
.footer-links a {
  transition: color 180ms var(--ease);
}
.footer-links a:hover { color: var(--ink); }

/* ================= REVEAL ANIMATIONS ================= */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
body.reveal-motion .reveal {
  opacity: 0;
  transform: translateY(26px);
}
body.reveal-motion .reveal.is-in,
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.reveal.delay-1 { transition-delay: 80ms; }
.reveal.delay-2 { transition-delay: 160ms; }
.reveal.delay-3 { transition-delay: 240ms; }
.reveal.delay-4 { transition-delay: 320ms; }

/* ================= KEYFRAMES ================= */
@keyframes routeDash {
  to { stroke-dashoffset: -220; }
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(163, 230, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ================= ABOUT ================= */
.about-section {
  padding-block: 80px;
  scroll-margin-top: 100px;
}
.about-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  align-items: stretch;
}
.about-bio {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about-bio::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(96,165,250,0.15), transparent 70%);
  pointer-events: none;
}
.bio-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.bio-body p {
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0;
  font-size: 0.94rem;
}
.bio-body strong, .bio-body em {
  color: var(--ink);
}
.bio-body em { font-style: italic; }
.bio-quickfacts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke);
}
.bio-quickfacts div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bio-quickfacts strong {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bio-quickfacts span {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.about-edu {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(14px);
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--blue-2), transparent);
  opacity: 0.5;
}
.timeline li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding-left: 22px;
  position: relative;
}
.tl-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.18);
}
.tl-year {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--blue-2);
  letter-spacing: 0.08em;
  font-weight: 600;
}
.timeline strong {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tl-meta {
  color: var(--ink-soft);
  font-size: 0.86rem;
}
.tl-grade {
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  margin-top: 2px;
}
.tl-note {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}
.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.about-badges .chip {
  padding: 6px 11px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-soft);
}
.about-badges .chip.expert {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
  color: var(--blue-2);
}

/* ================= RESEARCH ================= */
.research-section {
  padding-block: 80px;
  scroll-margin-top: 100px;
}
.research-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.research-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(14px);
  position: relative;
  transition: transform 300ms var(--ease), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.research-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
}
.research-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), var(--panel) 60%);
  border-color: rgba(96,165,250,0.3);
}
.research-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.research-year {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.research-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  color: var(--ink-soft);
}
.research-badge.funded {
  background: rgba(163, 230, 53, 0.12);
  border-color: rgba(163, 230, 53, 0.35);
  color: var(--lime);
}
.research-badge.sponsored {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--cyan);
}
.research-badge.internship {
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(124, 58, 237, 0.35);
  color: #6d28d9;
}
.research-badge.fellowship {
  background: rgba(236, 72, 153, 0.10);
  border-color: rgba(219, 39, 119, 0.35);
  color: #be185d;
}
.research-card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}
.research-card p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}
.research-card strong { color: var(--ink); }
.research-meta {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}
.research-meta .dot-sep { color: var(--stroke-2); }
.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
}
.research-tags span {
  font-size: 0.7rem;
  padding: 4px 9px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ================= PAPERS ================= */
.papers-section {
  padding-block: 80px;
  scroll-margin-top: 100px;
}
.scholar-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.08));
  border: 1px solid rgba(96,165,250,0.25);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
}
.scholar-strip article {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 16px;
  border-right: 1px solid var(--stroke);
}
.scholar-strip article:nth-child(4) { border-right: none; }
.scholar-strip strong {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.scholar-strip span {
  font-size: 0.76rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scholar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.scholar-link:hover {
  transform: translateY(-2px);
  background: #1e293b;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.20);
}
.scholar-link .arrow { transition: transform 220ms var(--ease); }
.scholar-link:hover .arrow { transform: translate(3px, -3px); }

.paper-cites {
  color: var(--lime);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.papers-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.paper {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px 26px 24px 22px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  backdrop-filter: blur(14px);
  align-items: start;
  transition: transform 300ms var(--ease), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
  position: relative;
}
.paper:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
}
.paper-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  padding-top: 2px;
}
.paper-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.paper-venue {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--blue-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
  font-weight: 600;
}
.paper-body h3 {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.paper-title-link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: color 200ms var(--ease), background-size 220ms var(--ease);
}
.paper-title-link:hover {
  color: var(--blue-2);
  background-size: 100% 1px;
}
.paper-authors {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin: 0;
}
.paper-authors strong {
  color: var(--ink);
  font-weight: 700;
}
.paper-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.paper-chips .chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  padding: 5px 10px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.paper-chips a.chip {
  text-decoration: none;
}
.paper-chips .paper-link-chip {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--blue-2);
}
.paper-chips .paper-link-chip:hover {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.42);
  color: var(--blue);
}
.paper-chips .chip.pub-published {
  background: rgba(163, 230, 53, 0.12);
  border-color: rgba(163, 230, 53, 0.35);
  color: var(--lime);
}
.paper-chips .chip.pub-review {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(202, 138, 4, 0.35);
  color: #ca8a04;
}
.paper-chips .chip.pub-accepted {
  background: rgba(34, 211, 238, 0.10);
  border-color: rgba(8, 145, 178, 0.35);
  color: var(--cyan);
}
.paper-chips .chip.pub-submitted {
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(124, 58, 237, 0.35);
  color: #6d28d9;
}

/* ================= RESPONSIVE ================= */
/* Large laptop / small desktop */
@media (max-width: 1280px) {
  .research-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-card.featured { grid-column: span 2; }
}

/* Tablet landscape */
@media (max-width: 1180px) {
  .site-header { padding-inline: 24px; }
  .brand-sub { display: none; }
  .hero-shell {
    grid-template-columns: 1fr;
    padding-block: 32px 60px;
  }
  .hero-visual { grid-template-columns: 1fr 1fr; }
  .prototype-lab,
  .project-card.featured,
  .stack-panel,
  .section-heading,
  .about-grid,
  .about-bio {
    grid-template-columns: 1fr;
  }
  .about-bio { grid-template-rows: 220px 1fr; }
  .bio-portrait img { object-position: center 20%; }
  .bio-quickfacts { grid-template-columns: repeat(4, 1fr); }
  .project-card.featured { flex-direction: column; }
  .project-grid,
  .track-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lab-screen { border-right: none; border-bottom: 1px solid var(--stroke); }
  .lab-screen { min-height: 420px; }
  .section-heading { margin-bottom: 28px; }
  .section-heading h2 { font-size: clamp(2rem, 5vw, 3rem); }
}

/* Scholar strip responsive */
@media (max-width: 900px) {
  .scholar-strip {
    grid-template-columns: repeat(2, 1fr);
    padding: 18px;
  }
  .scholar-strip article { border-right: none; padding-right: 0; }
  .scholar-link { grid-column: 1 / -1; justify-content: center; }
  .scholar-strip strong { font-size: 1.5rem; }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .site-header,
  .hero-shell,
  .lab-section,
  .portfolio-section,
  .tools-section,
  .evidence-section,
  .stack-section,
  .contact-section,
  .about-section,
  .research-section,
  .papers-section,
  .site-footer {
    padding-inline: 22px;
  }
  .header-cta { padding: 8px 12px; font-size: 0.8rem; }
  .site-nav a { padding: 8px 11px; font-size: 0.82rem; }
  .research-grid { grid-template-columns: 1fr; }
  .research-card.featured { grid-column: auto; }
  .bio-quickfacts { grid-template-columns: repeat(2, 1fr); }
  .paper { padding: 20px 20px 20px 18px; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
  .paper-num { font-size: 1.35rem; }
  .paper-body h3 { font-size: 1rem; }
  .lab-section, .portfolio-section, .evidence-section,
  .stack-section, .contact-section, .about-section,
  .research-section, .papers-section {
    padding-block: 60px;
  }
}

/* Mobile */
@media (max-width: 780px) {
  .site-header,
  .hero-shell,
  .lab-section,
  .portfolio-section,
  .tools-section,
  .evidence-section,
  .stack-section,
  .contact-section,
  .about-section,
  .research-section,
  .papers-section,
  .site-footer {
    padding-inline: 18px;
  }
  html { scroll-padding-top: 78px; }
  .site-header { top: 8px; padding-block: 12px; }
  .site-header::before { inset: 6px 12px; }
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex;
    position: absolute;
    top: 62px;
    right: 16px;
    left: 16px;
    background: var(--surface-strong);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 10px;
    flex-direction: column;
    gap: 2px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-hi);
  }
  .site-nav.is-open a { padding: 12px 14px; font-size: 0.95rem; }
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .brand-name { font-size: 0.9rem; }
  .brand-mark { width: 36px; height: 36px; }

  .hero-shell { padding-block: 28px 48px; gap: 24px; }
  .hero-visual { grid-template-columns: 1fr; gap: 12px; }
  .bento-portrait { grid-column: 1; grid-row: 1; aspect-ratio: 5 / 4; min-height: 260px; }
  .bento-signal { grid-column: 1; grid-row: 2; min-height: 220px; }
  .bento-stats { grid-column: 1; grid-row: 3; }
  .bento-tags { grid-row: 4; }
  .hero-copy h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .hero-copy { padding: 0; }
  .hero-actions .button { flex: 1; min-width: 140px; }

  .section-heading { margin-bottom: 22px; gap: 12px; }
  .section-heading h2 { font-size: clamp(1.6rem, 7vw, 2.4rem); }

  .about-bio { grid-template-rows: 200px 1fr; }
  .bio-body { padding: 22px; gap: 12px; }
  .bio-body h3 { font-size: 1.2rem; }
  .bio-quickfacts { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .about-edu { padding: 24px; }

  .research-card { padding: 20px; }
  .research-card h3 { font-size: 1rem; }
  .research-head { gap: 6px; }

  .paper { padding: 18px; grid-template-columns: 38px 1fr; gap: 12px; }
  .paper-num { font-size: 1.2rem; }

  .lab-screen { min-height: 320px; }
  .lab-copy { padding: 22px; gap: 14px; }
  .lab-copy h3 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .lab-tabs { padding: 12px; gap: 6px; }
  .prototype-tab { font-size: 0.76rem; padding: 0 11px; min-height: 34px; }
  .screen-topbar #active-category { display: none; }

  .project-grid,
  .track-board,
  .stack-grid {
    grid-template-columns: 1fr;
  }
  .stack-panel, .contact-panel { padding: 28px 24px; }
  .contact-panel h2 { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .contact-intro > p { max-width: none; }
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .contact-actions .button {
    width: 100%;
    justify-content: center;
    min-width: 0;
  }
  .contact-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contact-links a {
    justify-content: center;
    min-width: 0;
  }
  .site-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .hero-particles { opacity: 0 !important; }
}

/* Very small phones */
@media (max-width: 420px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .filter-bar { gap: 6px; }
  .filter-chip { font-size: 0.78rem; padding: 0 12px; min-height: 36px; }
  .bio-quickfacts { grid-template-columns: 1fr 1fr; }
  .contact-section { padding-inline: 12px; }
  .contact-panel { padding: 22px 16px; }
  .contact-form,
  .fit-card {
    padding: 16px;
  }
  .contact-links { grid-template-columns: 1fr; }
  .contact-form input,
  .contact-form textarea {
    font-size: 16px;
  }
  .contact-actions .button,
  .contact-submit {
    padding-inline: 14px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ================= FILM GRAIN OVERLAY ================= */
.grain-overlay {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
  animation: grainShift 1.4s steps(6) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-6%, 3%); }
  40% { transform: translate(4%, -4%); }
  60% { transform: translate(-3%, 5%); }
  80% { transform: translate(5%, -2%); }
  100% { transform: translate(0, 0); }
}

/* ================= STATE-AWARE CURSOR RING ================= */
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1.5px solid rgba(96, 165, 250, 0.75);
  border-radius: 50%;
  pointer-events: none;
  z-index: 70;
  transform: translate3d(var(--cx, 50vw), var(--cy, 50vh), 0) scale(1);
  transition: transform 120ms var(--ease), width 220ms var(--ease), height 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease), border-radius 220ms var(--ease);
  display: none;
  backdrop-filter: invert(0.12);
  -webkit-backdrop-filter: invert(0.12);
}
.cursor-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 200ms var(--ease);
  white-space: nowrap;
  padding: 0 10px;
  border-radius: 999px;
}
body.is-ready.has-fine-pointer .cursor-ring { display: block; }
body.cursor-interactive .cursor-ring {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.55);
}
body.cursor-magnet .cursor-ring {
  width: 72px;
  height: 36px;
  margin: -18px 0 0 -36px;
  border-radius: 999px;
  background: var(--surface-strong);
  border-color: rgba(37, 99, 235, 0.65);
  backdrop-filter: blur(4px);
}
body.cursor-magnet .cursor-ring-label { opacity: 1; }

/* ================= STATUS BAR (top-right live pill) ================= */
.status-bar {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 6px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  z-index: 35;
  letter-spacing: 0.04em;
  opacity: 0;
  animation: sbIn 700ms var(--ease) 500ms forwards;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
}
@keyframes sbIn { to { opacity: 1; transform: translate(-50%, 0); } }
.status-bar .sb-item { display: inline-flex; align-items: center; gap: 7px; }
.status-bar .sb-live { color: var(--ink); }
.status-bar .sb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(163, 230, 53, 0.8);
  animation: pulse 1.6s ease-in-out infinite;
}
.status-bar .sb-sep { color: var(--muted); opacity: 0.45; }
.status-bar .sb-hint { color: var(--muted); }
.status-bar kbd {
  font-family: inherit;
  font-size: 0.66rem;
  padding: 2px 6px;
  margin: 0 1px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 5px;
  color: var(--ink);
}

/* ================= SECTION RAIL (right-side dot nav) ================= */
.section-rail {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  opacity: 0;
  transform: translate(14px, -50%);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.section-rail.is-ready {
  opacity: 1;
  transform: translate(0, -50%);
}
.section-rail a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: 22px;
  padding: 0 6px;
  color: var(--muted);
  transition: color 200ms var(--ease);
}
.section-rail .rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stroke-2);
  transition: background 220ms var(--ease), transform 220ms var(--ease), box-shadow 220ms var(--ease);
  flex-shrink: 0;
}
.section-rail .rail-text {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translate(8px, -50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 240ms var(--ease);
  white-space: nowrap;
}
.section-rail a:hover .rail-text {
  opacity: 1;
  transform: translate(0, -50%);
}
.section-rail a:hover .rail-dot {
  background: var(--ink-soft);
  transform: scale(1.3);
}
.section-rail a.is-active .rail-dot {
  background: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18), 0 0 12px rgba(96, 165, 250, 0.8);
  transform: scale(1.2);
}

/* ================= LANGUAGE DROPDOWN ================= */
.lang-dropdown {
  position: relative;
  margin-left: 4px;
}
.lang-dropdown summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  user-select: none;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.lang-dropdown summary::-webkit-details-marker { display: none; }
.lang-dropdown summary::marker { display: none; content: ""; }
.lang-dropdown summary:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.35);
  color: var(--ink);
}
.lang-dropdown summary svg { opacity: 0.75; flex-shrink: 0; }
.lang-dropdown summary .caret { transition: transform 200ms var(--ease); }
.lang-dropdown[open] summary .caret { transform: rotate(180deg); }
.lang-dropdown[open] summary {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.45);
  color: var(--ink);
}
.lang-current { font-variant-numeric: tabular-nums; }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  padding: 6px;
  background: var(--surface-strong);
  border: 1px solid rgba(37, 99, 235, 0.20);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(37, 99, 235, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: langMenuIn 160ms var(--ease);
}
@keyframes langMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.lang-menu .lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  text-align: left;
  width: 100%;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.lang-menu .lang-btn:hover {
  background: rgba(96, 165, 250, 0.1);
  color: var(--ink);
}
.lang-menu .lang-btn.is-active {
  background: rgba(96, 165, 250, 0.16);
  color: var(--ink);
}
.lang-menu .lang-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  min-width: 32px;
  text-align: center;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 5px;
  color: var(--muted);
}
.lang-menu .lang-btn.is-active .lang-code {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.45);
  color: var(--ink);
}
.lang-menu .lang-name {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
}
.lang-menu .lang-btn[data-lang="ur"] .lang-name { font-family: "Noto Nastaliq Urdu", "Manrope", sans-serif; }
.lang-menu .lang-btn[data-lang="zh"] .lang-name { font-family: "Noto Sans SC", "Manrope", sans-serif; }

@media (max-width: 900px) {
  .lang-dropdown { margin-left: auto; margin-right: 8px; }
  .lang-dropdown summary { padding: 5px 8px; font-size: 0.66rem; }
  .lang-menu { right: 0; min-width: 170px; }
}

/* RTL adjustments for the whole site when Urdu is active */
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .site-nav { flex-direction: row-reverse; }
html[dir="rtl"] .filter-bar { flex-direction: row-reverse; justify-content: flex-start; }
html[dir="rtl"] .bento-tags { flex-direction: row-reverse; justify-content: flex-end; }
html[dir="rtl"] .about-badges { flex-direction: row-reverse; justify-content: flex-end; }
html[dir="rtl"] .hero-actions { flex-direction: row-reverse; justify-content: flex-start; }
html[dir="rtl"] .scroll-explore { flex-direction: row-reverse; }
html[lang="ur"] body {
  font-feature-settings: "kern";
}
html[lang="ur"] .hero-lede,
html[lang="ur"] .bio-body p,
html[lang="ur"] .section-heading p,
html[lang="ur"] .process-node p,
html[lang="ur"] .pn-sub li {
  font-family: "Noto Nastaliq Urdu", "Manrope", sans-serif;
  line-height: 1.95;
}
html[lang="zh"] .hero-lede,
html[lang="zh"] .bio-body p,
html[lang="zh"] .section-heading p,
html[lang="zh"] .process-node p {
  font-family: "Noto Sans SC", "Manrope", sans-serif;
  letter-spacing: 0.02em;
  line-height: 1.75;
}

/* ================= COMMAND PALETTE ================= */
.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 11px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 200ms var(--ease), color 200ms var(--ease), background 200ms var(--ease);
  backdrop-filter: blur(10px);
}
.cmdk-trigger:hover {
  border-color: rgba(96, 165, 250, 0.5);
  color: var(--ink);
  background: var(--panel-2);
}
.cmdk-trigger svg { opacity: 0.7; flex-shrink: 0; }
.cmdk-trigger kbd {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  padding: 2px 6px;
  background: var(--panel-2);
  border: 1px solid var(--stroke-2);
  border-radius: 4px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.04em;
}
/* Collapse the cmdk trigger to icon-only on narrower screens */
@media (max-width: 1180px) {
  .cmdk-trigger > span { display: none; }
  .cmdk-trigger { padding: 7px 9px; gap: 6px; }
}

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}
.cmdk.is-open { display: block; }
.cmdk-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 180ms var(--ease);
}
.cmdk-panel {
  position: absolute;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  background: var(--surface-strong);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 18px;
  box-shadow: 0 40px 100px rgba(15, 23, 42, 0.20), 0 0 0 1px rgba(37, 99, 235, 0.05);
  overflow: hidden;
  animation: cmdkIn 260ms var(--ease);
}
@keyframes cmdkIn {
  from { opacity: 0; transform: translate(-50%, -8px) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cmdk-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--stroke);
}
.cmdk-search svg { color: var(--blue-2); flex-shrink: 0; }
.cmdk-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  font-weight: 500;
}
.cmdk-search input::placeholder { color: var(--muted); }
.cmdk-esc {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  padding: 3px 8px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 5px;
  color: var(--muted);
  font-weight: 700;
}
.cmdk-list {
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding: 8px;
}
.cmdk-group-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  padding: 10px 12px 6px;
}
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.cmdk-item-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  color: var(--blue-2);
  flex-shrink: 0;
}
.cmdk-item-body { flex: 1; min-width: 0; }
.cmdk-item-body strong { display: block; color: var(--ink); font-weight: 600; }
.cmdk-item-body span {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmdk-item-shortcut {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 3px 8px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 5px;
}
.cmdk-item.is-active {
  background: rgba(96, 165, 250, 0.1);
  color: var(--ink);
}
.cmdk-item.is-active .cmdk-item-icon {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.4);
}
.cmdk-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.cmdk-footer {
  display: flex;
  gap: 20px;
  padding: 12px 18px;
  border-top: 1px solid var(--stroke);
  background: rgba(15, 23, 42, 0.025);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
}
.cmdk-footer kbd {
  font-family: inherit;
  font-size: 0.62rem;
  padding: 2px 6px;
  margin-right: 5px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  color: var(--ink-soft);
  font-weight: 700;
}

/* ================= CASE-STUDY LIGHTBOX ================= */
.case-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
}
.case-modal.is-open { display: block; }
.case-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fadeIn 200ms var(--ease);
}
.case-panel {
  position: absolute;
  inset: 4vh 4vw;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "header header"
    "stage  meta"
    "thumbs thumbs"
    "footer footer";
  gap: 14px 18px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 20px;
  box-shadow: 0 50px 120px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(37, 99, 235, 0.05);
  overflow: hidden;
  animation: caseIn 280ms var(--ease);
}
@keyframes caseIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.case-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--stroke);
}
.case-header-text { min-width: 0; }
.case-kicker {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-2);
  margin-bottom: 4px;
}
.case-header h3 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.case-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.case-lang {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
}
.case-lang-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  min-width: 30px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.case-lang-btn:hover { color: var(--ink-soft); }
.case-lang-btn.is-active {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45) inset;
}
.case-lang-btn[data-lang="ur"] { font-family: "Manrope", sans-serif; font-size: 0.78rem; }
.case-lang-btn[data-lang="zh"] { font-family: "Manrope", sans-serif; font-size: 0.82rem; }
.case-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 6px 12px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-weight: 600;
}
.case-counter-sep { color: var(--muted); margin: 0 2px; }
.case-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}
.case-close:hover {
  background: rgba(96, 165, 250, 0.12);
  color: var(--ink);
  border-color: rgba(96, 165, 250, 0.4);
}

.case-stage {
  grid-area: stage;
  position: relative;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 0;
}
.case-figure {
  margin: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
#case-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #f1f5fc;
  transition: opacity 240ms var(--ease);
}
#case-image.is-swapping { opacity: 0; }
#case-caption {
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid var(--stroke);
  text-align: center;
}
.case-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--stroke-2);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}
.case-nav:hover {
  background: rgba(96, 165, 250, 0.22);
  border-color: rgba(96, 165, 250, 0.55);
  transform: translateY(-50%) scale(1.06);
}
.case-prev { left: 12px; }
.case-next { right: 12px; }

.case-meta {
  grid-area: meta;
  overflow-y: auto;
  padding: 4px 6px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.case-meta h4 {
  margin: 0 0 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.case-meta p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}
.case-shipped ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.case-shipped li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}
.case-shipped li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
}
.case-stack #case-stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.case-stack-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.case-thumbs {
  grid-area: thumbs;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.4) transparent;
}
.case-thumbs::-webkit-scrollbar { height: 6px; }
.case-thumbs::-webkit-scrollbar-thumb { background: rgba(96, 165, 250, 0.35); border-radius: 4px; }
.case-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 56px;
  padding: 0;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.case-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.case-thumb:hover { opacity: 0.85; transform: translateY(-1px); }
.case-thumb.is-active {
  opacity: 1;
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.4), 0 6px 18px rgba(96, 165, 250, 0.18);
}

.case-footer {
  grid-area: footer;
  display: flex;
  gap: 18px;
  padding-top: 6px;
  border-top: 1px solid var(--stroke);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  color: var(--muted);
}
.case-footer kbd {
  font-family: inherit;
  font-size: 0.6rem;
  padding: 2px 6px;
  margin-right: 4px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  color: var(--ink-soft);
  font-weight: 700;
}

@media (max-width: 900px) {
  .case-panel {
    inset: 2vh 2vw;
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "stage"
      "meta"
      "thumbs"
      "footer";
    grid-template-rows: auto minmax(40vh, 1fr) auto auto auto;
    padding: 14px;
    gap: 10px;
  }
  .case-meta {
    max-height: 28vh;
    padding-right: 4px;
  }
  .case-header h3 { font-size: 1.02rem; }
  .case-thumb { width: 64px; height: 44px; }
  .case-nav { width: 38px; height: 38px; }
  .case-lang-btn { padding: 4px 7px; min-width: 26px; }
}

/* ---- RTL adjustments for Urdu ---- */
.case-panel[dir="rtl"] {
  text-align: right;
}
.case-panel[dir="rtl"] .case-header,
.case-panel[dir="rtl"] .case-footer {
  flex-direction: row-reverse;
}
.case-panel[dir="rtl"] .case-shipped li {
  padding-left: 0;
  padding-right: 18px;
}
.case-panel[dir="rtl"] .case-shipped li::before {
  left: auto;
  right: 0;
}
.case-panel[dir="rtl"] .case-prev {
  left: auto;
  right: 12px;
}
.case-panel[dir="rtl"] .case-next {
  right: auto;
  left: 12px;
}
.case-panel[dir="rtl"] .case-prev svg { transform: rotate(180deg); }
.case-panel[dir="rtl"] .case-next svg { transform: rotate(180deg); }
.case-panel[dir="rtl"] .case-stack #case-stack-list { justify-content: flex-end; }
.case-panel[lang="ur"] #case-brief-text,
.case-panel[lang="ur"] #case-title,
.case-panel[lang="ur"] #case-kicker,
.case-panel[lang="ur"] .case-shipped li,
.case-panel[lang="ur"] #case-caption {
  font-family: "Noto Nastaliq Urdu", "Manrope", sans-serif;
  line-height: 1.85;
}
.case-panel[lang="zh"] #case-brief-text,
.case-panel[lang="zh"] #case-title,
.case-panel[lang="zh"] .case-shipped li {
  font-family: "Noto Sans SC", "Manrope", sans-serif;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

/* ================= MARQUEE BAND ================= */
.marquee-band {
  position: relative;
  margin: 0 auto;
  padding: 18px 0;
  overflow: hidden;
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.04), rgba(236, 72, 153, 0.05));
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding-inline: 0;
}
.marquee-track {
  display: inline-flex;
  gap: 32px;
  align-items: center;
  white-space: nowrap;
  animation: marqueeScroll 46s linear infinite;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding-left: 32px;
  will-change: transform;
}
.marquee-track span:not(.m-dot) {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.marquee-track .m-dot {
  color: rgba(15, 23, 42, 0.30);
  font-size: 0.7rem;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-band:hover .marquee-track { animation-play-state: paused; }

/* ================= TRUSTED-BY STRIP ================= */
.trusted-strip {
  margin: 0 0 36px;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.trusted-strip .trusted-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  padding-right: 18px;
  border-right: 1px solid var(--stroke);
  flex-shrink: 0;
}
.trusted-badges {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.badge-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 6px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}
.badge-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.08);
}
.badge-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.badge-card[data-tone="cyan"] .badge-mark { background: linear-gradient(135deg, #22d3ee, #60a5fa); }
.badge-card[data-tone="violet"] .badge-mark { background: linear-gradient(135deg, #8b5cf6, #6366f1); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.badge-card[data-tone="lime"] .badge-mark { background: linear-gradient(135deg, #84cc16, #22c55e); box-shadow: 0 4px 12px rgba(132, 204, 22, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.badge-glyph {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.badge-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
  min-width: 0;
}
.badge-text strong {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.badge-text small {
  font-size: 0.6rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ================= PROCESS SECTION ================= */
.process-section {
  padding-block: 80px;
  scroll-margin-top: 100px;
}
.process-flow {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  position: relative;
}
.process-flow::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 68px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.35) 15%, rgba(34, 211, 238, 0.35) 50%, rgba(139, 92, 246, 0.35) 85%, transparent);
  z-index: 0;
  pointer-events: none;
}
.process-node {
  position: relative;
  z-index: 1;
  padding: 26px 22px 22px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  transition: transform 300ms var(--ease), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.process-node:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
}
.pn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  margin-bottom: 4px;
}
.pn-index {
  font-family: "JetBrains Mono", monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.pn-icon {
  width: 42px;
  height: 42px;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: var(--blue-2);
  transition: transform 400ms var(--ease), border-color 400ms var(--ease);
}
.process-node:hover .pn-icon {
  transform: rotate(-6deg) scale(1.06);
  border-color: rgba(96, 165, 250, 0.45);
}
.process-node h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.process-node p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.58;
  margin: 0;
}
.pn-sub {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--stroke);
}
.pn-sub li {
  position: relative;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
}
.pn-sub li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-2);
  transform: translateY(-50%);
  opacity: 0.6;
}

/* ================= TESTIMONIAL STRIP ================= */
.testimonial-strip {
  margin-top: 8px;
  padding: 32px 38px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.06), rgba(236, 72, 153, 0.06) 70%, rgba(139, 92, 246, 0.08));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
}
.testimonial-strip::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.4), transparent 40%, transparent 60%, rgba(236, 72, 153, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  pointer-events: none;
}
.ts-mark { color: var(--blue-2); flex-shrink: 0; }
.testimonial-strip blockquote {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.testimonial-strip p {
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
  font-weight: 400;
  font-style: italic;
  max-width: 68ch;
}
.testimonial-strip footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.86rem;
}
.testimonial-strip footer strong { color: var(--ink); font-weight: 700; }
.testimonial-strip footer span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

/* ================= PROJECT CARD METRICS ================= */
.card-metrics {
  list-style: none;
  padding: 12px 0 0;
  margin: 8px 0 2px;
  border-top: 1px dashed var(--stroke);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.card-metrics li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.card-metrics strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-metrics span {
  font-size: 0.66rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================= RESPONSIVE additions ================= */
@media (max-width: 1180px) {
  .process-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-flow::before { display: none; }
  .section-rail { display: none; }
}
@media (max-width: 900px) {
  .status-bar { display: none; }
  .testimonial-strip { grid-template-columns: 1fr; padding: 24px; }
  .trusted-strip .trusted-label { border-right: none; padding-right: 0; }
}
@media (max-width: 780px) {
  .process-section { padding-block: 60px; }
  .process-flow { grid-template-columns: 1fr; }
  .card-metrics { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .card-metrics strong { font-size: 0.82rem; }
  .cmdk-trigger { display: none; }
}
@media (pointer: coarse) {
  .cursor-ring { display: none !important; }
}

/* ================= HERO 3D GLOBE ================= */
.globe-stage {
  flex: 1;
  position: relative;
  border-radius: 12px;
  background:
    radial-gradient(100% 80% at 50% 30%, rgba(59, 130, 246, 0.10), transparent 60%),
    radial-gradient(60% 60% at 50% 120%, rgba(139, 92, 246, 0.08), transparent 60%),
    #f1f5fc;
  border: 1px solid var(--stroke);
  overflow: hidden;
  cursor: grab;
  min-height: 160px;
}
.globe-stage:active { cursor: grabbing; }
.globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.globe-hud {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  font-family: "JetBrains Mono", monospace;
  pointer-events: none;
  z-index: 2;
}
.ghud-lbl {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}
.ghud-coord {
  font-size: 0.66rem;
  color: var(--blue-2);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.globe-legend {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  color: var(--ink-soft);
  pointer-events: none;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.globe-legend span { display: inline-flex; align-items: center; gap: 6px; }
.globe-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

/* ================= SCROLL-EXPLORE INDICATOR ================= */
.scroll-explore {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 auto 18px;
  padding: 0 32px;
  max-width: var(--max);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 220ms var(--ease);
}
.scroll-explore:hover { color: var(--ink); }
.scroll-explore .se-line {
  position: relative;
  width: 64px;
  height: 1px;
  background: var(--stroke-2);
  overflow: hidden;
}
.scroll-explore .se-line span {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: var(--grad);
  animation: seSweep 2.4s ease-in-out infinite;
}
@keyframes seSweep {
  0% { left: -40%; }
  100% { left: 110%; }
}

/* ================= BEFORE / AFTER COMPARE ================= */
.lab-compare {
  position: relative;
  width: 100%;
  height: calc(100% - 49px);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}
.compare-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 300ms var(--ease);
}
.compare-before {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--split, 50%);
  overflow: hidden;
  transition: none;
}
.compare-raw {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.compare-tag {
  position: absolute;
  top: 12px;
  padding: 5px 10px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(8px);
  z-index: 3;
  pointer-events: none;
}
.compare-tag.raw-tag { left: 14px; color: var(--cyan); border-color: rgba(34, 211, 238, 0.35); }
.compare-tag.out-tag { right: 14px; color: var(--lime); border-color: rgba(163, 230, 53, 0.35); }
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(96, 165, 250, 0.9) 15%, rgba(34, 211, 238, 0.9) 50%, rgba(139, 92, 246, 0.9) 85%, transparent);
  transform: translateX(-1px);
  z-index: 4;
  outline: none;
}
.compare-handle .ch-bar {
  position: absolute;
  inset: 0;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.7);
  pointer-events: none;
}
.compare-handle .ch-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 1.5px solid rgba(37, 99, 235, 0.55);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: grab;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18), 0 0 0 4px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(10px);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.compare-handle:hover .ch-grip,
.compare-handle:focus .ch-grip {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22), 0 0 0 6px rgba(37, 99, 235, 0.14);
}
.compare-handle:active .ch-grip { cursor: grabbing; }

/* ================= KINETIC HERO TYPOGRAPHY ================= */
.hero-copy h1 .kt-word,
.heading-reveal .kt-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  line-height: inherit;
  padding-bottom: 0.06em;
}
.hero-copy h1 .kt,
.heading-reveal .kt {
  display: inline-block;
  transform: translateY(0) rotateX(0);
  opacity: 1;
  transition: transform 820ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 600ms var(--ease);
  transition-delay: var(--kd, 0ms);
  will-change: transform, opacity;
}
body.reveal-motion .hero-copy h1 .kt,
body.reveal-motion .heading-reveal .kt {
  transform: translateY(100%) rotateX(-40deg);
  transform-origin: 50% 100%;
  opacity: 0;
}
body.reveal-motion .hero-copy h1.is-in .kt,
body.reveal-motion .hero-copy h1.kinetic-show .kt,
body.reveal-motion .heading-reveal.is-revealed .kt,
.hero-copy h1.is-in .kt,
.hero-copy h1.kinetic-show .kt,
.heading-reveal.is-revealed .kt {
  transform: translateY(0) rotateX(0);
  opacity: 1;
}

/* ================= TOPO DIVIDERS ================= */
.topo-divider {
  display: block;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 90px;
  position: relative;
  overflow: hidden;
  opacity: 0.65;
  pointer-events: none;
}
.topo-divider svg {
  width: 100%;
  height: 100%;
  display: block;
}
.topo-divider .topo-line {
  fill: none;
  stroke: rgba(96, 165, 250, 0.22);
  stroke-width: 1;
}
.topo-divider .topo-line.hl {
  stroke: rgba(34, 211, 238, 0.45);
  stroke-dasharray: 220 880;
  animation: topoSweep 14s linear infinite;
}
@keyframes topoSweep {
  to { stroke-dashoffset: -1100; }
}

/* Responsive additions for new elements */
@media (max-width: 780px) {
  .form-row { grid-template-columns: 1fr; }
  .compare-handle .ch-grip { width: 30px; height: 30px; }
  .topo-divider { height: 50px; opacity: 0.5; }
}

/* ================= ANIMATION UPGRADE PACK ================= */

/* ---- 1+2: Hero h1 + section h2 char-level reveal + sheen sweep ---- */
.kt-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em) rotate(2deg);
  transition: opacity 700ms var(--ease-spring), transform 700ms var(--ease-spring);
  transition-delay: var(--kd, 0ms);
  will-change: transform, opacity;
}
.kinetic-show .kt-char,
.is-revealed .kt-char {
  opacity: 1;
  transform: translateY(0) rotate(0);
}
.heading-reveal {
  overflow: hidden;
}
.heading-reveal .kt-word { display: inline-block; }
.heading-reveal .grad {
  background-size: 200% 100%;
  background-position: 100% 50%;
  transition: background-position 1400ms var(--ease-out-quint) 200ms;
}
.heading-reveal.is-revealed .grad {
  background-position: 0% 50%;
}
.heading-reveal .grad {
  position: relative;
}
.heading-reveal .grad::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  background-size: 220% 100%;
  background-position: -100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
  opacity: 0;
}
.heading-reveal.is-revealed .grad::after {
  animation: sheenSweep 1500ms var(--ease-out-soft) 320ms forwards;
}
@keyframes sheenSweep {
  0%   { opacity: 0; background-position: -100% 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; background-position: 220% 0; }
}

/* (Rotator slot-machine removed - using original simple cross-fade) */

/* ---- 8: Cursor ring shape morph ---- */
.cursor-ring {
  transition: width 320ms var(--ease-out-quint),
              height 320ms var(--ease-out-quint),
              border-radius 320ms var(--ease-out-quint),
              border-color 200ms var(--ease),
              opacity 200ms var(--ease);
}
.cursor-ring.is-snapped {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(96, 165, 250, 0.04);
  mix-blend-mode: normal;
}

/* ---- 9: Case-modal Ken Burns + grain ---- */
#case-image.kb-out-left  { animation: kbOutLeft 280ms var(--ease-out-quint) forwards; }
#case-image.kb-out-right { animation: kbOutRight 280ms var(--ease-out-quint) forwards; }
#case-image.kb-in-left   { animation: kbInLeft 480ms var(--ease-out-quint); }
#case-image.kb-in-right  { animation: kbInRight 480ms var(--ease-out-quint); }
@keyframes kbOutLeft  { to { opacity: 0; transform: scale(1.05) translateX(-22px); } }
@keyframes kbOutRight { to { opacity: 0; transform: scale(1.05) translateX(22px); } }
@keyframes kbInLeft   { from { opacity: 0; transform: scale(1.05) translateX(22px); }  to { opacity: 1; transform: scale(1) translateX(0); } }
@keyframes kbInRight  { from { opacity: 0; transform: scale(1.05) translateX(-22px); } to { opacity: 1; transform: scale(1) translateX(0); } }
.case-figure { position: relative; }
.case-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  opacity: 0.06;
  mix-blend-mode: overlay;
}

/* ---- 10: Lab tab clip-wipe + sliding underline ---- */
.lab-screen.is-wiping .compare-after {
  animation: clipWipeOut 320ms var(--ease-out-quint) forwards;
}
.lab-screen.is-wipein .compare-after {
  animation: clipWipeIn 360ms var(--ease-out-quint) forwards;
}
@keyframes clipWipeOut { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 0 100%); } }
@keyframes clipWipeIn  { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.lab-copy.is-staggering > * {
  opacity: 0;
  transform: translateY(8px);
  animation: labMetaIn 420ms var(--ease-out-quint) forwards;
  animation-delay: var(--ms, 0ms);
}
@keyframes labMetaIn { to { opacity: 1; transform: translateY(0); } }
.lab-tabs { position: relative; }
.lab-tabs::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: var(--tab-x, 0);
  width: var(--tab-w, 0);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-2), var(--cyan));
  transition: left 380ms var(--ease-spring), width 380ms var(--ease-spring);
  pointer-events: none;
}

/* (Removed orphaned process-path / is-lit rules - the scroll-path SVG was rolled back) */

/* ---- 11: Aurora mesh (subtle ambient - no blend-mode, low opacity) ---- */
.aurora-mesh {
  position: fixed;
  inset: -8vmax;
  z-index: 0;
  pointer-events: none;
  background:
    conic-gradient(from 0deg at 30% 40%,
      rgba(96,165,250,0.10),
      rgba(34,211,238,0.06),
      rgba(139,92,246,0.10),
      rgba(236,72,153,0.10),
      rgba(249,115,22,0.06),
      rgba(96,165,250,0.10));
  filter: blur(120px);
  opacity: 0.5;
  animation: auroraSpin 80s linear infinite;
  transform-origin: 30% 40%;
  will-change: transform;
}
@keyframes auroraSpin {
  to { transform: rotate(360deg); }
}

/* ---- 13: Marquee scroll velocity (no 3D tilt - keeps text crisp) ---- */
.marquee-track {
  animation-duration: calc(46s / var(--marquee-speed, 1)) !important;
}

/* ---- 14: Stack + Papers per-item stagger ---- */
.papers-list .paper.reveal,
.stack-grid > article.reveal {
  transition-delay: var(--stagger, 0ms);
}
.papers-list .paper.reveal {
  transform: translateY(26px) rotate(-1.2deg);
}
.papers-list .paper.reveal.is-in {
  transform: translateY(0) rotate(0);
}
.stack-grid > article.reveal {
  transform: translateY(20px) rotate(-1deg);
}
.stack-grid > article.reveal.is-in {
  transform: translateY(0) rotate(0);
}

/* ---- 5: Filter chip + grid FLIP ---- */
.project-card.is-flipping {
  transition: transform 460ms var(--ease-spring), opacity 280ms var(--ease);
}
.project-card.is-leaving {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 220ms var(--ease), transform 280ms var(--ease-out-quint);
  pointer-events: none;
}
.project-card.is-entering {
  opacity: 0;
  transform: scale(0.94);
  animation: cardEnter 460ms var(--ease-spring) forwards;
}
@keyframes cardEnter {
  to { opacity: 1; transform: scale(1); }
}
.filter-chip.is-active {
  position: relative;
}
.filter-chip.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 6px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-2), var(--cyan));
  border-radius: 2px;
  animation: chipUnderline 280ms var(--ease-spring) forwards;
  transform-origin: 50% 50%;
}
@keyframes chipUnderline {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ---- 3: View Transitions - only morph the case cover, not the whole page ---- */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.001s; /* effectively disable page-wide crossfade */
}
::view-transition-group(case-cover-active) {
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
::view-transition-image-pair(case-cover-active) {
  isolation: isolate;
}

/* ---- Reduced motion guards ---- */
@media (prefers-reduced-motion: reduce) {
  .kt-char,
  .heading-reveal .grad::after,
  .rotator > span,
  #case-image,
  .lab-screen .compare-after,
  .aurora-mesh,
  .bento.reveal,
  .papers-list .paper.reveal,
  .stack-grid > article.reveal,
  .project-card.is-flipping,
  .project-card.is-entering {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    clip-path: none !important;
  }
}

/* Print / PDF capture - force all content visible */
@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-particles, .cursor-glow, .cursor-ring, .scroll-progress,
  .section-rail, .status-bar, .grain-overlay, .marquee-band,
  .globe-stage, .topo-divider { display: none !important; }
  body::before, body::after { display: none !important; }
  body { background: #ffffff !important; color: #0b1220 !important; }
}

/* Visually hidden helper (accessible to screen readers, invisible on screen) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip-to-content link - visually hidden until focused */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 10000;
  padding: 12px 18px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-sm);
  font: 600 14px/1 "Manrope", system-ui, sans-serif;
  text-decoration: none;
  box-shadow: var(--shadow-hi);
  transition: top 200ms var(--ease-out-quint);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Global focus-visible ring - restores keyboard discoverability after outline:none resets */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
details:focus-visible,
[role="button"]:focus-visible,
[role="option"]:focus-visible,
[role="tab"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Tools section ---------- */
/* =========================================================================
   Tools section — "manifest" treatment
   - CLI-style header strip with terrain ridge-line
   - Cards: contour pattern behind icon, refined chips, tightened action
     hierarchy, subtle topographic corner mark
   - Local accent: contour-cyan, layered on the existing blue/ink palette
   ========================================================================= */

.tools-section {
  --tool-accent: #0e7490;          /* contour cyan, dark for AA on light bg */
  --tool-accent-soft: #06b6d4;
  --tool-accent-tint: rgba(14, 116, 144, 0.10);
  --tool-accent-line: rgba(14, 116, 144, 0.30);
  --tool-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  position: relative;
  padding-block: 86px;
  scroll-margin-top: 100px;
  isolation: isolate;
}

.tools-section::before {
  /* Faint contour-line topographic backdrop, masked to fade in from corners */
  content: "";
  position: absolute;
  inset: 24px 0;
  pointer-events: none;
  z-index: -1;
  background:
    repeating-radial-gradient(
      circle at 18% 28%,
      transparent 0,
      transparent 54px,
      rgba(14, 116, 144, 0.07) 54px,
      rgba(14, 116, 144, 0.07) 55px
    ),
    repeating-radial-gradient(
      circle at 88% 78%,
      transparent 0,
      transparent 64px,
      rgba(37, 99, 235, 0.05) 64px,
      rgba(37, 99, 235, 0.05) 65px
    );
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
  opacity: 0.85;
}

/* ---- Manifest header (was: stats strip) ----------------------------------- */

.tools-strip {
  position: relative;
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 22px;
  margin-top: 32px;
  padding: 18px 22px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.78),
    rgba(248, 250, 252, 0.62)
  );
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  backdrop-filter: blur(10px);
}

.tools-strip::before {
  /* terrain ridge-line under the strip */
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: -1px;
  height: 6px;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 6' preserveAspectRatio='none'><path d='M0 5 Q 14 1 28 4 T 56 4 T 84 3 T 112 4 T 140 2 T 168 4 T 200 3' fill='none' stroke='%230e7490' stroke-opacity='0.35' stroke-width='1'/></svg>");
  background-repeat: repeat-x;
  background-size: 200px 6px;
  opacity: 0.7;
}

.tools-strip::after {
  /* CLI prompt label — generated, no markup change required */
  content: "// tools.manifest";
  font-family: var(--tool-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--tool-accent);
  white-space: nowrap;
  grid-column: 1;
  grid-row: 1;
}

.tools-strip > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  position: relative;
  padding-left: 16px;
}

.tools-strip > div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 22px;
  background: var(--stroke);
  transform: translateY(-50%);
}

.tools-strip-value {
  color: var(--ink);
  font-family: var(--tool-mono);
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  position: relative;
}

.tools-strip-value::after {
  /* tiny accent underscore under the numeral */
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 14px;
  height: 2px;
  background: var(--tool-accent);
  border-radius: 2px;
}

.tools-strip-label {
  color: var(--ink-soft);
  font-family: var(--tool-mono);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.2;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.tools-strip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-height: 38px;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--tool-accent-line);
  border-radius: 999px;
  background: var(--tool-accent-tint);
  color: var(--tool-accent);
  font-family: var(--tool-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-decoration: none;
  transition: border-color 200ms var(--ease), background 200ms var(--ease),
              color 200ms var(--ease), transform 200ms var(--ease);
}

.tools-strip-link:hover {
  color: #fff;
  background: var(--tool-accent);
  border-color: var(--tool-accent);
  transform: translateY(-1px);
}

/* ---- Grid -------------------------------------------------------------- */

.tools-grid {
  display: grid;
  align-items: stretch;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 32px;
}

/* ---- Card -------------------------------------------------------------- */

.tool-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  padding: 24px 22px 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(248, 250, 252, 0.78)
  );
  border: 1px solid var(--stroke);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  backdrop-filter: blur(10px);
  transition: transform 400ms var(--ease), border-color 300ms var(--ease),
              box-shadow 400ms var(--ease);
  overflow: hidden;
}

.tool-card::before {
  /* topographic corner mark — three contour arcs in the top-right */
  content: "";
  position: absolute;
  top: -22px;
  right: -22px;
  width: 110px;
  height: 110px;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 110' fill='none' stroke='%230e7490' stroke-opacity='0.18' stroke-width='1'><circle cx='110' cy='0' r='40'/><circle cx='110' cy='0' r='58'/><circle cx='110' cy='0' r='76'/><circle cx='110' cy='0' r='94'/></svg>");
  background-repeat: no-repeat;
  background-size: 110px 110px;
  opacity: 0.55;
  transition: opacity 300ms var(--ease);
}

.tool-card::after {
  /* preserved cursor-tracking glow from main.js (--mx / --my) */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(14, 116, 144, 0.10),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 300ms var(--ease);
  pointer-events: none;
}

.tool-card:hover {
  border-color: var(--tool-accent-line);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.10),
              0 0 0 1px rgba(14, 116, 144, 0.10) inset;
  transform: translateY(-3px);
}

.tool-card:hover::after { opacity: 1; }
.tool-card:hover::before { opacity: 0.85; }

.tool-card.coming { cursor: default; opacity: 0.78; }
.tool-card.coming::before { opacity: 0.3; }
.tool-card.coming:hover {
  transform: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  border-color: var(--stroke);
}

/* ---- Card head: icon + status pill ------------------------------------- */

.tool-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--tool-accent-tint);
  border: 1px solid var(--tool-accent-line);
  color: var(--tool-accent);
  overflow: hidden;
  flex: 0 0 auto;
  isolation: isolate;
}

.tool-icon::before {
  /* contour pattern *inside* the icon badge */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-radial-gradient(
      circle at 20% 80%,
      transparent 0,
      transparent 7px,
      rgba(14, 116, 144, 0.18) 7px,
      rgba(14, 116, 144, 0.18) 8px
    );
  opacity: 0.7;
}

.tool-icon svg {
  width: 24px;
  height: 24px;
  position: relative;
}

.tool-card:hover .tool-icon {
  background: var(--tool-accent);
  color: #fff;
  border-color: var(--tool-accent);
}

.tool-card:hover .tool-icon::before {
  background-image:
    repeating-radial-gradient(
      circle at 20% 80%,
      transparent 0,
      transparent 7px,
      rgba(255, 255, 255, 0.22) 7px,
      rgba(255, 255, 255, 0.22) 8px
    );
}

.tool-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 50%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--stroke);
  color: var(--ink-soft);
  font-family: var(--tool-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-status.live {
  color: #047857;
  border-color: rgba(5, 150, 105, 0.36);
  background: rgba(16, 185, 129, 0.09);
}

.tool-status.library {
  color: var(--tool-accent);
  border-color: var(--tool-accent-line);
  background: var(--tool-accent-tint);
}

.tool-status.live .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* ---- Card body --------------------------------------------------------- */

.tool-card h3 {
  font-family: var(--tool-mono);
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 4px 0 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.tool-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.tool-meta li {
  padding: 3px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink-soft);
  font-family: var(--tool-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---- Action row: clear hierarchy --------------------------------------- */

.tool-actions {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px dashed var(--stroke);
}

.tool-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--tool-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-decoration: none;
  transition: border-color 200ms var(--ease), color 200ms var(--ease),
              background 200ms var(--ease), transform 200ms var(--ease);
}

.tool-action svg {
  flex: 0 0 auto;
}

.tool-action:hover {
  color: var(--ink);
  background: rgba(15, 23, 42, 0.04);
  transform: translateY(-1px);
}

/* PRIMARY: filled, prominent, sized up — the eye lands here first */
.tool-action.primary {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  font-weight: 600;
  padding: 9px 14px;
  margin-right: 4px;
}

.tool-action.primary:hover {
  background: var(--tool-accent);
  border-color: var(--tool-accent);
  color: #fff;
  transform: translateY(-1px);
}

/* DOI: small, contour-cyan accent — quiet but distinguishable */
.tool-action.doi {
  color: var(--tool-accent);
  border-color: var(--tool-accent-line);
  background: transparent;
}

.tool-action.doi:hover {
  background: var(--tool-accent-tint);
  color: var(--tool-accent);
}

.tool-action.doi.pending {
  cursor: help;
  color: #8a5a00;
  border-color: rgba(217, 119, 6, 0.30);
  background: rgba(245, 158, 11, 0.08);
}

/* ---- "Coming soon" CTA ------------------------------------------------- */

.tool-cta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--stroke);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--tool-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.85;
  transition: opacity 200ms var(--ease), gap 200ms var(--ease);
}

.tool-card:hover .tool-cta:not(.muted) {
  opacity: 1;
  gap: 12px;
}

.tool-cta.muted {
  color: var(--ink-soft);
  opacity: 0.55;
  font-style: normal;
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 1100px) {
  .tools-strip {
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto;
    row-gap: 14px;
  }
  .tools-strip::after {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .tools-strip > div { grid-row: 2; }
  .tools-strip-link {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
  }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .tools-strip {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 12px;
    padding: 16px 18px;
  }
  .tools-strip::after { grid-column: 1; grid-row: 1; }
  .tools-strip::before { left: 18px; right: 18px; }
  .tools-strip > div {
    grid-column: 1;
    grid-row: auto;
    justify-content: space-between;
    padding-left: 0;
  }
  .tools-strip > div::before { display: none; }
  .tools-strip-link {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    justify-self: stretch;
  }
  .tools-grid { grid-template-columns: 1fr; }
  .tools-section { padding-block: 56px; }
  .tool-card {
    padding: 22px 20px 18px;
    border-radius: 12px;
  }
  .tool-card::before {
    width: 90px; height: 90px;
    background-size: 90px 90px;
    top: -16px; right: -16px;
  }
  .tool-card h3 { font-size: 1rem; }
  .tool-icon { width: 46px; height: 46px; border-radius: 11px; }
  .tool-icon svg { width: 22px; height: 22px; }
  .tool-status { max-width: 56%; }
  .tool-action.primary { padding: 8px 12px; }
}

/* ================= GIS MOUSE INTERACTION ================= */

/* GIS Crosshairs */
.gis-crosshair {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: none;
}
body.is-ready.has-fine-pointer:not(.cursor-interactive):not(.cursor-magnet) .gis-crosshair {
  display: block;
}
/* Hide the old heavy cursor ring to reduce clutter */
.cursor-ring {
  display: none !important;
}

.crosshair-x,
.crosshair-y {
  position: absolute;
  background: rgba(34, 211, 238, 0.08); /* Faint, elegant line */
  /* Use hardware acceleration for smooth tracking */
  will-change: transform;
}
.crosshair-x {
  top: 0;
  left: 0;
  width: 100vw;
  height: 1px;
  transform: translateY(calc(var(--cy, 0) * 1px));
}
.crosshair-y {
  top: 0;
  left: 0;
  width: 1px;
  height: 100vh;
  transform: translateX(calc(var(--cx, 0) * 1px));
}

/* Coordinate HUD */
.gis-coord-label {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(calc(var(--cx, 0) * 1px + 24px), calc(var(--cy, 0) * 1px + 24px));
  font-family: var(--tool-mono, "JetBrains Mono", monospace);
  font-size: 0.65rem;
  color: rgba(34, 211, 238, 0.4);
  background: transparent;
  padding: 0;
  border: none;
  white-space: pre;
  will-change: transform;
  pointer-events: none;
}

/* Topographic Flashlight Background */
.topo-background {
  position: fixed;
  inset: -10vw; /* bleed out to avoid edges during move */
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000' preserveAspectRatio='xMidYMid slice'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.005' numOctaves='3' seed='5'/><feColorMatrix type='hueRotate' values='0'><animate attributeName='values' from='0' to='360' dur='60s' repeatCount='indefinite'/></feColorMatrix><feComponentTransfer><feFuncR type='discrete' tableValues='0 0.2 0.4 0.6 0.8 1'/><feFuncG type='discrete' tableValues='0 0.2 0.4 0.6 0.8 1'/><feFuncB type='discrete' tableValues='0 0.2 0.4 0.6 0.8 1'/></feComponentTransfer></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.25'/></svg>");
  background-size: cover;
  opacity: 0.04; /* Very subtle easter egg */
  
  /* Mask it using the cursor position */
  mask-image: radial-gradient(
    600px circle at calc(var(--cx, 50vw) * 1px) calc(var(--cy, 50vh) * 1px),
    black 0%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    600px circle at calc(var(--cx, 50vw) * 1px) calc(var(--cy, 50vh) * 1px),
    black 0%,
    transparent 100%
  );
  will-change: mask-position;
}

/* ================= PREMIUM GLASSMORPHISM ================= */
.site-header {
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}
@media (prefers-color-scheme: dark) {
  /* Assuming the site might have a dark mode, adding safe fallback */
  body.theme-dark .site-header {
    background: rgba(15, 23, 42, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  }
}

.status-bar, .cmdk-panel {
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

/* ================= SPOTLIGHT CARDS ================= */
.spotlight-card {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-radius: inherit; /* inherit from existing card radius */
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.spotlight-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    600px circle at var(--mx-px, -9999px) var(--my-px, -9999px),
    rgba(34, 211, 238, 0.15),
    transparent 40%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}
.spotlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--mx-px, -9999px) var(--my-px, -9999px),
    rgba(34, 211, 238, 0.03),
    transparent 40%
  );
  pointer-events: none;
  z-index: 0;
}
.spotlight-card > * {
  position: relative;
  z-index: 2;
}

/* Magnetic Button helper */
.magnetic {
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

