/* ================================================================
   Design tokens
   ================================================================ */
:root {
  --bg: #f8f8f6;
  --bg-alt: #f1f1ee;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --good: #15803d;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px -6px rgba(15,23,42,.08);
  --shadow-lg: 0 2px 4px rgba(15,23,42,.04), 0 20px 48px -16px rgba(15,23,42,.18);
  --contact-bg: #0f172a;
  --contact-ink: #f8fafc;
  --contact-accent: #93b4ff;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --wrap: 1140px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --bg-alt: #0f172a; --surface: #131c2e; --ink: #f1f5f9; --ink-2: #cbd5e1;
    --muted: #94a3b8; --line: #1e293b; --line-2: #334155; --accent: #8aa8ff; --accent-ink: #0b1120;
    --accent-soft: #1a2747; --good: #4ade80;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px -6px rgba(0,0,0,.5);
    --shadow-lg: 0 20px 48px -16px rgba(0,0,0,.7);
    --contact-bg: #131c2e; --contact-ink: #f1f5f9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --bg-alt: #0f172a; --surface: #131c2e; --ink: #f1f5f9; --ink-2: #cbd5e1;
  --muted: #94a3b8; --line: #1e293b; --line-2: #334155; --accent: #8aa8ff; --accent-ink: #0b1120;
  --accent-soft: #1a2747; --good: #4ade80;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px -6px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 48px -16px rgba(0,0,0,.7);
  --contact-bg: #131c2e; --contact-ink: #f1f5f9;
  color-scheme: dark;
}

/* ================================================================
   Base
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.65 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.005em; }
strong { font-weight: 600; }
kbd {
  font: 500 11px/1 var(--mono); padding: 3px 6px; border-radius: 5px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* Small uppercase label used above headings */
.eyebrow {
  font: 600 13px/1.4 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  display: flex; gap: 10px; align-items: center;
}
.idx { color: var(--accent); font-variant-numeric: tabular-nums; }
.idx::after { content: ""; display: inline-block; width: 20px; height: 1px; background: currentColor; margin-left: 10px; vertical-align: middle; opacity: .6; }
.h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.025em; }
.h2 em, .hero__title em { color: var(--accent); }
.h3 { font-size: 22px; }

/* ================================================================
   Buttons
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 10px; font: 600 15px/1 var(--font);
  text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn--small { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(15,23,42,.12); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ink:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.btn--ghost { border-color: var(--line-2); color: var(--ink); background: var(--surface); }
.btn--ghost:hover { border-color: var(--ink-2); }
.btn--light { background: var(--contact-ink); color: var(--contact-bg); }
.btn--outline-light { border-color: rgba(255,255,255,.22); color: var(--contact-ink); }
.btn--outline-light:hover { border-color: var(--contact-ink); }

.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--ink-2); }
.kbd-btn {
  height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px 0 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font: 500 14px var(--font); cursor: pointer;
}
.kbd-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.link { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ================================================================
   Nav
   ================================================================ */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { height: 68px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font: 700 13px/1 var(--font); letter-spacing: .02em;
}
.nav__links { list-style: none; display: flex; gap: 2px; margin-left: 12px; }
.nav__links a {
  display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ================================================================
   Hero
   ================================================================ */
.hero { padding: calc(68px + clamp(40px, 6vw, 80px)) 0 32px; margin-top: -68px; position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 720px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 320px at 82% 18%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    linear-gradient(to bottom, transparent, var(--bg));
}
.hero__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.hero__title { font-size: clamp(38px, 4.9vw, 62px); line-height: 1.08; letter-spacing: -0.03em; margin: 22px 0 20px; font-weight: 600; }
.hero__lede { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.65; color: var(--ink-2); max-width: 600px; }
.hero__lede strong { color: var(--ink); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__meta { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 28px; color: var(--muted); font-size: 15px; }
.hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta svg { width: 17px; height: 17px; }

.hero__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px; box-shadow: var(--shadow-lg);
}
.portrait { margin: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1 / 1; background: var(--bg-alt); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.flow { display: flex; align-items: center; gap: 8px; padding: 16px 6px 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.flow__step { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.flow__step--on { color: var(--ink); }
.flow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.flow__step--on .flow__dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.flow__line { flex: 1; height: 1px; min-width: 10px; background: var(--line-2); }
.card-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 6px 0 0; background: var(--line); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.card-facts div { background: var(--surface); padding: 11px 13px; }
.card-facts dt { font: 600 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card-facts dd { margin: 7px 0 0; font-size: 14px; font-weight: 600; line-height: 1.35; }

.proof {
  list-style: none; margin-top: clamp(48px, 6vw, 80px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.proof li { padding: 26px 24px 26px 0; display: flex; flex-direction: column; gap: 8px; }
.proof li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.proof b { font: 600 clamp(32px, 3.4vw, 42px)/1 var(--font); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.proof span { color: var(--muted); font-size: 15px; line-height: 1.45; max-width: 230px; }

.orgs { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 26px 0 0; }
.orgs__label { font: 600 13px/1.4 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.orgs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.orgs li { font-size: 16px; font-weight: 600; color: var(--ink-2); letter-spacing: -0.01em; opacity: .85; }

/* ================================================================
   Sections
   ================================================================ */
.section { padding: clamp(64px, 8.5vw, 112px) 0; }
.section--tight { padding: clamp(32px, 4vw, 48px) 0 clamp(32px, 5vw, 56px); }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { max-width: 760px; margin-bottom: clamp(32px, 4.5vw, 52px); }
.section__head .h2 { margin: 16px 0 14px; }
.section__lede { color: var(--ink-2); font-size: 18px; max-width: 640px; }

/* TL;DR */
.tldr {
  display: grid; grid-template-columns: 220px 1fr; gap: 36px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(24px, 3vw, 36px); box-shadow: var(--shadow);
  border-left: 3px solid var(--accent);
}
.tldr__head .h3 { margin-top: 12px; font-size: 24px; }
.tldr__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 40px; margin: 0; }
.tldr__grid dt { font-weight: 600; font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.tldr__grid dd { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.6; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  font: 500 15px var(--font); cursor: pointer; transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip__n { font: 600 12px var(--font); opacity: .6; font-variant-numeric: tabular-nums; }

/* Case cards */
.cases { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.case {
  grid-column: span 2; position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
  min-height: 300px; overflow: hidden;
}
.case:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.case--feature { grid-column: span 3; min-height: 340px; }
.case__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.case__kicker { font: 600 12px/1.4 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.case__metric { text-align: right; flex: none; }
.case__metric b { display: block; font: 600 28px/1 var(--font); letter-spacing: -0.03em; color: var(--ink); }
.case__metric span { font-size: 13px; color: var(--muted); }
.case h3 { font-size: 21px; margin: 24px 0 10px; letter-spacing: -0.02em; line-height: 1.25; }
.case--feature h3 { font-size: 25px; }
.case p { color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.case__foot { margin-top: auto; padding-top: 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.case__stack { display: flex; flex-wrap: wrap; gap: 6px; }
.case__stack span { font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 6px; background: var(--bg-alt); color: var(--ink-2); border: 1px solid var(--line); }
.case__go {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); transition: all .3s var(--ease);
}
.case:hover .case__go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.case.is-hidden { display: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--good); margin-top: 12px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.more { margin-top: 28px; color: var(--muted); font-size: 16px; max-width: 840px; }

/* Approach */
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 22px; display: flex; flex-direction: column; }
.step__n {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); font: 700 15px var(--font); margin-bottom: 18px;
}
.step:last-child { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.step:last-child .step__n { background: var(--accent); color: var(--accent-ink); }
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.step__out { margin-top: auto !important; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px !important; line-height: 1.55 !important; color: var(--muted) !important; }
.step p:not(.step__out) { margin-bottom: 16px; }

/* Experience */
.journey { display: flex; gap: 4px; margin-bottom: 44px; }
.journey__seg {
  flex: var(--w) 1 0; min-width: 0; padding: 14px 14px; background: var(--surface);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; border-radius: 4px;
}
.journey__seg:first-child { border-radius: 10px 4px 4px 10px; }
.journey__seg:last-child { border-radius: 4px 10px 10px 4px; }
.journey__seg b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journey__seg span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.journey__seg--now { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.journey__seg--now span { color: inherit; opacity: .85; }

.timeline { list-style: none; }
.job { display: grid; grid-template-columns: 220px 1fr; gap: 36px; padding: 34px 0; border-top: 1px solid var(--line); }
.job:last-child { border-bottom: 1px solid var(--line); }
.job__when { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 15px; font-weight: 500; color: var(--muted); padding-top: 3px; font-variant-numeric: tabular-nums; }
.tag { font: 600 12px var(--font); padding: 4px 10px; border-radius: 999px; }
.tag--live { background: var(--accent-soft); color: var(--accent); }
.job h3 { font-size: 22px; }
.job__org { color: var(--muted); margin: 6px 0 16px; font-size: 16px; }
.job ul { list-style: none; display: grid; gap: 10px; }
.job li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 16.5px; }
.job li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .8; }
.job li strong { color: var(--ink); }
.job__tools { margin-top: 18px; font-size: 14px; color: var(--muted); }
.job__tools::before { content: "Tools: "; font-weight: 600; color: var(--ink-2); }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.skill h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.skill__ico { color: var(--accent); font-size: 10px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); }
.domains { margin-top: 28px; color: var(--ink-2); font-size: 16px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.domains span { font: 600 13px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }

/* About */
.about { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.about__copy .h2 { margin: 16px 0 24px; }
.about__copy p { color: var(--ink-2); font-size: 18px; margin-bottom: 16px; }
.pull {
  margin: 28px 0 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent);
  font: 400 clamp(24px, 2.6vw, 30px)/1.3 var(--serif); font-style: italic; color: var(--ink);
}
.about__side { display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 26px; }
.panel--accent { background: var(--accent-soft); border-color: transparent; }
.panel__h { font: 600 13px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.list { list-style: none; display: grid; gap: 14px; }
.list b { display: block; font-weight: 600; font-size: 16px; }
.list span { color: var(--muted); font-size: 15px; }

/* Contact */
.contact { background: var(--contact-bg); color: var(--contact-ink); border-radius: clamp(0px, 2vw, 24px); margin: 0 clamp(0px, 1.5vw, 16px) 16px; }
.contact__grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.eyebrow--inv { color: rgba(248,250,252,.6); }
.eyebrow--inv .idx { color: var(--contact-accent); }
.contact__title { margin: 16px 0 18px; color: var(--contact-ink); }
.contact__title em { color: var(--contact-accent); }
.contact__lede { color: rgba(248,250,252,.72); font-size: 18px; }
.contact__actions { margin-top: 32px; display: grid; gap: 16px; }
.contact__links { display: flex; flex-wrap: wrap; gap: 10px; }
.copy {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 520px;
  padding: 18px 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.04);
  color: var(--contact-ink); font: 500 clamp(17px, 2vw, 21px) var(--font); cursor: pointer; text-align: left;
  transition: border-color .2s, background .2s;
}
.copy:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.07); }
.copy__txt { overflow-wrap: anywhere; }
.copy__hint { font: 600 13px var(--font); padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,.1); flex: none; }
.form { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-lg); padding: clamp(22px, 3vw, 30px); display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 500; color: rgba(248,250,252,.82); }
.opt { color: rgba(248,250,252,.45); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: 400 16px/1.5 var(--font); color: var(--contact-ink); background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 12px 14px; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(248,250,252,.38); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--contact-accent); box-shadow: 0 0 0 3px rgba(147,180,255,.25); }
.field.is-bad input, .field.is-bad textarea { border-color: #fca5a5; }
.form .btn--accent { background: var(--contact-accent); color: #0b1120; box-shadow: none; }
.form .btn--accent:hover { background: #b3caff; }
.form__note { font-size: 13.5px; color: rgba(248,250,252,.55); }

.footer { padding: 28px 0 40px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }

/* ================================================================
   Modal
   ================================================================ */
dialog { color: inherit; }
.modal {
  width: min(860px, calc(100% - 24px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); overflow: auto;
}
.modal::backdrop, .palette::backdrop { background: rgba(2,6,23,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[open] { animation: rise .3s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal__inner { padding: clamp(24px, 4vw, 48px); position: relative; }
.modal__close { position: sticky; top: 0; float: right; margin: -8px -8px 0 12px; z-index: 2; }
.cs__kicker { font: 600 13px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.cs__title { font-size: clamp(26px, 3.6vw, 38px); margin: 12px 0 10px; letter-spacing: -0.025em; }
.cs__org { color: var(--muted); font-size: 16px; }
.cs__metrics { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.cs__metric { flex: 1 1 160px; padding: 16px 18px; border-radius: 12px; background: var(--bg-alt); border: 1px solid var(--line); }
.cs__metric b { display: block; font: 600 26px/1.1 var(--font); letter-spacing: -0.02em; color: var(--accent); }
.cs__metric span { font-size: 14px; color: var(--muted); }
.cs__block { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); }
.cs__block h3 { font: 600 13px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.cs__block p, .cs__block li { color: var(--ink-2); font-size: 16.5px; }
.cs__block ul { list-style: none; display: grid; gap: 10px; }
.cs__block li { padding-left: 20px; position: relative; }
.cs__block li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cs__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Palette */
.palette { width: min(560px, calc(100% - 24px)); margin: 12vh auto auto; padding: 0; border: 0; background: transparent; overflow: visible; }
.palette__box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette[open] { animation: rise .2s var(--ease); }
.palette__search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette__search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 16px var(--font); }
.palette__list { list-style: none; max-height: 340px; overflow: auto; padding: 6px; }
.palette__list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; font-size: 15px;
}
.palette__list li small { color: var(--muted); font: 500 12px var(--font); }
.palette__list li[aria-selected="true"] { background: var(--accent-soft); color: var(--ink); }
.palette__empty { color: var(--muted); padding: 14px 12px; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  transition: opacity .25s, transform .25s var(--ease); pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ================================================================
   Motion
   ================================================================ */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1080px) {
  .kbd-btn__label { display: none; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .case, .case--feature { grid-column: span 3; }
}
@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .kbd-btn { display: none; }
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 2px; margin: 0;
    padding: 10px var(--gutter) 18px; background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 12px 14px; font-size: 16px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__card { max-width: 420px; }
  .br-lg { display: none; }
  .proof { grid-template-columns: repeat(2, 1fr); }
  .proof li:nth-child(3) { padding-left: 0; border-left: 0; }
  .proof li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tldr { grid-template-columns: 1fr; gap: 20px; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .about, .contact__grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 12px; }
  .job__when { flex-direction: row; align-items: center; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand__name { display: none; }
  .tldr__grid { grid-template-columns: 1fr; }
  .cases { grid-template-columns: 1fr; }
  .case, .case--feature { grid-column: auto; min-height: 0; }
  .case--feature h3 { font-size: 22px; }
  .steps { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .journey { flex-direction: column; }
  .journey__seg, .journey__seg:first-child, .journey__seg:last-child { border-radius: 8px; flex: none; flex-direction: row; justify-content: space-between; }
  .proof li { padding: 20px 12px 20px 0; }
  .proof li + li { padding-left: 12px; }
  .proof li:nth-child(3) { padding-left: 0; }
  .proof span { font-size: 14px; }
  .orgs { flex-direction: column; align-items: flex-start; }
  .orgs ul { gap: 8px 18px; }
  .orgs li { font-size: 15px; }
  .cs__block { grid-template-columns: 1fr; gap: 8px; }
  .flow { font-size: 12px; gap: 6px; }
  .contact { margin: 0 0 12px; border-radius: 16px; }
  .btn { height: 46px; padding: 0 18px; }
  .job li, .cs__block p, .cs__block li { font-size: 16px; }
}

/* ================================================================
   Print: a clean CV straight from the browser
   ================================================================ */
@media print {
  :root { --bg: #fff; --bg-alt: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --muted: #555; --line: #ccc; --accent: #1d4ed8; --contact-bg: #fff; --contact-ink: #000; }
  .nav, .progress, .filters, .hero__cta, .hero__card, .form, .footer__hint, .contact__links, .case__go, .modal, .palette, .toast, .skip, .more .link { display: none !important; }
  body { font-size: 11pt; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .section, .hero { padding: 18pt 0 !important; margin: 0; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__title { font-size: 28pt; }
  .section--alt, .contact { background: #fff !important; border: 0; color: #000; margin: 0; }
  .contact__title, .contact__lede, .eyebrow--inv, .copy { color: #000 !important; }
  .case, .skill, .panel, .tldr, .job, .step { break-inside: avoid; box-shadow: none !important; }
  .case.is-hidden { display: flex !important; }
  .cases { grid-template-columns: 1fr 1fr; }
  .case, .case--feature { grid-column: auto; min-height: 0; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
