/* ==========================================================================
   DongHyuk Lim — Forward Deployed Engineer
   Hairline grid, mono operational labels, one cobalt accent.
   Dark by default; light is an explicit choice stored per visitor.
   No gradients. Radius <= 8px. Motion limited to 120-200ms state transitions.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces — deep blue-grey, never pure black */
  --bg:          #0e1217;
  --bg-sunken:   #0a0e12;
  --surface:     #151a21;
  --surface-2:   #11161c;

  /* Ink */
  --ink:         #e9edf3;
  --ink-2:       #c3cbd7;
  --ink-3:       #98a3b2;
  --muted:       #78838f;

  /* Lines */
  --line:        #212832;
  --line-2:      #2d3641;
  --line-3:      #4a5666;

  /* Accents */
  --accent:      #6f9bff;
  --accent-ink:  #a9c3ff;
  --accent-weak: #17203a;
  --accent-line: #2d4782;

  --green:       #4bc79a;
  --green-weak:  #10271f;
  --green-line:  #245c47;
  --amber:       #d9a548;
  --amber-weak:  #26200f;
  --amber-line:  #5c4820;

  /* Inverted solids (buttons, active states) */
  --solid:       #e9edf3;
  --on-solid:    #0e1217;

  --term-bg:     #0a0e13;
  --shadow:      0 10px 28px -16px rgba(0, 0, 0, .75);
  --scrim:       rgba(4, 6, 9, .62);

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
          "Helvetica Neue", "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo,
          "Cascadia Mono", Consolas, monospace;

  /* Metrics */
  --w-page: 1200px;
  --w-text: 720px;
  --gut: 32px;
  --header-h: 60px;
  --r: 6px;
  --r-lg: 8px;

  --t: 160ms cubic-bezier(.2, .6, .3, 1);
}

/* Light theme — opt-in via the header toggle. Dark is the default. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:          #f6f7f9;
  --bg-sunken:   #eef0f4;
  --surface:     #ffffff;
  --surface-2:   #fbfcfd;

  --ink:         #0d1117;
  --ink-2:       #333c4a;
  --ink-3:       #5b6675;
  --muted:       #79828f;

  --line:        #e2e6ec;
  --line-2:      #ccd3dd;
  --line-3:      #aab3c0;

  --accent:      #1f4bd8;
  --accent-ink:  #12329a;
  --accent-weak: #edf1ff;
  --accent-line: #c3d0f8;

  --green:       #0d7d55;
  --green-weak:  #e8f6f0;
  --green-line:  #bfe3d4;
  --amber:       #9a6300;
  --amber-weak:  #fbf1de;
  --amber-line:  #ecd9ae;

  --solid:       #0d1117;
  --on-solid:    #ffffff;

  --term-bg:     #0f141b;
  --shadow:      0 8px 22px -14px rgba(13, 17, 23, .28);
  --scrim:       rgba(13, 17, 23, .42);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[lang="ko"] body { word-break: keep-all; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.22; letter-spacing: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent-weak); color: var(--accent-ink); }

/* ---------- Utilities ---------- */

.wrap { width: 100%; max-width: var(--w-page); margin: 0 auto; padding: 0 var(--gut); }
.prose { max-width: var(--w-text); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: 8px; left: 8px; z-index: 200;
  transform: translateY(-200%);
  background: var(--solid); color: var(--on-solid); padding: 10px 16px;
  border-radius: var(--r); text-decoration: none; font-size: 14px;
}
.skip-link:focus { transform: none; }

/* ---------- Reveal ---------- */

.reveal { opacity: 0; transform: translateY(10px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 180ms ease-out, transform 180ms ease-out; }

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

/* ==========================================================================
   Header
   ========================================================================== */

.progress-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90;
  background: transparent; pointer-events: none;
}
.progress-rail i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width 90ms linear; }

.site-header {
  position: sticky; top: 0; z-index: 80;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 6px 8px; margin-left: -8px; border-radius: var(--r);
}
.brand .sig {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  background: var(--solid); color: var(--on-solid);
  font-family: var(--mono); font-size: 11px; font-weight: 600; border-radius: 3px;
}
.brand .role {
  color: var(--muted); font-weight: 400; font-size: 13px;
  padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line-2);
}

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  text-decoration: none; color: var(--ink-3); font-size: 14px;
  padding: 7px 11px; border-radius: var(--r);
  transition: color var(--t), background var(--t);
}
.site-nav a:hover { color: var(--ink); background: var(--bg-sunken); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }

.header-tools { display: flex; align-items: center; gap: 10px; }

.kbd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); cursor: pointer; color: var(--muted); font-size: 13px;
  transition: border-color var(--t), color var(--t);
}
.kbd-btn:hover { border-color: var(--line-3); color: var(--ink-2); }
.kbd-btn kbd {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: 3px; padding: 1px 5px; color: var(--ink-3);
}

.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 32px; flex: none;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); cursor: pointer; color: var(--ink-3);
  transition: border-color var(--t), color var(--t);
}
.theme-btn:hover { border-color: var(--line-3); color: var(--ink); }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }

.lang-switch {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-2); border-radius: var(--r);
  overflow: hidden; background: var(--surface);
}
.lang-switch a {
  display: grid; place-items: center;
  min-width: 38px; height: 32px;
  font-family: var(--mono); font-size: 12px; text-decoration: none; color: var(--muted);
  transition: background var(--t), color var(--t);
}
.lang-switch a + a { border-left: 1px solid var(--line-2); }
.lang-switch a:hover { background: var(--bg-sunken); color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--solid); color: var(--on-solid); }

.menu-btn {
  display: none;
  width: 38px; height: 34px; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); cursor: pointer;
}
.menu-btn span { display: block; width: 15px; height: 1.5px; background: var(--ink); position: relative; }
.menu-btn span::before, .menu-btn span::after {
  content: ""; position: absolute; left: 0; width: 15px; height: 1.5px; background: var(--ink);
}
.menu-btn span::before { top: -5px; }
.menu-btn span::after { top: 5px; }

.mobile-nav { display: none; border-bottom: 1px solid var(--line); background: var(--surface); }
.mobile-nav ul { list-style: none; padding: 8px var(--gut) 16px; }
.mobile-nav a {
  display: block; padding: 13px 0; text-decoration: none;
  font-size: 16px; border-bottom: 1px solid var(--line); min-height: 44px;
}

/* ==========================================================================
   Command palette
   ========================================================================== */

.palette-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: var(--scrim);
  display: grid; place-items: start center;
  padding: max(9vh, 60px) 16px 16px;
}
.palette {
  width: 100%; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.palette-input-row { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.palette-input-row .mono { color: var(--muted); font-size: 13px; }
.palette input {
  flex: 1; border: 0; outline: 0; background: transparent;
  height: 50px; font-size: 15px; font-family: var(--sans); color: var(--ink);
}
.palette input::placeholder { color: var(--muted); }
.palette-list { list-style: none; max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette-list li + li { margin-top: 2px; }
.palette-list a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); text-decoration: none; }
.palette-list a .pi-kind {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  color: var(--muted); text-transform: uppercase;
  border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 5px;
  flex: none; min-width: 52px; text-align: center;
}
.palette-list a .pi-label { font-size: 14px; flex: 1; }
.palette-list a .pi-sub { font-size: 12px; color: var(--muted); }
.palette-list li.is-active a { background: var(--accent-weak); }
.palette-list li.is-active .pi-kind { border-color: var(--accent-line); color: var(--accent-ink); }
.palette-empty { padding: 22px 16px; color: var(--muted); font-size: 14px; text-align: center; }
.palette-foot {
  display: flex; gap: 16px; padding: 9px 14px;
  border-top: 1px solid var(--line); background: var(--surface-2);
  font-size: 11px; color: var(--muted); font-family: var(--mono);
}

/* ==========================================================================
   Section framing
   ========================================================================== */

.band { border-top: 1px solid var(--line); }
.band-sunken { background: var(--bg-sunken); }
.band-surface { background: var(--surface-2); }

.sec-head { display: grid; grid-template-columns: 64px 1fr; gap: 0 20px; padding: 64px 0 34px; }
.sec-head .sec-n { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 5px; letter-spacing: .04em; }
.sec-head .eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent-ink);
  display: block; margin-bottom: 12px;
}
.sec-head h2 { font-size: clamp(22px, 2.4vw, 28px); }
.sec-head .sec-sub { margin-top: 12px; color: var(--ink-3); font-size: 16px; max-width: 62ch; }
.sec-body { padding-bottom: 72px; }
.sec-body.indent { padding-left: 84px; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding: 76px 0 0; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: 14px; border-bottom: 1px solid var(--line-2);
}
.hero-meta .dot { color: var(--green); }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 20px 56px; align-items: center; }

.hero-name {
  margin: 40px 0 0;
  font-size: 15px; font-weight: 500; color: var(--ink-3);
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.hero-name strong { font-size: 17px; color: var(--ink); font-weight: 600; }
.hero-name .div { color: var(--line-3); }

.hero-statement {
  margin: 22px 0 0;
  font-size: clamp(32px, 5.2vw, 58px);
  line-height: 1.08; font-weight: 600; max-width: 17ch;
}
.hero-statement em { font-style: normal; color: var(--accent); }
html[lang="ko"] .hero-statement { max-width: 20ch; line-height: 1.26; font-size: clamp(28px, 4.4vw, 48px); }

.hero-support { margin: 26px 0 0; max-width: 56ch; font-size: 17px; color: var(--ink-2); line-height: 1.62; }
.hero-actions { margin: 34px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 0 18px;
  border-radius: var(--r); text-decoration: none; font-size: 15px;
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
}
.btn-primary { background: var(--solid); color: var(--on-solid); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-plain { padding: 0 4px; color: var(--accent-ink); text-decoration: none; }
.btn-plain:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn .arr { transition: transform var(--t); }
.btn:hover .arr { transform: translateX(2px); }
.btn-primary:hover .arr.down { transform: translateY(2px); }

.hero-tags {
  margin: 44px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.hero-tags .sep { color: var(--line-3); }

/* ---- Hero schematic: request → workflow → system ---- */

.hero-visual { position: relative; min-width: 0; }
.hero-visual svg { display: block; width: 100%; height: auto; }
.hv-note { margin-top: 14px; padding-left: 2px; font-size: 13px; line-height: 1.55; color: var(--muted); max-width: 44ch; }
.hv-title {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

.hv .hv-lab { fill: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; }
.hv .hv-band-lab { fill: var(--ink-3); font-family: var(--mono); font-size: 9.5px; }
.hv .hv-req { fill: var(--surface); stroke: var(--line-2); }
.hv .hv-req-in { fill: var(--line-2); }
.hv .hv-panel { fill: var(--surface); stroke: var(--line-2); }
.hv .hv-band { fill: none; stroke: var(--line); }
.hv .hv-wire { stroke: var(--line); stroke-width: 1; fill: none; }
.hv .hv-sys { fill: var(--accent-weak); stroke: var(--accent-line); }
.hv .hv-seg { fill: var(--accent); opacity: .16; }
.hv .hp { fill: var(--accent); }
.hv .hp-drop { fill: var(--line-3); }

.hv-parallax-a { transform: translate(calc(var(--px, 0px) * -0.6), calc(var(--py, 0px) * -0.6)); transition: transform 240ms ease-out; }
.hv-parallax-b { transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform 240ms ease-out; }

.hv .hp, .hv .hp-drop, .hv .hv-seg { animation-play-state: paused; }
.hero-visual.is-running .hp,
.hero-visual.is-running .hp-drop,
.hero-visual.is-running .hv-seg { animation-play-state: running; }

.hv .hp      { animation: dl-pulse 4.4s linear infinite; opacity: 0; }
.hv .hp-drop { animation: dl-pulse-drop 4.4s linear infinite; opacity: 0; }
.hv .hp-emit { animation: dl-emit 4.4s linear infinite; opacity: 0; }
.hv .hv-seg  { animation: dl-seg 4.4s ease-in-out infinite; }

@keyframes dl-pulse {
  0%   { transform: translate(0, 0); opacity: 0; }
  6%   { opacity: 1; }
  28%  { transform: translate(40px, 0); }
  62%  { transform: translate(40px, var(--dy)); }
  90%  { transform: translate(70px, var(--dy)); opacity: 1; }
  100% { transform: translate(70px, var(--dy)); opacity: 0; }
}
@keyframes dl-pulse-drop {
  0%   { transform: translate(0, 0); opacity: 0; }
  6%   { opacity: .85; }
  28%  { transform: translate(40px, 0); }
  60%  { transform: translate(40px, var(--dy)); opacity: .85; }
  76%  { transform: translate(56px, var(--dy)); opacity: 0; }
  100% { transform: translate(56px, var(--dy)); opacity: 0; }
}
@keyframes dl-emit {
  0%   { transform: translateX(0); opacity: 0; }
  12%  { opacity: 1; }
  88%  { transform: translateX(40px); opacity: 1; }
  100% { transform: translateX(40px); opacity: 0; }
}
@keyframes dl-seg {
  0%, 100% { opacity: .14; }
  55%      { opacity: .52; }
}

@media (prefers-reduced-motion: reduce) {
  .hv .hp, .hv .hp-drop, .hv .hp-emit { animation: none; opacity: 1; }
  .hv .hv-seg { animation: none; opacity: .35; }
  .hv-parallax-a, .hv-parallax-b { transform: none; }
}

/* ==========================================================================
   Reframe machine
   ========================================================================== */

.reframe { padding: 44px 0 72px; }
.reframe-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.reframe-title { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.reframe-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.reframe-tabs button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 13px;
  background: transparent; border: 1px solid var(--line-2);
  border-radius: var(--r); cursor: pointer; font-size: 13.5px; color: var(--ink-3);
  transition: border-color var(--t), color var(--t), background var(--t);
}
.reframe-tabs button .n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.reframe-tabs button:hover { border-color: var(--line-3); color: var(--ink); }
.reframe-tabs button[aria-selected="true"] { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.reframe-tabs button[aria-selected="true"] .n { color: var(--on-solid); opacity: .6; }

.reframe-stage { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.reframe-flow { display: grid; grid-template-columns: 1fr 44px 1fr 44px 1fr; align-items: stretch; }
.rf-node { padding: 24px 22px 26px; min-width: 0; }
.rf-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 7px; margin-bottom: 14px;
}
.rf-label .tick { width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); }
.rf-node.is-problem .rf-label .tick { background: var(--amber); }
.rf-node.is-system .rf-label .tick { background: var(--green); }
.rf-text { font-size: 16.5px; line-height: 1.5; color: var(--ink); }
.rf-node.is-request .rf-text { color: var(--ink-3); }
.rf-note { margin-top: 12px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.rf-arrow { display: grid; place-items: center; position: relative; }
.rf-arrow svg { color: var(--line-3); }
.rf-divider { border-left: 1px solid var(--line); }

.rf-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.rf-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rf-panel { animation: rf-in 160ms ease-out; }
@keyframes rf-in { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   Chips / status
   ========================================================================== */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11.5px;
  padding: 4px 9px; border-radius: 4px;
  border: 1px solid var(--line-2); color: var(--ink-3); background: var(--surface);
  white-space: nowrap;
}
.chip-accent { border-color: var(--accent-line); background: var(--accent-weak); color: var(--accent-ink); }
.chip-green  { border-color: var(--green-line); background: var(--green-weak); color: var(--green); }
.chip-amber  { border-color: var(--amber-line); background: var(--amber-weak); color: var(--amber); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em;
  padding: 5px 10px; border-radius: 4px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
}
.status-pill .mk { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--line-3); }
.status-pill[data-tone="done"]     { border-color: var(--green-line); background: var(--green-weak); color: var(--green); }
.status-pill[data-tone="done"] .mk { background: var(--green); }
.status-pill[data-tone="progress"] { border-color: var(--amber-line); background: var(--amber-weak); color: var(--amber); }
.status-pill[data-tone="progress"] .mk { background: var(--amber); }
.status-pill[data-tone="poc"]      { border-color: var(--line-2); background: var(--bg-sunken); color: var(--ink-3); }
.status-pill[data-tone="poc"] .mk  { background: var(--ink-3); }

/* ==========================================================================
   Evidence strip
   ========================================================================== */

.evidence { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.ev-item { padding: 28px 24px 26px; min-width: 0; }
.ev-item + .ev-item { border-left: 1px solid var(--line); }
.ev-val {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(26px, 3vw, 34px); font-weight: 500; line-height: 1;
  display: flex; align-items: baseline; gap: 4px;
}
.ev-val .u { font-size: 15px; color: var(--muted); }
.ev-val .to { color: var(--line-3); font-size: 20px; padding: 0 2px; }
.ev-val .after { color: var(--green); }
.ev-label { margin-top: 12px; font-size: 13.5px; color: var(--ink-3); line-height: 1.45; }
.ev-src { margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ==========================================================================
   Career
   ========================================================================== */

.career-list { list-style: none; border-top: 1px solid var(--line-2); }
.career-item { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0 36px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.cr-when { padding-top: 3px; }
.cr-period { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.cr-now {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--green); border: 1px solid var(--green-line); background: var(--green-weak);
  border-radius: 4px; padding: 3px 8px;
}
.cr-now i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: block; }

.cr-org { font-size: 20px; line-height: 1.25; }
.cr-role { margin-top: 6px; font-size: 14.5px; color: var(--accent-ink); font-family: var(--mono); letter-spacing: .01em; }
.cr-scope { margin-top: 14px; font-size: 15.8px; line-height: 1.66; color: var(--ink-2); max-width: 64ch; }

.cr-projects { list-style: none; margin-top: 18px; display: grid; gap: 8px; max-width: 640px; }
.cr-projects a {
  display: block; text-decoration: none; padding: 13px 16px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg);
  transition: border-color var(--t), transform var(--t), background var(--t);
}
.cr-projects a:hover { border-color: var(--accent-line); background: var(--accent-weak); transform: translateX(2px); }
.crp-label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.crp-label .arr { color: var(--muted); transition: transform var(--t), color var(--t); }
.cr-projects a:hover .crp-label .arr { color: var(--accent); transform: translateX(3px); }
.crp-note { display: block; margin-top: 5px; font-size: 13.4px; color: var(--ink-3); line-height: 1.5; }

.cr-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }

/* ==========================================================================
   Work cards
   ========================================================================== */

.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.work-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.work-card:hover { border-color: var(--line-3); box-shadow: var(--shadow); transform: translateY(-2px); }
.work-card:focus-within { border-color: var(--accent); }
.work-card .thumb { background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 18px 18px 14px; display: block; }
.work-card .thumb svg { display: block; width: 100%; height: auto; }
.work-card .body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.work-card .wc-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.work-card h3 { font-size: 19px; line-height: 1.3; }
.work-card h3 a { text-decoration: none; }
.work-card h3 a::after { content: ""; position: absolute; inset: 0; }
.work-card .wc-line { margin-top: 10px; font-size: 14.5px; color: var(--accent-ink); line-height: 1.5; }
.work-card .wc-desc { margin-top: 12px; font-size: 14.5px; color: var(--ink-3); line-height: 1.6; }
.work-card .wc-tags { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; }
.work-card .wc-go { margin-top: 16px; font-size: 14px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 7px; }
.work-card:hover .wc-go { color: var(--accent); }
.work-card .wc-go .arr { transition: transform var(--t); }
.work-card:hover .wc-go .arr { transform: translateX(3px); }

/* ==========================================================================
   Method / about / contact / footer
   ========================================================================== */

.method-list { display: grid; gap: 0; border-top: 1px solid var(--line-2); }
.method-item { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 0 28px; padding: 26px 0; border-bottom: 1px solid var(--line); align-items: start; }
.method-n { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.method-item h3 { font-size: 18px; }
.method-item .m-desc { margin-top: 8px; color: var(--ink-3); font-size: 15px; max-width: 46ch; }
.method-proof { border-left: 2px solid var(--accent-line); padding-left: 16px; font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.method-proof .src {
  display: block; margin-top: 7px; font-family: var(--mono);
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.method-proof a { color: var(--accent-ink); text-underline-offset: 3px; }

.statement { max-width: 760px; font-size: 19px; line-height: 1.68; color: var(--ink-2); }
.statement strong { color: var(--ink); font-weight: 600; }
.statement + .statement { margin-top: 20px; }


/* Rows in the About section — deliveries and awards. A row with detail
   discloses a short body on click, matching the .dec pattern in case studies. */
.aw-list { list-style: none; border-top: 1px solid var(--line-2); }
.aw-list > li { border-bottom: 1px solid var(--line); }
.aw-name { font-size: 16px; }
.aw-fact { font-family: var(--mono); font-size: 13px; color: var(--ink-3); text-align: right; }

.aw-list > li.aw-flat {
  display: grid; grid-template-columns: 1fr auto 24px; gap: 8px 24px;
  align-items: baseline; padding: 16px 0;
}

.aw > summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto 24px; gap: 8px 24px;
  align-items: baseline; padding: 16px 0; transition: color var(--t);
}
.aw > summary::-webkit-details-marker { display: none; }
.aw > summary:hover .aw-name { color: var(--accent); }
.aw-cv { color: var(--muted); justify-self: end; transition: transform var(--t); align-self: center; }
.aw[open] .aw-cv { transform: rotate(180deg); }
.aw-body { padding: 2px 0 18px; }
.aw-body > * + * { margin-top: 12px; }
.aw-body p { font-size: 15px; line-height: 1.7; color: var(--ink-2); max-width: 62ch; }

.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.contact-line { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.4; max-width: 22ch; }
.contact-links { list-style: none; border-top: 1px solid var(--line-2); }
.contact-links li { border-bottom: 1px solid var(--line); }
.contact-links a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 4px; min-height: 44px; text-decoration: none;
  transition: padding var(--t), color var(--t);
}
.contact-links a:hover { padding-left: 10px; color: var(--accent); }
.contact-links .cl-k { font-size: 16px; }
.contact-links .cl-v { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.contact-links a:hover .cl-v { color: var(--accent); }

.site-footer { border-top: 1px solid var(--line-2); padding: 34px 0 44px; font-size: 13px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer .mono { font-size: 12px; }

/* ==========================================================================
   Case study — hero
   ========================================================================== */

.case-hero { padding: 56px 0 0; }
.case-crumb { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.case-crumb a { text-decoration: none; }
.case-crumb a:hover { color: var(--ink); }
.case-crumb .sl { color: var(--line-3); }

.case-kicker { margin-top: 26px; font-family: var(--mono); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-ink); }
.case-title { margin-top: 14px; max-width: 20ch; font-size: clamp(28px, 4vw, 44px); line-height: 1.14; }
html[lang="ko"] .case-title { line-height: 1.32; font-size: clamp(25px, 3.4vw, 38px); }
.case-lede { margin-top: 22px; max-width: 68ch; font-size: 17.5px; line-height: 1.68; color: var(--ink-2); }
.case-hero-foot { margin-top: 30px; padding: 20px 0 0; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.case-metrics {
  margin-top: 34px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.cm-item { padding: 20px 22px; min-width: 0; }
.cm-item + .cm-item { border-left: 1px solid var(--line); }
.cm-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 500; line-height: 1.1; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.cm-val .u { font-size: 14px; color: var(--muted); }
.cm-val .to { color: var(--line-3); }
.cm-val .after { color: var(--green); }
.cm-label { margin-top: 9px; font-size: 13px; color: var(--ink-3); line-height: 1.45; }

/* ==========================================================================
   Case study — layout with sticky TOC
   ========================================================================== */

.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 244px; gap: 0 56px; align-items: start; padding-top: 12px; }
.case-main { min-width: 0; padding-bottom: 40px; }

.toc-rail { position: sticky; top: calc(var(--header-h) + 28px); padding-top: 60px; }
.toc-rail .toc-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.toc-rail ol { list-style: none; margin-top: 8px; max-height: 62vh; overflow-y: auto; }
.toc-rail ol a {
  display: grid; grid-template-columns: 26px 1fr; gap: 6px;
  padding: 7px 0 7px 10px; margin-left: -12px;
  text-decoration: none; font-size: 13.2px; line-height: 1.4; color: var(--muted);
  border-left: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.toc-rail ol a .tn { font-family: var(--mono); font-size: 10.5px; padding-top: 2px; }
.toc-rail ol a:hover { color: var(--ink-2); }
.toc-rail ol a.is-current { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 500; }

/* Back to Selected Work. Deliberately not .btn: that carries min-height:44px
   on an inline-flex box, which overflows its line box and collides with the
   table of contents above it. */
.toc-back {
  display: flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 13px 0 4px;
  border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.4; color: var(--accent-ink); text-decoration: none;
}
.toc-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.toc-back .arr { transition: transform var(--t); flex: none; }
.toc-back:hover .arr { transform: translateX(3px); }

.toc-mobile { display: none; margin: 26px 0 8px; }
.toc-mobile > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 46px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.toc-mobile > summary::-webkit-details-marker { display: none; }
.toc-mobile > summary .cv { transition: transform var(--t); }
.toc-mobile[open] > summary .cv { transform: rotate(180deg); }
.toc-mobile ol { list-style: none; margin-top: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.toc-mobile ol a { display: grid; grid-template-columns: 28px 1fr; padding: 12px 10px; min-height: 44px; align-items: center; text-decoration: none; font-size: 14.5px; color: var(--ink-2); }
.toc-mobile ol a .tn { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ==========================================================================
   Case study — blocks
   ========================================================================== */

.cs-section { padding: 52px 0 0; }
.cs-section + .cs-section { border-top: 1px solid var(--line); margin-top: 52px; }
.cs-section > .cs-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.cs-section .cs-n { font-family: var(--mono); font-size: 11.5px; color: var(--muted); flex: none; padding-top: 2px; }
.cs-section h2 { font-size: clamp(20px, 2.2vw, 25px); }

.blk + .blk { margin-top: 22px; }
.blk-p { max-width: var(--w-text); font-size: 16.5px; line-height: 1.72; color: var(--ink-2); }
.blk-p strong { color: var(--ink); font-weight: 600; }
.blk-p code, .inline-code {
  font-family: var(--mono); font-size: .89em;
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: 3px; padding: 1px 5px; color: var(--ink);
}
.blk-lead { max-width: var(--w-text); font-size: 18.5px; line-height: 1.64; color: var(--ink); }

.blk-quote { max-width: var(--w-text); margin-top: 26px; border-left: 3px solid var(--accent); padding: 4px 0 4px 22px; }
.blk-quote p { font-size: 20px; line-height: 1.5; color: var(--ink); }
html[lang="ko"] .blk-quote p { font-size: 18.5px; line-height: 1.62; }
.blk-quote cite { display: block; margin-top: 10px; font-style: normal; font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.blk-ul, .blk-ol { max-width: var(--w-text); list-style: none; }
.blk-ul li, .blk-ol li { position: relative; padding-left: 26px; font-size: 16px; line-height: 1.66; color: var(--ink-2); }
.blk-ul li + li, .blk-ol li + li { margin-top: 11px; }
.blk-ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--line-3); }
.blk-ol { counter-reset: bl; }
.blk-ol li { padding-left: 34px; counter-increment: bl; }
.blk-ol li::before { content: counter(bl, decimal-leading-zero); position: absolute; left: 0; top: 2px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

.blk-note { max-width: var(--w-text); border: 1px solid var(--line-2); border-left: 3px solid var(--line-3); border-radius: var(--r); background: var(--surface); padding: 14px 18px; font-size: 14.5px; color: var(--ink-3); line-height: 1.6; }

.blk-callout { border: 1px solid var(--accent-line); background: var(--accent-weak); border-radius: var(--r-lg); padding: 20px 22px; max-width: var(--w-text); }
.blk-callout h4 { font-size: 14px; color: var(--accent-ink); margin-bottom: 8px; }
.blk-callout p { font-size: 15.5px; line-height: 1.66; color: var(--ink-2); }

.blk-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.kv-row { display: grid; grid-template-columns: 132px 1fr; gap: 16px; padding: 14px 18px; min-width: 0; }
.kv-row:nth-child(odd) { border-right: 1px solid var(--line); }
.blk-kv .kv-row:nth-child(n+3) { border-top: 1px solid var(--line); }
.kv-k { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.kv-v { font-size: 14.8px; line-height: 1.55; color: var(--ink-2); min-width: 0; }

.blk-reframe { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.rfb { background: var(--surface); padding: 18px 20px; display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: baseline; }
.rfb .rfb-k { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.rfb .rfb-k .tick { width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); flex: none; }
.rfb:nth-child(2) .rfb-k .tick { background: var(--amber); }
.rfb:nth-child(3) .rfb-k .tick { background: var(--accent); }
.rfb:nth-child(3) { background: var(--accent-weak); }
.rfb .rfb-v { font-size: 16px; line-height: 1.6; color: var(--ink); }

.blk-own { border-top: 1px solid var(--line-2); }
.own-row { display: grid; grid-template-columns: 128px 1fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: start; }
.own-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em;
  text-transform: uppercase; padding: 4px 8px; border-radius: 4px;
  border: 1px solid var(--line-2); color: var(--ink-3); background: var(--surface); white-space: nowrap;
}
.own-tag .bar { width: 3px; height: 11px; border-radius: 1px; background: var(--line-3); }
.own-row[data-scope="direct"] .own-tag { border-color: var(--accent-line); background: var(--accent-weak); color: var(--accent-ink); }
.own-row[data-scope="direct"] .own-tag .bar { background: var(--accent); }
.own-row[data-scope="co"] .own-tag { border-color: var(--green-line); background: var(--green-weak); color: var(--green); }
.own-row[data-scope="co"] .own-tag .bar { background: var(--green); }
.own-row[data-scope="coord"] .own-tag { border-color: var(--amber-line); background: var(--amber-weak); color: var(--amber); }
.own-row[data-scope="coord"] .own-tag .bar { background: var(--amber); }
.own-row .own-text { font-size: 15.8px; line-height: 1.65; color: var(--ink-2); }

.blk-decisions { display: grid; gap: 14px; }
.dec { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.dec > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px 1fr 24px; gap: 14px; align-items: center; padding: 17px 20px; transition: background var(--t); }
.dec > summary::-webkit-details-marker { display: none; }
.dec > summary:hover { background: var(--surface-2); }
.dec .dec-n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dec .dec-t { font-size: 16.5px; font-weight: 500; line-height: 1.4; }
.dec .dec-cv { color: var(--muted); transition: transform var(--t); justify-self: end; }
.dec[open] .dec-cv { transform: rotate(180deg); }
.dec[open] > summary { border-bottom: 1px solid var(--line); }
.dec-body { padding: 18px 20px 22px 68px; }
.dec-body > * + * { margin-top: 14px; }
.dec-body p { font-size: 15.8px; line-height: 1.7; color: var(--ink-2); max-width: 64ch; }
.dec-tradeoff { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink-3); }
.dec-tradeoff .dt-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }

.blk-table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); }
table.blk-table { width: 100%; border-collapse: collapse; min-width: 520px; }
table.blk-table th, table.blk-table td { text-align: left; padding: 13px 18px; font-size: 15px; line-height: 1.55; border-bottom: 1px solid var(--line); vertical-align: top; }
table.blk-table thead th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); font-weight: 500; }
table.blk-table tbody tr:last-child td { border-bottom: 0; }
table.blk-table td:first-child { font-weight: 500; color: var(--ink); }

.blk-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split-col { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); padding: 18px 20px 20px; }
.split-col.is-hard { border-color: var(--accent-line); background: var(--accent-weak); }
.split-col h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.split-col.is-hard h4 { color: var(--accent-ink); }
.split-col ul { list-style: none; }
.split-col li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.split-col li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.split-col.is-hard li + li { border-top-color: var(--accent-line); }
.split-col li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 6px; height: 1.5px; background: var(--line-3); }
.split-col.is-hard li::before { background: var(--accent); }

.blk-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.st-col { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); padding: 18px 20px 20px; }
.st-col h4 { margin-bottom: 14px; }
.st-col ul { list-style: none; }
.st-col li { font-size: 14.6px; line-height: 1.55; color: var(--ink-2); padding-left: 18px; position: relative; }
.st-col li + li { margin-top: 10px; }
.st-col li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--line-3); }
.st-col[data-tone="done"] li::before { background: var(--green); }
.st-col[data-tone="progress"] li::before { background: var(--amber); }
.st-col[data-tone="poc"] li::before { background: var(--ink-3); }

/* ==========================================================================
   Figures: diagrams, charts, interactive demos
   ========================================================================== */

.figure { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.fig-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.fig-title { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.fig-tools { display: flex; align-items: center; gap: 8px; }
.fig-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: 12.5px; color: var(--ink-3);
  transition: border-color var(--t), color var(--t), background var(--t);
}
.fig-btn:hover { border-color: var(--line-3); color: var(--ink); }
.fig-btn[aria-pressed="true"], .fig-btn.is-on { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.fig-body { padding: 22px 18px; overflow-x: auto; }
.fig-body .dg { display: block; margin: 0 auto; min-width: 560px; }
.fig-caption { padding: 13px 18px; border-top: 1px solid var(--line); font-size: 13.6px; line-height: 1.6; color: var(--ink-3); background: var(--surface-2); }
.fig-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 11px 18px; border-top: 1px solid var(--line); }
.fig-legend span { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.fig-legend i { width: 11px; height: 11px; border-radius: 2px; display: block; flex: none; }

/* Diagram SVG conventions */
.dg { font-family: var(--mono); }
.dg .dg-box { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; }
.dg .dg-box.mine { fill: var(--accent-weak); stroke: var(--accent-line); }
.dg .dg-box.ext  { fill: var(--bg-sunken); stroke: var(--line-2); }
.dg .dg-box.coord{ fill: var(--amber-weak); stroke: var(--amber-line); }
.dg .dg-group { fill: none; stroke: var(--line-2); stroke-dasharray: 3 3; }
.dg .dg-group-label { fill: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.dg .dg-t  { fill: var(--ink); font-size: 11.5px; }
.dg .dg-t2 { fill: var(--muted); font-size: 10px; }
.dg .dg-edge { stroke: var(--line-3); stroke-width: 1.2; fill: none; }
.dg .dg-edge.hot { stroke: var(--accent); stroke-width: 1.6; }
.dg .dg-edge-label { fill: var(--muted); font-size: 9.5px; }
.dg .dg-head { fill: var(--line-3); }
.dg .dg-head.hot { fill: var(--accent); }
.dg .dg-node { transition: opacity var(--t); }
.dg.is-dim .dg-node:not(.is-lit) { opacity: .28; }

/* Zoom / lightbox */
.zoom-backdrop { position: fixed; inset: 0; z-index: 160; background: var(--scrim); display: flex; flex-direction: column; padding: 18px; }
.zoom-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #fff; padding: 4px 4px 14px; flex-wrap: wrap; }
.zoom-bar .zt { font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.zoom-bar button {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: var(--r); height: 34px; padding: 0 12px; cursor: pointer; font-size: 13px; min-width: 40px;
}
.zoom-bar button:hover { background: rgba(255,255,255,.22); }
.zoom-stage { flex: 1; background: var(--surface); border-radius: var(--r-lg); overflow: auto; padding: 24px; display: grid; place-items: center; }
.zoom-stage svg { min-width: 0; }

/* Before / after comparison */
.compare-stage { position: relative; }
.compare-pane { display: none; }
.compare-pane.is-on { display: block; }
.compare-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.compare-switch button { height: 30px; padding: 0 13px; border: 0; background: var(--surface); cursor: pointer; font-size: 12.5px; color: var(--ink-3); transition: background var(--t), color var(--t); }
.compare-switch button + button { border-left: 1px solid var(--line-2); }
.compare-switch button[aria-pressed="true"] { background: var(--solid); color: var(--on-solid); }

/* Mock product UI (anonymised, reconstructed) */
.mock { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.mock-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mock-bar .dots { display: flex; gap: 5px; }
.mock-bar .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); display: block; }
.mock-bar .path { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.mock-search { display: flex; align-items: center; gap: 9px; margin: 12px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.mock-search .q { font-family: var(--mono); font-size: 12.5px; }
.mock-body { display: grid; }
.mock-body.with-rail { grid-template-columns: 178px 1fr; }
.mock-rail { border-right: 1px solid var(--line); padding: 12px; background: var(--surface-2); }
.mock-rail-h { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.mock-tree { list-style: none; font-size: 12.5px; }
.mock-tree li { padding: 5px 0; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.mock-tree li.lv2 { padding-left: 14px; }
.mock-tree li.on { color: var(--accent-ink); font-weight: 500; }
.mock-tree .cnt { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.mock-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 12px 0; }
.mock-results { padding: 12px; display: grid; gap: 8px; }
.mock-row { border: 1px solid var(--line); border-radius: var(--r); padding: 11px 13px; background: var(--surface); }
.mock-row.flat { display: flex; gap: 14px; align-items: center; }
.mock-row .r-name { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.mock-row .r-blob { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-row .r-path { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.mock-row .r-desc { font-size: 12.8px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.mock-row .r-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mock-note { padding: 10px 13px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12.4px; color: var(--muted); }

/* Stepper */
.stepper-nav { display: flex; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--line); overflow-x: auto; background: var(--surface-2); }
.stepper-nav button {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  height: 34px; padding: 0 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: 12.8px; color: var(--ink-3);
  transition: border-color var(--t), background var(--t), color var(--t);
}
.stepper-nav button .sn { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.stepper-nav button:hover { border-color: var(--line-3); color: var(--ink); }
.stepper-nav button[aria-selected="true"] { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.stepper-nav button[aria-selected="true"] .sn { color: var(--on-solid); opacity: .6; }
.stepper-nav button.is-done { border-color: var(--accent-line); background: var(--accent-weak); color: var(--accent-ink); }
.step-panel { padding: 22px 20px; display: grid; grid-template-columns: 300px 1fr; gap: 28px; }
.step-copy h4 { font-size: 16.5px; margin-bottom: 10px; }
.step-copy p { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.step-copy .step-k { display: block; margin-bottom: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.step-visual { min-width: 0; }
.step-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.step-progress { display: flex; gap: 4px; align-items: center; }
.step-progress i { width: 22px; height: 3px; border-radius: 2px; background: var(--line-2); display: block; }
.step-progress i.on { background: var(--accent); }

/* Terminal / transcript */
.term { background: var(--term-bg); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,.09); }
.term-bar .dots { display: flex; gap: 5px; }
.term-bar .dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.2); display: block; }
.term-bar .tt { font-family: var(--mono); font-size: 10.5px; color: rgba(255,255,255,.45); letter-spacing: .06em; }
.term-body { padding: 14px 16px; font-family: var(--mono); font-size: 12.4px; line-height: 1.72; }
.term-line { display: grid; grid-template-columns: 74px 1fr; gap: 12px; }
.term-line + .term-line { margin-top: 9px; }
.term-role { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; padding-top: 4px; color: rgba(255,255,255,.4); }
.term-line[data-role="user"] .term-text { color: #e6edf3; }
.term-line[data-role="tool"] .term-text { color: #7fb1ff; }
.term-line[data-role="ctx"]  .term-text { color: #f0b849; }
.term-line[data-role="out"]  .term-text { color: #6fd3a4; white-space: pre-wrap; }
.term-line[data-role="note"] .term-text { color: rgba(255,255,255,.42); }
.term-text { min-width: 0; overflow-wrap: anywhere; }

/* Timeline */
.blk-timeline { position: relative; padding-left: 4px; }
.tl-item { display: grid; grid-template-columns: 128px 22px 1fr; gap: 0 16px; padding-bottom: 26px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-when { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; padding-top: 2px; letter-spacing: .02em; }
.tl-mark { position: relative; display: grid; justify-items: center; }
.tl-mark i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-3); margin-top: 5px; z-index: 1; }
.tl-item[data-tone="key"] .tl-mark i { border-color: var(--accent); background: var(--accent); }
.tl-item[data-tone="done"] .tl-mark i { border-color: var(--green); background: var(--green); }
.tl-item:not(:last-child) .tl-mark::after { content: ""; position: absolute; top: 14px; bottom: -26px; width: 1px; background: var(--line-2); }
.tl-body h4 { font-size: 16px; }
.tl-body p { margin-top: 6px; font-size: 14.8px; line-height: 1.6; color: var(--ink-3); max-width: 58ch; }

/* Charts */
.blk-chart { display: grid; gap: 22px; }
.chart-row { display: grid; grid-template-columns: 168px 1fr; gap: 22px; align-items: center; }
.chart-label { font-size: 14.5px; color: var(--ink-2); }
.chart-label .cl-sub { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.chart-bars { display: grid; gap: 9px; min-width: 0; }
.bar-row { display: grid; grid-template-columns: 62px 1fr 86px; gap: 12px; align-items: center; }
.bar-k { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.bar-track { height: 20px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--line-3); border-radius: 3px; transition: width 420ms cubic-bezier(.2,.7,.3,1); }
.bar-row.is-after .bar-fill { background: var(--accent); }
.bar-v { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bar-row.is-after .bar-v { color: var(--accent-ink); font-weight: 500; }
.chart-delta { font-family: var(--mono); font-size: 11.5px; color: var(--green); border: 1px solid var(--green-line); background: var(--green-weak); border-radius: 4px; padding: 3px 8px; justify-self: start; margin-top: 4px; }

/* Case footer nav */
.case-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 40px 0 70px; }
.case-nav a { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); padding: 20px 22px; text-decoration: none; transition: border-color var(--t), transform var(--t); }
.case-nav a:hover { border-color: var(--line-3); transform: translateY(-2px); }
.case-nav .cn-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 9px; }
.case-nav .cn-t { font-size: 16.5px; line-height: 1.4; }
.case-nav a.is-next { text-align: right; }

/* ==========================================================================
   Resume
   ========================================================================== */

.resume { padding: 56px 0 80px; }
.resume-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.resume h1 { font-size: clamp(28px, 3.4vw, 38px); }
.resume .r-role { margin-top: 8px; font-size: 17px; color: var(--ink-3); }
.resume .r-contact { list-style: none; display: grid; gap: 5px; font-family: var(--mono); font-size: 12.5px; }
.resume .r-contact a { color: var(--ink-2); text-decoration: none; }
.resume .r-contact a:hover { color: var(--accent); }
.r-summary { max-width: 78ch; font-size: 17px; }
.r-sec { padding-top: 34px; margin-top: 34px; border-top: 1px solid var(--line-2); }
.r-sec > h2 { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.r-entry + .r-entry { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.r-entry.is-cont { margin-top: 18px; padding-top: 0; border-top: 0; }
.r-entry-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: baseline; }
.r-entry h3 { font-size: 17px; }
.r-entry .r-org { font-size: 14.5px; color: var(--ink-3); margin-top: 4px; }
.r-entry .r-when { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.r-sub { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--accent-line); font-size: 14.5px; line-height: 1.55; color: var(--accent-ink); }
.r-entry.is-cont .r-sub { margin-top: 0; }
.r-entry ul { list-style: none; margin-top: 12px; }
.r-entry li { position: relative; padding-left: 20px; font-size: 15.2px; line-height: 1.62; color: var(--ink-2); }
.r-entry li + li { margin-top: 8px; }
.r-entry li::before { content: ""; position: absolute; left: 3px; top: .68em; width: 6px; height: 1.5px; background: var(--line-3); }
.r-link { margin-top: 12px; }
.r-link a { color: var(--accent-ink); font-size: 14px; text-decoration: none; }
.r-link a:hover { text-decoration: underline; text-underline-offset: 3px; }
.r-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.r-skill-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.r-skill-v { font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.print-hint { margin-top: 28px; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ==========================================================================
   Case overlay — case studies open in place over the home page.
   The standalone /work/*.html pages stay real: they are what the overlay
   fetches, what search engines index, and what loads without JavaScript.
   ========================================================================== */

.case-overlay { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; }
.ov-scrim { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: ov-fade 160ms ease-out; }
.ov-panel {
  position: relative;
  width: 100%; max-width: 1180px;
  margin: 30px auto 0; height: calc(100% - 30px);
  background: var(--bg);
  border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 -16px 60px -24px rgba(0, 0, 0, .7);
  animation: ov-rise 200ms cubic-bezier(.2, .7, .3, 1);
}
@keyframes ov-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes ov-rise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) { .ov-scrim, .ov-panel { animation: none; } }

.ov-bar { flex: none; height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ov-bar .ov-id { font-family: var(--mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; min-width: 0; }
.ov-bar .ov-id b { color: var(--ink-2); font-weight: 500; }
.ov-bar .ov-id .ov-name { color: var(--ink); font-weight: 500; text-transform: none; font-family: var(--sans); font-size: 13.5px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.ov-tools a, .ov-tools button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px; cursor: pointer; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: 12.5px; color: var(--ink-3);
  transition: border-color var(--t), color var(--t);
}
.ov-tools a:hover, .ov-tools button:hover { border-color: var(--line-3); color: var(--ink); }
.ov-tools kbd { font-family: var(--mono); font-size: 10.5px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; color: var(--muted); }

.ov-progress { flex: none; height: 2px; background: transparent; }
.ov-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 90ms linear; }

.ov-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.ov-scroll .case-hero { padding-top: 34px; }
.ov-scroll .toc-rail { top: 24px; padding-top: 60px; }
.ov-scroll .case-nav { padding-bottom: 48px; }
.ov-scroll .case-crumb { display: none; }
.ov-loading { display: grid; place-items: center; height: 100%; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .case-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc-rail { display: none; }
  .toc-mobile { display: block; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid > :last-child { grid-column: span 2; }
  .work-card:last-child .thumb { max-width: 520px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 20px 36px; }
}

@media (max-width: 900px) {
  :root { --gut: 22px; }
  .site-nav { display: none; }
  .menu-btn { display: inline-flex; }
  .brand .role { display: none; }
  .kbd-btn { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 520px; }
  .reframe-flow { grid-template-columns: 1fr; }
  .rf-arrow { padding: 0 22px; justify-items: start; }
  .rf-arrow svg { transform: rotate(90deg); }
  .rf-divider { border-left: 0; border-top: 1px solid var(--line); }
  .evidence { grid-template-columns: repeat(2, 1fr); }
  .ev-item:nth-child(2n) { border-left: 1px solid var(--line); }
  .ev-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .career-item { grid-template-columns: 1fr; gap: 12px; }
  .cr-when { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .cr-now { margin-top: 0; }
  .method-item { grid-template-columns: 40px 1fr; gap: 0 16px; }
  .method-proof { grid-column: 2; margin-top: 16px; }
  .contact-grid { grid-template-columns: 1fr; gap: 30px; }
  .sec-body.indent { padding-left: 0; }
  .sec-head { grid-template-columns: 40px 1fr; gap: 0 12px; padding: 48px 0 26px; }
  .step-panel { grid-template-columns: 1fr; gap: 20px; }
  .blk-status { grid-template-columns: 1fr; }
  .case-metrics { grid-template-columns: repeat(2, 1fr); }
  .cm-item:nth-child(2n+1) { border-left: 0; }
  .cm-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ov-panel { margin-top: 0; height: 100%; border-radius: 0; border-left: 0; border-right: 0; }
  .ov-bar .ov-id .ov-name { display: none; }
}

@media (max-width: 720px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-grid > :last-child { grid-column: auto; }
  .work-card:last-child .thumb { max-width: none; }
  .blk-kv { grid-template-columns: 1fr; }
  .kv-row:nth-child(odd) { border-right: 0; }
  .blk-kv .kv-row + .kv-row { border-top: 1px solid var(--line); }
  .kv-row { grid-template-columns: 108px 1fr; gap: 12px; }
  .blk-split { grid-template-columns: 1fr; }
  .rfb { grid-template-columns: 1fr; gap: 8px; }
  .own-row { grid-template-columns: 1fr; gap: 10px; }
  .mock-body.with-rail { grid-template-columns: 1fr; }
  .mock-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .dec-body { padding-left: 20px; }
  .chart-row { grid-template-columns: 1fr; gap: 12px; }
  .tl-item { grid-template-columns: 16px 1fr; gap: 0 14px; }
  .tl-when { grid-column: 2; text-align: left; margin-bottom: 6px; }
  .tl-mark { grid-row: 1 / span 2; grid-column: 1; }
  .tl-body { grid-column: 2; }
  .case-nav { grid-template-columns: 1fr; }
  .case-nav a.is-next { text-align: left; }
  .aw-list > li.aw-flat, .aw > summary { grid-template-columns: 1fr 24px; }
  .aw-fact { text-align: left; grid-column: 1; }
  .fig-body { padding: 16px 12px; }
  .evidence { grid-template-columns: 1fr; }
  .ev-item + .ev-item { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 480px) {
  .hero { padding-top: 46px; }
  .hero-statement { font-size: 30px; }
  .step-panel { padding: 18px 14px; }
}

/* ==========================================================================
   Print (resume -> PDF)
   ========================================================================== */

@media print {
  :root, :root[data-theme="light"] {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #fff; --bg-sunken: #fff;
    --ink: #000; --ink-2: #1a1a1a; --ink-3: #333; --muted: #555;
    --line: #ddd; --line-2: #ccc; --line-3: #999;
    --solid: #000; --on-solid: #fff;
  }
  .site-header, .progress-rail, .site-footer, .print-hint, .palette-backdrop,
  .mobile-nav, .skip-link, .case-overlay { display: none !important; }
  body { font-size: 11pt; }
  .wrap { max-width: none; padding: 0; }
  .resume { padding: 0; }
  .r-entry, .r-sec { break-inside: avoid; }
  a { text-decoration: none; color: #000; }
}
