/* ==========================================================================
   rakshithmuda22.github.io — the site is an agent trace that passes its own contract
   ========================================================================== */

/* ---------- Fonts (self-hosted, Latin subset, OFL) ---------- */
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-var.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
/* metric-matched fallbacks keep the swap from shifting layout */
@font-face { font-family: "Bricolage Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Roboto"); size-adjust: 97%; ascent-override: 96%; descent-override: 28%; line-gap-override: 0%; }
@font-face { font-family: "Serif Fallback"; font-style: italic; src: local("Times New Roman Italic"), local("Georgia Italic"), local("Times New Roman"), local("Georgia"); size-adjust: 92%; }
@font-face { font-family: "Mono Fallback"; src: local("Menlo"), local("Consolas"), local("DejaVu Sans Mono"); size-adjust: 96%; }

/* ---------- Tokens ---------- */
:root {
  --ink-0: #100f0d;   /* page */
  --ink-1: #161411;   /* chapter panels */
  --ink-2: #1e1b17;
  --ink-3: #2a2621;
  --fg: #efeae0;
  --fg-2: #b8b1a5;
  --fg-3: #8e877c;
  --line: rgba(239, 234, 224, .11);
  --line-2: rgba(239, 234, 224, .22);
  --accent: #ff5b1f;          /* signal orange — the only accent */
  --accent-hi: #ff7a45;
  --on-accent: #140e0a;
  --on-accent-2: rgba(20, 14, 10, .64);
  --pass: #3ccf7c;            /* only for verdicts */

  --f-display: "Bricolage", "Bricolage Fallback", system-ui, sans-serif;
  --f-serif: "Instrument Serif", "Serif Fallback", Georgia, serif;
  --f-mono: "Geist Mono", "Mono Fallback", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-out-soft: cubic-bezier(.22, 1, .36, 1);
  --ease-inout: cubic-bezier(.76, 0, .24, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --gutter: clamp(16px, 2.6vw, 44px);
  --rail: 22px;
  --nav-h: 56px;
  --pad-x: calc(var(--gutter) + var(--rail));
  --sec-y: clamp(96px, 14vh, 180px);
}
@media (min-width: 900px) { :root { --rail: clamp(40px, 4vw, 72px); --nav-h: 64px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 8px); }
html:not(.lenis) { scroll-behavior: smooth; }
html.rm { scroll-behavior: auto; }
body {
  margin: 0; background: var(--ink-0); color: var(--fg);
  font: 400 1rem/1.6 var(--f-display); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
code, kbd, pre, time { font-family: var(--f-mono); }
code { font-size: .9em; letter-spacing: -.01em; }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, pre { margin: 0; padding: 0; }
ol, ul { list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.i { width: 1em; height: 1em; flex: none; }
.no-js [data-js-only] { display: none !important; }
main { position: relative; z-index: 2; outline: none; }
main:focus { outline: none; }

.skip {
  position: fixed; left: var(--gutter); top: 10px; z-index: 100;
  padding: 10px 16px; background: var(--fg); color: var(--ink-0); border-radius: 999px;
  font: 500 14px/1 var(--f-display); transform: translateY(-160%); transition: transform .4s var(--ease-out);
}
.skip:focus { transform: none; }

/* shared section padding */
.hero, .manifesto__inner, .work__head, .anatomy__pin, .chapter__inner, .more, .pg, .about, .xp, .contact__inner, .colophon {
  padding-left: var(--pad-x); padding-right: var(--gutter);
}

/* ---------- Pills, links ---------- */
.pill {
  --pill-bg: transparent; --pill-fg: var(--fg); --pill-hover-bg: var(--fg); --pill-hover-fg: var(--ink-0);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--pill-bg); color: var(--pill-fg);
  font: 500 15px/1 var(--f-display); letter-spacing: -.005em; white-space: nowrap;
  transition: color .45s var(--ease-out), border-color .45s var(--ease-out), transform .5s var(--ease-out);
}
.pill::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--pill-hover-bg); transform: translateY(101%); transition: transform .55s var(--ease-out);
}
.pill .i { font-size: 13px; transition: transform .5s var(--ease-out); }
.pill:hover, .pill:focus-visible { color: var(--pill-hover-fg); }
.pill:hover::before, .pill:focus-visible::before { transform: none; }
.pill:hover .i use[href="#i-ne"], .pill:hover .i { transform: translate(1px, -1px); }
.pill:hover .i--down { transform: translateY(2px); }
.pill--accent { --pill-bg: var(--accent); --pill-fg: var(--on-accent); --pill-hover-bg: var(--fg); --pill-hover-fg: var(--ink-0); }
.pill--line { box-shadow: inset 0 0 0 1px var(--line-2); }
.pill--line:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.pill--solid { --pill-bg: var(--fg); --pill-fg: var(--ink-0); --pill-hover-bg: var(--accent); --pill-hover-fg: var(--on-accent); height: 38px; padding: 0 16px; font-size: 14px; }
.pill--ghost { height: 38px; padding: 0 14px; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.pill:active { transform: scale(.97); }

.textlink {
  display: inline-flex; align-items: center; gap: .45em; position: relative; padding-block: 4px;
  color: var(--fg-2); font-size: 15px; transition: color .3s var(--ease-out);
}
.textlink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .6s var(--ease-out);
}
.textlink:hover { color: var(--fg); }
.textlink:hover::after { transform: scaleX(1); transform-origin: left; }

.iconbtn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  color: var(--fg-2); transition: background .3s var(--ease-out), color .3s var(--ease-out);
}
.iconbtn:hover { background: var(--ink-3); color: var(--fg); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); }
.dot--live { background: var(--accent); box-shadow: 0 0 0 0 rgba(255, 91, 31, .55); animation: live 2.4s var(--ease-out) infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 91, 31, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(255, 91, 31, 0); } }

kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(239, 234, 224, .04);
  font: 500 11px/1 var(--f-mono); color: var(--fg-2);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: 20px; padding: 0 var(--gutter);
  transition: background .5s var(--ease-out), box-shadow .5s var(--ease-out), height .5s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(16, 15, 13, .72); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}
.nav__mark { display: inline-flex; align-items: center; height: 40px; padding-right: 4px; }
.nav__mono {
  font: 800 19px/1 var(--f-display); font-stretch: 75%; letter-spacing: .02em;
  padding: 7px 9px 6px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--fg);
  transition: background .4s var(--ease-out), color .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.nav__mark:hover .nav__mono { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.nav__status { display: flex; align-items: center; gap: 9px; font: 400 12px/1.2 var(--f-mono); color: var(--fg-2); letter-spacing: .01em; }
.nav__links { display: none; margin-left: auto; gap: 4px; }
.nav__links a {
  position: relative; padding: 10px 12px; font-size: 15px; color: var(--fg-2); transition: color .3s var(--ease-out);
}
.nav__links a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-out);
}
.nav__links a:hover, .nav__links a[aria-current="true"] { color: var(--fg); }
.nav__links a:hover::after, .nav__links a[aria-current="true"]::after { transform: scaleX(1); transform-origin: left; }
.nav__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.kbd-hint { display: none; gap: 3px; padding: 6px; border-radius: 8px; transition: background .3s var(--ease-out); }
.kbd-hint:hover { background: var(--ink-2); }
.nav__email { display: none; }
.nav.is-scrolled .nav__email { display: inline-flex; }
.nav__menu {
  height: 38px; padding: 0 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2);
  font: 500 14px/1 var(--f-display);
}
.nav .pill--solid { display: none; }
.nav.is-scrolled .pill--solid { display: inline-flex; }
.nav.on-accent.is-scrolled { background: rgba(255, 91, 31, .9); box-shadow: 0 1px 0 rgba(20, 14, 10, .16); color: var(--on-accent); }
.nav.on-accent .nav__mono { box-shadow: inset 0 0 0 1.5px var(--on-accent); }
.nav.on-accent .nav__mark:hover .nav__mono { background: var(--on-accent); color: var(--accent); }
.nav.on-accent .nav__status { color: var(--on-accent-2); }
.nav.on-accent .dot--live { background: var(--on-accent); animation: none; }
.nav.on-accent .nav__links a { color: var(--on-accent-2); }
.nav.on-accent .nav__links a:hover, .nav.on-accent .nav__links a[aria-current="true"] { color: var(--on-accent); }
.nav.on-accent .nav__links a::after { background: var(--on-accent); }
.nav.on-accent kbd { color: var(--on-accent); box-shadow: inset 0 0 0 1px rgba(20, 14, 10, .3); background: transparent; }
.nav.on-accent .kbd-hint:hover { background: rgba(20, 14, 10, .08); }
.nav.on-accent .pill--ghost, .nav.on-accent .nav__menu { color: var(--on-accent); box-shadow: inset 0 0 0 1px rgba(20, 14, 10, .3); --pill-hover-bg: var(--on-accent); --pill-hover-fg: var(--accent); }
.nav.on-accent .pill--solid { --pill-bg: var(--on-accent); --pill-fg: var(--fg); --pill-hover-bg: var(--fg); --pill-hover-fg: var(--on-accent); }
@media (max-width: 899px) {
  .nav.is-scrolled .nav__status { display: none; }
  .nav.is-scrolled .nav__email { height: 38px; }
}
@media (min-width: 560px) { .nav .pill--solid { display: inline-flex; } }
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__actions { margin-left: 8px; }
  .kbd-hint { display: inline-flex; }
  .nav__menu { display: none; }
  .no-js .kbd-hint { display: none; }
}
@media (max-width: 1100px) and (min-width: 900px) { .nav__status span:last-child { display: none; } }

/* ---------- Stage (3D canvas) ---------- */
.stage { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1s var(--ease-out); }
.stage__canvas { width: 100%; height: 100%; }
.has-core .stage.is-on { opacity: 1; }

/* ---------- Spine + nodes ---------- */
.spine { position: absolute; top: calc(var(--nav-h) + 14px); bottom: 0; left: calc(var(--gutter) + 5px); width: 1px; z-index: 3; pointer-events: none; }
.spine__track { position: absolute; inset: 0; background: linear-gradient(var(--line) 60%, transparent); }
.spine__fill {
  position: absolute; left: 0; top: 0; width: 1px; height: 100%;
  background: linear-gradient(to bottom, rgba(255, 91, 31, 0), var(--accent) 120px);
  transform-origin: top; transform: scaleY(var(--spine, 0));
}
.spine__fill::after {
  content: ""; position: absolute; left: -3px; bottom: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px 2px rgba(255, 91, 31, .6);
  transform: scaleX(calc(1 / max(var(--spine, 1), .0001))) scaleY(calc(1 / max(var(--spine, 1), .0001)));
  transform-origin: 50% 100%;
  display: none;
}
.no-js .spine__fill { display: none; }

.node {
  position: relative; z-index: 4; display: flex; align-items: center; flex-wrap: wrap; row-gap: 4px;
  margin-left: calc(-1 * var(--rail)); margin-bottom: clamp(18px, 3vh, 32px);
  font: 400 11.5px/1.2 var(--f-mono); color: var(--fg-3); letter-spacing: .01em;
}
.node__dot { position: relative; flex: 0 0 var(--rail); height: 11px; }
.node__dot::before {
  content: ""; position: absolute; left: 0; top: 0; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink-0); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background .5s var(--ease-out), box-shadow .5s var(--ease-out), transform .6s var(--ease-spring);
}
.node__ts { color: var(--fg-3); min-width: 9.5ch; }
.node__kw { margin: 0 .9ch 0 1.4ch; color: var(--fg-3); }
.node__call { font-size: 1em; color: var(--fg-2); }
.node__assert { margin-left: 1.6ch; color: var(--pass); opacity: 0; transform: translateX(-6px); transition: opacity .5s var(--ease-out), transform .6s var(--ease-out); }
.node.is-lit .node__dot::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 91, 31, .16), 0 0 18px rgba(255, 91, 31, .5); transform: scale(1.05); }
.node.is-lit .node__ts { color: var(--fg); }
.node.is-lit .node__call { color: var(--fg); }
.node.is-lit .node__assert { opacity: 1; transform: none; }
.node--ink, .node--ink .node__ts, .node--ink .node__kw { color: var(--on-accent-2); }
.node--ink .node__call { color: var(--on-accent); }
.node--ink .node__dot::before { background: var(--accent); box-shadow: inset 0 0 0 1px rgba(20, 14, 10, .45); }
.node--ink.is-lit .node__dot::before { background: var(--on-accent); box-shadow: 0 0 0 4px rgba(20, 14, 10, .14); }
.node--ink.is-lit .node__ts { color: var(--on-accent); }
.node--ink .node__assert { color: var(--on-accent); }

.eyebrow { font: 400 12px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }

/* ---------- Mega headings ---------- */
.mega {
  font-weight: 800; font-stretch: 75%; text-transform: uppercase;
  font-size: clamp(3.4rem, 13.2vw, 15rem); line-height: .8; letter-spacing: -.008em;
  margin-left: -.04em;
}
.mega em {
  display: inline-block; text-transform: none; font-size: 1.04em; line-height: .8; letter-spacing: -.035em;
  color: var(--accent); padding-right: .06em; margin-left: .04em;
}
.mega .line-mask, .contact__title .line-mask { padding-bottom: .06em; margin-bottom: -.06em; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr);
  padding-top: calc(var(--nav-h) + clamp(18px, 4.5vh, 64px)); padding-bottom: 28px; row-gap: 20px;
}
.hero__copy { display: flex; flex-direction: column; align-items: flex-start; position: relative; z-index: 2; min-width: 0; }
.hero .node { margin-bottom: clamp(14px, 2.4vh, 28px); }
.hero__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: clamp(12px, 2vh, 22px); }
.hero__name { font: 650 clamp(1.15rem, 1.7vw, 1.6rem)/1.1 var(--f-display); letter-spacing: -.015em; }
.hero__role { font: 400 12px/1.2 var(--f-mono); color: var(--fg-2); letter-spacing: .06em; text-transform: uppercase; }
.hero__title {
  font-weight: 640; font-size: clamp(2.45rem, min(6.4vw, 10.6vh), 7.4rem); line-height: .96; letter-spacing: -.038em;
  max-width: 13.2em; text-wrap: balance;
}
.hero__title em { font-size: 1.07em; letter-spacing: -.03em; color: var(--accent); padding-right: .05em; }
.hero__title .char { display: inline-block; will-change: transform; }
.hero__sub { margin-top: clamp(16px, 2.6vh, 30px); max-width: 52ch; font-size: clamp(.98rem, 1.15vw, 1.13rem); line-height: 1.55; color: var(--fg-2); text-wrap: pretty; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(18px, 3vh, 34px); }
.hero__links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 16px; }
.hero__links a { display: inline-flex; align-items: center; gap: .4em; padding: 6px 0; font-size: 15px; color: var(--fg-2); position: relative; transition: color .3s var(--ease-out); }
.hero__links a .i { font-size: 12px; transition: transform .5s var(--ease-out); }
.hero__links a::after { content: ""; position: absolute; left: 0; right: 1.2em; bottom: 3px; height: 1px; background: var(--fg); transform: scaleX(0); transform-origin: right; transition: transform .55s var(--ease-out); }
.hero__links a:hover { color: var(--fg); }
.hero__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.hero__links a:hover .i { transform: translate(2px, -2px); }

.proof { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(16px, 2.8vh, 30px); }
.proof > li {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 12px 8px 10px; border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--fg-2); background: rgba(239, 234, 224, .025);
}
.proof > li.is-link { padding: 0; }
.proof > li.is-link > a { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 12px 8px 10px; border-radius: 6px; transition: box-shadow .3s var(--ease-out), color .3s var(--ease-out); }
.proof > li.is-link > a:hover { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--fg); }
.proof__k { font: 500 12px/1 var(--f-mono); color: var(--fg); letter-spacing: .01em; }
.proof code { font-size: 12px; color: var(--accent-hi); }

.hero__core { position: relative; width: min(100%, 520px); aspect-ratio: 1; margin: 6px auto 0; }
.hero__poster { width: 100%; height: 100%; object-fit: contain; transition: opacity .9s var(--ease-out); }
.has-core .hero__poster { opacity: 0; }

.bootlog { font: 400 11px/1.65 var(--f-mono); color: var(--fg-3); width: min(100%, 360px); }
.bootlog__head { display: flex; justify-content: space-between; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--fg-2); letter-spacing: .04em; }
.bootlog__lines li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bootlog__lines .t { color: var(--fg-3); }
.bootlog__lines .k { display: inline-block; min-width: 6ch; color: var(--accent-hi); }
.bootlog__lines .ok { color: var(--fg); }
.bootlog__lines li.is-new { animation: bootin .5s var(--ease-out) both; }
@keyframes bootin { from { opacity: 0; transform: translateX(-6px); } }

@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 7.2fr) minmax(0, 4.8fr); grid-template-rows: 1fr auto; column-gap: 3vw;
    padding-bottom: clamp(22px, 4vh, 48px);
  }
  .hero__copy { grid-column: 1; grid-row: 1 / span 2; align-self: end; }
  .hero__core { position: absolute; top: calc(var(--nav-h) + (100svh - var(--nav-h)) * 0.44); right: calc(var(--gutter) + 1vw); width: min(36vw, 62svh); margin: 0; transform: translateY(-50%); }
  .bootlog { grid-column: 2; grid-row: 2; justify-self: end; align-self: end; }
}
@media (max-width: 1023px) {
  .hero__core { width: min(88vw, 460px); }
}

/* ==========================================================================
   MANIFESTO — full-bleed signal orange
   ========================================================================== */
.manifesto { position: relative; z-index: 4; background: var(--accent); color: var(--on-accent); }
.manifesto::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) + 5px); width: 1px; background: rgba(20, 14, 10, .22); }
.manifesto__inner { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: var(--sec-y); }
.manifesto__text {
  font-weight: 620; font-size: clamp(1.85rem, 4.75vw, 5.6rem); line-height: 1.04; letter-spacing: -.035em;
  max-width: 17.5em; text-wrap: pretty;
}
.manifesto__text em { font-size: 1.08em; letter-spacing: -.02em; }
.manifesto__text .w { transition: opacity .2s linear; }
.manifesto.is-armed .w { opacity: var(--o, .2); }
.ref {
  display: inline-block; vertical-align: super; margin: 0 .2em 0 .25em; padding: .4em .55em .35em; border-radius: 999px;
  font: 500 max(11px, .17em)/1 var(--f-mono); letter-spacing: .02em; text-transform: lowercase;
  box-shadow: inset 0 0 0 1px rgba(20, 14, 10, .55); transform: translateY(-.2em);
  transition: background .3s var(--ease-out), color .3s var(--ease-out);
}
.ref:hover { background: var(--on-accent); color: var(--accent); }
.manifesto :focus-visible, .contact :focus-visible { outline-color: var(--on-accent); }

/* ==========================================================================
   WORK
   ========================================================================== */
.work { position: relative; }
.work__head { padding-top: var(--sec-y); padding-bottom: clamp(24px, 5vh, 64px); }

/* Anatomy — the exploded core */
.anatomy { position: relative; }
.anatomy__pin { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; row-gap: 24px; padding-block: 40px; }
.anatomy__copy { max-width: 34ch; position: relative; z-index: 2; }
.anatomy__title { margin: 14px 0 14px; font-weight: 700; font-stretch: 85%; font-size: clamp(2rem, 4vw, 3.6rem); line-height: .98; letter-spacing: -.03em; }
.anatomy__title em { color: var(--accent); font-size: 1.06em; }
.anatomy__lede { color: var(--fg-2); font-size: 15.5px; line-height: 1.6; }
.anatomy__stage { position: relative; width: 100%; height: 72svh; min-height: 460px; }
.anatomy__poster { position: absolute; left: 0; top: 0; width: 58%; height: 100%; object-fit: contain; object-position: center; transition: opacity .9s var(--ease-out); }
.has-core .anatomy__poster { opacity: 0; }
.anatomy__labels { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 42%; display: grid; gap: 14px; }
.anatomy__labels a {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; padding: 8px 0 8px 10px;
  border-left: 1px solid var(--line-2); transition: border-color .4s var(--ease-out);
}
.al__no { grid-row: span 2; font: 500 11px/1.4 var(--f-mono); color: var(--accent); }
.al__layer { font: 500 11px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.al__proj { font: 600 clamp(15px, 1.5vw, 22px)/1.1 var(--f-display); letter-spacing: -.015em; transition: color .3s var(--ease-out); }
.anatomy__labels a:hover { border-color: var(--accent); }
.anatomy__labels a:hover .al__proj { color: var(--accent-hi); }

/* when the live core runs, labels are pinned to the 3D layers by JS */
.has-core .anatomy__labels { inset: 0; transform: none; width: auto; display: block; }
.has-core .anatomy__labels li { position: absolute; left: 0; top: 0; will-change: transform, opacity; opacity: 0; }
.has-core .anatomy__labels a { border-left: 0; padding: 6px 0 6px 0; position: relative; }
.has-core .anatomy__labels a::before {
  content: ""; position: absolute; right: calc(100% + 8px); top: 50%; width: var(--lead, 40px); height: 1px;
  background: linear-gradient(to left, var(--line-2), rgba(239, 234, 224, .05));
}
.has-core .anatomy__labels a::after {
  content: ""; position: absolute; right: calc(100% + 8px + var(--lead, 40px) - 3px); top: calc(50% - 3px); width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px rgba(255, 91, 31, .7);
}

@media (min-width: 1024px) {
  .anatomy__pin { grid-template-columns: minmax(0, 3.3fr) minmax(0, 8.7fr); column-gap: 3vw; align-items: center; height: 100svh; padding-block: calc(var(--nav-h) + 20px) 40px; }
  .anatomy__stage { min-height: 0; height: min(86svh, 920px); }
}

/* Chapters */
.chapters { position: relative; }
.chapter { position: relative; background: var(--ink-1); border-top: 1px solid var(--line); }
.chapter:nth-child(even) { background: #13110f; }
.chapter__inner {
  display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 26px;
  padding-block: clamp(64px, 10vh, 120px) clamp(56px, 8vh, 96px); transform-origin: 50% 30%;
}
.chapter__index { display: flex; align-items: baseline; gap: 4px; font: 400 12px/1 var(--f-mono); color: var(--fg-3); margin-bottom: 10px; }
.chapter__no { color: var(--accent); font-weight: 500; }
.chapter__layer { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line-2); letter-spacing: .1em; text-transform: uppercase; }
.chapter__title {
  font-weight: 760; font-stretch: 80%; font-size: clamp(3.1rem, 9.6vw, 10rem); line-height: .86; letter-spacing: -.032em;
  margin-left: -.04em;
}
.chapter__title--long { font-size: clamp(2.6rem, 7vw, 7.4rem); line-height: .9; }
.chapter__pitch { margin-top: 16px; max-width: 34ch; font-size: clamp(1.15rem, 1.9vw, 1.7rem); line-height: 1.22; letter-spacing: -.015em; color: var(--fg); }
.chapter__pitch em { color: var(--accent-hi); font-size: 1.08em; }
.chapter__facts { display: grid; row-gap: 18px; max-width: 64ch; }
.chapter__facts > div { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.chapter__facts dt { font: 400 11.5px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.chapter__facts dd { font-size: 15.5px; line-height: 1.58; color: var(--fg-2); text-wrap: pretty; }
.chapter__facts dd strong { font-weight: 600; color: var(--fg); }
.chapter__facts code { color: var(--fg); font-size: .86em; padding: 1px 4px; border-radius: 4px; background: rgba(239, 234, 224, .06); }
.chapter__stack { display: flex; flex-wrap: wrap; gap: 6px; }
.chapter__stack li { padding: 5px 10px 4px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); font: 400 12px/1.3 var(--f-mono); color: var(--fg-2); }
.chapter__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.chapter__private { display: inline-flex; align-items: center; gap: 10px; font: 400 12.5px/1.3 var(--f-mono); color: var(--fg-2); padding: 12px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.chapter__private .dot { background: var(--accent); }
.todo { display: inline-block; padding: 2px 8px; border-radius: 4px; background: rgba(255, 91, 31, .1); box-shadow: inset 2px 0 0 var(--accent); font: 500 12px/1.6 var(--f-mono); color: var(--accent-hi); }

/* Terminal */
.chapter__side { display: grid; gap: 18px; align-content: start; min-width: 0; }
.term {
  position: relative; align-self: start; min-width: 0; border-radius: 10px; overflow: hidden;
  background: #0b0a09; box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px -40px rgba(0, 0, 0, .9);
}
.term__bar { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); font: 400 11.5px/1 var(--f-mono); color: var(--fg-3); }
.term__dots { display: inline-flex; gap: 6px; }
.term__dots::before, .term__dots::after, .term__dots { --d: radial-gradient(circle, transparent 3.5px, transparent 0); }
.term__dots { width: 42px; height: 8px; background:
  radial-gradient(circle at 4px 4px, var(--line-2) 3.4px, transparent 3.9px),
  radial-gradient(circle at 21px 4px, var(--line-2) 3.4px, transparent 3.9px),
  radial-gradient(circle at 38px 4px, var(--line-2) 3.4px, transparent 3.9px); }
.term__body { padding: 18px 18px 22px; height: min(420px, 62svh); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; font: 400 12.5px/1.65 var(--f-mono); color: var(--fg-2); white-space: pre-wrap; word-break: break-word; }
.term__body:focus-visible { outline-offset: -2px; }
.term--pending .term__body { height: auto; min-height: 0; padding-bottom: 18px; }
.term--pending .term__bar span::after { content: " · transcript pending"; color: var(--fg-3); }
.term .ln { display: block; }
.term .ln--cmd { color: var(--fg); }
.term .ln--cmd::before { content: ""; }
.term .ln--todo { color: var(--accent-hi); position: relative; padding: 8px 10px; margin: 8px 0 2px; border-radius: 4px; background: rgba(255, 91, 31, .07); box-shadow: inset 2px 0 0 var(--accent); }
.term .caret { display: inline-block; width: .62em; height: 1.15em; margin-left: 2px; vertical-align: -.2em; background: var(--fg); animation: caret 1.05s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

@media (min-width: 1024px) {
  .chapter__inner {
    grid-template-columns: minmax(0, 6.2fr) minmax(0, 4.8fr); grid-template-rows: auto 1fr auto; column-gap: 4.5vw; row-gap: 26px;
    min-height: 100svh; padding-block: calc(var(--nav-h) + 5vh) 5vh; align-content: start;
  }
  .chapter__head { grid-column: 1; grid-row: 1; }
  .chapter__facts { grid-column: 1; grid-row: 2; align-self: start; }
  .chapter__facts > div { grid-template-columns: 8.5rem minmax(0, 1fr); column-gap: 18px; }
  .chapter__side { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .term__body { height: clamp(260px, 48vh, 470px); }
  .chapter__title { font-size: clamp(3rem, 7.6vw, 8.6rem); }
  .chapter__title--long { font-size: clamp(2.4rem, 5.2vw, 5.8rem); }
  .chapter__pitch { max-width: 30ch; }
  .is-stacking .chapter { position: sticky; top: var(--stick, 0px); border-radius: 26px 26px 0 0; box-shadow: 0 -1px 0 var(--line-2), 0 -40px 80px -30px rgba(0, 0, 0, .75); border-top: 0; }
}

/* More work */
.more { position: relative; padding-top: var(--sec-y); padding-bottom: clamp(48px, 10vh, 120px); background: var(--ink-0); z-index: 1; }
.more__title { font-weight: 700; font-stretch: 85%; font-size: clamp(2rem, 4.4vw, 4rem); letter-spacing: -.03em; line-height: 1; margin-bottom: clamp(20px, 4vh, 44px); }
.more__title em { color: var(--accent); }
.more__list { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); }
.row__link {
  position: relative; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; align-items: baseline;
  padding: 22px 0; isolation: isolate;
}
.row__link::before {
  content: ""; position: absolute; inset: 0 calc(-1 * var(--gutter)) 0 calc(-1 * var(--gutter) - var(--rail) + 18px); z-index: -1;
  background: var(--ink-2); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease-out);
}
.row__no { font: 400 12px/1 var(--f-mono); color: var(--fg-3); grid-row: 1; }
.row__name { grid-column: 2; font-weight: 650; font-size: clamp(1.5rem, 3vw, 2.6rem); line-height: 1.05; letter-spacing: -.03em; transition: transform .6s var(--ease-out), color .3s; }
.row__pitch { grid-column: 2; max-width: 60ch; color: var(--fg-2); font-size: 15px; line-height: 1.55; }
.row__pitch code { color: var(--fg); }
.row__stack { grid-column: 2; font: 400 12px/1.4 var(--f-mono); color: var(--fg-3); }
.row__arrow { grid-column: 3; grid-row: 1; font-size: 20px; color: var(--fg-3); transition: transform .6s var(--ease-out), color .3s; }
.row__link:hover::before, .row__link:focus-visible::before { transform: scaleY(1); }
.row { position: relative; }
.row__extra { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: -10px 0 0; padding: 0 0 20px calc(2.6rem + 12px); font: 400 12px/1.4 var(--f-mono); color: var(--fg-3); }
.row__extra .textlink { font-family: var(--f-display); font-size: 14.5px; color: var(--fg); }
@media (min-width: 1024px) { .row__extra { padding-left: calc(3.2rem + 28px); margin-top: -16px; padding-bottom: 26px; } }
.row__link:hover .row__name { transform: translateX(10px); }
.row__link:hover .row__arrow { transform: rotate(45deg); color: var(--accent); }
@media (min-width: 1024px) {
  .row__link { grid-template-columns: 3.2rem minmax(0, 3.6fr) minmax(0, 6fr) minmax(0, 3.2fr) 2rem; column-gap: 28px; align-items: center; padding: 30px 0; }
  .row__no, .row__name, .row__pitch, .row__stack, .row__arrow { grid-row: 1; }
  .row__name { grid-column: 2; }
  .row__pitch { grid-column: 3; }
  .row__stack { grid-column: 4; text-align: right; }
  .row__arrow { grid-column: 5; justify-self: end; }
}
.peek {
  position: fixed; left: 0; top: 0; z-index: 30; width: 260px; pointer-events: none;
  padding: 10px; border-radius: 10px; background: rgba(30, 27, 23, .92); box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 60px -20px rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transform: translate3d(-999px, -999px, 0) scale(.9);
}
.peek__art { width: 100%; height: auto; border-radius: 6px; background: var(--ink-0); }
.peek__name { margin-top: 10px; font: 650 17px/1.1 var(--f-display); letter-spacing: -.015em; }
.peek__meta { margin-top: 4px; font: 400 11px/1.4 var(--f-mono); color: var(--fg-3); }

/* ==========================================================================
   PLAYGROUND
   ========================================================================== */
.pg { position: relative; padding-top: var(--sec-y); padding-bottom: var(--sec-y); border-top: 1px solid var(--line); background: var(--ink-0); }
.pg__head { margin-bottom: clamp(28px, 6vh, 64px); }
.pg__intro { display: grid; gap: 18px; margin-top: clamp(20px, 4vh, 44px); }
.pg__lede { max-width: 58ch; color: var(--fg-2); font-size: clamp(1rem, 1.3vw, 1.18rem); line-height: 1.55; }
.pg__install { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 6px 6px 6px 14px; border-radius: 8px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.pg__install code { font-size: 13.5px; color: var(--fg); }
.pg__install code::before { content: "$ "; color: var(--fg-3); }
@media (min-width: 1024px) { .pg__intro { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }

.pg__app { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.pg__panel { min-width: 0; padding: 20px; border-radius: 4px; background: var(--ink-1); box-shadow: inset 0 0 0 1px var(--line); }
.pg__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; font: 500 12px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); }
.pg__h--sub { margin-top: 26px; }
.pg__hint { text-transform: none; letter-spacing: 0; color: var(--fg-3); font-size: 11.5px; }
.pg__rules { display: grid; gap: 8px; }
.pg__rules li { display: flex; align-items: center; gap: 8px; }
.rule {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 6px; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s var(--ease-out), background .3s var(--ease-out);
}
.rule:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.rule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rule__box { flex: none; position: relative; width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--fg-3); transition: background .3s var(--ease-out), box-shadow .3s; }
.rule__box::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .4s var(--ease-spring); }
.rule input:checked + .rule__box { background: var(--fg); box-shadow: none; }
.rule input:checked + .rule__box::after { transform: rotate(45deg) scale(1); }
.rule input:focus-visible + .rule__box { outline: 2px solid var(--accent); outline-offset: 3px; }
.rule code { font-size: 12.5px; color: var(--fg); overflow-wrap: break-word; }
.rule input:not(:checked) ~ code { color: var(--fg-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.rule.is-fail { box-shadow: inset 0 0 0 1px rgba(255, 91, 31, .55); background: rgba(255, 91, 31, .05); }
.rule.is-pass { box-shadow: inset 0 0 0 1px rgba(60, 207, 124, .35); }
.stepper { display: inline-flex; flex: none; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 34px; height: 44px; font: 500 16px/1 var(--f-mono); color: var(--fg-2); transition: background .25s, color .25s; }
.stepper button:hover { background: var(--ink-3); color: var(--fg); }
.stepper button:first-child { border-radius: 6px 0 0 6px; } .stepper button:last-child { border-radius: 0 6px 6px 0; }
.pg__scenarios { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 36px; padding: 0 13px; border-radius: 999px; font: 400 12.5px/1 var(--f-mono); color: var(--fg-2);
  box-shadow: inset 0 0 0 1px var(--line-2); transition: background .3s var(--ease-out), color .3s, box-shadow .3s;
}
.chip:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg-3); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--ink-0); box-shadow: none; }

.pg__replay { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); letter-spacing: .04em; font: 500 11.5px/1 var(--f-mono); text-transform: uppercase; transition: transform .4s var(--ease-out), background .3s; }
.pg__replay:hover { background: var(--accent-hi); transform: translateY(-1px); }
.pg__replay .i { font-size: 10px; }
.pg__trace { position: relative; display: grid; gap: 6px; counter-reset: c; }
.pg__trace::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.call {
  position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; column-gap: 8px;
  min-height: 48px; padding: 4px 4px 4px 0; border-radius: 6px; transition: background .3s var(--ease-out), box-shadow .3s, opacity .4s var(--ease-out), transform .5s var(--ease-out);
}
.call__i { position: relative; z-index: 1; justify-self: center; display: grid; place-items: center; width: 30px; height: 22px; border-radius: 999px; background: var(--ink-1); box-shadow: inset 0 0 0 1px var(--line-2); font: 500 10.5px/1 var(--f-mono); color: var(--fg-3); }
.call__sig { font-size: 12.5px; color: var(--fg); overflow-wrap: break-word; line-height: 1.45; padding: 6px 0; }
.call__sig .kv { white-space: nowrap; }
.call__sig .fn { color: var(--fg); font-weight: 500; }
.call__sig .arg { color: var(--fg-3); }
.call__ops { display: inline-flex; gap: 2px; opacity: .55; transition: opacity .3s; }
.call:hover .call__ops, .call:focus-within .call__ops { opacity: 1; }
.call__ops button { display: grid; place-items: center; width: 30px; height: 40px; border-radius: 6px; color: var(--fg-2); transition: background .25s, color .25s; }
.call__ops button:hover { background: var(--ink-3); color: var(--fg); }
.call__ops button:disabled { opacity: .25; pointer-events: none; }
.call__ops .i { font-size: 14px; }
.call.is-bad { background: rgba(255, 91, 31, .07); box-shadow: inset 0 0 0 1px rgba(255, 91, 31, .5); }
.call.is-bad .call__i { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.call.is-bad .call__sig .fn { color: var(--accent-hi); }
.call.is-rogue .call__sig .fn { text-decoration: underline wavy rgba(255, 91, 31, .7); text-underline-offset: 4px; }
.call.is-pending { opacity: .2; transform: translateX(-6px); }
.call.is-live .call__i { background: var(--fg); color: var(--ink-0); box-shadow: 0 0 0 4px rgba(239, 234, 224, .1); }
.pg__trace .empty { padding: 18px 12px 18px 44px; color: var(--fg-3); font: 400 12.5px/1.5 var(--f-mono); }
.pg__add { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.pg__add-label { display: block; margin-bottom: 10px; font: 400 11.5px/1 var(--f-mono); color: var(--fg-3); letter-spacing: .08em; text-transform: uppercase; }
.pg__add-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pg__add-btns .chip::before { content: "+ "; color: var(--fg-3); }
.pg__add-btns .chip--rogue { box-shadow: inset 0 0 0 1px rgba(255, 91, 31, .5); color: var(--accent-hi); }

.verdict { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 16px; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.verdict__big { font-weight: 800; font-stretch: 75%; font-size: clamp(3.6rem, 7vw, 6rem); line-height: .8; letter-spacing: -.02em; color: var(--accent); transition: color .4s var(--ease-out); }
.verdict[data-state="pass"] .verdict__big { color: var(--pass); }
.verdict__meta { font: 400 12px/1.5 var(--f-mono); color: var(--fg-2); padding-bottom: 4px; }
.verdict.is-flip .verdict__big { animation: flip .6s var(--ease-out); }
@keyframes flip { from { transform: translateY(18%); opacity: 0; } }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.tabs button { height: 34px; padding: 0 12px; border-radius: 6px; font: 400 12px/1 var(--f-mono); color: var(--fg-3); transition: background .25s, color .25s; }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { background: var(--ink-3); color: var(--fg); }
.pg__out {
  margin: 0; padding: 14px 16px; border-radius: 6px; background: #0b0a09; box-shadow: inset 0 0 0 1px var(--line);
  font: 400 12px/1.6 var(--f-mono); color: var(--fg-2); white-space: pre-wrap; word-break: break-word; overflow: auto; max-height: 460px;
}
.pg__out .p { color: var(--pass); } .pg__out .f { color: var(--accent-hi); } .pg__out .h { color: var(--fg); }
.pg__out .kw { color: var(--accent-hi); } .pg__out .s { color: #d9c9a8; } .pg__out .c { color: var(--fg-3); } .pg__out .fn { color: var(--fg); }

@media (min-width: 760px) and (max-width: 1199px) {
  .pg__app { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pg__panel--out { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  .pg__app { grid-template-columns: minmax(0, 3.7fr) minmax(0, 4.6fr) minmax(0, 5.2fr); align-items: start; }
  .pg__panel { padding: 24px; }
}

/* ==========================================================================
   ABOUT / HOW I WORK
   ========================================================================== */
.about { position: relative; padding-top: var(--sec-y); padding-bottom: var(--sec-y); border-top: 1px solid var(--line); background: var(--ink-0); }
.about__statement {
  margin-top: clamp(28px, 6vh, 72px); max-width: 24em; font-weight: 560; font-size: clamp(1.6rem, 3.4vw, 3.4rem); line-height: 1.1; letter-spacing: -.03em; text-wrap: pretty;
}
.about__statement em { color: var(--accent); font-size: 1.08em; }
.steps { display: grid; gap: 0; margin-top: clamp(40px, 8vh, 96px); border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.step__no { font: 400 12px/1.7 var(--f-mono); color: var(--accent); }
.step__t { font-weight: 650; font-size: clamp(1.25rem, 1.8vw, 1.6rem); letter-spacing: -.02em; line-height: 1.15; }
.step p { grid-column: 2; margin-top: 8px; color: var(--fg-2); font-size: 15.5px; line-height: 1.55; max-width: 44ch; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 0; }
  .step { grid-template-columns: minmax(0, 1fr); padding: 26px 28px 30px 0; border-bottom: 0; border-top: 1px solid var(--line-2); }
  .step + .step { padding-left: 28px; border-left: 1px solid var(--line); }
  .step__no { margin-bottom: 26px; }
  .step p { grid-column: 1; }
}
.about__grid { display: grid; gap: 56px; margin-top: clamp(56px, 10vh, 120px); }
@media (min-width: 1024px) { .about__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 6vw; } }
.tally__cap { display: flex; justify-content: space-between; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line-2); font: 400 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
.tally__list li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.6rem; align-items: center; column-gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font: 400 12.5px/1.2 var(--f-mono); color: var(--fg-2); }
.tally__list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally__list i { display: block; height: 6px; border-radius: 1px; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); transform-origin: left; transform: scaleX(var(--v, 1)); }
.tally__list b { font-weight: 500; color: var(--fg); text-align: right; }
.skills__title { font: 400 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.skills__list > div { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.skills__list dt { font: 400 11.5px/1.4 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.skills__list dd { font-size: clamp(1.02rem, 1.3vw, 1.2rem); line-height: 1.45; letter-spacing: -.01em; color: var(--fg); }
@media (min-width: 640px) { .skills__list > div { grid-template-columns: 10rem minmax(0, 1fr); column-gap: 18px; align-items: baseline; } }

/* ==========================================================================
   EXPERIENCE
   ========================================================================== */
.xp { position: relative; padding-top: var(--sec-y); padding-bottom: var(--sec-y); border-top: 1px solid var(--line); background: var(--ink-0); }
.xp__grid { display: grid; gap: 56px; margin-top: clamp(40px, 8vh, 96px); }
@media (min-width: 1024px) { .xp__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 6vw; } }
.timeline { position: relative; padding-left: 28px; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line-2); }
.timeline::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--tl, 1)); }
.tl { position: relative; padding-bottom: clamp(32px, 6vh, 56px); }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: -28px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-0); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tl__when { font: 400 12px/1.4 var(--f-mono); color: var(--accent-hi); letter-spacing: .02em; }
.tl__what { margin-top: 8px; font-weight: 680; font-size: clamp(1.4rem, 2.6vw, 2.3rem); letter-spacing: -.03em; line-height: 1.05; }
.tl__where { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--fg); font-size: 15.5px; }
.tl__body { margin-top: 10px; color: var(--fg-2); font-size: 15.5px; line-height: 1.58; max-width: 58ch; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 500 11px/1 var(--f-mono); letter-spacing: .02em; }
.xp__side { display: grid; gap: 44px; align-content: start; }
.xp__h { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); font: 400 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); }
.xp__list li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.xp__list li span:last-child { flex: none; font: 400 12px/1.6 var(--f-mono); color: var(--fg-3); text-align: right; }

/* ==========================================================================
   CONTACT — full-bleed signal orange
   ========================================================================== */
.contact { position: relative; z-index: 4; background: var(--accent); color: var(--on-accent); overflow: hidden; }
.contact::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) + 5px); width: 1px; background: rgba(20, 14, 10, .22); }
.contact__inner { min-height: 92svh; display: flex; flex-direction: column; justify-content: center; padding-block: var(--sec-y) clamp(56px, 10vh, 120px); }
.contact__title {
  font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(3.6rem, 15.4vw, 17.5rem); line-height: .8; letter-spacing: -.01em; margin-left: -.04em;
}
.contact__title em { display: inline-block; text-transform: none; font-size: 1.04em; letter-spacing: -.035em; padding-right: .06em; }
.contact__row { display: grid; gap: 24px; margin-top: clamp(32px, 6vh, 64px); align-items: center; }
.contact__lede { max-width: 30ch; font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.4; color: var(--on-accent); }
.mailbtn {
  position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: space-between; gap: 18px;
  justify-self: start; max-width: 100%; height: clamp(64px, 8vw, 96px); padding: 0 12px 0 clamp(20px, 2.4vw, 34px); border-radius: 999px;
  background: var(--on-accent); color: var(--fg); transition: transform .6s var(--ease-out);
}
.mailbtn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fg); transform: translateY(101%); transition: transform .6s var(--ease-out); border-radius: inherit; }
.mailbtn:hover { color: var(--on-accent); }
.mailbtn:hover::before { transform: none; }
.mailbtn__addr { font-weight: 600; font-size: clamp(1.05rem, 2.6vw, 2.2rem); letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mailbtn__act { flex: none; display: inline-flex; align-items: center; gap: 8px; height: calc(100% - 20px); padding: 0 clamp(14px, 1.6vw, 22px); border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 500 13px/1 var(--f-mono); }
.mailbtn__act .i { font-size: 15px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: clamp(32px, 6vh, 64px); padding-top: 22px; border-top: 1px solid rgba(20, 14, 10, .25); }
.contact__links a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; font-weight: 560; font-size: clamp(1rem, 1.5vw, 1.3rem); letter-spacing: -.01em; position: relative; }
.contact__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1.5px; background: currentColor; transform: scaleX(.0); transform-origin: right; transition: transform .6s var(--ease-out); }
.contact__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.contact__links a .i { font-size: 14px; transition: transform .5s var(--ease-out); }
.contact__links a:hover .i { transform: translate(2px, -2px); }
@media (min-width: 1024px) { .contact__row { grid-template-columns: minmax(0, 1fr) auto; } .mailbtn { justify-self: end; } }

/* ---------- Footer ---------- */
.colophon { position: relative; z-index: 2; padding-block: 36px 40px; background: var(--ink-0); font-size: 13px; color: var(--fg-3); }
.colophon__grid { display: grid; gap: 14px; }
.colophon__name { font: 600 15px/1.2 var(--f-display); color: var(--fg); }
.colophon__name span { margin-left: 8px; color: var(--fg-3); font: 400 12px/1 var(--f-mono); }
.colophon__text { max-width: 70ch; line-height: 1.6; color: var(--fg-2); }
.colophon__meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font: 400 12px/1.5 var(--f-mono); }
.colophon__meta b { font-weight: 500; color: var(--fg); }
@media (min-width: 1024px) { .colophon__grid { grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 4fr); align-items: start; column-gap: 4vw; } .colophon__meta { flex-direction: column; } }

/* ==========================================================================
   HUD — site.contract
   ========================================================================== */
.hud { position: fixed; left: var(--gutter); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 55; }
.hud[hidden] { display: none; }
.hud__btn {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: rgba(22, 20, 17, .82); box-shadow: inset 0 0 0 1px var(--line-2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 500 12px/1 var(--f-mono); color: var(--fg-2); transition: box-shadow .4s var(--ease-out), transform .5s var(--ease-out);
}
.hud__btn:hover { box-shadow: inset 0 0 0 1px var(--fg-3); }
.hud__ring { position: absolute; inset: 4px; width: 36px; height: 36px; transform: rotate(-90deg); }
.hud__count { position: relative; font-size: 10.5px; letter-spacing: -.02em; }
.hud__count span { color: var(--fg-3); }
.hud__ring circle { fill: none; stroke-width: 3; transition: stroke .5s var(--ease-out); }
.hud__ring .seg-pend { stroke: var(--line-2); } .hud__ring .seg-pass { stroke: var(--pass); } .hud__ring .seg-fail { stroke: var(--accent); }
.hud__count b { color: var(--fg); font-weight: 500; }
.hud.is-done .hud__btn { box-shadow: inset 0 0 0 1px rgba(60, 207, 124, .55); }
.hud.is-done .hud__count { color: var(--pass); }
.hud.is-done .hud__count b { color: var(--pass); }
.hud.is-pulse .hud__btn { animation: hudpulse .9s var(--ease-out); }
@keyframes hudpulse { 30% { transform: scale(1.08); } }
.hud__panel {
  position: absolute; left: 0; bottom: calc(100% + 10px); width: min(380px, calc(100vw - 2 * var(--gutter))); padding: 16px 16px 14px; border-radius: 14px;
  background: rgba(22, 20, 17, .96); box-shadow: inset 0 0 0 1px var(--line-2), 0 40px 80px -30px rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transform-origin: 0 100%;
  animation: hudin .5s var(--ease-out);
}
.hud__panel[hidden] { display: none; }
@keyframes hudin { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.hud__title { display: flex; justify-content: space-between; align-items: center; margin: -6px -6px 8px 0; font-size: 13px; color: var(--fg); }
.hud__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font: 400 12px/1.45 var(--f-mono); color: var(--fg-2); }
.hud__list code { font-size: 12px; color: var(--fg); overflow-wrap: anywhere; }
.hud__v { font-size: 11px; letter-spacing: .06em; color: var(--fg-3); }
.hud__v.is-pass { color: var(--pass); } .hud__v.is-fail { color: var(--accent); }
.hud__msg { grid-column: 1 / -1; margin-top: 4px; color: var(--fg-3); font-size: 11.5px; }
.hud__msg button { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.hud__sum { padding: 10px 0; border-top: 1px solid var(--line-2); font: 500 12px/1.4 var(--f-mono); color: var(--fg); }
.hud.is-done .hud__sum { color: var(--pass); }
.hud__note { font-size: 13px; line-height: 1.5; color: var(--fg-2); }
.hud__note a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
@media (min-width: 900px) { .hud { left: calc(var(--gutter) - 16px); } }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 90; display: grid; place-items: start center; padding: max(10vh, 64px) var(--gutter) 24px; }
.palette[hidden] { display: none; }
.palette__scrim { position: absolute; inset: 0; background: rgba(8, 7, 6, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .35s var(--ease-out); }
.palette__panel {
  position: relative; width: min(640px, 100%); max-height: min(560px, 76vh); display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: var(--ink-1); box-shadow: inset 0 0 0 1px var(--line-2), 0 50px 120px -30px rgba(0, 0, 0, .9);
  animation: palin .45s var(--ease-out);
}
@keyframes fade { from { opacity: 0; } }
@keyframes palin { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.palette__field { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette__prompt { font: 500 18px/1 var(--f-mono); color: var(--accent); }
.palette__input { flex: 1; min-width: 0; height: 58px; border: 0; outline: 0; background: none; color: var(--fg); font: 400 16px/1 var(--f-display); }
.palette__input::placeholder { color: var(--fg-3); }
.palette__list { overflow: auto; padding: 8px; overscroll-behavior: contain; }
.palette__group { padding: 12px 10px 6px; font: 400 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.palette__item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--fg-2); }
.palette__item .k { flex: none; width: 22px; font: 400 11px/1 var(--f-mono); color: var(--fg-3); }
.palette__item .l { flex: 1; min-width: 0; font-size: 15px; color: var(--fg); }
.palette__item .h { font: 400 11.5px/1 var(--f-mono); color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette__item[aria-selected="true"] { background: var(--ink-3); }
.palette__item[aria-selected="true"] .k { color: var(--accent); }
.palette__empty { padding: 28px 12px; text-align: center; font: 400 13px/1.5 var(--f-mono); color: var(--fg-3); }
.palette__foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font: 400 11.5px/1 var(--f-mono); color: var(--fg-3); }
.palette__foot span { display: inline-flex; align-items: center; gap: 5px; }
.palette__esc { margin-left: 4px; }
@media (pointer: coarse) { .palette__foot, .palette__esc { display: none; } .palette { place-items: end center; padding: 0; } .palette__panel { width: 100%; max-height: 82svh; border-radius: 18px 18px 0 0; animation-name: sheetin; } }
@keyframes sheetin { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 95; display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 32px); padding: 12px 16px 12px 14px; border-radius: 10px; background: var(--fg); color: var(--ink-0);
  font: 500 13.5px/1.3 var(--f-display); box-shadow: 0 20px 50px -14px rgba(0, 0, 0, .7);
  opacity: 0; transform: translate(-50%, 16px) scale(.98); pointer-events: none; transition: opacity .45s var(--ease-out), transform .55s var(--ease-out);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pass); flex: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Cursor (pointer: fine only, enabled by JS) ---------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 99; pointer-events: none; }
.cursor__dot { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); transition: opacity .3s, transform .4s var(--ease-out); }
.cursor__ring {
  position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(239, 234, 224, .45);
  display: grid; place-items: center; transition: width .5s var(--ease-out), height .5s var(--ease-out), left .5s var(--ease-out), top .5s var(--ease-out), background .4s var(--ease-out), box-shadow .4s, opacity .3s;
}
.cursor__label { font: 500 10.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--on-accent); opacity: 0; transform: scale(.6); transition: opacity .3s, transform .5s var(--ease-out); white-space: nowrap; }
.cursor.is-label .cursor__ring { width: 74px; height: 74px; left: -37px; top: -37px; background: var(--accent); box-shadow: none; }
.cursor.is-label .cursor__label { opacity: 1; transform: none; }
.cursor.is-label .cursor__dot { opacity: 0; }
.cursor.is-link .cursor__ring { width: 52px; height: 52px; left: -26px; top: -26px; box-shadow: inset 0 0 0 1px rgba(239, 234, 224, .8); }
.cursor.is-down .cursor__ring { transform: scale(.86); }
.cursor.is-text .cursor__ring { opacity: 0; }
.cursor.is-hidden { opacity: 0; }
.cursor.on-accent .cursor__dot { background: var(--on-accent); }
.cursor.on-accent .cursor__ring { box-shadow: inset 0 0 0 1px rgba(20, 14, 10, .5); }
.cursor.on-accent.is-label .cursor__ring { background: var(--on-accent); }
.cursor.on-accent .cursor__label { color: var(--accent); }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -10%; z-index: 80; pointer-events: none; opacity: .045;
  background-image: url("../img/grain.webp"); background-size: 112px 112px; animation: grain 1.2s steps(5) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } }


/* ==========================================================================
   Mobile refinements (designed, not shrunk)
   ========================================================================== */
.anatomy { overflow-x: clip; }
.nav__menu i { display: none; }
.pg__chip { display: none; }
@media (max-width: 899px) {
  .nav { gap: 12px; }
  .nav__status { font-size: 11.5px; white-space: nowrap; }
  .nav__menu { position: relative; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
  .nav__menu-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .nav__menu i, .nav__menu i::before { display: block; width: 16px; height: 1.5px; background: currentColor; border-radius: 2px; position: relative; transition: transform .4s var(--ease-out); }
  .nav__menu i { transform: translateY(-3px); }
  .nav__menu i::before { content: ""; position: absolute; left: 0; top: 6px; width: 11px; }
  .nav__menu:hover i::before { transform: scaleX(1.45); transform-origin: left; }
  .nav .pill--solid, .nav__email { height: 36px; padding: 0 13px; font-size: 13.5px; }
  .nav .pill--solid .i { display: none; }
  .nav.is-scrolled .nav__actions { padding-right: 46px; }
  .hud { top: calc((var(--nav-h) - 44px) / 2); bottom: auto; left: auto; right: calc(var(--gutter) + 44px); opacity: 0; visibility: hidden; transition: opacity .4s var(--ease-out), visibility .4s; }
  html.is-scrolled .hud { opacity: 1; visibility: visible; }
  .hud__btn { width: 40px; height: 40px; background: var(--ink-0); box-shadow: inset 0 0 0 1px var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .hud__ring { inset: 2px; }
  .hud__panel { top: calc(100% + 12px); bottom: auto; left: auto; right: -44px; transform-origin: 100% 0; }

  .hero__ctas { gap: 8px; }
  .hero__ctas .pill { height: 44px; padding: 0 15px; font-size: 14.5px; }
  .proof > li, .proof > li.is-link > a { padding: 7px 10px; font-size: 12.5px; }
  .proof > li.is-link { padding: 0; }

  .manifesto__inner { min-height: 0; padding-block: clamp(88px, 16vh, 140px); }
  .ref { font-size: 10.5px; padding: .35em .5em .3em; }
  .anatomy__pin { display: flex; flex-direction: column; height: 100svh; padding-top: calc(var(--nav-h) + 18px); padding-bottom: 16px; row-gap: 8px; }
  .anatomy__title { margin: 8px 0 8px; }
  .anatomy__lede { font-size: 14px; line-height: 1.5; }
  .anatomy__stage { flex: 1; min-height: 0; height: auto; }
  .anatomy__labels .al__proj { font-size: 14.5px; line-height: 1.05; }
  .has-core .anatomy__labels a { padding: 2px 0; row-gap: 1px; }
  .anatomy__labels .al__layer { font-size: 9.5px; }
  .no-core-pin .anatomy__pin { height: auto; }

  .pg__panel { padding: 16px; }
  .rule { padding: 10px; gap: 10px; }
  .pg__chip {
    position: sticky; bottom: 14px; z-index: 5; justify-self: end; order: 9; display: inline-flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 16px 0 14px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
    font: 500 12.5px/1 var(--f-mono); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
  }
  .pg__chip b { font: 800 18px/1 var(--f-display); font-stretch: 75%; letter-spacing: .01em; }
  .pg__chip[data-state="pass"] { background: var(--pass); }
  .pg__panel--out { order: 10; }
}

/* ---------- Reveal defaults (JS sets initial state only for off-screen items) ---------- */
.line-mask { overflow: clip; display: block; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .grain { display: none; }
}
.rm .grain { display: none; }
@media (pointer: coarse) { .grain { display: none; } }
