/* =========================================================
   Portfolio — design tokens
   ========================================================= */
/* Light is the default theme. Dark tokens apply via [data-theme="dark"]
   and inside .dark-scope panels (hero, contact) in either theme. */
:root {
  --bg: #f6f7f9;
  --bg-2: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-solid: #ffffff;
  --line: rgba(17, 20, 32, 0.08);
  --line-2: rgba(17, 20, 32, 0.14);
  --text: #11141f;
  --text-2: #4b5163;
  --text-3: #697083;
  --brand-1: #7c3aed;
  --brand-2: #0891b2;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #f43f5e;
  --grid: rgba(17, 20, 32, 0.04);
  --shadow: 0 30px 60px -30px rgba(20, 24, 50, 0.22);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -14px rgba(16, 24, 40, 0.12);
  --radius: 18px;
  --radius-sm: 10px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1200px;
  color-scheme: light;
}

:root[data-theme="dark"], .dark-scope {
  --bg: #0b0e18;
  --bg-2: #10141f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-solid: #131826;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f1f3f9;
  --text-2: #b4bacb;
  --text-3: #7c8396;
  --brand-1: #a78bfa;
  --brand-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #fb7185;
  --grid: rgba(255, 255, 255, 0.04);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  --shadow-sm: none;
  color-scheme: dark;
}
.dark-scope { color: var(--text); }

/* part accent — set inline as --c on any element */
[style*="--c"] { --c-soft: color-mix(in oklab, var(--c) 16%, transparent); --c-line: color-mix(in oklab, var(--c) 45%, transparent); --c-text: color-mix(in oklab, var(--c) 70%, #000); }
:root[data-theme="dark"] [style*="--c"], .dark-scope [style*="--c"], [style*="--c"].dark-scope { --c-text: var(--c); }

/* =========================================================
   Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img, svg { display: block; max-width: 100%; }
::selection { background: color-mix(in oklab, var(--brand-1) 40%, transparent); }
.mono { font-family: var(--mono); letter-spacing: 0; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* page-wide background: grid + glow */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  width: 900px; height: 900px; border-radius: 50%;
  filter: blur(120px); opacity: 0.18;
  background: radial-gradient(circle, var(--brand-1), transparent 60%);
  top: -420px; left: -200px;
}
.bg-glow.b { background: radial-gradient(circle, var(--brand-2), transparent 60%); left: auto; right: -300px; top: -300px; opacity: 0.12; }
:root:not([data-theme="dark"]) .bg-glow { display: none; }

/* scroll progress */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 100; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); }

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 50; width: calc(100% - 32px); max-width: var(--maxw);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  transition: border-color .3s, box-shadow .3s;
}
.nav.scrolled { border-color: var(--line-2); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #06070b;
  font: 800 12px/1 var(--mono);
}
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links button {
  padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--text-2);
  transition: color .2s, background .2s;
}
.nav-links button:hover, .nav-links button.active { color: var(--text); background: var(--surface-2); }
.nav-tools { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  height: 34px; min-width: 34px; padding: 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); color: var(--text-2); font-size: 13px;
  transition: border-color .2s, color .2s, background .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--surface); }
.kbd { font: 500 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-3); }
@media (max-width: 860px) { .nav-links { display: none; } .nav-tools { margin-left: auto; } .cmdk-label { display: none; } }

/* =========================================================
   Generic section bits
   ========================================================= */
section { position: relative; }
.section { padding: 120px 0 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.15; letter-spacing: -0.035em; margin: 14px 0 14px; font-weight: 750; }
.lede { color: var(--text-2); font-size: 17px; max-width: 640px; margin: 0; }
.grad-text { background: linear-gradient(100deg, var(--brand-1), var(--brand-2) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 44px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; line-height: 1.4;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  white-space: nowrap;
}
.chip.mono { font-size: 11.5px; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--text-3)); }
.chip.c { color: var(--c-text); border-color: var(--c-line); background: var(--c-soft); }
.layer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.layer-tag { font: 600 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; } .reveal[data-d="2"] { transition-delay: .16s; } .reveal[data-d="3"] { transition-delay: .24s; }

/* =========================================================
   Hero
   ========================================================= */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 60px; overflow: hidden; isolation: isolate;
  border-radius: 0 0 36px 36px;
  background:
    radial-gradient(ellipse 60% 55% at 12% 8%, rgba(124, 58, 237, 0.42), transparent 70%),
    radial-gradient(ellipse 50% 50% at 92% 18%, rgba(8, 145, 178, 0.38), transparent 70%),
    radial-gradient(ellipse 60% 50% at 60% 110%, rgba(236, 72, 153, 0.22), transparent 70%),
    var(--bg); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 100%); }
@media (max-width: 640px) { .hero { border-radius: 0 0 24px 24px; } }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .9; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--text-2);
}
.status-pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: ping 2s infinite; margin-left: 6px; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ok) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 10px transparent; } }
.hero h1 {
  font-size: clamp(38px, 5vw, 64px); line-height: 1.08; letter-spacing: -0.045em; font-weight: 800;
  margin: 26px 0 22px;
}
.rotator { display: inline-grid; vertical-align: bottom; overflow: hidden; height: 1.12em; }
.rotator span { grid-area: 1 / 1; transform: translateY(110%); opacity: 0; transition: transform .7s var(--ease), opacity .7s var(--ease); white-space: nowrap; }
.rotator span.on { transform: none; opacity: 1; }
.rotator span.off { transform: translateY(-110%); opacity: 0; }
.hero p.sub { color: var(--text-2); font-size: clamp(16px, 1.6vw, 19px); max-width: 560px; margin: 0 0 34px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line-2); background: var(--surface); transition: transform .3s var(--ease), background .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text-3); }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.primary:hover { box-shadow: 0 12px 40px -10px color-mix(in oklab, var(--brand-1) 70%, transparent); }
.btn svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 56px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.metric { background: color-mix(in oklab, var(--bg) 88%, transparent); padding: 18px 20px; backdrop-filter: blur(6px); }
.metric b { display: block; font: 700 clamp(24px, 2.6vw, 32px)/1.1 var(--mono); letter-spacing: -0.03em; }
.metric b small { font-size: 0.5em; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.metric > span { font-size: 12.5px; color: var(--text-3); }
i.num { font-style: normal; }
@media (max-width: 640px) { .metrics { grid-template-columns: repeat(2, 1fr); } }

/* terminal */
.term {
  border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  background: color-mix(in oklab, var(--surface-solid) 82%, transparent);
  backdrop-filter: blur(14px); box-shadow: var(--shadow);
  transform: perspective(1200px) rotateY(-6deg) rotateX(3deg); transition: transform .8s var(--ease);
}
.term:hover { transform: none; }
@media (max-width: 980px) { .term { transform: none; } }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; font: 12px var(--mono); color: var(--text-3); }
.term-tabs { margin-left: auto; display: flex; gap: 4px; }
.term-tabs button { font: 11px var(--mono); padding: 3px 8px; border-radius: 6px; color: var(--text-3); }
.term-tabs button.on { background: var(--surface-2); color: var(--text); }
.term-body { padding: 16px 18px 20px; font: 12.5px/1.85 var(--mono); min-height: 340px; color: var(--text-2); }
.term-body .ln { white-space: pre-wrap; opacity: 0; transform: translateY(4px); animation: lnIn .35s var(--ease) forwards; }
@keyframes lnIn { to { opacity: 1; transform: none; } }
.term-body .p { color: var(--brand-2); } .term-body .k { color: var(--brand-1); } .term-body .ok { color: var(--ok); }
.term-body .wn { color: var(--warn); } .term-body .er { color: var(--err); } .term-body .dim { color: var(--text-3); }
.cursor { display: inline-block; width: 7px; height: 14px; vertical-align: -2px; background: var(--text-2); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   System map
   ========================================================= */
.map-shell { border: 1px solid var(--line); border-radius: 24px; background: var(--surface); overflow: hidden; position: relative; }
.map-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.map-toolbar .hint { margin-left: auto; font: 12px var(--mono); color: var(--text-3); }
.map-filter { cursor: pointer; transition: opacity .2s, transform .2s; }
.map-filter:hover { transform: translateY(-1px); }
.map-filter.dim { opacity: .35; }
.map-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#sysmap { width: 100%; min-width: 980px; height: auto; display: block; }
#sysmap .lane-label { font: 600 10.5px var(--mono); letter-spacing: .14em; fill: var(--text-3); text-transform: uppercase; }
#sysmap .lane { fill: none; stroke: var(--line); stroke-dasharray: 3 5; }
#sysmap .edge { fill: none; stroke: var(--line-2); stroke-width: 1.2; transition: stroke .3s, opacity .3s; }
#sysmap .edge.hot { stroke: var(--c); stroke-width: 1.8; }
#sysmap .pkt { transition: opacity .3s; }
#sysmap .node { cursor: pointer; transition: opacity .3s; }
#sysmap .node rect { fill: var(--surface-solid); stroke: var(--line-2); transition: stroke .25s, fill .25s; }
#sysmap .node .bar { stroke: none; }
#sysmap .node text { font: 600 12.5px var(--font); fill: var(--text); letter-spacing: -0.01em; }
#sysmap .node text.sub { font: 400 10.5px var(--mono); fill: var(--text-3); }
#sysmap .node:hover rect.box, #sysmap .node.hot rect.box { stroke: var(--c); fill: color-mix(in oklab, var(--c) 10%, var(--surface-solid)); }
#sysmap.focus .node:not(.hot), #sysmap.focus .edge:not(.hot) { opacity: .18; }
#sysmap.focus .pkt:not(.hot) { opacity: 0; }
.map-tip {
  position: absolute; pointer-events: none; z-index: 3; max-width: 260px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2);
  background: color-mix(in oklab, var(--surface-solid) 92%, transparent); backdrop-filter: blur(10px);
  font-size: 13px; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; box-shadow: var(--shadow);
}
.map-tip.on { opacity: 1; transform: none; }
.map-tip b { display: block; margin-bottom: 2px; }
.map-tip small { color: var(--text-3); font-family: var(--mono); font-size: 11px; }

/* =========================================================
   Bento — systems
   ========================================================= */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(250px, auto); gap: 14px; }
.card {
  --mx: 50%; --my: 50%;
  position: relative; grid-column: span 4; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); overflow: hidden; isolation: isolate; cursor: pointer;
  display: flex; flex-direction: column; transition: transform .5s var(--ease), border-color .3s;
}
.card::before { /* spotlight */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx) var(--my), var(--c-soft), transparent 60%);
}
.card::after { /* border glow */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--c), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover { transform: translateY(-4px); }
.card:hover::before, .card:hover::after { opacity: 1; }
.card.w8 { grid-column: span 8; } .card.w6 { grid-column: span 6; } .card.w5 { grid-column: span 5; } .card.w7 { grid-column: span 7; } .card.w3 { grid-column: span 3; }
@media (max-width: 1020px) { .card, .card.w8, .card.w6, .card.w5, .card.w7, .card.w3 { grid-column: span 6; } }
@media (max-width: 680px) { .bento { grid-template-columns: 1fr; } .card, .card.w8, .card.w6, .card.w5, .card.w7, .card.w3 { grid-column: 1 / -1; } }
.card-viz { position: relative; flex: 1; min-height: 150px; border-bottom: 1px solid var(--line); overflow: hidden; }
.card-body { padding: 18px 20px 20px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-no { font: 600 12px var(--mono); color: var(--c-text); }
.card h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.03em; line-height: 1.3; }
.card h3 em { display: block; font-style: normal; color: var(--text-3); font-weight: 500; font-size: 12px; margin-top: 2px; font-family: var(--mono); letter-spacing: 0.02em; }
.card p { margin: 0 0 14px; color: var(--text-2); font-size: 14.5px; }
.card .go { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; background: color-mix(in oklab, var(--bg) 60%, transparent); backdrop-filter: blur(6px);
  transform: rotate(-45deg) scale(.9); opacity: 0; transition: all .4s var(--ease); z-index: 2; }
.card:hover .go { opacity: 1; transform: rotate(0) scale(1); border-color: var(--c); color: var(--c-text); }
.card .go svg { width: 14px; height: 14px; }

/* ---- card micro-visuals ---- */
.viz { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; font: 11.5px/1.5 var(--mono); color: var(--text-2); }
.viz svg { width: 100%; height: 100%; overflow: visible; }

/* engine: chat stream */
.v-chat { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 8px; }
.v-chat .q, .v-chat .a { padding: 8px 12px; border-radius: 12px; max-width: 85%; font-family: var(--font); font-size: 13px; }
.v-chat .q { align-self: flex-end; background: var(--surface-2); }
.v-chat .a { align-self: flex-start; border: 1px solid var(--c-line); background: var(--c-soft); min-height: 38px; }
.v-chat .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.v-chat .meta span { font: 10.5px var(--mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--text-3); transition: all .3s; }
.v-chat .meta span.on { color: var(--c-text); border-color: var(--c-line); background: var(--c-soft); }

/* pipeline DAG */
.dag-node rect { fill: var(--surface-solid); stroke: var(--line-2); transition: stroke .3s, fill .3s; }
.dag-node text { fill: var(--text-2); font: 10.5px var(--mono); }
.dag-node[data-s="run"] rect { stroke: var(--c); fill: color-mix(in oklab, var(--c) 14%, var(--surface-solid)); }
.dag-node[data-s="ok"] rect { stroke: var(--ok); }
.dag-node[data-s="fail"] rect { stroke: var(--err); fill: color-mix(in oklab, var(--err) 14%, var(--surface-solid)); }
.dag-node[data-s="retry"] rect { stroke: var(--warn); stroke-dasharray: 3 3; }
.dag-node .st { transition: fill .3s; fill: var(--text-3); }
.dag-node[data-s="run"] .st { fill: var(--c); } .dag-node[data-s="ok"] .st { fill: var(--ok); } .dag-node[data-s="fail"] .st { fill: var(--err); } .dag-node[data-s="retry"] .st { fill: var(--warn); }
.dag-edge { stroke: var(--line-2); fill: none; }

/* deploy gates */
.v-gates { width: 100%; max-width: 460px; }
.gates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; position: relative; }
.gate { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 8px 10px; text-align: center; background: var(--surface-solid); transition: all .35s; }
.gate b { display: block; font-size: 11.5px; color: var(--text); font-weight: 600; }
.gate small { font-size: 10px; color: var(--text-3); }
.gate.on { border-color: var(--c); background: color-mix(in oklab, var(--c) 12%, var(--surface-solid)); }
.gate.done { border-color: color-mix(in oklab, var(--ok) 60%, transparent); }
.gate.done small { color: var(--ok); }
.gate.wait small { color: var(--warn); }
.canary { margin-top: 14px; }
.canary-row { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); margin-bottom: 6px; }
.canary-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.canary-bar i { display: block; height: 100%; background: var(--c); transition: width .9s var(--ease); }
.canary-bar i + i { background: var(--line-2); }

/* infra path */
.hop circle.ring { fill: var(--surface-solid); stroke: var(--line-2); transition: all .3s; }
.hop.on circle.ring { stroke: var(--c); fill: color-mix(in oklab, var(--c) 18%, var(--surface-solid)); }
.hop.block circle.ring { stroke: var(--err); fill: color-mix(in oklab, var(--err) 18%, var(--surface-solid)); }
.hop text { fill: var(--text-2); font: 10.5px var(--mono); text-anchor: middle; }
.hop text.ms { fill: var(--text-3); font-size: 9.5px; }
.hop.on text.ms { fill: var(--c-text); }

/* client phone */
.phone { width: 150px; height: 100%; max-height: 220px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface-solid); padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; position: relative; }
.phone::before { content: ""; width: 44px; height: 5px; border-radius: 9px; background: var(--line-2); align-self: center; margin-bottom: 4px; flex: none; }
.phone .b { font: 10.5px/1.4 var(--font); padding: 6px 8px; border-radius: 9px; max-width: 88%; animation: lnIn .4s var(--ease) both; }
.phone .b.u { align-self: flex-end; background: var(--surface-2); }
.phone .b.a { align-self: flex-start; background: var(--c-soft); border: 1px solid var(--c-line); }
.phone .card-ui { border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 8px; animation: lnIn .4s var(--ease) both; }
.phone .card-ui b { font: 600 10.5px var(--font); display: block; }
.phone .card-ui .spark { height: 22px; margin-top: 3px; }

/* ai-native palette */
.v-pal { width: 100%; max-width: 420px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-solid); overflow: hidden; }
.v-pal .in { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.v-pal .in .p { color: var(--c-text); }
.v-pal ul { list-style: none; margin: 0; padding: 6px; }
.v-pal li { padding: 5px 8px; border-radius: 7px; display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); transition: background .2s; }
.v-pal li.on { background: var(--c-soft); color: var(--text); }
.v-pal li small { color: var(--text-3); }

/* =========================================================
   Stack matrix
   ========================================================= */
.stack-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.stack-legend .chip { cursor: pointer; }
.stack-legend .chip.off { opacity: .35; }
.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .stack-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .stack-grid { grid-template-columns: 1fr; } }
.stack-cat { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.stack-cat h4 { margin: 0 0 14px; font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; }
.stack-items { display: flex; flex-wrap: wrap; gap: 6px; }
.tool { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); font-size: 13px; background: var(--surface); transition: opacity .25s, border-color .25s, transform .25s; cursor: default; }
.tool .dots { display: inline-flex; gap: 2px; }
.tool .dots i { width: 5px; height: 5px; border-radius: 50%; }
.tool.dim { opacity: .2; }
.tool:hover { border-color: var(--line-2); transform: translateY(-1px); }

/* =========================================================
   Timeline
   ========================================================= */
.tl { position: relative; padding-left: 28px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(var(--brand-1), var(--brand-2), transparent); }
.tl-item { position: relative; padding: 0 0 34px; display: grid; grid-template-columns: 120px 1fr; gap: 20px; }
@media (max-width: 640px) { .tl-item { grid-template-columns: 1fr; gap: 4px; } }
.tl-item::before { content: ""; position: absolute; left: -27px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--c, var(--brand-1)); }
.tl-date { font: 500 13px var(--mono); color: var(--text-3); padding-top: 1px; }
.tl-item h4 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.02em; }
.tl-item p { margin: 0 0 8px; color: var(--text-2); font-size: 14.5px; }

/* =========================================================
   Contact / footer
   ========================================================= */
.contact { margin: 60px 0 40px; border: 1px solid var(--line); border-radius: 28px; padding: clamp(32px, 6vw, 72px); position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(ellipse 60% 80% at 0% 0%, rgba(124, 58, 237, 0.35), transparent 70%), var(--bg); }
.contact::before { content: ""; position: absolute; width: 600px; height: 600px; right: -200px; bottom: -340px; border-radius: 50%; filter: blur(80px); opacity: .35;
  background: radial-gradient(circle, var(--brand-1), var(--brand-2) 50%, transparent 70%); }
.contact h2 { font-size: clamp(32px, 5vw, 60px); line-height: 1.1; letter-spacing: -0.04em; margin: 16px 0 28px; position: relative; }
.contact .cta-row { position: relative; }
.footer { padding: 30px 0 50px; color: var(--text-3); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* =========================================================
   Detail page
   ========================================================= */
.detail-hero { padding: 140px 0 40px; position: relative; }
.detail-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 520px; z-index: -1;
  background: radial-gradient(ellipse 60% 70% at 20% 0%, var(--c-soft), transparent 70%); }
.crumb { display: flex; align-items: center; gap: 8px; font: 13px var(--mono); color: var(--text-3); margin-bottom: 28px; }
.crumb button:hover { color: var(--text); }
.detail-no { font: 600 14px var(--mono); color: var(--c-text); display: flex; align-items: center; gap: 10px; }
.detail-no::after { content: ""; width: 40px; height: 1px; background: var(--c); }
.detail-hero h1 { font-size: clamp(36px, 5.6vw, 68px); line-height: 1.08; letter-spacing: -0.045em; margin: 16px 0 6px; }
.detail-hero .en { font: 500 15px var(--mono); color: var(--text-3); margin-bottom: 22px; }
.detail-hero .summary { font-size: clamp(17px, 1.7vw, 20px); color: var(--text-2); max-width: 780px; margin: 0 0 26px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 40px; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--surface); }
.stat b { display: block; font: 700 26px/1.15 var(--mono); letter-spacing: -0.03em; color: var(--c-text); }
.stat b .unit { font-size: 0.55em; margin-left: 4px; color: var(--text-3); letter-spacing: 0; }
.stat > span { display: block; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.stat > small { display: block; margin-top: 6px; font: 10.5px var(--mono); color: var(--text-3); }

.block { padding: 64px 0 0; }
.block-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; }
.block-title h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; margin: 0; }
.block-title span { font: 500 12px var(--mono); color: var(--text-3); letter-spacing: .1em; text-transform: uppercase; }

/* context two-col */
.ctx { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .ctx { grid-template-columns: 1fr; } }
.ctx-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); }
.ctx-card h3 { margin: 0 0 10px; font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.ctx-card ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.ctx-card li { margin: 4px 0; }
.ctx-card li::marker { color: var(--c); }
.cov { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .cov { grid-template-columns: 1fr; } }
.cov-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.cov-col h3 { margin: 0; font-size: 19px; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 8px; }
.cov-col h3 small { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--c-text); }
.cov-lead { margin: 4px 0 14px; color: var(--text-2); font-size: 14px; }
.cov-g + .cov-g { margin-top: 12px; }
.cov-g h5 { margin: 0 0 6px; font: 600 12px var(--font); color: var(--text-3); }
.cov-ops { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow-x: auto; }
.cov-ops table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.cov-ops th, .cov-ops td { padding: 11px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cov-ops tr:last-child th, .cov-ops tr:last-child td { border-bottom: 0; }
.cov-ops thead th { font: 600 12px var(--font); color: var(--text-3); }
.cov-ops thead th:last-child { color: var(--c-text); }
.cov-ops tbody th { font-weight: 600; white-space: nowrap; color: var(--text); width: 1%; }
.cov-ops td { color: var(--text-2); }

/* flow */
.flow { --cols: 4; position: relative; display: grid; grid-template-columns: repeat(var(--cols), 1fr); row-gap: 28px; padding: 6px 0 18px; margin: 0 -10px; }
.flow.cols-3 { --cols: 3; }
.flow-step { position: relative; padding: 0 10px; }
.flow.cols-4 .flow-step:nth-child(4n)::before, .flow.cols-4 .flow-step:nth-child(4n)::after,
.flow.cols-3 .flow-step:nth-child(3n)::before, .flow.cols-3 .flow-step:nth-child(3n)::after { display: none; }
@media (max-width: 1000px) {
  .flow.flow { --cols: 2; }
  .flow.flow .flow-step:not(:last-child)::before, .flow.flow .flow-step:not(:last-child)::after { display: block; }
  .flow.flow .flow-step:nth-child(2n)::before, .flow.flow .flow-step:nth-child(2n)::after { display: none; }
}
@media (max-width: 600px) {
  .flow.flow { --cols: 1; }
  .flow.flow .flow-step::before, .flow.flow .flow-step::after { display: none !important; }
}
.flow-step .num { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--mono);
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text-2); margin-bottom: 14px; transition: all .4s; }
.flow-step.on .num { border-color: var(--c); color: var(--c-text); box-shadow: 0 0 0 6px var(--c-soft); }
.flow-step::before { content: ""; position: absolute; top: 17px; left: 44px; right: -10px; height: 1px; background: var(--line-2); }
.flow-step:last-child::before { display: none; }
.flow-step::after { content: ""; position: absolute; top: 16px; left: 44px; height: 3px; width: 0; background: linear-gradient(90deg, var(--c), transparent); border-radius: 2px; transition: width .7s var(--ease); }
.flow-step.on::after { width: calc(100% - 34px); }
.flow-step:last-child::after { display: none; }
.flow-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 16px; background: var(--surface); min-height: 150px; transition: border-color .4s, background .4s; }
.flow-step.on .flow-card { border-color: var(--c-line); background: color-mix(in oklab, var(--c) 5%, var(--surface)); }
.flow-card h4 { margin: 0 0 6px; font-size: 15px; letter-spacing: -0.02em; }
.flow-card p { margin: 0 0 10px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.flow-card .tech { display: flex; flex-wrap: wrap; gap: 4px; }
.flow-card .tech span { font: 10.5px var(--mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--text-3); }
.flow-card .fail { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--text-3); }
.flow-card .fail b { color: var(--warn); font-weight: 600; font-family: var(--mono); font-size: 10.5px; margin-right: 4px; }
.flow-ctrl { display: flex; gap: 8px; margin-top: 4px; }

/* decisions accordion */
.decisions { display: grid; gap: 10px; }
.dec { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; transition: border-color .3s; }
.dec.open { border-color: var(--c-line); }
.dec-h { width: 100%; text-align: left; display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.dec-h .i { font: 600 12px var(--mono); color: var(--c-text); flex: none; }
.dec-h h4 { margin: 0; font-size: 16.5px; letter-spacing: -0.02em; flex: 1; }
.dec-h .pm { width: 22px; height: 22px; flex: none; position: relative; }
.dec-h .pm::before, .dec-h .pm::after { content: ""; position: absolute; left: 5px; right: 5px; top: 10px; height: 1.5px; background: var(--text-2); transition: transform .35s var(--ease); }
.dec-h .pm::after { transform: rotate(90deg); }
.dec.open .dec-h .pm::after { transform: rotate(0); }
.dec-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.dec.open .dec-b { grid-template-rows: 1fr; }
.dec-b > div { overflow: hidden; }
.dec-in { padding: 0 20px 20px 54px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .dec-in { grid-template-columns: 1fr; padding-left: 20px; } }
.dec-in h5 { margin: 0 0 4px; font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.dec-in p { margin: 0; font-size: 14.5px; color: var(--text-2); }

/* incidents */
.incidents { display: grid; gap: 14px; }
.inc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.inc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.inc-head h4 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }
.sev { font: 600 10.5px var(--mono); padding: 3px 7px; border-radius: 6px; color: var(--err); border: 1px solid color-mix(in oklab, var(--err) 40%, transparent); background: color-mix(in oklab, var(--err) 10%, transparent); }
.inc-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 860px) { .inc-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .inc-steps { grid-template-columns: 1fr; } }
.inc-step { border-radius: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); position: relative; }
.inc-step h5 { margin: 0 0 6px; font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.inc-step h5::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.inc-step p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.inc-step.s1 h5 { color: var(--err); } .inc-step.s2 h5 { color: var(--warn); } .inc-step.s3 h5 { color: var(--ok); } .inc-step.s4 h5 { color: var(--c-text); }
.inc-step.s4 { border-color: var(--c-line); background: var(--c-soft); }

/* projects in part */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.proj { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); transition: border-color .3s, transform .3s var(--ease); }
.proj:hover { border-color: var(--c-line); transform: translateY(-2px); }
.proj h4 { margin: 0 0 6px; font-size: 15.5px; letter-spacing: -0.02em; display: flex; justify-content: space-between; gap: 8px; }
.proj h4 small { font: 500 11px var(--mono); color: var(--text-3); white-space: nowrap; padding-top: 3px; }
.proj p { margin: 0; color: var(--text-2); font-size: 13.5px; }

/* image placeholder */
.shot-img { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.shot-img img { width: 100%; display: block; }
.shot-img figcaption { padding: 10px 14px; font-size: 13px; color: var(--text-2); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }

.stack-row { display: flex; flex-wrap: wrap; gap: 6px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 80px 0 30px; }
.pager button { text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: var(--surface); transition: border-color .3s, transform .3s var(--ease); }
.pager button:hover { border-color: var(--c-line); transform: translateY(-2px); }
.pager button.next { text-align: right; }
.pager small { display: block; font: 12px var(--mono); color: var(--text-3); margin-bottom: 4px; }
.pager b { font-size: 17px; letter-spacing: -0.02em; }

/* =========================================================
   Command palette
   ========================================================= */
.cmdk { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 14vh 16px 16px; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }
.cmdk.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.cmdk-panel { width: 100%; max-width: 600px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface-solid); box-shadow: 0 40px 120px -20px rgba(0,0,0,.6); overflow: hidden; animation: pop .25s var(--ease); }
@keyframes pop { from { transform: scale(.97) translateY(-6px); opacity: 0; } }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-in svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.cmdk-in input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: 16px var(--font); }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.cmdk-group { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.cmdk-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--text-3)); flex: none; }
.cmdk-item small { margin-left: auto; color: var(--text-3); font: 11.5px var(--mono); }
.cmdk-item.on { background: var(--surface-2); }
.cmdk-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 14px; }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font: 11px var(--mono); color: var(--text-3); }

/* route transition */
#app { animation: routeIn .6s var(--ease); }
@keyframes routeIn { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   Color & depth — light-first surfaces, larger accent areas
   ========================================================= */
.card, .map-shell, .stack-cat, .ctx-card, .flow-card, .dec, .inc, .proj, .stat, .pager button, .tool { box-shadow: var(--shadow-sm); }
.eyebrow { color: var(--brand-1); }

/* card: tinted visual panel on top */
.card-viz {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in oklab, var(--c) 22%, transparent) 1px, transparent 0) 0 0 / 18px 18px,
    linear-gradient(160deg, color-mix(in oklab, var(--c) 20%, transparent), color-mix(in oklab, var(--c) 6%, transparent));
  border-bottom-color: var(--c-line);
}
.card-no { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 7px; border-radius: 6px;
  background: var(--c-text); color: #fff; font-weight: 700; }
.dark-scope .card-no, :root[data-theme="dark"] .card-no { color: #0b0e18; }

/* section band for the map */
#map { background: var(--bg-2); margin-top: 80px; padding-bottom: 100px; }
#map .map-shell { background: var(--surface); }

/* detail header: colored band */
.detail-hero::before { height: 640px;
  background:
    radial-gradient(ellipse 50% 70% at 15% 0%, color-mix(in oklab, var(--c) 30%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in oklab, var(--c) 12%, transparent), transparent); }
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c); }
.flow-step .num { background: var(--surface); }
.flow-step.on .num { background: var(--c-text); color: #fff; border-color: var(--c-text); }
.dark-scope .flow-step.on .num, :root[data-theme="dark"] .flow-step.on .num { color: #0b0e18; }
.dec.open { background: color-mix(in oklab, var(--c) 5%, var(--surface)); }
.block-title span { color: var(--c-text); }

/* timeline: tighter */
.tl-item { padding-bottom: 26px; }

/* =========================================================
   Review fixes — nav, hero, cards, map, timeline, detail TOC
   ========================================================= */
/* nav: dark over the hero, compact menu on mobile */
.nav.dark-scope { background: color-mix(in oklab, #0b0e18 55%, transparent); border-color: rgba(255, 255, 255, 0.12); }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: calc(100% + 8px); left: 0; right: 0; gap: 2px; padding: 8px;
    background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow);
  }
  .nav.open .nav-links button { text-align: left; padding: 12px 16px; font-size: 15px; border-radius: 12px; }
}
@media (max-width: 640px) {
  .nav { top: 10px; width: calc(100% - 20px); padding: 6px 6px 6px 14px; }
  .icon-btn { height: 32px; min-width: 32px; }
}

/* hero: fixed headline, capability ticker inside the status pill */
.status-pill .rotator { height: 1.5em; vertical-align: middle; font-weight: 600; color: var(--text); }
.status-pill .rotator span { line-height: 1.5em; }
@media (max-width: 640px) {
  .hero { min-height: auto; padding: 92px 0 36px; }
  .hero-grid > :last-child { display: none; }
  .hero p.sub { margin-bottom: 24px; }
  .metrics { margin-top: 28px; }
}

/* cards are links: visible affordance on touch, focus ring */
.card:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
@media (hover: none) { .card .go { opacity: 1; transform: none; border-color: var(--c-line); color: var(--c-text); } }
.card.practice { border-style: dashed; border-color: var(--c-line); }
.practice-tag { margin: 0 auto 0 10px; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--c-text); }

/* map: emphasized request path, larger labels */
#sysmap .edge.main { stroke: var(--brand-1); stroke-width: 2.2; }
#sysmap .node text { font-size: 13.5px; }
#sysmap .node text.sub { font-size: 11.5px; }
#sysmap .lane-label { font-size: 11.5px; }
.map-filter, .stack-legend .chip { cursor: pointer; }
@media (max-width: 760px) { .map-toolbar .hint::after { content: " · 좌우로 스크롤"; } }

/* timeline: centered column */
.section-head.center { justify-content: center; text-align: center; }
.tl { max-width: 820px; margin: 0 auto; }

/* detail: My Role emphasis + sticky in-page TOC */
.ctx-card.role { border-color: var(--c-line); background: color-mix(in oklab, var(--c) 6%, var(--surface)); }
.toc { position: sticky; top: 0; z-index: 20; padding-top: 68px; margin-top: -68px; pointer-events: none;
  background: color-mix(in oklab, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toc .wrap { pointer-events: auto; }
.toc .wrap { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.toc button { white-space: nowrap; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; border: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface-solid) 82%, transparent); backdrop-filter: blur(10px); color: var(--text-2); transition: all .2s; }
.toc button:hover { color: var(--text); border-color: var(--line-2); }
.toc button.on { background: var(--c-text); border-color: var(--c-text); color: #fff; }
:root[data-theme="dark"] .toc button.on { color: #0b0e18; }
@media (max-width: 640px) { .toc { padding-top: 54px; margin-top: -54px; } }

/* dark theme: slightly brighter secondary text and edges */
:root[data-theme="dark"], .dark-scope { --text-3: #8d94a8; --line-2: rgba(255, 255, 255, 0.18); }

/* illustrations */
.shot-img { cursor: zoom-in; }
.shot-img img { aspect-ratio: 16 / 10; object-fit: cover; }
.shot-img figcaption { display: flex; gap: 8px; align-items: baseline; }
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; padding: 24px; background: rgba(8, 10, 18, .82); backdrop-filter: blur(6px); cursor: zoom-out; }
.lightbox.open { display: grid; animation: fadeIn .2s ease; }
.lightbox img { max-width: min(1600px, 100%); max-height: 100%; border-radius: 16px; box-shadow: 0 40px 120px -20px rgba(0,0,0,.6); }

/* about */
.about { display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; gap: 32px; } }
.about-photo { margin: 0; position: relative; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in oklab, var(--brand-1) 22%, var(--surface)), color-mix(in oklab, var(--brand-2) 18%, var(--surface))); }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; mix-blend-mode: multiply; }
:root[data-theme="dark"] .about-photo img { mix-blend-mode: normal; }
.about-photo figcaption { padding: 18px 22px 22px; background: var(--surface); display: grid; gap: 2px; }
.about-photo figcaption b { font-size: 22px; letter-spacing: -0.03em; }
.about-photo figcaption span { font: 500 13px var(--mono); color: var(--text-3); }
.about-photo figcaption small { margin-top: 6px; font-size: 13.5px; color: var(--text-2); }
@media (max-width: 900px) { .about-photo { max-width: 300px; } }
.about-body .h2 { margin-top: 12px; }
.about-intro p { margin: 0 0 12px; font-size: 17px; color: var(--text-2); max-width: 720px; }
.about-facts { margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 640px) { .about-facts { grid-template-columns: 1fr; } }
.about-facts > div { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.about-facts dt { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brand-1); margin-bottom: 4px; }
.about-facts dd { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.about-facts dd small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.about-domains { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 20px; }
.about-domains > span:first-child { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-right: 6px; }


/* =========================================================
   Review round 2 — layout fixes, featured, timeline phases
   ========================================================= */
/* sticky TOC overlaps the hero by its padding-top — leave room for it */
.detail-hero { padding-bottom: 108px; }
@media (max-width: 640px) { .detail-hero { padding-bottom: 94px; } }

/* readable wrapping */
.metric > span, .stat > span, .ctx-card li, .card p, .flow-card p, .inc-step p, .dec-in p, .tl-item p, .feat-card p { text-wrap: pretty; }
.h2, .detail-hero h1, .contact h2, .feat-card h3 { text-wrap: balance; }
.eyebrow { line-height: 1.5; align-items: flex-start; }
.eyebrow::before { margin-top: .75em; flex: none; }

/* illustrations: light/dark pair + lightbox */
.shot-img .art-dark { display: none; }
:root[data-theme="dark"] .shot-img .art-light { display: none; }
:root[data-theme="dark"] .shot-img .art-dark { display: block; }
.lb-close { position: fixed; top: 14px; right: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1;
  color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); cursor: pointer; }
@media (max-width: 640px) {
  .lightbox { place-items: start; overflow: auto; padding: 64px 0 24px; cursor: default; }
  .lightbox img { max-width: none; width: 1400px; max-height: none; border-radius: 0; }
}
@media (hover: none) { .shot-img figcaption::after { content: " · 탭하여 크게 보기"; color: var(--text-3); } }

/* coverage: flow arrows between columns, mobile comparison cards */
@media (min-width: 901px) {
  .cov-col { position: relative; }
  .cov-col:not(:last-child)::after { content: "→"; position: absolute; right: -13px; top: 22px; z-index: 1; width: 12px; text-align: center; color: var(--c-text); font-weight: 700; }
}
@media (max-width: 640px) {
  .cov-ops table { min-width: 0; }
  .cov-ops thead { display: none; }
  .cov-ops tr { display: grid; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .cov-ops tr:last-child { border-bottom: 0; }
  .cov-ops th, .cov-ops td { padding: 0; border: 0; }
  .cov-ops td::before { content: attr(data-h); display: block; font: 600 11.5px var(--font); color: var(--text-3); }
  .cov-ops td:last-child::before { color: var(--c-text); }
}

/* flow cards: equal height per row on desktop, compact on mobile */
.flow-step { display: flex; flex-direction: column; }
.flow-card { flex: 1; }
@media (max-width: 600px) {
  .flow-card { min-height: 0; }
  .flow.flow { row-gap: 18px; }
}

/* project cards: period above title instead of squeezing it */
.proj h4 { flex-direction: column-reverse; gap: 3px; }
.proj h4 small { padding-top: 0; }

/* touch: card arrow button should not cover the mini viz */
@media (hover: none) { .card .go { top: 10px; right: 10px; width: 28px; height: 28px; } }

/* mobile: tighter section rhythm */
@media (max-width: 640px) {
  .section { padding: 72px 0 24px; }
  #map { margin-top: 40px; padding-bottom: 56px; }
  .block { padding-top: 48px; }
  .tl-item { padding-bottom: 18px; }
}

/* dark: profile photo panel */
:root[data-theme="dark"] .about-photo { background: #e7e4f3; }
:root[data-theme="dark"] .about-photo figcaption { background: var(--surface-solid); }

/* featured cases */
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .feat { grid-template-columns: 1fr; } }
.feat-card { text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--c); transition: transform .25s var(--ease), border-color .25s; }
.feat-card:hover { transform: translateY(-3px); border-color: var(--c-line); border-top-color: var(--c); }
.feat-part { display: flex; align-items: center; gap: 6px; font: 600 12.5px var(--font); color: var(--c-text); margin-bottom: 10px; }
.feat-part .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.feat-metric { font-size: 34px; letter-spacing: -0.04em; line-height: 1.1; }
.feat-card > small { font-size: 13px; color: var(--text-3); }
.feat-card h3 { margin: 14px 0 4px; font-size: 18px; letter-spacing: -0.02em; line-height: 1.35; }
.feat-card p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.feat-go { margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--c-text); font-weight: 600; }
.feat-go svg { width: 14px; height: 14px; }

/* timeline phases */
.tl-phase + .tl-phase { margin-top: 18px; }
.tl-phase-h { position: relative; margin: 0 0 22px; padding: 14px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tl-phase-h::before { content: ""; position: absolute; left: -33px; top: 20px; width: 21px; height: 21px; border-radius: 50%; background: var(--bg); border: 2px solid var(--brand-1); }
.tl-phase-h span { font: 600 12px var(--mono); color: var(--brand-1); letter-spacing: .06em; }
.tl-phase-h h3 { margin: 2px 0 2px; font-size: 19px; letter-spacing: -0.02em; }
.tl-phase-h p { margin: 0; color: var(--text-2); font-size: 14px; }
.tl-more { margin: 0 0 24px 140px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: 500 13.5px var(--font); cursor: pointer; }
.tl-more:hover { color: var(--text); border-color: var(--text-3); }
@media (max-width: 640px) { .tl-more { margin-left: 0; } }
@media (max-width: 600px) {
  .flow-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 0; }
  .flow-step .num { margin: 0; }
}

/* ===== Review round 3 — final QA fixes ===== */
/* mobile caption hint goes on its own line instead of a squeezed flex column */
@media (hover: none) { .shot-img figcaption { flex-wrap: wrap; } .shot-img figcaption::after { flex-basis: 100%; } }
/* metric tiles: keep rounded clipping despite backdrop-filter children; tidy two-line labels */
.metrics { clip-path: inset(0 round var(--radius)); }
.metric > span, .stat > span { display: block; line-height: 1.5; }
/* lightbox should not scroll the page behind it */
.lightbox { overscroll-behavior: contain; }
/* featured deep-link target highlight */
.dec.flash, .proj.flash { outline: 2px solid var(--c); outline-offset: 4px; transition: outline-color .6s; }
.tl-more { margin-bottom: 18px; }
