/* ───────── Fonts (self-hosted, latin subset) ───────── */
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-opsz-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

/* ───────── Tokens ───────── */
:root {
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* light: oscilloscope paper */
  --bg: #f3efe4;
  --bg-2: #ebe5d5;
  --bg-3: #e2dac6;
  --ink: #17211c;
  --ink-2: #47524b;
  --line: #cdc4ae;
  --grid: rgba(23, 33, 28, .09);
  --span: #bf400b;
  --on-span: #ffffff;
  --svc: #0b6b60;
  --warn: #7d5200;
  --warn-bg: #f1dfae;
  --ok: #0b6b60;
  --ok-bg: #cfe6df;
  --focus: #0b6b60;
  --shadow: 0 1px 0 rgba(23, 33, 28, .06), 0 12px 30px -18px rgba(23, 33, 28, .35);

  --wrap: 1180px;
  --pad: clamp(16px, 4vw, 40px);
  --label: 248px;
  --radius: 6px;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #0f1613;
  --bg-2: #15201b;
  --bg-3: #1c2924;
  --ink: #ece6d6;
  --ink-2: #a5ada1;
  --line: #2b3a33;
  --grid: rgba(236, 230, 214, .08);
  --span: #ff8c5a;
  --on-span: #1d0f07;
  --svc: #62d6c0;
  --warn: #e9bb4e;
  --warn-bg: #3a2f12;
  --ok: #62d6c0;
  --ok-bg: #12332d;
  --focus: #62d6c0;
  --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 16px 34px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
/* No-JS fallback: follow the OS */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f1613; --bg-2: #15201b; --bg-3: #1c2924; --ink: #ece6d6; --ink-2: #a5ada1; --line: #2b3a33;
    --grid: rgba(236, 230, 214, .08); --span: #ff8c5a; --on-span: #1d0f07; --svc: #62d6c0; --warn: #e9bb4e;
    --warn-bg: #3a2f12; --ok: #62d6c0; --ok-bg: #12332d; --focus: #62d6c0; color-scheme: dark;
  }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  overflow-x: hidden;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px);
  background-size: 100% 48px;
  background-attachment: local;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--span); }
code, .k, .mono { font-family: var(--font-mono); }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--pad), var(--wrap)); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius); font-family: var(--font-mono); }
.skip:focus { top: 8px; }

/* ───────── Header ───────── */
.bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap;
  padding: 10px var(--pad);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font: 600 .95rem var(--font-mono); text-decoration: none; }
.trace-id { margin: 0; font-size: .75rem; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.trace-id .k { color: var(--ink-2); }
.trace-id code { color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); padding: 1px 7px; border-radius: 4px; }
.bar nav { margin-left: auto; }
.bar nav ul { display: flex; gap: 4px; }
.bar nav a { display: block; padding: 6px 10px; font: 500 .8rem var(--font-mono); text-decoration: none; border-radius: 4px; }
.bar nav a:hover { background: var(--bg-3); color: var(--ink); }
.bar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius); cursor: pointer; }
.icon-btn:hover { border-color: var(--ink-2); }
[data-theme='dark'] .icon-btn .rays { opacity: 0; }

/* ───────── Buttons & chips ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; min-height: 44px;
  font: 600 .85rem var(--font-mono); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  color: var(--on-span); background: var(--span); border: 1px solid var(--span); border-radius: var(--radius);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { color: var(--on-span); transform: translateY(-1px); box-shadow: 0 6px 16px -8px var(--span); }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: var(--bg-2); box-shadow: none; }
.btn-sm { padding: 6px 12px; min-height: 36px; font-size: .78rem; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px;
  font: 600 .72rem/1.6 var(--font-mono); border-radius: 99px; white-space: nowrap;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-2);
}
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.ok i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.live i { animation: pulse 1.8s ease-out infinite; }
.tag { display: inline-block; padding: 2px 8px; font: 500 .75rem/1.55 var(--font-mono); background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); }
.tag b { color: var(--ink-2); font-weight: 400; }

/* ───────── Root span / intro ───────── */
.root { position: relative; padding-top: clamp(28px, 6vw, 72px); padding-bottom: clamp(40px, 7vw, 88px); }
.reqline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font: 500 .85rem var(--font-mono); margin-bottom: 18px; }
.method { background: var(--svc); color: var(--bg); padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.root-grid { display: grid; gap: 36px; }
h1 { font-size: clamp(4.4rem, 17vw, 12.5rem); font-variation-settings: 'opsz' 144; font-weight: 700; letter-spacing: -.045em; line-height: .84; }
h1 .l { display: block; animation: name-in .9s cubic-bezier(.2, .8, .2, 1) both; }
h1 .l2 { color: var(--span); padding-left: clamp(.6rem, 5vw, 4.5rem); animation-delay: .15s; }
h1 { text-shadow: 0 0 .35em var(--bg), 0 0 .12em var(--bg); }
.role { font: 500 clamp(.85rem, 2.4vw, 1.05rem)/1.5 var(--font-mono); margin: 18px 0 20px; color: var(--ink); }
.pipe { color: var(--span); margin-inline: .25em; }
.lede { max-width: 62ch; color: var(--ink-2); font-size: 1.05rem; }
.cta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.attrs { margin: 0; align-self: start; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-family: var(--font-mono); font-size: .8rem; }
.attrs > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 9px 14px; border-bottom: 1px dashed var(--line); }
.attrs > div:last-child { border-bottom: 0; }
.attrs dt { color: var(--ink-2); }
.attrs dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 960px) { .root-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 400px); gap: 64px; align-items: center; } }

/* ───────── Sections ───────── */
.sec { padding-block: clamp(36px, 6vw, 72px); border-top: 1px solid var(--line); }
.sec-head { margin-bottom: 28px; max-width: 70ch; }
.eyebrow { font: 500 .78rem var(--font-mono); color: var(--svc); text-transform: lowercase; margin-bottom: 8px; }
.eyebrow::before { content: '▸ '; color: var(--span); }
.sec h2 { font-size: clamp(2rem, 5.5vw, 3.4rem); font-variation-settings: 'opsz' 96; }
.sub { color: var(--ink-2); margin: 12px 0 0; }
.k { color: var(--ink-2); font-size: .78rem; }

/* ───────── Ask my CV ───────── */
.ask { display: flex; align-items: stretch; gap: 0; background: var(--bg-2); border: 1.5px solid var(--ink-2); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ask:focus-within { border-color: var(--focus); outline: 3px solid var(--focus); outline-offset: 2px; }
.ask .prompt { display: grid; place-items: center; padding: 0 14px; font: 600 .85rem var(--font-mono); color: var(--svc); border-right: 1px dashed var(--line); white-space: nowrap; }
.ask input { flex: 1; min-width: 0; padding: 14px; font: 500 .95rem var(--font-mono); color: var(--ink); background: transparent; border: 0; outline: 0; }
.ask input::placeholder { color: var(--ink-2); opacity: .8; }
.ask .btn { border-radius: 0; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.examples button { cursor: pointer; padding: 6px 12px; min-height: 36px; font: 500 .8rem var(--font-mono); text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 99px; }
.examples button:hover { border-color: var(--span); color: var(--span); }
.ask-out { display: grid; gap: 12px; }
.q-echo { font: 500 .85rem var(--font-mono); color: var(--ink-2); margin: 0; overflow-wrap: anywhere; }
.q-echo b { color: var(--svc); }
.hit { background: var(--bg-2); border: 1px solid var(--line); border-left: 4px solid var(--svc); border-radius: var(--radius); padding: 14px 16px; animation: rise .35s ease both; }
.hit.top { border-left-color: var(--span); box-shadow: var(--shadow); }
.hit p { margin: 0 0 10px; }
.hit.top p { font-size: 1.08rem; }
.hit mark { background: var(--warn-bg); color: var(--ink); padding: 0 2px; border-radius: 2px; }
.hit footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font: 500 .75rem var(--font-mono); color: var(--ink-2); }
.hit footer strong { color: var(--ink); }
.rel { display: inline-block; width: 64px; height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.rel i { display: block; height: 100%; background: var(--svc); }
.none { background: var(--warn-bg); border: 1px solid transparent; border-radius: var(--radius); padding: 16px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; animation: rise .35s ease both; }
.none p { margin: 0; font-weight: 600; color: var(--ink); }
.out-meta { font: 400 .75rem var(--font-mono); color: var(--ink-2); margin: 0; }

/* ───────── Waterfall ───────── */
.wf { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); box-shadow: var(--shadow); overflow: hidden; }
.wf-head, .wf-row .rowhead { display: grid; grid-template-columns: var(--label) 1fr; align-items: center; }
.wf-head { background: var(--bg-3); border-bottom: 1px solid var(--line); font: 500 .72rem var(--font-mono); color: var(--ink-2); }
.wf-head > div:first-child { padding: 10px 16px; }
.ticks { display: grid; grid-template-columns: repeat(var(--years), minmax(0, 1fr)); }
.ticks span { white-space: nowrap; padding: 10px 0 10px 4px; border-left: 1px solid var(--line); }
.track { position: relative; height: 100%; min-height: 54px; background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px); background-size: calc(100% / var(--years)) 100%; }
.wf-row { border-bottom: 1px solid var(--line); }
.wf-row:last-child { border-bottom: 0; }
.rowhead { width: 100%; padding: 0; text-align: left; background: transparent; border: 0; cursor: pointer; }
button.rowhead:hover { background: color-mix(in srgb, var(--span) 6%, transparent); }
.lbl { padding: 10px 16px; min-width: 0; }
.lbl .n { display: flex; align-items: center; gap: 8px; font: 600 .88rem/1.3 var(--font-mono); }
.lbl .n .car { width: 14px; color: var(--span); transition: transform .2s; flex: none; }
button.rowhead[aria-expanded='true'] .car { transform: rotate(90deg); }
.lbl .d { font: 400 .75rem var(--font-mono); color: var(--ink-2); margin: 2px 0 0 22px; }
.bar-span { position: absolute; top: 14px; height: 26px; border-radius: 4px; background: var(--span); transform-origin: left center; display: flex; align-items: center; justify-content: flex-end; min-width: 6px; }
.bar-span.root-b { top: 22px; height: 10px; background: repeating-linear-gradient(135deg, var(--ink-2) 0 5px, transparent 5px 9px); opacity: .55; border-radius: 2px; }
.bar-span.s2 { background: var(--svc); }
.bar-span.s3 { background: var(--warn); }
.bar-span .live-dot { position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--span); box-shadow: 0 0 0 0 var(--span); animation: pulse 1.8s ease-out infinite; }
.bar-span .dur { font: 600 .72rem var(--font-mono); color: var(--on-span); padding-right: 8px; white-space: nowrap; }
.s2 .dur { color: var(--bg); } .s3 .dur { color: var(--bg); }
.js .bar-span { animation: draw .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 140ms + 120ms); }
.js .live-dot { animation: pulse 1.8s ease-out infinite; }
.wf-panel { padding: 16px 16px 20px calc(var(--label) + 0px); background: var(--bg); border-top: 1px dashed var(--line); animation: fade .25s ease both; }
.wf-panel[hidden] { display: none; }
.panel-grid { display: grid; gap: 18px; padding-right: 8px; }
.panel-title { font: 600 1.4rem/1.15 var(--font-display); margin: 0 0 4px; }
.panel-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.sect-label { font: 500 .72rem var(--font-mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.logs { font-family: var(--font-mono); font-size: .8rem; line-height: 1.55; background: color-mix(in srgb, var(--ink) 4%, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius); }
.logs li { display: grid; grid-template-columns: 4.6em 1fr; gap: 10px; padding: 8px 12px; border-bottom: 1px dashed var(--line); }
.logs li:last-child { border-bottom: 0; }
.logs .lv { color: var(--svc); font-weight: 600; }
.logs .tx { font-family: var(--font-body); font-size: .93rem; color: var(--ink); }
.evt { margin-top: 18px; }
.evt ul { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.evt li { display: grid; grid-template-columns: 6.5em 8.5em 1fr; gap: 12px; padding: 9px 14px; border-bottom: 1px dashed var(--line); font: 400 .8rem var(--font-mono); align-items: baseline; }
.evt li:last-child { border-bottom: 0; }
.evt .yr { color: var(--ink-2); }
.evt .kd { color: var(--svc); }
.evt li span:last-child { font-family: var(--font-body); font-size: .93rem; }
.ev-mark { position: absolute; top: 18px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); background: var(--svc); border-radius: 2px; }
.js .ev-mark { animation: pop .5s ease both; animation-delay: 700ms; }

/* ───────── Service map ───────── */
.map { position: relative; height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); box-shadow: var(--shadow); background-image: radial-gradient(var(--grid) 1.2px, transparent 1.4px); background-size: 22px 22px; }
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.edge { fill: none; stroke: var(--ink-2); stroke-width: 1.5; opacity: .5; stroke-dasharray: var(--len); transition: opacity .2s, stroke .2s; }
.js .edge { animation: edge-draw 1.1s cubic-bezier(.3, .7, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 250ms); }
.flow { fill: none; stroke: var(--span); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 14; opacity: .0; animation: flow 1.4s linear infinite; }
.edge.on { stroke: var(--span); opacity: 1; stroke-width: 2; }
.flow.on { opacity: .9; }
.edge-label { font: 600 11px var(--font-mono); fill: var(--ink); paint-order: stroke; stroke: var(--bg-2); stroke-width: 5px; stroke-linejoin: round; opacity: 0; transition: opacity .2s; text-anchor: middle; }
.edge-label.on { opacity: 1; }
.node {
  position: absolute; transform: translate(-50%, -50%);
  width: var(--node-w, 184px); padding: 10px 12px 11px; text-align: left; cursor: pointer;
  background: var(--bg); border: 1.5px solid var(--ink-2); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.js .node { animation: node-in .5s ease both; animation-delay: calc(var(--i) * 70ms); }
.node:hover { border-color: var(--span); transform: translate(-50%, -50%) translateY(-2px); }
.node[aria-pressed='true'] { border-color: var(--span); box-shadow: 0 0 0 3px color-mix(in srgb, var(--span) 28%, transparent), var(--shadow); }
.node.featured { border-width: 2px; border-color: var(--warn); background: color-mix(in srgb, var(--warn-bg) 55%, var(--bg)); }
.node.featured[aria-pressed='true'], .node.featured:hover { border-color: var(--span); }
.node .nm { display: block; font: 600 .98rem/1.15 var(--font-display); font-variation-settings: 'opsz' 24; }
.node .kd { display: block; font: 400 .68rem/1.35 var(--font-mono); color: var(--ink-2); margin: 3px 0 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.node .row { display: flex; gap: 6px; flex-wrap: wrap; }
.node .chip { font-size: .66rem; padding: 0 6px; }
.stage { display: block; }
.detail { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: clamp(16px, 3vw, 28px); box-shadow: var(--shadow); scroll-margin-top: 80px; }
.detail .panel-title { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.detail-grid { display: grid; gap: 4px 36px; }
.conn { display: flex; flex-wrap: wrap; gap: 6px; }
.conn button { cursor: pointer; font: 500 .75rem var(--font-mono); padding: 3px 9px; min-height: 28px; background: transparent; border: 1px dashed var(--ink-2); border-radius: 99px; }
.conn button:hover { border-color: var(--span); color: var(--span); }
@media (min-width: 860px) { .detail-grid { grid-template-columns: 1.3fr 1fr; } }

.map.compact .edge-label { display: none; }
.map.compact .node { --node-w: min(220px, 46%); padding: 8px 10px 9px; }
.map.compact .node .nm { font-size: .92rem; }

/* ───────── Catalog ───────── */
.catalog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); box-shadow: var(--shadow); }
.svc { display: grid; grid-template-columns: 220px 1fr; gap: 12px 24px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.svc:last-child { border-bottom: 0; }
.svc h3 { font: 600 .92rem var(--font-mono); letter-spacing: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc h3 .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--svc); }
.svc .meta { font: 400 .72rem var(--font-mono); color: var(--ink-2); margin-top: 4px; }
.svc .dep-l { font: 500 .7rem var(--font-mono); color: var(--ink-2); margin-bottom: 6px; }
.svc .tag { transition: border-color .15s, background .15s; }
.svc .tag:hover { border-color: var(--svc); background: var(--ok-bg); }

/* ───────── Contact & footer ───────── */
.contact { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); margin-bottom: 22px; max-width: 640px; }
.contact li { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px dashed var(--line); font: 500 .85rem var(--font-mono); overflow-wrap: anywhere; }
.contact li:last-child { border-bottom: 0; }
.contact a { text-decoration-color: var(--span); }
.noscript { padding: 16px; background: var(--warn-bg); border-radius: var(--radius); }
.foot { margin-top: 40px; padding: 36px 0 48px; background: var(--ink); color: var(--bg); font-family: var(--font-mono); }
.foot-title { margin: 0 0 14px; font-weight: 600; letter-spacing: .1em; font-size: .85rem; }
.summary { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 24px; }
.summary div { border-left: 2px solid var(--span); padding-left: 10px; }
.summary dt { font-size: .72rem; opacity: .72; }
.summary dd { margin: 0; font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.foot-note { margin: 24px 0 0; font-size: .75rem; opacity: .72; }


/* ───────── Portrait card ───────── */
.portrait { --rx: 0deg; --ry: 0deg; margin: 0; position: relative; max-width: 400px; width: 100%; justify-self: center; background: var(--bg); border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 10px 10px 0 var(--span); transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out; }
.p-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; font: 600 .75rem var(--font-mono); background: var(--ink); color: var(--bg); border-radius: 4px 4px 0 0; }
.p-head .chip { background: transparent; border: 1px solid currentColor; color: var(--bg); }
.p-head .chip i { background: var(--svc); }
.p-img { position: relative; background: var(--span); overflow: hidden; aspect-ratio: 390 / 450; }
.p-img img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.18) brightness(1.04); mix-blend-mode: multiply; transition: filter .4s; }
.p-img::after { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(0, 0, 0, .5) 1px, transparent 1.6px); background-size: 4px 4px; mix-blend-mode: multiply; opacity: .28; transition: opacity .4s; }
.p-img[data-mode='original'] { background: transparent; }
.p-img[data-mode='original'] img { filter: none; mix-blend-mode: normal; }
.p-img[data-mode='original']::after { opacity: 0; }
.scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--svc); box-shadow: 0 0 14px 2px var(--svc); animation: scan 5.5s ease-in-out infinite; z-index: 2; }
.corner { position: absolute; width: 22px; height: 22px; z-index: 2; border: 0 solid #f3efe4; }
.corner.tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; } .corner.tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.corner.bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; } .corner.br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }
.p-badge { position: absolute; left: 10px; bottom: 36px; z-index: 3; max-width: calc(100% - 20px); padding: 3px 9px; font: 600 .7rem/1.5 var(--font-mono); background: var(--warn-bg); color: var(--warn); border-radius: 3px; }
.p-spans { position: relative; height: 44px; margin: 12px 12px 4px; background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px); background-size: calc(100% / var(--years, 13)) 100%; border-left: 1px solid var(--line); }
.p-spans i { position: absolute; height: 10px; border-radius: 2px; transform-origin: left; animation: draw .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 140ms + 600ms); }
.p-attrs { margin: 0; padding: 4px 12px 8px; font: 400 .72rem var(--font-mono); }
.p-attrs div { display: flex; gap: 10px; padding: 4px 0; border-top: 1px dashed var(--line); }
.p-attrs dt { color: var(--ink-2); min-width: 8.2em; } .p-attrs dd { margin: 0; }
.portrait figcaption { padding: 0 12px 12px; }
.view-toggle { cursor: pointer; width: 100%; min-height: 40px; padding: 8px 12px; font: 600 .75rem var(--font-mono); background: transparent; border: 1px dashed var(--ink-2); border-radius: 4px; }
.view-toggle:hover { border-color: var(--span); color: var(--span); }
@keyframes scan { 0%, 100% { top: 0; } 50% { top: calc(100% - 2px); } }

/* ───────── Metrics ───────── */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: clamp(32px, 6vw, 64px); border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--bg-2); }
.metric { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; border-right: 1px dashed var(--line); border-bottom: 1px dashed var(--line); position: relative; }
.metric::before { content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--span); transform-origin: left; animation: draw 1s cubic-bezier(.2, .8, .2, 1) both; }
.metric:nth-child(even)::before { background: var(--svc); } .metric:nth-child(3n)::before { background: var(--warn); }
.mk { font: 500 .7rem var(--font-mono); color: var(--ink-2); }
.mv { font: 650 clamp(2.6rem, 6vw, 3.8rem)/1 var(--font-display); font-variation-settings: 'opsz' 144; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.mv b { font-weight: inherit; }
.ml { font-size: .85rem; line-height: 1.4; color: var(--ink-2); }

/* ───────── Section numerals, rail, kbd ───────── */
main { counter-reset: s; overflow-x: clip; }
.sec { position: relative; counter-increment: s; }
.sec::after { content: counter(s, decimal-leading-zero); position: absolute; right: 0; top: clamp(24px, 4vw, 48px); font: 650 clamp(5rem, 13vw, 10rem)/1 var(--font-display); font-variation-settings: 'opsz' 144; color: transparent; -webkit-text-stroke: 1.5px var(--line); pointer-events: none; z-index: 0; }
.sec > * { position: relative; z-index: 1; }
kbd { font: 600 .8em var(--font-mono); padding: 1px 6px; background: var(--bg-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--ink); }
.rail { display: none; }
@media (min-width: 1360px) {
  .rail { display: block; position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 40; }
  .rail ul { display: grid; gap: 16px; position: relative; }
  .rail-line { position: absolute; right: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
  .rail-line i { display: block; width: 100%; height: 0; background: var(--span); }
  .rail a { display: flex; justify-content: flex-end; align-items: center; gap: 10px; text-decoration: none; font: 500 .72rem var(--font-mono); color: var(--ink-2); }
  .rail a span { opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s; background: var(--bg-2); border: 1px solid var(--line); padding: 1px 7px; border-radius: 3px; }
  .rail a::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink-2); position: relative; z-index: 1; transition: background .2s, border-color .2s; }
  .rail a:hover span, .rail a:focus-visible span, .rail a.on span { opacity: 1; transform: none; }
  .rail a.on::after { background: var(--span); border-color: var(--span); }
}
@media (max-width: 760px) {
  h1 { font-size: clamp(4.4rem, 23vw, 7rem); }
  .hero-bg { opacity: .55; -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 28%); mask-image: linear-gradient(to bottom, #000 0, transparent 28%); }
  .sec::after { display: none; }
  .portrait { box-shadow: 6px 6px 0 var(--span); max-width: 340px; }
  .metric { padding: 14px 12px 14px; }
  .mv { font-size: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) { .ribbon-track { animation: none !important; } .scan { display: none; } .portrait { transform: none !important; } }


/* ───────── Hero scene ───────── */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; display: grid; grid-auto-rows: 34px; align-content: start; padding-top: 24px; -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 98%); mask-image: linear-gradient(to bottom, #000 40%, transparent 98%); }
.hb-row { position: relative; border-top: 1px solid var(--grid); }
.hb { position: absolute; top: 5px; height: 24px; display: flex; align-items: center; padding: 0 8px; font: 500 .68rem var(--font-mono); white-space: nowrap; overflow: hidden; color: var(--ink-2); border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 0 3px 3px 0; transform-origin: left; animation: draw 1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
.root-grid > div:first-child { position: relative; z-index: 1; }
.reqline, .role, .lede { background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); border-radius: 6px; }
.reqline { position: relative; z-index: 1; width: fit-content; padding: 4px 10px; margin-left: -10px; }
.role, .lede { padding: 8px 12px; margin-left: -12px; }
.lede { margin-bottom: 0; }
.portrait { z-index: 1; }
@keyframes name-in { from { opacity: 0; transform: translateY(.25em); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(-.2em -.2em -.2em -.2em); } }
@keyframes letter { from { opacity: 0; transform: translateY(45%) rotate(4deg); } to { opacity: 1; transform: none; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes blink { 50% { opacity: 0; } }

/* ───────── Ribbon ───────── */
.ribbon { overflow: hidden; margin: 36px -4vw; padding: 13px 0; background: var(--ink); color: var(--bg); border-block: 3px solid var(--span); transform: rotate(-1.3deg); }
.ribbon-track { display: flex; width: max-content; animation: marquee 70s linear infinite; }
.ribbon:hover .ribbon-track { animation-play-state: paused; }
.ribbon-track span { padding-inline: 14px; font: 600 .88rem var(--font-mono); white-space: nowrap; }
.ribbon-track span:nth-child(even) { color: var(--span); }

/* ───────── Deck: terminal + metrics ───────── */
.deck { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: stretch; padding-block: 24px 8px; }
.deck .metrics { margin-top: 0; grid-template-columns: repeat(2, 1fr); }
.deck .metric:last-child { grid-column: 1 / -1; }
.tail { margin: 0; background: #0b110e; color: #d6e1d8; border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--svc); font: 400 .9rem/1.95 var(--font-mono); overflow: hidden; }
.tail-head { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: #17211c; color: #a5ada1; font-weight: 600; font-size: .75rem; }
.tail-head i { width: 10px; height: 10px; border-radius: 50%; background: #ff8c5a; } .tail-head i:nth-child(2) { background: #e9bb4e; } .tail-head i:nth-child(3) { background: #62d6c0; }
.tail-head span { margin-left: 8px; }
.tail-body { margin: 0; padding: 14px 14px 16px; list-style: none; }
.tail-body li { display: grid; grid-template-columns: 3.4em 4.4em 1fr; gap: 8px; }
.js .tail-body li { animation: rise .4s both; animation-delay: calc(var(--i) * 520ms + 500ms); }
.tail-body .y { color: #8d978d; } .tail-body .lv { color: #62d6c0; font-weight: 600; } .tail-body .lv.ev { color: #e9bb4e; } .tail-body .lv.up { color: #ff8c5a; }
.tail-body .m b { color: #ece6d6; font-weight: 600; }
.tail-body::after { content: '▍'; color: #62d6c0; margin-left: 3.4em; animation: blink 1s steps(2) infinite; }
@media (max-width: 900px) { .deck { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .tail-body li { grid-template-columns: 3em 1fr; } .tail-body .lv { display: none; } }

/* ───────── Ask band (inverted) ───────── */
.ask-band {
  --bg: #17211c; --bg-2: #202e27; --bg-3: #2b3b34; --ink: #ece6d6; --ink-2: #aab2a6; --line: #3a4c43; --grid: rgba(236, 230, 214, .08);
  --span: #ff8c5a; --on-span: #1d0f07; --svc: #62d6c0; --warn: #e9bb4e; --warn-bg: #3a2f12; --ok: #62d6c0; --ok-bg: #12332d; --focus: #62d6c0;
  background: var(--bg); color: var(--ink); margin-top: 24px;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px); background-size: 100% 48px;
}
[data-theme='dark'] .ask-band {
  --bg: #f3efe4; --bg-2: #e8e1cf; --bg-3: #ddd4bd; --ink: #17211c; --ink-2: #47524b; --line: #c4baa2; --grid: rgba(23, 33, 28, .09);
  --span: #bf400b; --on-span: #fff; --svc: #0b6b60; --warn: #7d5200; --warn-bg: #f1dfae; --ok: #0b6b60; --ok-bg: #cfe6df; --focus: #0b6b60;
}
.ask-band .sec { border-top: 0; }
.ask-band .ask { border-color: var(--ink); }

/* ───────── Waterfall crosshair ───────── */
.wf { position: relative; }
.xh { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--span); pointer-events: none; z-index: 6; display: none; }
.xh b { position: absolute; top: 5px; left: 6px; padding: 1px 7px; font: 600 .68rem var(--font-mono); background: var(--span); color: var(--on-span); border-radius: 3px; white-space: nowrap; }
.xh.flip b { left: auto; right: 6px; }
.wf:hover .xh { display: block; }
@media (max-width: 760px) { .xh b { top: 28px; } }


/* ───────── Topics, scope, retrieval trace ───────── */
.scope { font: 500 .78rem var(--font-mono); color: var(--ink-2); margin: 14px 0 10px; }
.topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.topics button { cursor: pointer; min-height: 34px; padding: 4px 12px; font: 600 .76rem var(--font-mono); background: transparent; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-2); }
.topics button:hover { border-color: var(--ink-2); color: var(--ink); }
.topics button[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.examples { margin: 0 0 22px; }
.examples button.oos { border-style: dashed; color: var(--ink-2); }
.wt { padding: 0 7px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg-3); color: var(--ink); }
.rtrace { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 4px 14px 12px; animation: rise .35s ease both; }
.rt-row { display: grid; grid-template-columns: 9.5em 1fr 5.5em; gap: 10px; align-items: center; font: 400 .74rem var(--font-mono); padding: 3px 0; }
.rt-n { color: var(--ink-2); } .rt-d { text-align: right; }
.rt-track { position: relative; height: 10px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 2px; }
.rt-track i { position: absolute; top: 0; bottom: 0; background: var(--svc); border-radius: 2px; transform-origin: left; animation: draw .6s ease both; }
.rt-row:nth-child(odd) .rt-track i { background: var(--span); }
@media (max-width: 480px) { .rt-row { grid-template-columns: 7.2em 1fr 4.6em; font-size: .68rem; } }

/* ───────── Reverse lookup + packets ───────── */
.dep-note { margin: 0 0 12px; padding: 10px 14px; font: 500 .82rem var(--font-mono); background: var(--warn-bg); color: var(--ink); border-radius: var(--radius); }
.dep-note b { color: var(--warn); }
.dep-note button { cursor: pointer; margin-left: 6px; padding: 1px 10px; min-height: 28px; font: 600 .75rem var(--font-mono); background: transparent; border: 1px solid currentColor; border-radius: 99px; }
.node.dim { opacity: .32; }
.node.dep { border-color: var(--svc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--svc) 30%, transparent); }
.packet { display: none; fill: var(--span); stroke: var(--bg); stroke-width: 2; }
.packet.on { display: block; }
button.tag { cursor: pointer; color: var(--ink); }
.svc button.tag[aria-pressed='true'] { background: var(--svc); color: var(--bg); border-color: var(--svc); }
.svc ul.tags { margin: 0; padding: 0; }

/* ───────── Span inspector ───────── */
.btn-inspect { cursor: pointer; min-height: 36px; padding: 4px 12px; font: 600 .76rem var(--font-mono); background: transparent; border: 1px dashed var(--ink-2); border-radius: var(--radius); }
.btn-inspect:hover { border-color: var(--span); color: var(--span); }
.btn-inspect[aria-pressed='true'] { background: var(--span); color: var(--on-span); border: 1px solid var(--span); }
.inspect [data-span] { outline: 2px dashed var(--span); outline-offset: -2px; position: relative; }
.inspect [data-span]::before { content: attr(data-span); position: absolute; left: 0; top: 0; z-index: 60; padding: 2px 9px; font: 600 .72rem var(--font-mono); background: var(--span); color: var(--on-span); }
@media (max-width: 520px) { .btn-inspect { display: none; } }


/* ───────── Full-screen service stage ───────── */
.svc-band {
  --bg: #0b110e; --bg-2: #111a15; --bg-3: #1a2620; --ink: #ece6d6; --ink-2: #a5ada1; --line: #2b3a33; --grid: rgba(236, 230, 214, .07);
  --span: #ff8c5a; --on-span: #1d0f07; --svc: #62d6c0; --warn: #e9bb4e; --warn-bg: #3a2f12; --ok: #62d6c0; --ok-bg: #12332d; --focus: #62d6c0;
  background: var(--bg); color: var(--ink);
  background-image: radial-gradient(rgba(98, 214, 192, .14) 1px, transparent 1.5px); background-size: 28px 28px;
}
.svc-band .sec { border-top: 0; }
.svc-band .sec::after { -webkit-text-stroke-color: #25352d; }
.hud { position: absolute; left: 12px; top: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.hud-reset { position: absolute; right: 12px; bottom: 12px; z-index: 5; cursor: pointer; min-height: 36px; padding: 4px 14px; font: 600 .76rem var(--font-mono); background: var(--bg); color: var(--ink); border: 1px solid var(--ink-2); border-radius: 99px; }
.hud-reset:hover { border-color: var(--span); color: var(--span); }
.hud-reset[hidden] { display: none; }
.map.compact .hud { display: none; }
.node.dragging { transition: none; cursor: grabbing; z-index: 4; box-shadow: 0 14px 30px -10px #000, 0 0 0 3px color-mix(in srgb, var(--span) 40%, transparent); }
.node { touch-action: manipulation; user-select: none; }
.dscroll { padding: 0; }
@media (min-width: 1360px) {
  .svc-band .sec { width: min(100% - 120px, 1500px); min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
  .stage { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; min-height: max(620px, calc(100vh - 330px)); }
  .stage .map { height: auto; min-height: 620px; }
  .stage .node { --node-w: 196px; }
  .stage .detail { position: relative; margin: 0; padding: 0; overflow: hidden; scroll-margin-top: 0; }
  .stage .dscroll { position: absolute; inset: 0; overflow: auto; padding: 22px 22px 28px; }
  .stage .detail-grid { grid-template-columns: 1fr; }
  .stage .detail .panel-title { font-size: 1.9rem; }
}

/* ───────── Boot sequence ───────── */
.boot { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; background: #0b110e; color: #d6e1d8; font-family: var(--font-mono); transition: clip-path .65s cubic-bezier(.7, 0, .2, 1); clip-path: inset(0 0 0 0); }
.boot-on .boot { display: grid; }
.boot.out { clip-path: inset(0 0 100% 0); }
.boot-on body { overflow: hidden; }
.boot-box { width: min(560px, 100% - 40px); }
.boot-title { margin: 0 0 18px; font: 700 1.1rem var(--font-mono); color: #ece6d6; }
.boot-title span { color: #62d6c0; font-weight: 500; }
.boot ol { list-style: none; margin: 0 0 22px; padding: 0; font-size: .85rem; line-height: 2; }
.boot li { opacity: 0; transform: translateY(5px); transition: opacity .25s, transform .25s; white-space: pre-wrap; overflow-wrap: anywhere; }
.boot li.on { opacity: 1; transform: none; }
.boot li b { color: #62d6c0; }
.boot li em { color: #ff8c5a; font-style: normal; font-weight: 600; }
.boot-bars { display: grid; gap: 5px; }
.boot-bars i { display: block; height: 8px; border-radius: 2px; background: #62d6c0; transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.boot-bars i:nth-child(1) { width: 100%; background: #ff8c5a; } .boot-bars i:nth-child(2) { width: 80%; margin-left: 10%; } .boot-bars i:nth-child(3) { width: 60%; margin-left: 25%; background: #e9bb4e; }
.boot-bars i:nth-child(4) { width: 45%; margin-left: 40%; } .boot-bars i:nth-child(5) { width: 25%; margin-left: 70%; background: #ff8c5a; }
.boot-bars i.on { transform: scaleX(1); }
.boot-skip { margin: 20px 0 0; font-size: .72rem; color: #8d978d; }
.boot-on main *, .boot-on header.bar *, .boot-on .ribbon-track { animation-play-state: paused !important; }

/* ───────── Motion ───────── */
@keyframes draw { from { transform: scaleX(0); opacity: .2; } to { transform: scaleX(1); opacity: 1; } }
@keyframes edge-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes flow { to { stroke-dashoffset: -32; } }
@keyframes node-in { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: rotate(45deg) scale(0); } to { opacity: 1; transform: rotate(45deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .flow { opacity: .35; }
}

/* ───────── Responsive ───────── */
@media (max-width: 1000px) {
  .ticks span:nth-child(even) { visibility: hidden; }
  :root { --label: 210px; }
}
@media (max-width: 760px) {
  :root { --label: 0px; }
  .bar { gap: 8px 12px; }
  .trace-id { order: 5; width: 100%; font-size: .7rem; }
  .bar nav { order: 4; margin-left: 0; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .bar nav ul { width: max-content; }
  .bar-actions { margin-left: auto; }
  html { scroll-padding-top: 130px; }

  .ask { flex-wrap: wrap; }
  .ask .prompt { padding: 0 12px; border-right: 0; }
  .ask input { flex: 1 1 60%; }
  .ask .btn { width: 100%; border-top: 1px solid var(--line); }

  /* waterfall becomes a vertical stack */
  .wf-head { grid-template-columns: 1fr; }
  .wf-head > div:first-child { display: none; }
  .ticks span { padding-block: 8px; }
  .wf-row .rowhead { grid-template-columns: 1fr; }
  .lbl { padding: 12px 14px 0; }
  .track { min-height: 44px; }
  .bar-span { top: 9px; height: 24px; }
  .bar-span.root-b { top: 17px; }
  .bar-span .dur { display: none; }
  .ev-mark { top: 14px; }
  .wf-panel { padding: 14px; }
  .logs li { grid-template-columns: 1fr; gap: 2px; }
  .evt li { grid-template-columns: 4.2em 1fr; }
  .evt li .kd { display: none; }
  .attrs > div { grid-template-columns: 1fr; gap: 2px; }
  .svc { grid-template-columns: 1fr; }
  .contact li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 400px) {
  .brand span { font-size: .85rem; }
  .btn-sm { padding-inline: 10px; }
}

.views { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 26px 0 0; font: 600 .78rem var(--font-mono); }
.views-k { opacity: .72; }
.views a { padding: 6px 12px; border: 1px solid currentColor; border-radius: 99px; text-decoration: none; opacity: .85; }
.views a:hover { opacity: 1; color: var(--span); }
.views a[aria-current='page'] { background: var(--span); color: var(--on-span); border-color: var(--span); opacity: 1; }

/* ───────── Layout picker (inside the boot overlay) ───────── */
.boot { overflow: auto; padding: 20px; }
.boot > * { margin: auto; }
.boot.picking .boot-box { display: none; }
.picker { display: none; width: min(1020px, 100%); color: #d6e1d8; }
.boot.picking .picker { display: block; animation: rise .5s ease both; }
.pk-k { margin: 0 0 8px; font: 600 .8rem var(--font-mono); color: #62d6c0; }
.picker h2 { margin: 0 0 8px; font: 650 clamp(1.9rem, 4.4vw, 3rem)/1.05 var(--font-display); font-variation-settings: 'opsz' 96; color: #ece6d6; }
.pk-sub { margin: 0 0 22px; max-width: 62ch; color: #a5ada1; }
.pk-grid { display: grid; gap: 18px; grid-template-columns: 350px minmax(0, 1fr); }
.pk-list { display: grid; gap: 10px; align-content: start; margin: 0; padding: 0; border: 0; min-width: 0; }
.pk-opt { position: relative; }
.pk-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.pk-opt label { display: block; padding: 14px 16px 14px 48px; border: 1.5px solid #2b3a33; border-radius: 10px; background: #111a15; transition: border-color .15s, background .15s; position: relative; }
.pk-opt label::before { content: ''; position: absolute; left: 16px; top: 18px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #6b776d; }
.pk-opt:hover label { border-color: #4a5a50; }
.pk-opt input:checked + label { border-color: #ff8c5a; background: #1b2a22; }
.pk-opt input:checked + label::before { border-color: #ff8c5a; background: radial-gradient(#ff8c5a 0 4px, transparent 5px); }
.pk-opt input:focus-visible + label { outline: 3px solid #62d6c0; outline-offset: 2px; }
.pk-n { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 650 1.2rem var(--font-display); color: #ece6d6; }
.pk-badge { font: 600 .62rem var(--font-mono); padding: 1px 8px; border-radius: 99px; background: #ff8c5a; color: #1d0f07; }
.pk-badge.ai { background: #62d6c0; color: #0b110e; }
.pk-d { margin: 5px 0 0; font-size: .85rem; line-height: 1.5; color: #a5ada1; }
.pk-preview { min-height: 330px; border: 1px solid #2b3a33; border-radius: 12px; background: #0e1612; padding: 16px; overflow: hidden; position: relative; }
.pk-actions { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-top: 20px; }
.pk-hint { font: 400 .72rem var(--font-mono); color: #8d978d; }
.pv { animation: fade .35s ease both; }
.pv-cap { margin: 12px 0 0; font: 500 .72rem var(--font-mono); color: #8d978d; }
.pv-t { font: 600 .78rem var(--font-mono); color: #ece6d6; margin-bottom: 12px; }
.pv-t b { color: #62d6c0; }
.pv-axis { display: grid; grid-template-columns: 8.8em 1fr; gap: 10px; font: 500 .62rem var(--font-mono); color: #8d978d; }
.pv-axis span:last-child { display: flex; justify-content: space-between; }
.pv-row { display: grid; grid-template-columns: 8.8em 1fr; gap: 10px; align-items: center; margin: 10px 0; font: 500 .7rem var(--font-mono); color: #d6e1d8; }
.pv-track { position: relative; height: 22px; background-image: linear-gradient(to right, rgba(236, 230, 214, .1) 1px, transparent 1px); background-size: calc(100% / var(--years)) 100%; }
.pv-bar { position: absolute; top: 4px; height: 14px; border-radius: 3px; background: #ff8c5a; transform-origin: left; animation: draw .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 120ms + 100ms); }
.pv-bar.t2 { background: #62d6c0; } .pv-bar.rt { top: 7px; height: 8px; background: repeating-linear-gradient(135deg, #8d978d 0 4px, transparent 4px 8px); }
.pv-mark { position: absolute; top: 6px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: #62d6c0; }
.pv-model { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; align-items: start; }
.pv-av { position: relative; border: 1.5px solid #ece6d6; border-radius: 10px; overflow: hidden; aspect-ratio: 781 / 900; box-shadow: 5px 5px 0 rgba(255, 213, 0, .6); }
.pv-av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pv-box { position: absolute; left: 27%; top: 3%; width: 50%; height: 62%; border: 2px solid #ff7b6e; }
.pv-box b { position: absolute; left: -2px; top: calc(100% + 2px); background: #ff7b6e; color: #fff; font: 600 .5rem var(--font-mono); padding: 1px 5px; white-space: nowrap; }
.pv-code { margin: 0; padding: 12px; background: #080c0a; border-radius: 8px; font: 400 .7rem/1.75 var(--font-mono); color: #e6e9f2; overflow: hidden; }
.pv-code i { font-style: normal; color: #ff9d7a; } .pv-code u { text-decoration: none; color: #9fe3b8; } .pv-code em { font-style: normal; color: #8a92a8; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@media (max-width: 800px) {
  .pk-grid { grid-template-columns: 1fr; }
  .pk-preview { min-height: 240px; order: -1; }
  .pv-model { grid-template-columns: 96px minmax(0, 1fr); }
  .pv-code { font-size: .62rem; }
  .pv-row, .pv-axis { grid-template-columns: 6.2em 1fr; }
}

/* ───────── More projects list ───────── */
.morep { margin-top: 28px; }
.morep h3 { font: 650 1.4rem var(--font-display); margin: 0 0 4px; }
.morep .muted { margin: 0 0 14px; max-width: 70ch; }
.morep-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.mp { border: 1px solid var(--rule, currentColor); border-radius: 8px; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.mp summary { cursor: pointer; padding: 10px 14px; list-style: none; }
.mp summary::-webkit-details-marker { display: none; }
.mp summary b { display: block; font: 600 .95rem var(--font-mono); }
.mp summary small { display: block; opacity: .75; font-size: .8rem; }
.mp-body { padding: 0 14px 12px; font-size: .9rem; }
.mp-body > ul:first-child { margin: 0 0 8px; padding-left: 18px; }
.mp-body .tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; margin: 0; }
.mp-body .tag { font: 400 .72rem var(--font-mono); padding: 2px 8px; border: 1px solid currentColor; border-radius: 99px; opacity: .85; }
