:root {
  --bg: #0a0506;
  --bg2: #140809;
  --line: #2c1214;
  --ink: #f1e4e2;
  --mute: #a3898a;
  --dim: #654a4b;
  --red: #d8283a;
  --red2: #8f1720;
  --violet: #ff7b86;
  --good: #7fd6a2;
  --bad: #ff4655;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: inherit; }
::selection { background: var(--red); color: #fff; }

/* faint scanlines over everything */
.scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px); /* no blend mode: cheap to composite */
  will-change: transform; contain: strict; transform: translateZ(0); /* its own GPU layer: drawn once, blended for free */
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  font-family: var(--mono); font-size: 13px;
  background: linear-gradient(var(--bg) 60%, rgba(10,5,6,0));
}
.mark {
  font-weight: 700; letter-spacing: .08em; text-decoration: none; font-size: 15px;
  color: var(--ink); position: relative;
}
.mark::after { content: "_"; color: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav nav { display: flex; gap: 4px; margin-left: auto; }
.nav nav a {
  text-decoration: none; color: var(--mute); padding: 6px 10px; border: 1px solid transparent;
}
.nav nav a:hover { color: var(--ink); }
.nav nav a.on { color: var(--ink); border-color: var(--line); background: var(--bg2); }
.nav nav a.on::before { content: "["; color: var(--red); margin-right: 2px; }
.nav nav a.on::after { content: "]"; color: var(--red); margin-left: 2px; }
.gh {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--ink); padding: 6px 12px; border: 1px solid var(--line); background: var(--bg2);
}
.gh:hover { border-color: var(--red); color: #fff; }

main { flex: 1; }
.panel[hidden] { display: none !important; }
.kicker { font-family: var(--mono); font-size: 12px; color: var(--red); margin: 0 0 10px; letter-spacing: .02em; }
h1 {
  font-family: var(--mono); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(38px, 6.4vw, 76px); line-height: 1; margin: 0 0 22px;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 80px; }

/* ---------- home ---------- */
#tab-home {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex; align-items: center;
  overflow: hidden;
}
.art { position: absolute; top: 0; bottom: 0; right: 0; width: 58%; }
.art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.art::after { /* fade the art into the text side */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(10,5,6,.0) 28%), linear-gradient(0deg, var(--bg) 0%, rgba(10,5,6,0) 14%);
}
.hero { position: relative; z-index: 2; max-width: 560px; padding: 40px clamp(16px, 4vw, 48px); }
.lede { color: #d8cdc8; font-size: 17px; margin: 0 0 28px; max-width: 520px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.btn {
  font-family: var(--mono); font-size: 13px; text-decoration: none;
  padding: 11px 16px; background: var(--red); color: #fff; border: 1px solid var(--red);
  display: inline-flex; gap: 8px; align-items: center; position: relative;
}
.btn:hover { background: #ff4a58; animation: jitter .18s steps(2) 2; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
@keyframes jitter { 0% { transform: translate(1px,0); } 50% { transform: translate(-2px,1px); } 100% { transform: none; } }
.facts { list-style: none; padding: 0; margin: 0; display: flex; gap: 28px; flex-wrap: wrap; font-family: var(--mono); }
.facts li { display: flex; flex-direction: column; }
.facts b { font-size: 20px; color: var(--ink); }
.facts span { font-size: 11.5px; color: var(--mute); }

/* ---------- work ---------- */
.proj { border-top: 1px solid var(--line); padding: 34px 0 30px; }
.proj header { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.idx { font-family: var(--mono); color: var(--red); font-size: 13px; }
.proj h2 { font-family: var(--mono); font-size: 28px; margin: 0; letter-spacing: -.01em; }
.stack { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-left: auto; }
.what { color: #d3c7c2; margin: 0 0 18px; max-width: 760px; }
.nums { list-style: none; padding: 0; margin: 16px 0 0; display: flex; gap: 22px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; color: var(--mute); }
.nums b { color: var(--ink); font-size: 14px; margin-right: 4px; }
.fine { font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin: 6px 0 0; }
.repo { display: inline-block; margin-top: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--violet); text-decoration: none; }
.repo::after { content: " →"; }
.repo:hover { color: #fff; }
.repo.soon { color: var(--dim); pointer-events: none; }
.repo.soon::after { content: " · public soon"; }
.repo.live { color: var(--red); }

/* demo window */
.demo { border: 1px solid var(--line); background: #0e0909; position: relative; }
.demo .bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--dim);
}
.demo .bar i { width: 8px; height: 8px; border-radius: 50%; background: #2d1c1d; }
.demo .bar span { margin-left: 8px; }
.replay {
  margin-left: auto; font: inherit; color: var(--mute); background: none;
  border: 1px solid var(--line); padding: 2px 8px; cursor: pointer;
}
.replay:hover { color: var(--ink); border-color: var(--mute); }
.demo .body { height: 290px; overflow: hidden; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; position: relative; }

.term .l { white-space: pre-wrap; word-break: break-word; min-height: 1.55em; }
.term .p { color: var(--red); }
.term .c { color: var(--ink); }
.term .o { color: var(--mute); }
.term .dim { color: var(--dim); }
.term .good { color: var(--good); }
.term .bad { color: var(--bad); }
.term .vio { color: var(--violet); }
.caret::after { content: "▌"; color: var(--red); animation: blink .8s steps(1) infinite; }
.tbl { color: var(--mute); }

/* reviewbot diff */
.diff .ln { display: grid; grid-template-columns: 30px 14px 1fr; white-space: pre; transition: background .25s; }
.diff .n { color: var(--dim); }
.diff .add { color: #cfe8d6; }
.diff .add .s { color: var(--good); }
.diff .hit { background: rgba(216,40,58,.18); box-shadow: inset 2px 0 var(--red); }
.diff .scanning { background: rgba(255,123,134,.10); }
.note {
  margin: 8px 0 4px 44px; border: 1px solid var(--line); border-left: 2px solid var(--red);
  padding: 6px 10px; background: #160d0d; white-space: normal; opacity: 0; transform: translateY(4px); transition: .3s;
}
.note.in { opacity: 1; transform: none; }
.note b { color: var(--red); font-weight: 600; }
.ai { margin-left: 44px; white-space: normal; }
.ai s { color: var(--dim); }

/* inkwell */
.ink { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dev { border: 1px solid var(--line); background: #120b0b; display: flex; flex-direction: column; min-width: 0; }
.dev .h { display: flex; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid var(--line); color: var(--mute); font-size: 11.5px; }
.dot { display: inline-flex; align-items: center; gap: 6px; }
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.dot.off { color: var(--bad); }
.dot.off::before { background: var(--bad); }
.dev .t { padding: 10px; color: var(--ink); white-space: pre-wrap; word-break: break-word; font-family: var(--sans); font-size: 13.5px; flex: 1; }
.dev .t mark { background: rgba(255,123,134,.25); color: #fff; }
.ink .status { grid-column: 1 / -1; color: var(--mute); font-size: 12px; min-height: 1.5em; }

/* tripwire feed */
.feed .row { display: grid; grid-template-columns: 48px 1fr 70px 110px; gap: 10px; align-items: center; padding: 3px 0; border-bottom: 1px dashed #221415; animation: rowin .35s ease-out; }
@keyframes rowin { from { opacity: 0; transform: translateY(-6px); } }
.feed .eco { color: var(--dim); }
.feed .ver { color: var(--dim); }
.feed .score { height: 6px; background: #221415; position: relative; }
.feed .score i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--good); width: 0; transition: width .5s; }
.feed .row.flag { color: #ffd9d3; }
.feed .row.flag .score i { background: var(--bad); }
.feed .why { grid-column: 2 / -1; color: var(--bad); font-size: 11.5px; white-space: normal; }
.feed .head { color: var(--mute); margin-bottom: 6px; display: flex; justify-content: space-between; }

/* duet */
.duet { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.scr { border: 1px solid var(--line); background: #120b0b; min-width: 0; }
.scr .h { padding: 6px 10px; border-bottom: 1px solid var(--line); color: var(--mute); font-size: 11.5px; display: flex; justify-content: space-between; }
.scr svg { display: block; width: 100%; height: 150px; }
.duet .status { grid-column: 1 / -1; color: var(--mute); font-size: 12px; white-space: pre-wrap; }

/* design demo: themed workspace */
.dash {
  --t-bg: #120b0b; --t-panel: #160d0d; --t-grid: #251516; --t-up: #7fd6a2; --t-dn: #d8283a; --t-ln: #ff7b86; --t-tx: #a3898a;
  display: grid; grid-template-columns: 1fr 150px; grid-template-rows: auto 1fr; gap: 8px; padding: 10px !important;
  background: var(--t-bg); transition: background .5s;
}
.dash .tb { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--t-tx); font-size: 11.5px; transition: color .5s; }
.dash .tb .tab { padding: 3px 8px; border: 1px solid var(--t-grid); background: var(--t-panel); transition: .5s; }
.dash .tb .tab.on { color: var(--t-ln); border-color: var(--t-ln); }
.dash .sw { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.dash .sw button { width: 16px; height: 16px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.dash .sw button.on { border-color: var(--t-tx); transform: scale(1.15); }
.dash .win { border: 1px solid var(--t-grid); background: var(--t-panel); position: relative; min-width: 0; transition: .5s; }
.dash .win .wh { display: flex; justify-content: space-between; padding: 4px 8px; font-size: 11px; color: var(--t-tx); border-bottom: 1px solid var(--t-grid); transition: .5s; }
.dash canvas { display: block; width: 100%; height: calc(100% - 25px); }
.dash .side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.dash .side .win { flex: 1; }
.dash .kv { padding: 6px 8px; font-size: 11px; color: var(--t-tx); display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; }
.dash .kv b { color: var(--t-ln); font-weight: 600; transition: color .5s; }

/* test results under each project */
.tests { margin-top: 14px; border: 1px solid var(--line); background: #0e0909; font-family: var(--mono); font-size: 12.5px; }
.tests summary { cursor: pointer; padding: 8px 12px; list-style: none; display: flex; gap: 12px; align-items: center; color: var(--mute); flex-wrap: wrap; }
.tests summary::-webkit-details-marker { display: none; }
.tests summary span::before { content: "$ "; color: var(--red); }
.tests summary b { color: var(--good); font-weight: 600; }
.tests summary::after { content: "−"; margin-left: auto; color: var(--red); }
.tests:not([open]) summary::after { content: "+"; }
.tests ul { list-style: none; margin: 0; padding: 6px 12px 12px; border-top: 1px dashed var(--line); }
.tests li { padding: 3px 0 3px 20px; position: relative; color: #d3c7c2; line-height: 1.5; }
.tests li::before { position: absolute; left: 0; top: 3px; }
.tests li.ok::before { content: "✔"; color: var(--good); }
.tests li.bench::before { content: "≈"; color: var(--violet); }
.tests li.warn { color: var(--mute); }
.tests li.warn::before { content: "!"; color: #e0b44a; left: 4px; }
.tests .k { color: var(--ink); font-weight: 600; }

/* Traders Room: engine + feats */
.engine { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; margin-top: 22px; }
.engine h4 { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--red); margin: 0 0 10px; }
.engine ol { margin: 0; padding: 0; list-style: none; counter-reset: e; }
.engine ol li { counter-increment: e; position: relative; padding: 5px 0 5px 34px; color: #d3c7c2; border-bottom: 1px dashed #221415; font-size: 14px; }
.engine ol li::before { content: counter(e, decimal-leading-zero); position: absolute; left: 0; top: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--violet); }
.feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feats li { background: #0e0909; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.feats b { font-family: var(--mono); font-size: 18px; color: var(--ink); letter-spacing: -.01em; }
.feats span { font-size: 12.5px; color: var(--mute); line-height: 1.4; }
.feats li:hover b { color: var(--red); }
@media (max-width: 760px) { .engine { grid-template-columns: 1fr; } }

/* ---------- project tiles ---------- */
.view-switch { display: flex; gap: 6px; align-items: center; margin: -6px 0 18px; font-family: var(--mono); font-size: 12px; }
.view-switch button { font: inherit; color: var(--mute); background: var(--bg2); border: 1px solid var(--line); padding: 5px 10px; cursor: pointer; }
.view-switch button.on { color: var(--ink); border-color: var(--red); }
.view-switch span { margin-left: 10px; color: var(--dim); }
.tile {
  font: inherit; color: inherit; text-align: left; cursor: pointer; background: #0e0909;
  border: 1px solid var(--line); position: relative; transition: border-color .2s, transform .2s, background .2s;
}
.tile:hover, .tile:focus-visible { border-color: var(--red); background: #130b0b; outline: none; }
.tile b { font-weight: 700; }
.t-idx { font-family: var(--mono); font-size: 12px; color: var(--red); }
.t-name { font-family: var(--mono); font-size: 20px; letter-spacing: -.01em; display: block; }
.t-tag { color: #cfc3be; font-size: 13.5px; display: block; }
.t-stack { font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.t-stat { font-family: var(--mono); font-size: 13px; color: var(--violet); }
.t-tests { font-family: var(--mono); font-size: 11.5px; color: var(--good); }
.t-open { font-family: var(--mono); color: var(--dim); transition: color .2s, transform .2s; }
.tile:hover .t-open { color: var(--red); transform: translate(2px, -2px); }

.tiles.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tiles.grid .tile { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px; min-height: 210px; }
.tiles.grid .tile:hover { transform: translateY(-3px); }
.tiles.grid .t-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.tiles.grid .t-open { position: absolute; top: 12px; right: 14px; font-size: 16px; }
.tiles.grid .t-stat { border-top: 1px dashed var(--line); padding-top: 8px; }

.tiles.table { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.tiles.table .tile {
  display: grid; grid-template-columns: 34px minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 1.3fr) 18px;
  gap: 14px; align-items: center; padding: 12px 10px; border-width: 0 0 1px; background: transparent;
}
.tiles.table .tile:hover { background: #130b0b; }
.tiles.table .t-name { font-size: 15px; }
.tiles.table .t-tag { font-size: 12.5px; color: var(--mute); }
.tiles-head { display: none; }

/* ---------- full-screen viewer ---------- */
dialog#viewer {
  width: min(1100px, calc(100vw - 32px)); max-width: none; height: calc(100vh - 48px); max-height: none;
  padding: 0; border: 1px solid var(--red); background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column;
}
dialog#viewer:not([open]) { display: none; }
dialog#viewer::backdrop { background: rgba(5,2,2, .78); backdrop-filter: blur(3px); }
dialog#viewer[open] { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } }
.vbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; color: var(--mute); }
.vtitle::before { content: "~/"; color: var(--red); }
.vclose { margin-left: auto; font: inherit; color: var(--ink); background: var(--bg2); border: 1px solid var(--line); padding: 5px 12px; cursor: pointer; }
.vclose:hover { border-color: var(--red); }
.slot { overflow-y: auto; padding: 8px 28px 32px; flex: 1; }
.slot .proj { border-top: 0; padding-top: 18px; }
.slot .proj h2 { font-size: 34px; }
body:has(dialog[open]) { overflow: hidden; }

@media (max-width: 760px) {
  .view-switch span { display: none; }
  .tiles.table .tile { grid-template-columns: 26px 1fr 18px; gap: 4px 10px; }
  .tiles.table .t-main { grid-column: 2; }
  .tiles.table .t-open { grid-column: 3; grid-row: 1; }
  .tiles.table .t-stack, .tiles.table .t-stat, .tiles.table .t-tests { grid-column: 2; }
  .tiles.grid .tile { min-height: 0; }
  dialog#viewer { width: 100vw; height: 100dvh; border: 0; margin: 0; }
  .slot { padding: 4px 16px 28px; }
}

/* clipper demo */
.clip { display: flex; flex-direction: column; gap: 8px; }
.cl-head { display: flex; justify-content: space-between; color: var(--mute); font-size: 11.5px; }
.cl-state.hot { color: var(--red); }
.cl-bars { height: 92px; display: flex; align-items: flex-end; gap: 3px; border-bottom: 1px solid var(--line); }
.cl-bars i { flex: 1; background: #3b2425; min-width: 2px; transition: height .2s; }
.cl-bars i.hot { background: var(--red); box-shadow: 0 0 10px rgba(216,40,58,.5); }
.cl-steps { display: flex; flex-direction: column; gap: 3px; color: var(--mute); }
.cl-step { animation: rowin .3s ease-out; }
.cl-step.ok { color: var(--good); }
.cl-phone {
  position: absolute; right: 14px; bottom: 14px; width: 210px; padding: 10px 12px; border: 1px solid var(--line);
  background: #160d0d; display: flex; flex-direction: column; gap: 4px; opacity: 0; transform: translateY(10px); transition: .35s;
}
.cl-phone.in { opacity: 1; transform: none; }
.cl-phone b { color: var(--red); font-size: 12px; }
.cl-phone span { font-family: var(--sans); font-size: 13px; color: var(--ink); }
.cl-btns { display: flex; gap: 6px; }
.cl-btns i { font-style: normal; font-family: var(--mono); font-size: 11px; padding: 2px 8px; border: 1px solid var(--line); color: var(--mute); }
.cl-btns i:first-child { border-color: var(--good); color: var(--good); }
@media (max-width: 760px) { .cl-phone { position: static; width: auto; } }

/* ---------- research ---------- */
.intro { color: #d3c7c2; max-width: 760px; margin: 0 0 26px; font-size: 16px; }
.rfacts { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.rfacts li { background: #0e0909; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.rfacts b { font-family: var(--mono); font-size: 24px; }
.rfacts span { color: var(--mute); font-size: 12.5px; }
.methods { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 26px; }
.methods span { font-family: var(--mono); font-size: 11.5px; color: var(--mute); border: 1px solid var(--line); padding: 3px 8px; }
.methods span::before { content: "✔ "; color: var(--good); }
.rfilters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rfilters button { font-family: var(--mono); font-size: 12px; color: var(--mute); background: var(--bg2); border: 1px solid var(--line); padding: 5px 10px; cursor: pointer; }
.rfilters button.on { color: var(--ink); border-color: var(--red); }
.rtable { border-top: 1px solid var(--line); }
.rrow {
  display: grid; grid-template-columns: 30px minmax(0, 1.6fr) 110px 76px minmax(0, 2.4fr); gap: 14px; align-items: center;
  width: 100%; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
button.rrow:hover { background: #130b0b; }
button.rrow:hover .rt { color: #fff; }
.rhead { cursor: default; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.ri { font-family: var(--mono); font-size: 11.5px; color: var(--red); }
.rt { font-weight: 600; font-size: 14px; }
.rc { font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.rr { font-size: 12.5px; color: var(--mute); line-height: 1.45; }
.badge { font-family: var(--mono); font-size: 11px; padding: 2px 7px; border: 1px solid; justify-self: start; white-space: nowrap; }
.v-edge { color: var(--good); border-color: rgba(127,214,162,.5); }
.v-partial { color: var(--violet); border-color: rgba(255,123,134,.5); }
.v-tool { color: #e0b44a; border-color: rgba(224,180,74,.5); }
.v-no-edge { color: #c98b84; border-color: rgba(201,139,132,.35); }
.rsub { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .18em; color: var(--red); margin: 40px 0 12px; }
.datasets { margin: 0; padding-left: 18px; color: #d3c7c2; }
.datasets li { margin: 6px 0; }
.datasets li::marker { content: "▸ "; color: var(--dim); }
.study header { align-items: center; }
.study .idx { text-transform: uppercase; letter-spacing: .12em; }
.sgrid { display: grid; grid-template-columns: 160px 1fr; gap: 14px 22px; margin: 18px 0 0; }
.sgrid dt { font-family: var(--mono); font-size: 12px; color: var(--red); text-transform: uppercase; letter-spacing: .12em; padding-top: 3px; }
.sgrid dd { margin: 0; color: #ddd2cd; line-height: 1.6; }
@media (max-width: 760px) {
  .rfacts { grid-template-columns: 1fr 1fr; }
  .rhead { display: none; }
  .rrow { grid-template-columns: 26px 1fr auto; gap: 4px 10px; }
  .rrow .rc { display: none; }
  .rrow .rr { grid-column: 2 / -1; }
  .sgrid { grid-template-columns: 1fr; gap: 4px; }
  .sgrid dd { margin-bottom: 12px; }
}

/* ---------- lab ---------- */
.wrap.wide { max-width: 1180px; }
.labgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.labx { border: 1px solid var(--line); background: #0e0909; display: flex; flex-direction: column; transition: border-color .2s; }
.labx:hover { border-color: #4c282a; }
.labx header { display: flex; align-items: baseline; gap: 12px; padding: 12px 14px 10px; }
.labx h2 { font-family: var(--mono); font-size: 18px; margin: 0; }
.enlarge { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--mute); background: none; border: 1px solid var(--line); padding: 3px 8px; cursor: pointer; }
.enlarge:hover { color: var(--ink); border-color: var(--red); }
.labx .stage { position: relative; height: 280px; overflow: hidden; background: #0a0506; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); touch-action: none; cursor: crosshair; }
.labx .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.labx .what { padding: 12px 14px 0; margin: 0; font-size: 13.5px; }
.lab-tech { font-family: var(--mono); font-size: 11px; color: var(--dim); padding: 6px 14px 14px; margin: 0; }
.slot .labx { border: 0; background: none; }
.slot .labx .stage { height: min(68vh, 640px); }
.slot .enlarge { display: none; }

/* holo card */
.holo-stage { display: grid; place-items: center; perspective: 900px; cursor: default; background: radial-gradient(circle at 50% 120%, #2b0e0f 0%, #0a0506 60%) !important; }
.holo { --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 50%; width: min(78%, 340px); aspect-ratio: 1.586; transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; }
.holo-in {
  position: relative; width: 100%; height: 100%; border-radius: 14px; overflow: hidden; padding: 16px 18px;
  background: linear-gradient(135deg, #1d0a0c, #12070a 55%, #1b090b); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(216,40,58,.15); color: #f2e8e4; font-family: var(--mono);
  display: flex; flex-direction: column;
}
.h-top { display: flex; justify-content: space-between; font-size: 12px; }
.h-mark { font-weight: 700; letter-spacing: .06em; }
.h-mark, .h-chip { color: #ffb3ba; }
.h-id { color: #a3898a; }
.h-chip { width: 42px; margin-top: 14px; }
.h-name { margin-top: auto; font-size: 16px; letter-spacing: .14em; }
.h-role { font-size: 10.5px; color: #a3898a; letter-spacing: .06em; }
.h-foil {
  position: absolute; inset: 0; mix-blend-mode: color-dodge; opacity: .55; pointer-events: none;
  background: repeating-linear-gradient(115deg, #d8283a 0%, #ff9aa2 6%, #ffe1e4 12%, #ff7b86 18%, #d8283a 24%); /* crimson foil, like the forest */
  background-size: 300% 300%; background-position: var(--gx) var(--gy);
  -webkit-mask-image: radial-gradient(circle at var(--gx) var(--gy), #000 0%, transparent 65%);
  mask-image: radial-gradient(circle at var(--gx) var(--gy), #000 0%, transparent 65%);
}
.h-glare { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx) var(--gy), rgba(255,255,255,.32), transparent 45%); mix-blend-mode: overlay; }

/* command palette */
.pal-stage { display: grid; place-items: center; cursor: default; padding: 16px; background: radial-gradient(circle at 30% 0%, #1e0c0d, #0a0506 60%) !important; }
.pal { width: min(100%, 460px); border: 1px solid #3b2425; background: rgba(20,8,9,.92); box-shadow: 0 24px 60px -20px #000; font-family: var(--mono); font-size: 13px; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pal-in span { color: var(--red); }
.pal input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ink); font: inherit; }
.pal kbd { font: inherit; font-size: 10.5px; color: var(--dim); border: 1px solid var(--line); padding: 1px 5px; }
.pal ul { list-style: none; margin: 0; padding: 6px; max-height: 176px; overflow: auto; }
.pal li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; cursor: pointer; color: #cfc3be; }
.pal li.on { background: #251314; color: #fff; box-shadow: inset 2px 0 var(--red); }
.pal li b { color: var(--red); font-weight: 700; }
.pal li em { font-style: normal; font-size: 11px; color: var(--dim); }
.pal li.none { color: var(--dim); cursor: default; }
.pal-foot { display: flex; gap: 14px; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--dim); }
.pal-msg { margin-left: auto; color: var(--good); }
@media (max-width: 760px) {
  .labgrid { grid-template-columns: 1fr; }
  .labx .stage { height: 240px; }
  .nav nav a { padding: 6px 4px; font-size: 12px; }
}

/* ---------- resume ---------- */
.cv { max-width: 820px; }
.cv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cv-top h1 { margin-bottom: 10px; }
.cv-sub { font-family: var(--mono); font-size: 12.5px; color: var(--mute); margin: 0 0 8px; }
.cv-sub a { color: var(--violet); text-decoration: none; }
.cv h3 {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .18em; color: var(--red);
  margin: 34px 0 12px; display: flex; align-items: center; gap: 12px;
}
.cv h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cv p { color: #d3c7c2; margin: 0; }
.job { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.job b { font-size: 16px; }
.job span { color: var(--mute); margin-left: 8px; }
.job time { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.cv ul { margin: 6px 0 0; padding-left: 18px; color: #d3c7c2; }
.cv li { margin: 4px 0; }
.cv li::marker { content: "– "; color: var(--dim); }
.skills { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; margin: 0; }
.skills dt { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.skills dd { margin: 0; color: #d3c7c2; }

footer {
  display: flex; justify-content: space-between; padding: 18px clamp(16px, 4vw, 48px);
  font-family: var(--mono); font-size: 12px; color: var(--mute); border-top: 1px solid var(--line);
}
footer .dim { color: var(--dim); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .nav { gap: 10px; }
  .gh span { display: none; }
  .nav nav a { padding: 6px 6px; }
  #tab-home { flex-direction: column; align-items: stretch; min-height: 0; }
  .art { position: relative; width: 100%; height: 54vh; min-height: 300px; }
  .art::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(10,5,6,0) 45%); }
  .hero { margin-top: -70px; padding-top: 0; padding-bottom: 48px; }
  .dash { grid-template-columns: 1fr !important; }
  .dash .side { display: none; }
  .stack { margin-left: 0; width: 100%; }
  .ink, .duet { grid-template-columns: 1fr; }
  .duet .scr svg { height: 90px; }
  .demo .body { height: 330px; font-size: 11.5px; }
  .feed .row { grid-template-columns: 34px 1fr 64px; }
  .feed .ver { display: none; }
  .skills { grid-template-columns: 1fr; }
  .skills dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover { animation: none; }
  .tiles.grid .tile:hover { transform: none; }
}
.ink .status .okmsg { color: var(--good); }

/* phone nav with five tabs: tighter, and it can scroll sideways instead of pushing GitHub off screen */
@media (max-width: 760px) {
  .nav { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .mark { font-size: 13px; }
  .nav nav { min-width: 0; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .nav nav::-webkit-scrollbar { display: none; }
  .nav nav a { padding: 6px 5px; font-size: 12px; white-space: nowrap; }
  .nav nav a.on::before, .nav nav a.on::after { content: none; }
  .gh { padding: 6px 8px; flex: none; }
}

/* "take a look" beside project titles */
.proj header .look {
  font-family: var(--mono); font-size: 12px; text-decoration: none; align-self: center;
  color: #fff; background: var(--red); border: 1px solid var(--red); padding: 5px 10px; white-space: nowrap;
  transition: background .2s, transform .2s;
}
.proj header .look:hover { background: #ff4a58; transform: translate(1px, -1px); }
.proj header .look[title^="Open the code"] { background: transparent; color: var(--ink); border-color: var(--line); }
.proj header .look[title^="Open the code"]:hover { border-color: var(--red); }

/* discord button sits just left of github */
.nav .gh.dc { margin-right: -12px; }
.nav .gh.dc:hover { border-color: #5865f2; color: #fff; }
@media (max-width: 760px) { .nav .gh.dc { margin-right: -2px; } }
@media (max-width: 760px) {
  .nav nav a { padding: 6px 3px; font-size: 11.5px; letter-spacing: -.02em; }
  .nav .gh { padding: 6px 7px; }
}

/* X button: icon only, sits left of discord */
.nav .gh.xx { margin-right: -12px; padding-left: 10px; padding-right: 10px; }
.nav .gh.xx:hover { border-color: var(--ink); }
@media (max-width: 760px) {
  .nav .gh.xx, .nav .gh.dc { margin-right: -4px; }
  .nav .gh { padding: 6px 6px; }
  .nav .gh svg { width: 16px; height: 16px; }
  .nav { gap: 6px; }
}
@media (max-width: 400px) { .mark::after { content: none; } }

/* overfit lab demo */
.ofl { display: flex; flex-direction: column; gap: 6px; }
.of-cv { width: 100%; height: 104px; display: block; border-bottom: 1px solid var(--line); }
.of-log .l { white-space: normal; }
.of-log .o { color: var(--mute); } .of-log .c { color: var(--ink); } .of-log .vio { color: var(--violet); }
.of-log .good { color: var(--good); } .of-log .bad { color: var(--bad); } .of-log .dim { color: var(--dim); }
.ofl { gap: 4px; } .of-log .l { line-height: 1.45; }

/* phones: swiping over a lab piece scrolls the page; enlarged pieces take full touch control */
.labx .stage { touch-action: pan-y; }
.slot .labx .stage { touch-action: none; }

/* work tiles: more room, and a live preview at the top of each */
#tab-work .wrap { max-width: 1240px; }
.tiles.grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }
.tiles.grid .tile { padding: 0 0 18px; gap: 10px; min-height: 0; }
.tiles.grid .tile > *:not(.t-prev) { margin-left: 20px; margin-right: 20px; }
.tiles.grid .t-open { margin: 0; z-index: 1; background: rgba(10,5,6,.7); padding: 2px 6px; }
.t-prev { display: block; width: 100%; height: 138px; background: #0a0506; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.tiles.grid .tile:hover .t-prev { border-bottom-color: var(--red); }
.tiles.table .t-prev { display: none; }
@media (max-width: 760px) {
  .tiles.grid { gap: 18px; }
  .t-prev { height: 120px; }
}

/* ---------- lab: interface components ---------- */
.lab-sub { grid-column: 1 / -1; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .18em; color: var(--red); margin: 26px 0 0; display: flex; align-items: center; gap: 12px; }
.lab-sub::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ui-stage { cursor: default !important; display: grid; place-items: center; padding: 14px; font-family: var(--mono); }

/* spotlight */
.spot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.spot-c {
  --x: -999px; --y: -999px; position: relative; padding: 12px; min-height: 92px; display: flex; flex-direction: column; gap: 4px;
  background: #120a0a; border-radius: 8px; isolation: isolate;
}
.spot-c::before { /* the border that catches the light */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background: radial-gradient(180px circle at var(--x) var(--y), var(--red), rgba(255,123,134,.6) 40%, #2c1214 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot-c::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; background: radial-gradient(140px circle at var(--x) var(--y), rgba(216,40,58,.10), transparent 70%); }
.spot-i { color: var(--red); font-size: 16px; }
.spot-c b { font-size: 13px; color: var(--ink); }
.spot-d { font-family: var(--sans); font-size: 11.5px; color: var(--mute); }

/* kanban */
.kb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; height: 100%; }
.kb-col { background: #110a0a; border: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; min-height: 0; }
.kb-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); padding: 2px 4px 6px; }
.kb-list { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.kb-card {
  font-family: var(--sans); font-size: 12px; color: var(--ink); background: #1a1010; border: 1px solid #342122; padding: 6px 8px;
  cursor: grab; touch-action: none; user-select: none; border-radius: 4px;
}
.kb-card:hover { border-color: var(--red); }
.kb-hole { opacity: .25; border-style: dashed; }
.kb-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: rotate(-3deg) scale(1.04); box-shadow: 0 14px 30px -8px #000; border-color: var(--red); cursor: grabbing; }

/* split-flap */
.sf-stage { background: radial-gradient(circle at 50% 0%, #1b0c0d, #0a0506 70%) !important; }
.sf { display: flex; flex-direction: column; gap: 5px; }
.sf-row { display: flex; gap: 2px; }
.sf-c {
  width: 17px; height: 26px; display: grid; place-items: center; background: linear-gradient(#1c1414 49%, #000 49% 51%, #150f0f 51%);
  color: #f2e8d8; font-size: 15px; font-weight: 700; border-radius: 2px; box-shadow: inset 0 -1px 0 #2b1c1d;
}
.sf-title .sf-c { color: #e8c49a; }
.sf-c.flap { animation: flap .11s ease-in; }
@keyframes flap { 0% { transform: scaleY(1); } 50% { transform: scaleY(.15); filter: brightness(1.6); } 100% { transform: scaleY(1); } }

/* toasts */
.ts-bar { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.ts-btn { font: inherit; font-size: 11.5px; color: var(--mute); background: var(--bg2); border: 1px solid var(--line); padding: 4px 9px; cursor: pointer; }
.ts-btn:hover { color: var(--ink); border-color: var(--red); }
.ts-stack { position: absolute; right: 14px; bottom: 14px; width: min(270px, calc(100% - 28px)); height: 0; }
.ts {
  --i: 0; position: absolute; right: 0; bottom: 0; width: 100%; padding: 10px 12px 12px 30px; background: #1a1010; border: 1px solid #342122;
  border-radius: 8px; box-shadow: 0 10px 30px -10px #000; display: flex; flex-direction: column; gap: 2px; overflow: hidden; touch-action: pan-y;
  transform: translateY(calc(var(--i) * -12px)) scale(calc(1 - var(--i) * .05)); opacity: calc(1 - var(--i) * .22);
  transition: transform .3s cubic-bezier(.2,.9,.2,1), opacity .3s, translate .25s; animation: tsin .3s cubic-bezier(.2,.9,.2,1); cursor: grab;
}
.ts-stack:hover .ts { transform: translateY(calc(var(--i) * -64px)); opacity: 1; }
.ts.drag { transition: none; }
.ts.out { opacity: 0 !important; }
.ts.ts-hidden { opacity: 0; pointer-events: none; }
@keyframes tsin { from { transform: translateY(40px) scale(.96); opacity: 0; } }
.ts b { font-family: var(--sans); font-size: 13px; color: var(--ink); }
.ts-m { font-family: var(--sans); font-size: 12px; color: var(--mute); }
.ts-dot { position: absolute; left: 12px; top: 14px; width: 8px; height: 8px; border-radius: 50%; }
.ts-ok .ts-dot { background: var(--good); } .ts-bad .ts-dot { background: var(--bad); }
.ts-wait .ts-dot { background: transparent; border: 2px solid var(--violet); border-top-color: transparent; width: 10px; height: 10px; left: 11px; top: 13px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ts-life { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--red); transform-origin: left; animation: life linear forwards; }
.ts-ok .ts-life { background: var(--good); }
@keyframes life { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* knob */
.kn { position: relative; display: grid; place-items: center; outline: none; cursor: ns-resize; touch-action: none; user-select: none; }
.kn:focus-visible .kn-body { stroke: var(--violet); }
.kn-svg { width: min(210px, 70vw); height: auto; display: block; }
.kn-tick { stroke: #342122; stroke-width: 2; stroke-linecap: round; transition: stroke .15s; }
.kn-tick.on { stroke: var(--red); }
.kn-arc { fill: none; stroke: var(--violet); stroke-width: 3; stroke-linecap: round; opacity: .8; }
.kn-body { fill: #161010; stroke: #3b2425; stroke-width: 2; }
.kn-mark { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.kn-val { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 22px; font-weight: 700; color: var(--ink); pointer-events: none; }
.kn-val.hot { color: var(--red); }
.kn-lab { position: absolute; bottom: -4px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .14em; }

/* liquid tabs */
.lq-defs { position: absolute; width: 0; height: 0; }
.lq { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.lq-seg { position: relative; display: flex; background: #120a0a; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.lq-goo { position: absolute; inset: 4px; pointer-events: none; }
.lq-blob { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--red); transform-origin: center; }
.lq-trail { top: 20%; bottom: 20%; background: var(--red); opacity: .9; }
.lq-small .lq-blob { background: var(--violet); }
.lq-opt { position: relative; z-index: 1; font: inherit; font-size: 12.5px; color: var(--mute); background: none; border: 0; padding: 8px 16px; cursor: pointer; border-radius: 999px; transition: color .2s; }
.lq-opt.on { color: #fff; }
.lq-small .lq-opt { font-size: 11.5px; padding: 6px 13px; }
.lq-status { font-size: 11px; color: var(--dim); }
@media (max-width: 760px) {
  .spot { grid-template-columns: repeat(2, 1fr); } .spot-c:nth-child(n+5) { display: none; }
  .sf-c { width: 14px; height: 22px; font-size: 12.5px; }
  .lq-opt { padding: 7px 11px; }
}

/* glyph demo */
.gl { display: grid !important; grid-template-columns: 1.15fr 1fr .7fr; gap: 12px; }
.gl-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gl-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.gl-src { margin: 0; font: inherit; color: var(--ink); white-space: pre; overflow: hidden; }
.gl-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 6px; padding: 1px 4px; color: var(--mute); animation: rowin .25s ease-out; }
.gl-row .gl-op { color: var(--violet); } .gl-row .gl-o { color: var(--dim); }
.gl-row.on { background: rgba(216,40,58,.18); box-shadow: inset 2px 0 var(--red); color: var(--ink); }
.gl-row.on .gl-op { color: #fff; }
.gl-stack { display: flex; flex-direction: column-reverse; gap: 3px; min-height: 64px; justify-content: flex-start; }
.gl-stack span { border: 1px solid #3b2425; background: #160d0d; padding: 2px 8px; color: var(--ink); text-align: center; }
.gl-box { border: 1px dashed var(--violet); color: var(--violet); padding: 2px 8px; text-align: center; }
.gl-box.pop { animation: glpop .3s ease-out; }
@keyframes glpop { 50% { transform: scale(1.18); background: rgba(255,123,134,.2); } }
.gl-out { color: var(--dim); min-height: 1.5em; } .gl-out.done { color: var(--good); }
@media (max-width: 760px) { .gl { grid-template-columns: 1fr 1fr; } .gl-src { display: none; } .gl-col:first-child { display: none; } }

/* ---------- page transitions ---------- */
.curtain { position: fixed; left: 0; top: 0; z-index: 45; pointer-events: none; display: none; image-rendering: pixelated; image-rendering: crisp-edges; }
.curtain.on { display: block; }
.enter { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } } /* transform + opacity only: stays on the GPU */
body.fade-swap main { opacity: 0; transition: opacity .14s; }
main { transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { .enter { animation-duration: .35s; } @keyframes rise { from { opacity: 0; } } }

/* ---------- disintegration transition (View Transitions) ---------- */
::view-transition-group(root) { animation-duration: .72s; }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; animation: none; }
::view-transition-old(root) {
  z-index: 2;
  animation: vt-hold .72s steps(1) both;
  -webkit-mask-image: var(--dz); mask-image: var(--dz);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  image-rendering: pixelated;
  translate: var(--jx, 0px) 0;
}
::view-transition-new(root) { z-index: 1; animation: vt-hold .72s steps(1) both; }
@keyframes vt-hold { from { opacity: 1; } to { opacity: 1; } }
.dust { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; image-rendering: pixelated; view-transition-name: dust; }
::view-transition-group(dust) { z-index: 3; animation: none; }
::view-transition-old(dust) { display: none; }
::view-transition-new(dust) { animation: none; }
/* the menu stays solid during the crumble and switches to its new state at once */
.nav { view-transition-name: nav; }
::view-transition-group(nav) { z-index: 4; animation: none; }
::view-transition-old(nav) { display: none; }
::view-transition-new(nav) { animation: none; }

/* letters transition */
.letters { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 45; pointer-events: none; display: none; }
.letters.on { display: block; }

/* lattice demo */
.lt { display: flex !important; flex-direction: column; gap: 10px; }
.lt-nodes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lt-node { border: 1px solid var(--line); background: #120a0a; padding: 6px 8px; min-height: 92px; transition: border-color .3s, opacity .3s; }
.lt-node.leader { border-color: var(--red); box-shadow: inset 0 2px 0 var(--red); }
.lt-node.dead { opacity: .35; }
.lt-top { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 11px; }
.lt-top b { color: var(--ink); font-size: 12px; }
.lt-role { color: var(--mute); } .lt-node.leader .lt-role { color: var(--red); } .lt-node.dead .lt-role { color: var(--bad); }
.lt-term { margin-left: auto; color: var(--dim); }
.lt-entries { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.lt-entries span { font-size: 11px; padding: 1px 6px; border: 1px dashed var(--mute); color: var(--mute); animation: rowin .25s ease-out; }
.lt-entries span.ok { border-style: solid; border-color: var(--good); color: var(--good); }
.lt-log .l { white-space: normal; } .lt-log .o { color: var(--mute); } .lt-log .c { color: var(--ink); } .lt-log .vio { color: var(--violet); } .lt-log .good { color: var(--good); } .lt-log .bad { color: var(--bad); }
/* pulse demo */
.ps { display: flex !important; flex-direction: column; gap: 8px; }
.ps-row { display: grid; grid-template-columns: 90px 1fr 54px; gap: 10px; align-items: center; }
.ps-h { color: var(--mute); font-size: 11px; }
.ps-bar { height: 10px; background: #1a1010; }
.ps-bar i { display: block; height: 100%; width: 0; }
.ps-bar.raw i { background: #4b393a; } .ps-bar.cmp i { background: var(--red); transition: width .05s; }
.ps-n { color: var(--ink); font-size: 12px; text-align: right; }
.ps-bits { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; min-height: 26px; }
.ps-what { color: var(--violet); font-size: 11px; margin-right: 6px; }
.ps-bit { border: 1px solid #3b2425; padding: 1px 6px; color: var(--ink); animation: rowin .2s ease-out; }
.ps-blocks { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 16px; }
.ps-blocks i { background: #2c1214; }
.ps-blocks i.sum { background: var(--good); opacity: .7; }
.ps-log .l { white-space: normal; } .ps-log .o { color: var(--mute); } .ps-log .good { color: var(--good); }
@media (max-width: 760px) { .lt-nodes { grid-template-columns: 1fr 1fr 1fr; } .lt-node { min-height: 80px; padding: 5px; } .ps-row { grid-template-columns: 70px 1fr 46px; } }
.ts { z-index: calc(20 - var(--i)); } /* newest toast on top */

/* resume: projects list */
.cv-projects { display: flex; flex-direction: column; gap: 12px; }
.cv-proj b { font-size: 15px; color: var(--ink); }
.cv-proj a { text-decoration: none; }
.cv-proj a b { color: var(--violet); }
.cv-proj a:hover b { color: #fff; text-decoration: underline; }
.cv-proj > span { font-family: var(--mono); font-size: 11.5px; color: var(--mute); margin-left: 8px; }
.cv-proj p { margin: 2px 0 0; }

/* open to work */
.dot-live { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); vertical-align: middle; }
.dot-live::after { /* the pulse ring: transform + opacity only, so it never repaints */
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(127,214,162,.55);
  animation: livepulse 1.8s ease-out infinite; will-change: transform, opacity;
}
@keyframes livepulse { 0% { transform: scale(1); opacity: .8; } 70%, 100% { transform: scale(3); opacity: 0; } }
.work-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 4px 11px; border: 1px solid rgba(127,214,162,.4); border-radius: 999px; font-family: var(--mono); font-size: 12px; color: var(--good); text-decoration: none; background: rgba(127,214,162,.06); }
.work-pill:hover { border-color: var(--good); color: #fff; }
.open-work { margin: 18px 0 0 !important; padding: 12px 14px; border: 1px solid rgba(127,214,162,.35); background: rgba(127,214,162,.05); color: #d3c7c2; line-height: 1.6; }
.open-work .dot-live { margin-right: 8px; }
.open-work b { color: var(--good); }
.open-work a { color: var(--violet); }

/* ---------- HIRE ME button (on every page) ---------- */
.hire {
  --mx: 0px; --my: 0px;
  position: fixed; right: clamp(14px, 3vw, 34px); bottom: clamp(14px, 3vw, 30px); z-index: 44;
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: #fff;
  transform: translate(var(--mx), var(--my)); transition: transform .15s ease-out;
  animation: hire-in .8s cubic-bezier(.2,.9,.2,1.3) both .6s;
}
@keyframes hire-in { from { opacity: 0; transform: translateY(40px) scale(.7); } }
.hire-ring { /* rotating gradient border: the gradient layer turns (GPU transform), the ring shape is a fixed mask */
  position: absolute; inset: -2px; border-radius: 999px; padding: 2px; overflow: hidden;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.hire-ring::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px;
  background: conic-gradient(#3a080d, #d8283a 18%, #ffd6da 25%, #ff7b86 31%, #8f1720 45%, #3a080d 60%, #d8283a 80%, #3a080d);
  animation: ring-turn 4.5s linear infinite; will-change: transform;
}
@keyframes ring-turn { to { transform: rotate(360deg); } }
.hire::before { /* glow that breathes */
  content: ""; position: absolute; inset: -10px; border-radius: 999px; z-index: -1;
  background: radial-gradient(closest-side, rgba(216,40,58,.5), transparent); animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .35; transform: scale(1.12); } }
.hire-in {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 22px 14px 18px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(46,8,12,.78), rgba(20,4,6,.84) 70%, rgba(12,3,4,.9)); font-family: var(--mono);
  box-shadow: 0 8px 26px rgba(216,40,58,.42), 0 0 12px rgba(255,123,134,.18); /* static shadow: painted once, not every frame */ font-weight: 800; font-size: 16px; letter-spacing: .14em;
  overflow: hidden;
}
.hire-in::after { /* scanline sheen sweeping across */
  content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.18) 48%, transparent 66%);
  transform: translateX(-120%); animation: sheen 3.6s ease-in-out infinite 1.2s;
}
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.hire-txt { position: relative; min-width: 7.6ch; color: #ffe9ec; text-shadow: 0 0 8px rgba(255,123,134,.75), 0 0 18px rgba(216,40,58,.7), 1px 0 rgba(216,40,58,.8); }
.hire-arrow { transition: transform .2s; color: #d8283a; }
.hire:hover .hire-arrow { transform: translateX(4px); }
.hire:hover .hire-in { background: linear-gradient(180deg, rgba(70,10,16,.72), rgba(30,5,8,.8) 70%, rgba(16,3,5,.88)); }
.hire:hover .hire-in { box-shadow: 0 10px 36px rgba(216,40,58,.65), 0 0 18px rgba(255,123,134,.35); }
.hire:focus-visible { outline: 2px solid #ff7b86; outline-offset: 6px; border-radius: 999px; }
.hire.jolt .hire-in { animation: jolt .26s steps(2) 1; }
@keyframes jolt { 0% { transform: translate(2px, 0); } 33% { transform: translate(-3px, 1px); clip-path: inset(10% 0 40% 0); } 66% { transform: translate(2px, -1px); clip-path: inset(50% 0 5% 0); } 100% { transform: none; clip-path: none; } }
.hire-sparks { position: absolute; pointer-events: none; z-index: 1; }
.hire-in, .hire-ring { z-index: 2; }
.hire-arrow { color: #ff7b86 !important; }
.hire .dot-live { width: 9px; height: 9px; }

/* the contact panel */
dialog#hire-panel {
  width: min(560px, calc(100vw - 28px)); padding: 22px 24px 20px; border: 1px solid transparent; border-radius: 14px; color: var(--ink);
  background: linear-gradient(#120a0a, #120a0a) padding-box, linear-gradient(135deg, #d8283a, #ff7b86) border-box;
  box-shadow: 0 30px 80px -20px #000, 0 0 60px -20px rgba(216,40,58,.5);
}
dialog#hire-panel[open] { animation: pop .3s cubic-bezier(.2,.9,.2,1.2); }
dialog#hire-panel::backdrop { background: rgba(5,2,2,.82); } /* no blur: keeps the cursor trail smooth on top */
.hp-head { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--good); }
.hp-x { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--mute); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font: inherit; }
.hp-x:hover { color: #fff; border-color: var(--red); }
.hp-title { font-family: var(--mono); font-size: clamp(24px, 5vw, 32px); margin: 12px 0 8px; letter-spacing: -.01em; }
.hp-lead { color: #d3c7c2; margin: 0 0 14px; }
.hp-chips { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.hp-chips li { font-family: var(--mono); font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid #3b2425; color: var(--mute); }
.hp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hp-btn { font-family: var(--mono); font-size: 13px; text-decoration: none; text-align: center; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); color: var(--ink); background: #170e0e; transition: border-color .2s, transform .15s; }
.hp-btn:hover { border-color: var(--violet); transform: translateY(-2px); }
.hp-main { grid-column: 1 / -1; background: linear-gradient(135deg, #d8283a, #a81c2a); border-color: transparent; color: #fff; font-weight: 700; font-size: 14px; }
.hp-main:hover { border-color: transparent; filter: brightness(1.1); }
.hp-copy { margin-top: 12px; width: 100%; background: none; border: 0; color: var(--dim); font-family: var(--mono); font-size: 11.5px; cursor: pointer; }
.hp-copy:hover { color: var(--ink); }
body:has(dialog#hire-panel[open]) { overflow: hidden; }

@media (max-width: 760px) {
  .hire-in { padding: 12px 18px 12px 14px; font-size: 14px; }
  .hp-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .hire-ring::before { animation-duration: 8s; } .hire-in::after { animation: none; } }
.hp-actions .hp-btn:last-child { grid-column: 1 / -1; }
.job em.beta { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--red); border: 1px solid rgba(216,40,58,.45); border-radius: 999px; padding: 1px 8px; margin-left: 8px; vertical-align: 2px; }

/* cursor trail: a see-through layer over everything (top layer via popover where supported) */
.cursor-code { position: fixed; inset: 0; width: 100vw; height: 100vh; margin: 0; padding: 0; border: 0; background: transparent; pointer-events: none; z-index: 2147483000; display: none; overflow: visible; }
.cursor-code.on, .cursor-code:popover-open { display: block; }
.cursor-code::backdrop { display: none; }
.art canvas.art-tiles { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- home: the left side, alive ---------- */
#tab-home { --hx: -999px; --hy: -999px; }
#tab-home::before { /* cursor glow */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(420px circle at var(--hx) var(--hy), rgba(216,40,58,.10), rgba(255,123,134,.04) 45%, transparent 70%);
}
.hero { z-index: 2; }
.kclock { color: var(--dim); }
.rotator { font-family: var(--mono); font-size: clamp(15px, 1.6vw, 19px); color: var(--mute); margin: -10px 0 18px; min-height: 1.5em; }
.rot { background: linear-gradient(90deg, var(--red), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.rot-caret { display: inline-block; width: .55em; height: 1.05em; margin-left: 3px; vertical-align: -.15em; background: var(--red); animation: blink 1s steps(1) infinite; }
.facts b { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .rot-caret { animation: none; } }

/* ---------- home: one canopy across the whole hero ---------- */
.art { width: 100% !important; }
.art::after { /* a soft dark pool behind the text so it reads crisp over the branches */
  background:
    radial-gradient(ellipse 40% 60% at 20% 52%, rgba(10,5,6,.72) 0%, rgba(10,5,6,.5) 50%, rgba(10,5,6,0) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(10,5,6,0) 16%) !important;
}
.hero h1, .hero .lede, .hero .rotator, .hero .facts { text-shadow: 0 0 22px rgba(10,5,6,.9), 0 0 6px rgba(10,5,6,.8); }
@media (max-width: 760px) {
  .art::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(10,5,6,0) 45%) !important; }
}
.kclock { white-space: nowrap; }

/* ---------- WebGL forest hero ---------- */
.art .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; opacity: .4; display: none; }
.art canvas.hero-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.art.gl .hero-video, .art.gl canvas.hero-gl { display: block; }
.art.gl #bg, .art.gl #fg, .art.gl canvas.art-tiles { display: none; }
