/* cakbudak.com — design system
   Light editorial research layout, automatic dark mode.
   Fonts: Space Grotesk + JetBrains Mono, self-hosted under /dep/fonts/. */

:root {
  --paper: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeede7;
  --ink: #0b1a1e;
  --ink-2: #34464b;
  --muted: #5b6c70;
  --faint: #667679;
  --rule: #dcdeda;
  --rule-strong: #c3c9c5;
  --petrol: #187189;
  --petrol-ink: #0f5466;
  --petrol-soft: #e2eef0;
  --accent: #f26419;
  --accent-ink: #b5480d;
  --accent-soft: #fcebe0;
  --code-bg: #f0f0eb;
  --shadow: 0 1px 2px rgba(11, 26, 30, .04), 0 12px 32px -16px rgba(11, 26, 30, .16);

  --radius: 10px;
  --radius-l: 16px;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;

  --font-sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #081215;
    --surface: #0d1b1f;
    --surface-2: #122429;
    --ink: #e6eded;
    --ink-2: #b2c1c3;
    --muted: #8b9c9f;
    --faint: #7f9194;
    --rule: #1c3036;
    --rule-strong: #2b454c;
    --petrol: #5db3c9;
    --petrol-ink: #86c9da;
    --petrol-soft: #10292f;
    --accent: #f47a3a;
    --accent-ink: #f79a63;
    --accent-soft: #2b1a10;
    --code-bg: #0a171a;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--petrol-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
code, kbd, samp { font-family: var(--font-mono); font-size: .88em; }
p code, li code, td code { background: var(--surface-2); border: 1px solid var(--rule); border-radius: 4px; padding: .05em .35em; color: var(--ink); white-space: nowrap; }
strong { font-weight: 600; color: var(--ink); }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
.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; }

/* ---------- type helpers ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.kicker .n { color: var(--accent-ink); }
.kicker .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); flex: none; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

h1 {
  font-size: clamp(2.75rem, 6.6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.045em;
  margin: 20px 0 0;
}
h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -.03em;
  margin: 0;
}
h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -.012em; margin: 0; }
.lead { font-size: clamp(1.08rem, 1.5vw, 1.2rem); line-height: 1.6; color: var(--ink-2); max-width: 62ch; }
.prose p { color: var(--ink-2); max-width: 68ch; margin: 0 0 1.1em; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 600; letter-spacing: -.015em; font-size: 1rem; line-height: 1.1; white-space: nowrap; }
.brand-role { display: block; font-family: var(--font-mono); font-size: .66rem; font-weight: 400; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 500;
  padding: 7px 12px; border-radius: 999px; transition: background .15s, color .15s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--rule); }
.nav .lang {
  margin-left: 10px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em;
  border: 1px solid var(--rule-strong); padding: 6px 11px; color: var(--ink-2);
}
.nav .lang b { color: var(--ink); font-weight: 600; }
.menu-btn {
  display: none; align-items: center; gap: 8px; font: inherit; font-size: .9rem; font-weight: 500;
  color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.menu-btn span { display: block; width: 14px; height: 1.5px; background: currentColor; position: relative; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; width: 14px; height: 1.5px; background: currentColor; }
.menu-btn span::before { top: -4.5px; } .menu-btn span::after { top: 4.5px; }

@media (max-width: 900px) {
  .js .menu-btn { display: inline-flex; }
  .js .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 10px var(--gutter) 18px; box-shadow: var(--shadow);
  }
  .js .nav.open { display: flex; }
  .js .nav a { padding: 12px 14px; font-size: 1.05rem; border-radius: 10px; }
  .js .nav .lang { margin: 10px 0 0; align-self: flex-start; border-radius: 999px; padding: 8px 14px; font-size: .76rem; }
  html:not(.js) .site-header .wrap { height: auto; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 8px 24px; }
  html:not(.js) .nav { justify-content: flex-start; }
  .nav { flex-wrap: wrap; justify-content: flex-end; }
  .brand-role { display: none; }
}

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-size: .98rem; font-weight: 500; line-height: 1;
  padding: 14px 20px; border-radius: 999px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--petrol-ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
@media (prefers-color-scheme: dark) {
  .btn-primary:hover { background: var(--petrol); color: #061114; }
}

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section.tight { padding-top: 0; }
.rule-top { border-top: 1px solid var(--rule); }
.sec-head {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 0 clamp(32px, 6vw, 80px);
  align-items: end; margin-bottom: clamp(36px, 5vw, 56px);
}
.sec-head > .kicker { grid-column: 1 / -1; margin-bottom: 18px; }
.sec-head > div { display: contents; }
.sec-head h2 { grid-column: 1; max-width: 22ch; }
.sec-head .lead { grid-column: 2; margin: 0; padding-bottom: .2em; }
@media (max-width: 860px) {
  .sec-head { grid-template-columns: minmax(0, 1fr); }
  .sec-head .lead { grid-column: 1; margin: 18px 0 0; }
}
.story { max-width: 820px; }
.story h2 { margin: 18px 0 28px; }

/* ---------- hero ---------- */
.hero { padding: clamp(44px, 7vw, 96px) 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-role { font-size: clamp(1.2rem, 2.2vw, 1.6rem); color: var(--ink-2); margin: 16px 0 0; letter-spacing: -.012em; line-height: 1.3; font-weight: 400; }
.hero .lead { margin: 28px 0 0; }
.figure { margin: 0; }
.figure img { width: 100%; border-radius: var(--radius); background: var(--surface-2); }
.figure figcaption {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin-top: 12px;
}
.portrait img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.wide img { aspect-ratio: 16 / 7; object-fit: cover; }
.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-top: clamp(48px, 7vw, 88px);
}
.fact { padding: 22px 24px 24px 0; }
.fact + .fact { padding-left: 24px; border-left: 1px solid var(--rule); }
.fact b { display: block; font-size: 1.45rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; color: var(--ink); }
.fact span { display: block; font-size: .9rem; color: var(--muted); margin-top: 4px; line-height: 1.45; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid .figure { max-width: 440px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* sub hero (inner pages) */
.sub-hero { padding: clamp(44px, 7vw, 96px) 0 clamp(40px, 6vw, 72px); }
.sub-hero .lead { margin: 26px 0 0; }
.sub-hero h1 { max-width: 16ch; }

/* ---------- feature band (research) ---------- */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-l);
  padding: clamp(28px, 4.5vw, 64px); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.feature::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.feature h2 { margin-top: 18px; }
.feature .lead { margin: 18px 0 0; }
.stat-list { display: grid; align-content: center; }
.stat-list .stat { padding: 20px 0; border-top: 1px solid var(--rule); }
.stat-list .stat:first-child { border-top: 0; padding-top: 0; }
.stat b { display: block; font-size: clamp(1.9rem, 3vw, 2.4rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat span { display: block; color: var(--ink-2); font-size: .95rem; margin-top: 6px; line-height: 1.5; }
@media (max-width: 860px) { .feature { grid-template-columns: minmax(0, 1fr); } }

/* ---------- about ---------- */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.split .figure img { aspect-ratio: 4 / 5; object-fit: cover; }
.statement { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.45; letter-spacing: -.012em; color: var(--ink); margin: 0 0 28px; max-width: 34ch; font-weight: 500; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } .split .figure { max-width: 420px; } }

/* ---------- project index ---------- */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.index a {
  display: grid; grid-template-columns: 44px 120px minmax(0, 1fr) minmax(0, 220px) 24px;
  align-items: center; gap: 28px; padding: 20px 0;
  border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none;
  transition: background .2s;
}
.index .no { font-family: var(--font-mono); font-size: .78rem; color: var(--accent-ink); }
.index img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.index h3 { font-size: 1.3rem; transition: color .15s; }
.index p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.index .stack { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-2); line-height: 1.6; }
.index .arr { color: var(--faint); transition: transform .2s, color .2s; justify-self: end; }
.index a:hover h3 { color: var(--petrol-ink); }
.index a:hover .arr { transform: translateX(4px); color: var(--accent); }
.index.text a { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 260px) 90px 24px; }
.index .yr { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); text-align: right; }
@media (max-width: 860px) {
  .index a { grid-template-columns: 88px minmax(0, 1fr); gap: 6px 18px; }
  .index img { width: 88px; height: 66px; grid-row: span 3; }
  .index .no { grid-column: 2; }
  .index .stack { grid-column: 2; }
  .index .arr { display: none; }
  .index.text a { grid-template-columns: 40px minmax(0, 1fr); }
  .index.text .stack, .index.text .yr { grid-column: 2; text-align: left; }
  .index.text .no { grid-column: 1; grid-row: 1; padding-top: .3em; }
}

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.card .kicker { font-size: .68rem; }
.card h3 { font-size: 1.16rem; }
.card p { margin: 0; color: var(--ink-2); font-size: .96rem; line-height: 1.6; }
.card .num { font-family: var(--font-mono); font-size: .78rem; color: var(--accent-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.card .tags { margin-top: auto; padding-top: 10px; }
.tag {
  font-family: var(--font-mono); font-size: .7rem; line-height: 1.4; padding: 3px 8px;
  border: 1px solid var(--rule-strong); border-radius: 4px; color: var(--ink-2); white-space: nowrap; background: var(--paper);
}
@media (max-width: 1024px) { .cards, .cards.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .cards, .cards.c3, .cards.c2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.contact-grid h2 { margin-top: 18px; }
.contact-grid .lead { margin: 18px 0 0; }
.direct { list-style: none; padding: 0; margin: 32px 0 0; border-top: 1px solid var(--rule); }
.direct li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.direct .k { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.direct a, .direct span.v { color: var(--ink); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.direct a:hover { color: var(--petrol-ink); text-decoration: underline; text-decoration-color: var(--accent); }
.form {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-l);
  padding: clamp(22px, 3vw, 36px); display: grid; gap: 18px; box-shadow: var(--shadow);
}
.person { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.person img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.person b { display: block; font-weight: 600; }
.person span { font-size: .88rem; color: var(--muted); }
.form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form label { display: grid; gap: 7px; font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.form input, .form textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: 8px; padding: 12px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-soft); }
.form .note { font-size: .82rem; color: var(--muted); margin: 0; }
.form .btn { justify-self: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .form .row { grid-template-columns: minmax(0, 1fr); } .direct li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 56px 0 36px; font-size: .92rem; color: var(--muted); background: var(--paper); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.foot-grid .brand { margin-bottom: 14px; }
.foot-grid p { margin: 0; max-width: 40ch; }
.foot-grid h4 { font-family: var(--font-mono); font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 0 14px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.foot-bottom {
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .04em; text-transform: uppercase;
}
.foot-bottom a { color: var(--muted); text-decoration: none; }
.foot-bottom a:hover { color: var(--ink); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- projects page ---------- */
.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 28px; padding: 20px 24px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: inherit;
}
.callout > span:first-child { flex: 1 1 420px; min-width: 0; }
.callout b { display: block; color: var(--ink); font-weight: 600; }
.callout span { color: var(--ink-2); font-size: .95rem; }
.callout .arr { color: var(--accent-ink); font-family: var(--font-mono); font-size: .82rem; white-space: nowrap; }
.callout:hover { border-color: var(--rule-strong); color: inherit; }
.callout:hover .arr { color: var(--accent); }

.project { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px clamp(32px, 6vw, 80px); padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--rule); }
.project-meta { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.project-meta .no { font-family: var(--font-mono); font-size: 2.6rem; font-weight: 500; line-height: 1; color: var(--accent); letter-spacing: -.04em; }
.meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; margin: 26px 0 22px; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: .94rem; }
.meta dt { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding-top: .28em; }
.meta dd { margin: 0; color: var(--ink); }
.project-meta .btn { margin-top: 22px; padding: 11px 16px; font-size: .9rem; }
.project-meta .figure { margin-top: 26px; }
.project-meta .figure img { aspect-ratio: 4 / 3; object-fit: cover; }
.project-body h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
.project-body .lead { color: var(--ink); margin: 18px 0 26px; }
.flow { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 20px 22px 22px; margin: 28px 0; }
.flow + .flow { margin-top: -14px; }
.flow h4 { font-family: var(--font-mono); font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 14px; }
.flow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; }
.flow li {
  font-family: var(--font-mono); font-size: .76rem; line-height: 1.35; color: var(--ink);
  padding: 8px 11px; background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 6px;
}
.flow li:not(:last-child) { margin-right: 30px; position: relative; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -22px; top: 50%; transform: translateY(-50%); color: var(--accent-ink); font-family: var(--font-sans); }
@media (max-width: 620px) {
  .flow ol { flex-direction: column; align-items: flex-start; gap: 0; }
  .flow li:not(:last-child) { margin: 0 0 26px; }
  .flow li:not(:last-child)::after { content: "↓"; right: auto; left: 12px; top: auto; bottom: -23px; transform: none; }
}
.highlights { list-style: none; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; border-top: 1px solid var(--rule); }
.highlights li { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: .95rem; color: var(--ink-2); line-height: 1.5; }
.highlights b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
@media (max-width: 860px) {
  .project { grid-template-columns: minmax(0, 1fr); }
  .project-meta { position: static; }
  .project-meta .figure { display: none; }
}
@media (max-width: 620px) { .highlights { grid-template-columns: minmax(0, 1fr); } }

/* code */
.code {
  margin: 28px 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--code-bg); overflow: hidden;
}
.code figcaption {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-family: var(--font-mono); font-size: .8rem; line-height: 1.75; color: var(--ink); tab-size: 4; }
.code .k { color: var(--accent-ink); }
.code .s { color: var(--petrol-ink); }
.code .c { color: var(--muted); }
.code .f { color: var(--ink); font-weight: 500; }

/* ---------- career ---------- */
.pull {
  margin: 40px 0; padding: 4px 0 4px 28px; border-left: 2px solid var(--accent);
  font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.38; letter-spacing: -.016em; color: var(--ink); font-weight: 500; max-width: 38ch;
}
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.timeline > li { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 14px 48px; padding: 34px 0; border-bottom: 1px solid var(--rule); }
.tl-years { font-family: var(--font-mono); font-size: .86rem; color: var(--accent-ink); padding-top: .35em; font-variant-numeric: tabular-nums; }
.tl-role { font-size: clamp(1.2rem, 2vw, 1.45rem); letter-spacing: -.018em; }
.tl-role a { color: inherit; text-decoration: none; }
.tl-role a:hover { color: var(--petrol-ink); }
.tl-org { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 14px; }
.timeline p { margin: 0 0 16px; color: var(--ink-2); max-width: 68ch; }
.timeline .is-now .tl-years::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: .1em; }
@media (max-width: 760px) { .timeline > li { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* ---------- research (VAC) ---------- */
.paper-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 26px; font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.paper-meta b { color: var(--ink); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: clamp(44px, 6vw, 72px); }
.stats .stat { padding: 26px 24px 28px 0; }
.stats .stat + .stat { padding-left: 24px; border-left: 1px solid var(--rule); }
.stats .stat b { font-size: clamp(2.1rem, 3.6vw, 3rem); }
.stats .stat span { font-size: .92rem; }
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats .stat { padding-left: 0 !important; border-left: 0 !important; }
  .stats .stat + .stat { border-top: 1px solid var(--rule); }
}
.question {
  margin: 0; padding: clamp(24px, 3.5vw, 40px); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-l);
  font-size: clamp(1.2rem, 2.1vw, 1.55rem); line-height: 1.45; letter-spacing: -.014em; color: var(--ink); font-weight: 500; position: relative;
}
.question::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.question cite { display: block; margin-top: 16px; font-style: normal; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px clamp(28px, 5vw, 64px); }
@media (max-width: 860px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.step { padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 12px; position: relative; }
.step + .step { border-left: 1px solid var(--rule); }
.step + .step::before {
  content: "→"; position: absolute; left: -13px; top: 34px; width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 50%; color: var(--accent-ink); font-size: .8rem; z-index: 1;
}
.step .num { font-family: var(--font-mono); font-size: .74rem; color: var(--accent-ink); }
.step h3 { font-size: 1.3rem; }
.step p { margin: 0; color: var(--ink-2); font-size: .96rem; line-height: 1.6; }
.step .tags { margin-top: auto; padding-top: 10px; }
@media (max-width: 900px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step + .step { border-left: 0; border-top: 1px solid var(--rule); }
  .step + .step::before { content: "↓"; left: 28px; top: -13px; }
}
.classes-label { margin-top: 28px; }
.classes { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.classes li { font-family: var(--font-mono); font-size: .74rem; color: var(--ink); background: var(--surface-2); border: 1px solid var(--rule); border-radius: 6px; padding: 5px 10px; }

.finding { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px 26px; display: grid; gap: 10px; align-content: start; }
.finding header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.finding h3 { font-size: 1.15rem; }
.finding .origin { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.finding p { margin: 0; color: var(--ink-2); font-size: .96rem; line-height: 1.6; }
.finding .fig { font-family: var(--font-mono); font-size: .8rem; color: var(--accent-ink); }
.finding.quiet { background: transparent; border-style: dashed; }

.chart { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-l); padding: clamp(20px, 3vw, 32px); }
.chart > figcaption { margin: 0 0 18px; }
.chart > figcaption b { display: block; font-size: 1.08rem; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.chart > figcaption span { display: block; font-size: .9rem; color: var(--muted); margin-top: 4px; }
.bars { width: 100%; border-collapse: collapse; font-size: .92rem; }
.bars th, .bars td { text-align: left; padding: 13px 12px 13px 0; border-top: 1px solid var(--rule); vertical-align: middle; font-weight: 400; }
.bars thead th { border-top: 0; padding-top: 0; font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.bars tbody th { color: var(--ink); width: 38%; padding-right: 20px; line-height: 1.4; }
.bars tbody th small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.bars td { width: 31%; }
.bars tbody tr:hover { background: var(--surface-2); }
.bar { display: flex; align-items: center; gap: 10px; }
.bar .track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; min-width: 40px; }
.bars tbody tr:hover .bar .track { background: var(--paper); }
.bar .track i { display: block; height: 100%; width: 0; background: var(--petrol); border-radius: 0 4px 4px 0; }
.bar.cost .track i { background: var(--accent); }
.bar .val { font-family: var(--font-mono); font-size: .8rem; color: var(--ink); min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.chart .source { margin: 16px 0 0; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }
@media (max-width: 620px) {
  .bars thead { display: none; }
  .bars, .bars tbody, .bars tr, .bars th, .bars td, .bars tbody th { display: block; width: 100%; }
  .bars tr { border-top: 1px solid var(--rule); padding: 12px 0; }
  .bars th, .bars td { border: 0; padding: 4px 0; }
  .bars td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 4px; }
}

.enforce { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); margin-top: 28px; }
.enforce div { padding: 18px 18px 20px; }
.enforce div + div { border-left: 1px solid var(--rule); }
.enforce b { display: block; font-size: 1.7rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.enforce span { display: block; font-size: .84rem; color: var(--ink-2); margin-top: 6px; line-height: 1.4; }
@media (max-width: 860px) {
  .enforce { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .enforce div + div { border-left: 0; }
  .enforce div { border-top: 1px solid var(--rule); }
  .enforce div:nth-child(-n+2) { border-top: 0; }
  .enforce div:nth-child(even) { border-left: 1px solid var(--rule); }
  .enforce div:last-child { grid-column: 1 / -1; border-left: 0; }
}

.wp { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 26px; display: grid; gap: 10px; align-content: start; }
.wp .num { font-family: var(--font-mono); font-size: .74rem; color: var(--accent-ink); }
.wp h3 { font-size: 1.2rem; }
.wp p { margin: 0; color: var(--ink-2); font-size: .96rem; line-height: 1.6; }
.invariant {
  margin-top: 16px; padding: 22px 26px; border-radius: var(--radius); background: var(--petrol-soft); border: 1px solid var(--rule);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 22px; align-items: baseline;
}
.invariant .kicker { color: var(--petrol-ink); font-size: .74rem; font-weight: 500; }
.invariant p { margin: 0; color: var(--ink); font-size: 1.05rem; font-weight: 500; line-height: 1.5; }
@media (max-width: 760px) { .invariant { grid-template-columns: minmax(0, 1fr); } }

.terminal { margin: 0; border-radius: var(--radius); background: #0b1a1e; color: #e6eded; border: 1px solid var(--rule); overflow: hidden; }
.terminal figcaption { display: flex; gap: 6px; align-items: center; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); font-family: var(--font-mono); font-size: .68rem; color: #8b9c9f; text-transform: uppercase; letter-spacing: .07em; }
.terminal figcaption i { width: 9px; height: 9px; border-radius: 50%; background: #2b454c; }
.terminal figcaption i:first-child { background: var(--accent); }
.terminal figcaption span { margin-left: 8px; }
.terminal pre { margin: 0; padding: 18px 20px; font-family: var(--font-mono); font-size: .82rem; line-height: 1.8; overflow-x: auto; }
.terminal .p { color: #f47a3a; user-select: none; }
.terminal .c { color: #8b9c9f; }
.checklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.checklist li { padding: 14px 0 14px 30px; border-bottom: 1px solid var(--rule); position: relative; color: var(--ink-2); }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 1.3em; width: 12px; height: 7px; border-left: 2px solid var(--petrol); border-bottom: 2px solid var(--petrol); transform: rotate(-45deg); }
.checklist b { color: var(--ink); font-weight: 600; }

/* architecture figure (VAC hero) */
.vac-hero { align-items: center; }
.arch { margin: 0; padding: clamp(18px, 2.4vw, 26px); border: 1px solid var(--rule); border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow); }
.arch-node { border: 1px solid var(--rule-strong); border-radius: 10px; padding: 13px 15px; background: var(--paper); }
.arch-k { display: block; font-family: var(--font-mono); font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); }
.arch-node small { display: block; font-size: .82rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.arch-node.guard { border-color: var(--accent); background: var(--accent-soft); }
.arch-node ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; font-size: .86rem; line-height: 1.4; color: var(--ink-2); }
.arch-node ol li { display: flex; gap: 9px; align-items: baseline; }
.arch-node ol b { flex: none; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); color: #170900; font-family: var(--font-mono); font-size: .62rem; font-weight: 600; transform: translateY(-1px); }
.arch-node ol code { font-size: .8em; }
.arch-edge { position: relative; height: 40px; margin-left: 26px; border-left: 1.5px solid var(--rule-strong); }
.arch-edge::after { content: ""; position: absolute; left: -6px; bottom: -1px; width: 0; height: 0; border-left: 5.25px solid transparent; border-right: 5.25px solid transparent; border-top: 7px solid var(--rule-strong); }
.arch-edge span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: .68rem; color: var(--muted); white-space: nowrap; }
.arch-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.arch-branch.held .arch-edge { border-left-color: var(--accent); }
.arch-branch.held .arch-edge::after { border-top-color: var(--accent); }
.arch-branch.held .arch-edge span { color: var(--accent-ink); }
.arch-branch.held .arch-node { border-style: dashed; border-color: var(--accent); }
.arch figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 860px) { .arch { max-width: 480px; } }

/* ---------- legal ---------- */
.legal { padding: clamp(44px, 7vw, 96px) 0 clamp(64px, 9vw, 120px); }
.legal h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.legal h2 { font-size: 1.25rem; letter-spacing: -.012em; margin: 40px 0 10px; }
.legal p, .legal address { color: var(--ink-2); font-style: normal; margin: 0 0 12px; max-width: 68ch; }
.legal .updated { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); margin-top: 18px; }

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .menu-btn, .actions, .form { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 24px 0; }
}
