/* ==========================================================================
   Manas Mishra — portfolio
   ========================================================================== */

:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 24px;
  --radius: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f3f2ec;
  --line: rgba(20, 20, 22, .09);
  --line-2: rgba(20, 20, 22, .17);
  --text: #131315;
  --text-2: #4a4a51;
  --text-3: #6b6b73;
  --accent: #e8531f;
  --accent-ink: #b93a0e;
  --accent-soft: rgba(232, 83, 31, .1);
  --ok: #0c9a68;
  --ok-soft: rgba(12, 154, 104, .12);
  --blue: #2f66f0;
  --amber: #b86e00;
  --amber-soft: rgba(184, 110, 0, .12);
  --spot: rgba(20, 20, 22, .05);
  --dot: rgba(20, 20, 22, .13);
  --grain: .045;
  --shadow: 0 1px 2px rgba(20, 20, 22, .04), 0 18px 40px -24px rgba(20, 20, 22, .2);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090a;
    --surface: #111113;
    --surface-2: #17171a;
    --line: rgba(255, 255, 255, .075);
    --line-2: rgba(255, 255, 255, .15);
    --text: #edede7;
    --text-2: #a4a4ab;
    --text-3: #7e7e86;
    --accent: #ff6b3d;
    --accent-ink: #ff8b64;
    --accent-soft: rgba(255, 107, 61, .13);
    --ok: #3ddc97;
    --ok-soft: rgba(61, 220, 151, .12);
    --blue: #7aa2ff;
    --amber: #ffb547;
    --amber-soft: rgba(255, 181, 71, .12);
    --spot: rgba(255, 255, 255, .06);
    --dot: rgba(255, 255, 255, .085);
    --grain: .055;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 48px -28px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #09090a;
  --surface: #111113;
  --surface-2: #17171a;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .15);
  --text: #edede7;
  --text-2: #a4a4ab;
  --text-3: #7e7e86;
  --accent: #ff6b3d;
  --accent-ink: #ff8b64;
  --accent-soft: rgba(255, 107, 61, .13);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .12);
  --blue: #7aa2ff;
  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, .12);
  --spot: rgba(255, 255, 255, .06);
  --dot: rgba(255, 255, 255, .085);
  --grain: .055;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 48px -28px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1200px, 100% - var(--gutter) * 2); margin-inline: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: -64px; z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-size: 14px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.icon {
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 15px; font-weight: 500; letter-spacing: -.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text-3); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .icon { width: 17px; height: 17px; }
.btn--primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn--primary:hover { border-color: transparent; box-shadow: 0 12px 30px -14px var(--accent); }
.btn--icon { width: 46px; padding: 0; }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }

/* ---------- Scroll progress ---------- */

.progress { display: none; }
@supports (animation-timeline: scroll()) {
  .progress {
    display: block;
    position: fixed; inset: 0 0 auto; z-index: 80;
    height: 2px;
    background: var(--accent);
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
  @keyframes progress { to { transform: scaleX(1); } }
}

/* ---------- Nav ---------- */

.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.nav.is-scrolled {
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-bottom-color: var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; }
.bm-bg { fill: var(--text); }
.bm-line { fill: none; stroke: var(--bg); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.bm-node { fill: var(--bg); }
.bm-node--accent { fill: var(--accent); }

.nav-links {
  display: flex; gap: 2px;
  margin: 0; padding: 4px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.nav-links a {
  display: block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current] { color: var(--text); background: var(--surface-2); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

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

.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

@media (max-width: 900px) { .nav-links { display: none; } }
@media (max-width: 420px) { .brand-name { display: none; } }

/* ---------- Motion helpers ---------- */

.rise { animation: rise 1s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */

.hero { position: relative; padding: clamp(116px, 15vh, 164px) 0 56px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 58% 70% at 76% 42%, #000 22%, transparent 72%);
  mask-image: radial-gradient(ellipse 58% 70% at 76% 42%, #000 22%, transparent 72%);
}
.hero-glow {
  position: absolute; right: -12%; top: -6%;
  width: min(780px, 95vw); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 64%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: 13.5px;
  color: var(--text-2);
}
.status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.status-dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--ok);
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
.status-sep { width: 1px; height: 12px; background: var(--line-2); }

.hero-title { margin-top: 28px; font-weight: 400; }
.hero-name {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(68px, 11vw, 164px);
  line-height: .86;
  letter-spacing: -.04em;
}
.hero-name > span { display: block; }
.hero-name em { font-style: italic; letter-spacing: -.03em; }
.hero-dot { color: var(--accent); }
.hero-role {
  display: flex; align-items: center; gap: 12px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-2);
}
.hero-role::before { content: ""; width: 28px; height: 1px; background: var(--accent); }
.hero-lede {
  margin-top: 22px;
  max-width: 35ch;
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}
.hero-lede strong { color: var(--text); font-weight: 500; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 34px; }
.hero-viz { position: relative; justify-self: center; width: 100%; max-width: 470px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: clamp(56px, 8vw, 96px) 0 0;
}
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding-top: 20px; border-top: 1px solid var(--line-2); }
.stat dd {
  font-family: var(--font-serif);
  font-size: clamp(46px, 5vw, 66px);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat dd .unit { color: var(--accent); }
.stat dt { margin-top: 10px; max-width: 27ch; font-size: 14.5px; line-height: 1.45; color: var(--text-2); }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-viz { max-width: 440px; }
}
@media (max-width: 440px) {
  .status { font-size: 12.5px; }
  .status-sep--loc, .status-loc { display: none; }
  .hero-role { font-size: 11.5px; letter-spacing: .12em; }
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
}

/* Hero system diagram */

.sys { width: 100%; height: auto; overflow: visible; }
.sys .edge { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.sys .node rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; }
.sys .node text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  fill: var(--text-2);
  text-anchor: middle;
  dominant-baseline: central;
}
.sys .node--agent rect { stroke: var(--accent); stroke-width: 1.4; }
.sys .node--agent text { fill: var(--accent-ink); font-weight: 500; }
.sys .worker rect { animation: work 3.2s ease-in-out infinite; }
.sys .worker:nth-of-type(2) rect { animation-delay: -1.1s; }
.sys .worker:nth-of-type(3) rect { animation-delay: -2.2s; }
.sys .live { fill: var(--ok); animation: blink 2.4s ease-in-out infinite; }
.sys .q { fill: var(--accent); animation: qpulse 1.8s ease-in-out infinite; }
.sys .q:nth-of-type(2) { animation-delay: .25s; }
.sys .q:nth-of-type(3) { animation-delay: .5s; }
.sys .q:nth-of-type(4) { animation-delay: .75s; }
.sys .pkt-core { fill: var(--accent); }
.sys .pkt-glow { fill: var(--accent); opacity: .22; }
.sys .glow-stop { stop-color: var(--accent); stop-opacity: .16; }
.sys .glow-stop--end { stop-opacity: 0; }
.sys .out {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  fill: var(--accent-ink);
  text-anchor: middle;
}
@keyframes work { 0%, 100% { stroke: var(--line-2); } 50% { stroke: var(--accent); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes qpulse { 0%, 100% { opacity: .22; } 50% { opacity: 1; } }

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  overflow: hidden;
  padding: 20px 0;
  border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 50s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; align-items: center; gap: 44px; margin: 0; padding: 0 44px 0 0; list-style: none; }
.marquee li {
  display: flex; align-items: center; gap: 44px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-3);
}
.marquee li::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .7; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */

.section { position: relative; padding: clamp(96px, 12vw, 164px) 0; }
.section--tight { padding-top: clamp(64px, 8vw, 104px); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 28px 64px;
  align-items: end;
  margin-bottom: clamp(44px, 6vw, 72px);
}
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow b { font-weight: 500; color: var(--accent-ink); }
.eyebrow::after { content: ""; width: 40px; height: 1px; background: var(--line-2); }
.section-title {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(46px, 6.6vw, 92px);
  line-height: .94;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.section-title em { font-style: italic; }
.section-lede { max-width: 42ch; font-size: 17.5px; line-height: 1.6; color: var(--text-2); text-wrap: pretty; }

@media (max-width: 900px) { .section-head { grid-template-columns: minmax(0, 1fr); } }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.about-statement {
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.5vw, 46px);
  line-height: 1.14;
  letter-spacing: -.02em;
  text-wrap: pretty;
}
.about-statement em { font-style: italic; color: var(--accent-ink); }
.about-copy { display: grid; gap: 18px; font-size: 16.5px; color: var(--text-2); text-wrap: pretty; }
.about-copy strong { color: var(--text); font-weight: 500; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--line); }
.fact { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); }
.fact dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.fact dd { margin-top: 6px; font-size: 15px; color: var(--text); }

@media (max-width: 900px) { .about { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Cards / projects ---------- */

.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .35s, opacity 1s var(--ease), transform 1s var(--ease);
}
.card::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
}
.card:hover { border-color: var(--line-2); }
.card:hover::before { opacity: 1; }

.project { display: flex; flex-direction: column; }
.project-viz {
  position: relative;
  display: grid; place-items: center;
  min-height: 260px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(120% 100% at 50% 0%, var(--surface-2), var(--surface));
  overflow: hidden;
}
.project-viz::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
  opacity: .7;
}
.project-viz > * { position: relative; }
.project-body { display: flex; flex: 1; flex-direction: column; gap: 14px; padding: clamp(24px, 3vw, 34px); }

.project--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
.project--wide .project-viz { order: 2; min-height: 100%; border-bottom: 0; border-left: 1px solid var(--line); }
.project--wide.project--flip { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.project--wide.project--flip .project-viz { order: 0; border-left: 0; border-right: 1px solid var(--line); }

.project-meta {
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.project-meta span + span::before { content: "/"; margin-right: 10px; color: var(--line-2); }
.project-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1;
  letter-spacing: -.025em;
}
.project-pitch { font-size: 18px; line-height: 1.45; color: var(--text); text-wrap: pretty; }
.project-desc { font-size: 15.5px; color: var(--text-2); text-wrap: pretty; }
.project-desc + .project-desc { margin-top: -4px; }
code, .code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--text);
}

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.metric {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.metric dd { font-family: var(--font-serif); font-size: 30px; line-height: 1; letter-spacing: -.02em; }
.metric dt { font-size: 12.5px; line-height: 1.4; color: var(--text-3); }
.footnote { font-size: 13px; color: var(--text-3); }

.gotchas { border-top: 1px dashed var(--line-2); padding-top: 12px; }
.gotchas summary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
}
.gotchas summary::-webkit-details-marker { display: none; }
.gotchas summary::before { content: "+"; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 50%; font-size: 12px; transition: transform .3s var(--ease); }
.gotchas[open] summary::before { transform: rotate(45deg); }
.gotchas ul { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 14.5px; color: var(--text-2); }
.gotchas li { position: relative; padding-left: 18px; }
.gotchas li::before { content: "↳"; position: absolute; left: 0; color: var(--accent-ink); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 10px 0 0; list-style: none; }
.tags li {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
}

@media (max-width: 1000px) {
  .project--wide { grid-template-columns: minmax(0, 1fr); }
  .project--wide .project-viz { order: 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .project--wide.project--flip { grid-template-columns: minmax(0, 1fr); }
  .project--wide.project--flip .project-viz { border-right: 0; }
}
@media (max-width: 760px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-viz { min-height: 220px; padding: 20px 16px; }
}

/* ---------- Terminal (always dark) ---------- */

.term {
  --text: #edede7;
  --text-2: #a4a4ab;
  --text-3: #7e7e86;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .14);
  --amber: #ffb547;
  --amber-soft: rgba(255, 181, 71, .14);
  --blue: #7aa2ff;
  --accent: #ff6b3d;
  --accent-ink: #ff8b64;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: #0d0d0f;
  color: var(--text);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.term-bar span { margin-left: 8px; font-size: 11.5px; color: var(--text-3); }
.term-body { padding: 16px; }
.ps { color: var(--ok); }
.caret {
  display: inline-block;
  width: 7px; height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--text-2);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* llm-graph-optimizer demo */

.lgo { width: 100%; max-width: 560px; }
.lgo-graph { display: flex; align-items: center; margin-bottom: 16px; }
.gnode {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #141417;
  font-size: 11.5px;
  white-space: nowrap;
  transition: border-color .5s, box-shadow .5s;
}
.gnode b { padding: 1px 5px; border-radius: 4px; font-size: 9.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.b-llm { color: var(--amber); background: var(--amber-soft); }
.b-jev { display: none; color: var(--ok); background: var(--ok-soft); }
.gnode--end { color: var(--text-3); border-style: dashed; }
.gnode.is-swap { border-color: rgba(61, 220, 151, .55); box-shadow: 0 0 0 4px rgba(61, 220, 151, .08), 0 0 24px -4px rgba(61, 220, 151, .35); }
.gnode.is-swap .b-llm { display: none; }
.gnode.is-swap .b-jev { display: inline; }
.gedge { flex: 1; min-width: 8px; height: 1px; background: var(--line-2); }

.lgo-cmd { color: var(--text-2); }
.lgo-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lgo-table th { padding: 6px 10px 6px 0; border-bottom: 1px dashed var(--line-2); text-align: left; font-weight: 400; color: var(--text-3); }
.lgo-table td { padding: 8px 10px 8px 0; color: var(--text); white-space: nowrap; }
.lgo-table th:last-child, .lgo-table td:last-child { padding-right: 0; }
.lgo-table .from { color: var(--text-3); }
.lgo-table .to { color: var(--ok); }
.verdict { margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #09090a; background: var(--ok); }
.lgo-keep { margin-top: 6px; color: var(--text-3); }
.lgo-keep b { font-weight: 400; color: var(--amber); }
.lgo-sum { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2); color: var(--ok); }
.lgo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.replay {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.replay:hover { color: var(--text); border-color: var(--text-3); }
.replay .icon { width: 14px; height: 14px; }

.lgo.is-armed .lgo-table thead,
.lgo.is-armed .lgo-table tbody tr,
.lgo.is-armed .lgo-keep,
.lgo.is-armed .lgo-sum { opacity: 0; transform: translateY(4px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.lgo.is-armed .is-shown { opacity: 1 !important; transform: none !important; }
.lgo.is-armed .gnode.is-swap:not(.is-swapped) { border-color: var(--line-2); box-shadow: none; }
.lgo.is-armed .gnode.is-swap:not(.is-swapped) .b-llm { display: inline; }
.lgo.is-armed .gnode.is-swap:not(.is-swapped) .b-jev { display: none; }
.lgo:not(.is-typing) .caret { display: none; }

@media (max-width: 520px) {
  .gnode--end, .gedge--end { display: none; }
  .gnode { gap: 4px; padding: 4px 6px; font-size: 10.5px; }
  .gnode b { padding: 1px 4px; font-size: 8.5px; }
  .term-body { padding: 14px 12px; }
  .term { font-size: 11.5px; }
  .lgo-table td, .lgo-table th { padding-right: 6px; }
  .verdict { display: none; }
}

/* ---------- Flow diagrams (integrations, deploys) ---------- */

.flow { width: 100%; height: auto; overflow: visible; }
.flow .edge { fill: none; stroke: var(--line-2); stroke-width: 1.2; }
.flow .edge--live { stroke: var(--ok); stroke-width: 1.4; }
.flow .edge--dim { stroke-dasharray: 3 5; }
.flow .edge--back { fill: none; stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 2 4; }
.flow .box { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; }
.flow .box--live { stroke: var(--ok); stroke-width: 1.5; }
.flow .box--drain { stroke: var(--amber); stroke-width: 1.3; }
.flow .box--dead { stroke-dasharray: 4 4; }
.flow .dead { opacity: .45; }
.flow .t { font-family: var(--font-mono); font-size: 12px; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.flow .t-sub { font-family: var(--font-mono); font-size: 10.5px; fill: var(--text-3); text-anchor: middle; dominant-baseline: central; }
.flow .t-ok { fill: var(--ok); }
.flow .t-amber { fill: var(--amber); }
.flow .chip { fill: var(--surface-2); stroke: var(--line); }
.flow .chip-t { font-family: var(--font-mono); font-size: 9.5px; fill: var(--text-2); text-anchor: middle; dominant-baseline: central; }
.flow .raw { fill: var(--amber); }
.flow .clean { fill: var(--ok); }
.flow .pkt-live { fill: var(--ok); }
.flow .region { fill: none; stroke: var(--line-2); stroke-dasharray: 4 5; }
.flow .t-start { text-anchor: start; }
.flow .pkt-accent { fill: var(--accent); }
.flow .inflight { fill: var(--amber); animation: inflight 2.4s ease-in-out infinite; }
.flow .inflight:nth-of-type(2) { animation-delay: .4s; }
.flow .inflight:nth-of-type(3) { animation-delay: .8s; }
@keyframes inflight { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- Agent UIs (analyst, SME agent) ---------- */

.agent-ui {
  width: 100%;
  max-width: 440px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13.5px;
}
.agent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--ok);
  background: var(--ok-soft);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bubble {
  margin: 0 0 12px auto;
  width: fit-content;
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px 14px 4px 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px;
}
.steps { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.step {
  display: grid;
  grid-template-columns: 18px 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  transition: background-color .3s;
}
.step b { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--text); }
.step span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .ico {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11px;
  line-height: 1;
}
.step .ico::before { content: "✓"; }
.approve {
  display: none;
  justify-self: end;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 11.5px;
  font-weight: 500;
}
.agent-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 8px 0; border-top: 1px dashed var(--line-2); font-family: var(--font-mono); font-size: 11.5px; color: var(--ok); }

.is-armed .step:not(.is-run):not(.is-done) .ico { background: transparent; border: 1.5px solid var(--line-2); }
.is-armed .step:not(.is-run):not(.is-done) .ico::before { content: ""; }
.is-armed .step:not(.is-run):not(.is-done) b,
.is-armed .step:not(.is-run):not(.is-done) span { opacity: .45; }
.is-armed .step.is-run { background: var(--surface-2); }
.is-armed .step.is-run .ico { background: transparent; border: 1.5px solid var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.is-armed .step.is-run .ico::before { content: ""; }
.is-armed .step.is-run[data-wait] .ico { border: 0; background: var(--amber-soft); color: var(--amber); animation: none; }
.is-armed .step.is-run[data-wait] .ico::before { content: "❚❚"; font-size: 7px; letter-spacing: -1px; }
.is-armed .step.is-run[data-wait] { grid-template-columns: 18px 74px minmax(0, 1fr) auto; }
.is-armed .step.is-run[data-wait] .approve { display: inline-block; animation: nudge 1.4s var(--ease) infinite; }
.is-armed .agent-foot { opacity: 0; transition: opacity .4s; }
.is-armed.is-complete .agent-foot { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 30%, transparent); } 60% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- Ledger lookup (reconciliation) ---------- */

.ledger {
  width: 100%;
  max-width: 460px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.ledger-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.ledger-search {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
}
.ledger-search .icon { width: 14px; height: 14px; color: var(--text-3); }
.ledger-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; }
.ledger-line .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.ledger-paid { margin-top: 14px; color: var(--text-2); }
.ledger-paid .v { font-size: 15px; }
.ledger-rows { display: grid; gap: 2px; margin: 10px 0 0; padding: 8px 0; list-style: none; border-block: 1px dashed var(--line-2); }
.ledger-rows li { padding: 4px 0; font-size: 12.5px; color: var(--text-2); }
.ledger-rows small { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.ledger-rows .minus .v { color: var(--amber); }
.ledger-sum { margin-top: 10px; font-weight: 500; color: var(--text); }
.ledger-diff { margin-top: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--ok); }
.ledger-diff .v { color: var(--ok); }
.js .reveal .ledger-rows li, .js .reveal .ledger-sum, .js .reveal .ledger-diff { opacity: 0; }
.js .reveal.is-in .ledger-rows li,
.js .reveal.is-in .ledger-sum,
.js .reveal.is-in .ledger-diff { animation: line-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 140ms + 350ms); }

/* ---------- Gantt (pipeline) ---------- */

.gantt { width: 100%; max-width: 440px; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.gantt-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; }
.gantt-row + .gantt-row { margin-top: 18px; }
.gantt-label { line-height: 1.35; }
.gantt-label b { display: block; font-weight: 500; color: var(--text); }
.gantt-lanes { position: relative; display: grid; gap: 5px; padding: 6px 0; }
.gantt-lanes::after {
  content: "";
  position: absolute; top: -4px; bottom: -4px;
  left: var(--end);
  width: 0;
  border-left: 1px dashed var(--text-3);
}
.lane { position: relative; height: 12px; border-radius: 4px; background: var(--surface-2); }
.lane i {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--s) * 1%);
  width: calc(var(--w) * 1% - 2px);
  border-radius: 4px;
  background: var(--text-3);
  opacity: .55;
  transform-origin: 0 50%;
}
.gantt-row--fast .lane i { background: var(--accent); opacity: .9; }
.gantt-axis { display: flex; justify-content: space-between; margin: 10px 0 0 104px; }
.js .reveal .lane i { transform: scaleX(0); }
.js .reveal.is-in .lane i { animation: grow .6s var(--ease) forwards; animation-delay: calc(var(--s) * 28ms + 300ms); }
@keyframes grow { to { transform: scaleX(1); } }

/* ---------- More projects ---------- */

.more { margin-top: clamp(56px, 7vw, 88px); }
.more-title {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 400;
}
.more-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.more-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, .9fr);
  gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color .3s;
}
.more-item h4 { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.more-item p { font-size: 15px; color: var(--text-2); text-wrap: pretty; }
.more-item .stack { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); text-align: right; }
@media (max-width: 860px) {
  .more-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .more-item .stack { text-align: left; }
}

/* ---------- Experience ---------- */

.timeline { border-top: 1px solid var(--line); }
.job {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.6fr);
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(36px, 5vw, 56px) 0;
  border-bottom: 1px solid var(--line);
}
.job-side { position: sticky; top: 100px; align-self: start; }
.job-period { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; color: var(--text-3); }
.job-role { margin-top: 12px; font-family: var(--font-serif); font-size: clamp(30px, 3vw, 40px); font-weight: 400; line-height: 1.04; letter-spacing: -.02em; }
.job-company { margin-top: 10px; font-size: 16px; color: var(--text-2); }
.job-company strong { font-weight: 500; color: var(--text); }
.job-now {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: 2px;
  color: var(--ok);
  background: var(--ok-soft);
}
.job-points { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.job-points li { position: relative; padding-left: 26px; color: var(--text-2); text-wrap: pretty; }
.job-points li::before { content: ""; position: absolute; left: 0; top: .78em; width: 12px; height: 1px; background: var(--accent); }
.job-points strong { font-weight: 500; color: var(--text); }
@media (max-width: 860px) {
  .job { grid-template-columns: minmax(0, 1fr); }
  .job-side { position: static; }
}

/* ---------- Engineering log ---------- */

.log-term .term-body { padding: 20px 22px 24px; font-size: 13.5px; }
.log { display: grid; gap: 2px; margin: 14px 0 0; padding: 0; list-style: none; }
.log li {
  display: grid;
  grid-template-columns: 7ch 13ch minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  margin: 0 -10px;
  padding: 7px 10px;
  border-radius: 8px;
  transition: background-color .2s;
}
.log li:hover { background: rgba(255, 255, 255, .04); }
.log .hash { color: var(--amber); }
.log .type { color: var(--text-3); }
.log .type b { font-weight: 400; }
.log .t-feat b { color: var(--ok); }
.log .t-perf b { color: var(--accent-ink); }
.log .t-ops b { color: var(--blue); }
.log .msg { color: var(--text); text-wrap: pretty; }
.log .impact {
  padding: 1px 8px;
  border: 1px solid rgba(61, 220, 151, .3);
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--ok);
}
.js .log-term:not(.is-in) .log li { opacity: 0; }
.js .log-term.is-in .log li { animation: line-in .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 250ms); }
@keyframes line-in { from { opacity: 0; transform: translateX(-6px); } }
@media (max-width: 760px) {
  .log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .log .hash { display: none; }
  .log .impact { justify-self: start; margin-top: 4px; }
}

/* ---------- Skills ---------- */

.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.skill-group { padding: 28px; }
.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips li {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14px;
  transition: border-color .2s, transform .25s var(--ease);
}
.chips li:hover { border-color: var(--accent); transform: translateY(-1px); }
@media (max-width: 960px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .skills { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Education & recognition ---------- */

.honors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.honor { grid-column: span 2; display: flex; flex-direction: column; gap: 10px; min-height: 230px; padding: 28px; }
.honor--wide { grid-column: span 3; }
.honor p { font-size: 14px; color: var(--text-2); }
.honor .honor-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.honor .honor-value { font-family: var(--font-serif); font-size: clamp(40px, 4vw, 52px); line-height: 1; letter-spacing: -.02em; color: var(--text); }
.honor h3 { margin-top: auto; font-size: 16px; font-weight: 500; line-height: 1.35; }
@media (max-width: 1000px) {
  .honors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .honor, .honor--wide { grid-column: auto; }
}
@media (max-width: 560px) { .honors { grid-template-columns: minmax(0, 1fr); } .honor { min-height: 0; } }

/* ---------- Contact ---------- */

.contact { position: relative; overflow: hidden; padding: clamp(110px, 15vw, 200px) 0 clamp(80px, 10vw, 128px); border-top: 1px solid var(--line); }
.contact::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 85% 60%, #000 15%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 70% at 85% 60%, #000 15%, transparent 70%);
}
.contact .container { position: relative; }
.contact-title {
  margin-top: 22px;
  max-width: 13ch;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(54px, 9vw, 136px);
  line-height: .9;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.contact-title em { font-style: italic; color: var(--accent); }
.contact-lede { margin-top: 28px; max-width: 46ch; font-size: clamp(17px, 1.6vw, 19px); color: var(--text-2); text-wrap: pretty; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 40px; }

.email-pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 58px;
  padding: 0 6px 0 24px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  transition: box-shadow .3s;
}
.email-pill:hover { box-shadow: 0 18px 40px -18px var(--accent); }
.email-pill a { display: inline-flex; align-items: center; gap: 10px; font-size: clamp(15px, 1.6vw, 17px); font-weight: 500; }
.copy {
  display: inline-flex; align-items: center; gap: 6px;
  height: 46px;
  margin-left: 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 14%, transparent);
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color .2s;
}
.copy:hover { background: color-mix(in srgb, var(--bg) 24%, transparent); }
.copy .icon { width: 15px; height: 15px; }
.copy .i-check { display: none; }
.copy.is-copied .i-check { display: block; }
.copy.is-copied .i-copy { display: none; }
.contact-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 36px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); }

/* ---------- Footer ---------- */

.footer { padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-3); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer ul { display: flex; flex-wrap: wrap; gap: 18px; margin: 0; padding: 0; list-style: none; }
.footer a { transition: color .2s; }
.footer a:hover { color: var(--text); }

/* ---------- 404 ---------- */

.lost { display: grid; place-items: center; min-height: 100vh; padding: 96px var(--gutter); text-align: center; }
.lost-code { font-family: var(--font-mono); font-size: 13px; letter-spacing: .2em; color: var(--accent-ink); }
.lost h1 { margin-top: 18px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(48px, 8vw, 96px); line-height: .95; letter-spacing: -.03em; }
.lost p { margin: 18px auto 32px; max-width: 40ch; color: var(--text-2); }

/* ---------- Links on cards ---------- */

.project-title a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .45s var(--ease);
}
.project-title a:hover { background-size: 100% 1px; }
.cs-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14.5px; font-weight: 500; color: var(--text); }
.cs-link .icon { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.cs-link:hover .icon, .card:hover .cs-link .icon { transform: translate(3px, -3px); }
.metrics--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.more-item h4 a { transition: color .2s; }
.more-item h4 a:hover, .row-link:hover { color: var(--accent-ink); }
.row-link { color: var(--text); white-space: nowrap; }
.flow .arrowhead { fill: var(--text-3); }

.pill--wait { color: var(--accent-ink); background: var(--accent-soft); }
.pill--hold { color: var(--amber); background: var(--amber-soft); }
.pill--wait, .pill--hold { display: none; }
.is-armed:not(.is-complete) .pill--ok { display: none; }
.is-armed:not(.is-complete):not(.is-waiting) .pill--wait { display: inline-flex; }
.is-armed.is-waiting .pill--hold { display: inline-flex; }

/* ---------- Case studies ---------- */

.cs-hero { position: relative; padding: clamp(112px, 15vh, 152px) 0 0; }
.cs-hero::before {
  content: "";
  position: absolute; inset: 0 0 -120px;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 50% 60% at 88% 18%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse 50% 60% at 88% 18%, #000 20%, transparent 70%);
}
.cs-hero .container { position: relative; }
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0; padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line-2); }
.crumbs a { transition: color .2s; }
.crumbs a:hover { color: var(--text); }
.cs-kicker { margin-top: 30px; }
.cs-title {
  margin-top: 18px;
  max-width: 21ch;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(42px, 6vw, 82px);
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.cs-title em { font-style: italic; }
.cs-dek { margin-top: 24px; max-width: 60ch; font-size: clamp(18px, 1.8vw, 21px); line-height: 1.55; color: var(--text-2); text-wrap: pretty; }
.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.cs-meta dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.cs-meta dd { margin-top: 6px; font-size: 15px; line-height: 1.45; }
@media (max-width: 760px) { .cs-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cs-numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 28px; }
.cs-number {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cs-number dd { font-family: var(--font-serif); font-size: clamp(38px, 3.6vw, 50px); line-height: 1; letter-spacing: -.02em; }
.cs-number dt { font-size: 13.5px; line-height: 1.45; color: var(--text-2); }

.cs-figure {
  position: relative;
  display: grid; justify-items: center;
  margin: clamp(28px, 4vw, 48px) 0 0;
  padding: clamp(28px, 5vw, 64px) clamp(14px, 4vw, 48px) clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(120% 100% at 50% 0%, var(--surface-2), var(--surface));
  overflow: hidden;
}
.cs-figure::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
}
.cs-figure > * { position: relative; }
.cs-figure .flow { max-width: 680px; }
.cs-figure .agent-ui { max-width: 480px; }
.cs-figure .gantt { max-width: 560px; }
.cs-figure figcaption { margin-top: 22px; max-width: 64ch; font-size: 13.5px; line-height: 1.5; text-align: center; color: var(--text-3); }

.cs-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  padding: clamp(56px, 8vw, 104px) 0 clamp(64px, 8vw, 112px);
}
.toc { position: sticky; top: 100px; align-self: start; }
.toc-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.toc ol { display: grid; margin: 14px 0 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.toc a {
  display: block;
  margin-left: -1px;
  padding: 7px 0 7px 16px;
  border-left: 1px solid transparent;
  font-size: 14px;
  color: var(--text-3);
  transition: color .2s, border-color .2s;
}
.toc a:hover { color: var(--text); }
.toc a[aria-current] { color: var(--text); border-left-color: var(--accent); }
.toc-meta { margin-top: 24px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7; color: var(--text-3); }
@media (max-width: 960px) {
  .cs-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}

.prose { max-width: 70ch; font-size: 18px; line-height: 1.75; color: var(--text-2); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  margin-top: 2.6em;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.06;
  letter-spacing: -.02em;
  color: var(--text);
  text-wrap: balance;
  scroll-margin-top: 96px;
}
.prose h2 .n {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.prose h3 { margin-top: 2em; font-size: 20px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; color: var(--text); }
.prose strong { font-weight: 500; color: var(--text); }
.prose em { color: var(--text); }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--accent-ink); }

.tldr { padding: 22px 24px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 14px; background: var(--surface); font-size: 16.5px; line-height: 1.65; }
.tldr b { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }

.prose .pull {
  margin-block: 1.8em;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--text);
  text-wrap: balance;
}
.pull::before { content: "\201C"; display: block; height: .55em; font-size: 1.8em; line-height: 1; color: var(--accent); }

.callout { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); font-size: 16px; line-height: 1.65; }
.callout .k {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: 1px;
  color: var(--amber);
  background: var(--amber-soft);
}
.callout--ok .k { color: var(--ok); background: var(--ok-soft); }

.code-block {
  margin-top: 1.4em;
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: #0d0d0f;
  color: #e6e6e0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  tab-size: 4;
}
.code-block code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.code-block .c { color: #8a8a92; }
.code-block .k { color: #ff8b64; }
.code-block .s { color: #3ddc97; }
.code-block .f { color: #7aa2ff; }
.prose .code-cap { margin-top: .6em; font-size: 13.5px; color: var(--text-3); }

.steps-list { display: grid; gap: 12px; padding: 0 !important; list-style: none; counter-reset: s; }
.steps-list > li {
  position: relative;
  padding: 16px 18px 16px 60px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  counter-increment: s;
  font-size: 16.5px;
  line-height: 1.6;
}
.prose .steps-list > li + li { margin-top: 0; }
.steps-list > li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 20px; top: 17px; font-family: var(--font-mono); font-size: 13px; color: var(--accent-ink); }

.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare > div { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 16px; line-height: 1.6; }
.compare h4 { margin-bottom: 8px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.compare .after { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.compare .after h4 { color: var(--ok); }
@media (max-width: 640px) { .compare { grid-template-columns: minmax(0, 1fr); } }

.cs-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 2.6em !important;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.cs-cta p { max-width: 40ch; font-size: 17px; line-height: 1.5; color: var(--text); }
.cs-cta div { display: flex; flex-wrap: wrap; gap: 10px; }

.cs-next { border-top: 1px solid var(--line); }
.cs-next a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; padding: clamp(48px, 7vw, 88px) 0; }
.cs-next-k { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.cs-next-t { margin-top: 14px; font-family: var(--font-serif); font-size: clamp(36px, 5.4vw, 72px); line-height: 1; letter-spacing: -.03em; text-wrap: balance; }
.cs-next-d { margin-top: 14px; max-width: 56ch; color: var(--text-2); }
.cs-next .arrow {
  display: grid; place-items: center;
  width: 72px; height: 72px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  transition: transform .45s var(--ease), background-color .3s, color .3s;
}
.cs-next .arrow .icon { width: 24px; height: 24px; }
.cs-next a:hover .arrow { transform: translateX(6px); background: var(--text); color: var(--bg); }
@media (max-width: 560px) { .cs-next .arrow { width: 52px; height: 52px; } }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .log-term .log li { opacity: 1; }
  .js .reveal .lane i { transform: none; }
  .js .reveal .ledger-rows li, .js .reveal .ledger-sum, .js .reveal .ledger-diff { opacity: 1; }
  .sys .pkt, .flow .pkt { display: none; }
  .progress { display: none; }
}
