/*
  Palette: three moods.
    shadow  deep violet-black base and the violet accent
    sage    warm orange, used for things that are live or in motion
    cloud   soft white text and the light theme, with a little gold
  Layout follows the golden ratio: spacing steps of 1.618 and a 61.8 / 38.2 column split.
*/

:root {
  --paper: #0b0910;
  --surface: #14111c;
  --surface-2: #1b1726;
  --rule: #29243a;
  --ink: #eeeaf6;
  --ink-2: #b4acc7;
  --ink-3: #7f7793;
  --violet: #9884ee;
  --violet-soft: rgba(152, 132, 238, 0.14);
  --sage: #ec9545;
  --sage-soft: rgba(236, 149, 69, 0.14);
  --gold: #efcd72;
  --ok: #7fcaa3;
  --bad: #ec6f5f;
  --accent-ink: #0b0910;
  --bar-empty: #241f32;
  --aura-a: rgba(132, 108, 230, 0.22);
  --aura-b: rgba(236, 149, 69, 0.13);
  --aura-c: rgba(238, 234, 246, 0.06);

  --s-1: 0.382rem;
  --s-2: 0.618rem;
  --s-3: 1rem;
  --s-4: 1.618rem;
  --s-5: 2.618rem;
  --s-6: 4.236rem;
  --s-7: 6.854rem;

  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --measure: 38rem;
  --radius: 8px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --paper: #f7f5fb;
    --surface: #ffffff;
    --surface-2: #f1eef8;
    --rule: #e2deec;
    --ink: #1b1724;
    --ink-2: #4f4862;
    --ink-3: #807893;
    --violet: #5a3fc0;
    --violet-soft: rgba(90, 63, 192, 0.09);
    --sage: #b55e17;
    --sage-soft: rgba(181, 94, 23, 0.1);
    --gold: #a37a10;
    --ok: #2a7a54;
    --bad: #c03a2b;
    --accent-ink: #ffffff;
    --bar-empty: #e8e4f0;
    --aura-a: rgba(120, 96, 220, 0.16);
    --aura-b: rgba(236, 149, 69, 0.12);
    --aura-c: rgba(255, 255, 255, 0.7);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --paper: #f7f5fb;
  --surface: #ffffff;
  --surface-2: #f1eef8;
  --rule: #e2deec;
  --ink: #1b1724;
  --ink-2: #4f4862;
  --ink-3: #807893;
  --violet: #5a3fc0;
  --violet-soft: rgba(90, 63, 192, 0.09);
  --sage: #b55e17;
  --sage-soft: rgba(181, 94, 23, 0.1);
  --gold: #a37a10;
  --ok: #2a7a54;
  --bad: #c03a2b;
  --accent-ink: #ffffff;
  --bar-empty: #e8e4f0;
  --aura-a: rgba(120, 96, 220, 0.16);
  --aura-b: rgba(236, 149, 69, 0.12);
  --aura-c: rgba(255, 255, 255, 0.7);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--s-6);
  background: var(--paper);
}
html.fonts-loading body { opacity: 0; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.618;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease, opacity 0.35s ease;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
button { font: inherit; }

a { color: var(--violet); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

strong { font-weight: 600; color: var(--ink); }
.mono { font-family: var(--mono); font-size: 0.9em; }
.muted { color: var(--ink-3); }

.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }

.skip {
  position: absolute; left: var(--s-3); top: -3rem; z-index: 20;
  background: var(--ink); color: var(--paper); padding: var(--s-2) var(--s-3);
}
.skip:focus { top: var(--s-3); }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(12px);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.masthead.scrolled { border-bottom-color: var(--rule); }

.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); min-height: 3.75rem;
}

.wordmark {
  display: inline-flex; align-items: center; gap: var(--s-2);
  color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em;
}
.mark {
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 7px;
  background: linear-gradient(135deg, var(--violet), color-mix(in srgb, var(--violet) 55%, var(--sage)));
  color: var(--accent-ink); font-size: 0.75rem; font-weight: 600; letter-spacing: 0;
}

.nav { display: flex; align-items: center; gap: var(--s-3); }
.nav-links { display: flex; align-items: center; gap: var(--s-4); }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 0.9375rem; position: relative; }
.nav-links a:hover, .nav-links a[aria-current="page"], .nav-links a[aria-current="true"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after, .nav-links a[aria-current="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.3rem;
  height: 2px; border-radius: 2px; background: var(--sage);
}

.theme-toggle {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }

.nav-toggle {
  display: none; padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink); font-size: 0.875rem; cursor: pointer;
}
/* ---------- Hero ---------- */

.hero { position: relative; }

/* A still glow behind the top of every page. It sits behind the header too, so there is no hard edge. */
.aura { display: none; }
body { position: relative; isolation: isolate; }
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 52rem; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38rem 30rem at 78% 8%, var(--aura-a), transparent 70%),
    radial-gradient(28rem 24rem at 92% 38%, var(--aura-b), transparent 70%),
    radial-gradient(32rem 26rem at 4% 0%, var(--aura-c), transparent 70%);
}

.hero-grid {
  display: grid; grid-template-columns: 1.618fr 1fr; gap: var(--s-6);
  align-items: start; padding-block: var(--s-7) var(--s-6);
}

.hello { color: var(--ink-2); margin-bottom: var(--s-4); }

h1 {
  font-size: clamp(2.5rem, 1.2rem + 4.4vw, 4.4rem);
  line-height: 1.06; letter-spacing: -0.035em; font-weight: 500;
  max-width: 12em; text-wrap: balance;
}

.lede { margin-top: var(--s-4); max-width: var(--measure); font-size: 1.1875rem; color: var(--ink-2); text-wrap: pretty; }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 var(--s-4);
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 0.9688rem; text-decoration: none; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.button:hover { border-color: var(--ink-3); }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--violet); border-color: var(--violet); color: var(--accent-ink); }
.button.primary:hover { background: color-mix(in srgb, var(--violet) 86%, var(--ink)); }
.button[disabled] { opacity: 0.55; cursor: progress; }

.availability {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-4); color: var(--ink-2); font-size: 0.9375rem;
}
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }

/* ---------- Live deploy panel ---------- */

.deploy {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--rule); border-radius: 12px;
  padding: var(--s-4); font-size: 0.9063rem; margin-top: var(--s-2);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.deploy-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding-bottom: var(--s-3); border-bottom: 1px solid var(--rule);
}
.deploy-head h2 { font-size: 0.9375rem; font-weight: 600; }

.pulse { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink-3); flex: none; }
.pulse[data-state="up"] { background: var(--ok); animation: pulse 2.6s ease-out infinite; }
.pulse[data-state="down"] { background: var(--bad); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); }
  70% { box-shadow: 0 0 0 0.5rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.deploy-rows { margin-top: var(--s-2); }
.deploy-rows > div { display: grid; grid-template-columns: 5.5rem 1fr; gap: var(--s-2); padding-block: var(--s-1); }
.deploy-rows dt { color: var(--ink-3); }
.deploy-rows dd { min-width: 0; overflow-wrap: anywhere; }
.deploy-rows a { color: var(--ink); }

.uptime-bars { display: flex; gap: 2px; height: 1.6rem; margin-top: var(--s-3); }
.uptime-bars span { flex: 1; border-radius: 1px; background: var(--bar-empty); }
.uptime-bars span[data-ok="true"] { background: var(--ok); opacity: 0.85; }
.uptime-bars span[data-ok="false"] { background: var(--bad); }

.checks { display: grid; gap: var(--s-1); margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.checks li { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-3); transition: color 0.3s ease; }
.checks li::before {
  content: ""; width: 0.95rem; height: 0.95rem; flex: none; border-radius: 50%;
  border: 1.5px solid var(--rule); transition: background-color 0.3s ease, border-color 0.3s ease;
}
.checks li.passed { color: var(--ink); }
.checks li.passed::before {
  border-color: var(--ok);
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='%230b0910' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

/* ---------- Impact numbers ---------- */

.impact {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4);
  padding-block: var(--s-5) var(--s-6); border-top: 1px solid var(--rule);
}
.impact li { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 0.1rem; }
.impact .num {
  font-size: clamp(2.2rem, 1.4rem + 2vw, 3.2rem); font-weight: 500; letter-spacing: -0.04em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.impact .unit { font-size: 1.4rem; color: var(--sage); font-weight: 500; }
.impact p { grid-column: 1 / -1; margin-top: var(--s-2); color: var(--ink-2); font-size: 0.9375rem; line-height: 1.5; max-width: 16em; }

/* ---------- Sections ---------- */

.section { padding-block: var(--s-6); border-top: 1px solid var(--rule); }

.section-head {
  display: grid; grid-template-columns: 1.618fr 1fr; gap: var(--s-6);
  align-items: baseline; margin-bottom: var(--s-5);
}
.section h2, .now h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 500;
  letter-spacing: -0.025em; line-height: 1.18;
}
.section-head p { color: var(--ink-2); }

/* ---------- Playground ---------- */

.playground { background: linear-gradient(180deg, transparent, var(--violet-soft) 40%, transparent); }

.sim {
  border: 1px solid var(--rule); border-radius: 14px; background: var(--surface);
  padding: var(--s-4); display: grid; gap: var(--s-4);
}

.sim-controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-4); }
.scenario { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.scenario legend { width: 100%; font-weight: 500; margin-bottom: var(--s-2); }
.scenario label {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 0.45rem 0.85rem; border: 1px solid var(--rule); border-radius: 999px;
  font-size: 0.9375rem; color: var(--ink-2); cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.scenario label:hover { border-color: var(--ink-3); }
.scenario label:has(input:checked) { border-color: var(--violet); color: var(--ink); background: var(--violet-soft); }
.scenario input { accent-color: var(--violet); margin: 0; }

.stages { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; }
.stages li {
  position: relative; display: grid; justify-items: center; gap: var(--s-2);
  font-size: 0.8125rem; color: var(--ink-3); text-align: center; padding-top: 0.1rem;
}
.stages li::before {
  content: ""; position: absolute; top: 0.72rem; left: -50%; width: 100%; height: 2px;
  background: var(--rule); z-index: 0; transition: background-color 0.3s ease;
}
.stages li:first-child::before { display: none; }
.node {
  position: relative; z-index: 1; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--rule);
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}
.stages li[data-state="running"] { color: var(--ink); }
.stages li[data-state="running"] .node { border-color: var(--sage); animation: spin-glow 0.9s linear infinite; }
.stages li[data-state="passed"] { color: var(--ink); }
.stages li[data-state="passed"] .node { border-color: var(--ok); background: var(--ok); }
.stages li[data-state="passed"]::before, .stages li[data-state="running"]::before { background: var(--ok); }
.stages li[data-state="failed"] { color: var(--bad); }
.stages li[data-state="failed"] .node { border-color: var(--bad); background: var(--bad); transform: scale(1.1); }
.stages li[data-state="rolled"] { color: var(--ink-3); text-decoration: line-through; }
.stages li[data-state="rolled"] .node { border-color: var(--gold); border-style: dashed; }
.stages li[data-state="skipped"] { opacity: 0.45; }

@keyframes spin-glow {
  0% { box-shadow: 0 0 0 0 var(--sage-soft); }
  100% { box-shadow: 0 0 0 0.5rem transparent; }
}

.sim-body { display: grid; grid-template-columns: 1.618fr 1fr; gap: var(--s-4); }

.sim-log {
  height: 15rem; overflow-y: auto; padding: var(--s-3);
  border-radius: 10px; background: var(--paper); border: 1px solid var(--rule);
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.7; color: var(--ink-2);
}
.sim-log p { white-space: pre-wrap; overflow-wrap: anywhere; }
.sim-log .t { color: var(--ink-3); }
.sim-log .ok { color: var(--ok); }
.sim-log .bad { color: var(--bad); }
.sim-log .warn { color: var(--gold); }
.sim-log .info { color: var(--violet); }
.log-idle { color: var(--ink-3); }

.sim-metric {
  display: grid; align-content: start; gap: var(--s-2); padding: var(--s-3);
  border-radius: 10px; background: var(--paper); border: 1px solid var(--rule);
}
.metric-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); font-size: 0.875rem; color: var(--ink-2); }
.metric-value { font-family: var(--mono); font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric-value[data-high="true"] { color: var(--bad); }
.metric-chart { width: 100%; height: 8.5rem; display: block; }
.metric-chart .threshold { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.6; vector-effect: non-scaling-stroke; }
.metric-chart .line { fill: none; stroke: var(--sage); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.metric-note { font-size: 0.8125rem; color: var(--ink-3); }

.sim-result { min-height: 1.6em; font-weight: 500; }
.sim-result[data-tone="ok"] { color: var(--ok); }
.sim-result[data-tone="bad"] { color: var(--bad); }
.sim-result[data-tone="warn"] { color: var(--gold); }

/* ---------- Skills ---------- */

.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4) var(--s-5); }
.skill-group h3 { font-size: 0.9375rem; font-weight: 500; color: var(--ink-3); margin-bottom: var(--s-2); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.chips button {
  padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); font-size: 0.9063rem; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.chips button:hover { border-color: var(--ink-3); }
.chips button[aria-pressed="true"] { border-color: var(--sage); background: var(--sage-soft); }

.skill-answer { margin-top: var(--s-4); min-height: 1.6em; color: var(--ink-2); }
.skill-answer a { font-weight: 500; }

/* ---------- Projects ---------- */

.repos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--s-5); margin-top: var(--s-5); }
.repos .empty { grid-column: 1 / -1; color: var(--ink-2); }
.repo { padding-block: var(--s-4); border-bottom: 1px solid var(--rule); }
.repo h3 { font-size: 1.0625rem; font-weight: 600; }
.repo h3 a { color: var(--ink); text-decoration: none; }
.repo h3 a:hover { color: var(--violet); }
.repo p { margin-top: var(--s-1); color: var(--ink-2); }
.repo .meta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); font-size: 0.875rem; color: var(--ink-3); }

/* ---------- Now ---------- */

.now ul { display: grid; gap: var(--s-2); margin-top: var(--s-4); }
.now li { display: flex; gap: var(--s-3); color: var(--ink-2); }
.now li::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; margin-top: 0.62em; border-radius: 50%; background: var(--sage); }
.now > p { margin-top: var(--s-5); font-size: 0.9375rem; }


/* ---------- Page headers (inner pages) ---------- */

.page-head { padding-block: var(--s-6) var(--s-5); }
.crumb { font-size: 0.875rem; color: var(--ink-3); margin-bottom: var(--s-4); }
.crumb a { color: var(--ink-2); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.crumb span { margin-inline: 0.35rem; }
.page-head h1 { font-size: clamp(2.2rem, 1.2rem + 3.4vw, 3.8rem); max-width: 16em; }
.page-head .lede { max-width: 42rem; }
.page-head .actions { margin-top: var(--s-4); }

/* ---------- Home: pillars, work list ---------- */

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.pillar {
  display: grid; align-content: start; gap: var(--s-2); padding: var(--s-4);
  border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  color: inherit; text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease;
}
.pillar:hover { border-color: var(--violet); transform: translateY(-2px); }
.pillar h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.pillar p { color: var(--ink-2); font-size: 0.9688rem; }
.pillar-link { margin-top: var(--s-2); color: var(--violet); font-weight: 500; font-size: 0.9375rem; }

.work-list { border-top: 1px solid var(--rule); }
.work-list a {
  display: grid; grid-template-columns: 6rem 1fr 1.3fr; align-items: baseline; gap: var(--s-4);
  padding: var(--s-4) var(--s-2); border-bottom: 1px solid var(--rule);
  color: inherit; text-decoration: none; transition: background-color 0.2s ease, padding 0.2s ease;
}
.work-list a:hover { background: var(--surface); padding-left: var(--s-3); }
.wl-num { font-size: 1.5rem; font-weight: 500; color: var(--sage); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wl-title { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; }
.wl-sub { color: var(--ink-2); }

.sim-more { margin-top: var(--s-3); color: var(--ink-2); font-size: 0.9375rem; }
.deploy-more { display: inline-block; margin-top: var(--s-3); font-size: 0.875rem; font-weight: 500; }

/* ---------- About ---------- */

.prose-grid { display: grid; grid-template-columns: 1fr 1.618fr; gap: var(--s-6); }
.side-note { align-self: start; position: sticky; top: 5.5rem; padding: var(--s-4); border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.side-note h2 { font-size: 1rem !important; font-weight: 600 !important; letter-spacing: 0 !important; margin-bottom: var(--s-3); }
.facts-list { display: grid; gap: var(--s-2); }
.facts-list div { display: grid; gap: 0.1rem; }
.facts-list dt { font-size: 0.8125rem; color: var(--ink-3); }
.facts-list dd { color: var(--ink); }

.prose { max-width: var(--measure); }
.prose h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; margin-top: var(--s-5); }
.prose h3:first-child { margin-top: 0; }
.prose p { margin-top: var(--s-3); color: var(--ink-2); }

.beliefs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5) var(--s-4); }
.beliefs article { padding-top: var(--s-3); border-top: 2px solid var(--violet-soft); transition: border-color 0.2s ease; }
.beliefs article:hover { border-top-color: var(--violet); }
.beliefs h3 { font-size: 1.0625rem; font-weight: 600; }
.beliefs p { margin-top: var(--s-2); color: var(--ink-2); font-size: 0.9688rem; }

.edu { display: grid; gap: var(--s-3); border-left: 2px solid var(--rule); padding-left: var(--s-4); }
.edu li { position: relative; }
.edu li::before {
  content: ""; position: absolute; left: calc(-1 * var(--s-4) - 6px); top: 0.55em;
  width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--violet);
}
.edu h3 { font-size: 1.0625rem; font-weight: 600; }
.edu p { color: var(--ink-2); }

/* ---------- Work index ---------- */

.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.case-card {
  display: grid; align-content: start; gap: var(--s-2); padding: var(--s-4);
  border: 1px solid var(--rule); border-radius: 14px; background: var(--surface);
  color: inherit; text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease;
}
.case-card:hover { border-color: var(--violet); transform: translateY(-2px); }
.cc-result { color: var(--ink-2); font-size: 0.9375rem; }
.cc-result strong { color: var(--sage); font-size: 1.25rem; }
.case-card h3 { font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.015em; }
.case-card p { color: var(--ink-2); }
.cc-stack { font-size: 0.8438rem; color: var(--ink-3) !important; margin-top: var(--s-2); }

.earlier { display: grid; gap: var(--s-2); max-width: 46rem; }
.earlier li { color: var(--ink-2); padding-left: var(--s-4); position: relative; }
.earlier li::before { content: ""; position: absolute; left: 0.2rem; top: 0.7em; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--sage); }

/* ---------- Case study pages ---------- */

.case-meta { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); margin-top: var(--s-4); }
.case-meta div { display: grid; }
.case-meta dt { font-size: 0.8125rem; color: var(--ink-3); }
.case-meta dd { font-weight: 500; }

.results-band { padding-bottom: var(--s-5); }
.results { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.results li {
  flex: 1 1 14rem; display: grid; gap: 0.2rem; padding: var(--s-4);
  border-radius: 12px; background: var(--surface); border: 1px solid var(--rule);
}
.r-num { font-size: clamp(2rem, 1.4rem + 1.8vw, 2.8rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; color: var(--sage); }
.r-label { color: var(--ink-2); }

.case-body { display: grid; grid-template-columns: 12rem 1fr; gap: var(--s-6); padding-block: var(--s-5) var(--s-6); border-top: 1px solid var(--rule); }
.case-toc { align-self: start; position: sticky; top: 5.5rem; display: grid; gap: var(--s-1); font-size: 0.9063rem; }
.case-toc p { color: var(--ink-3); font-size: 0.8125rem; margin-bottom: var(--s-1); }
.case-toc a { color: var(--ink-2); text-decoration: none; padding: 0.15rem 0 0.15rem var(--s-3); border-left: 2px solid var(--rule); }
.case-toc a:hover, .case-toc a.active { color: var(--ink); border-left-color: var(--sage); }

.case-article { max-width: 44rem; }
.case-article h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; margin-top: var(--s-6); scroll-margin-top: 5rem; }
.case-article h2:first-child { margin-top: 0; }
.case-article h3 { font-size: 1.0625rem; font-weight: 600; margin-top: var(--s-4); }
.case-article p { margin-top: var(--s-3); color: var(--ink-2); }
.case-article code { font-family: var(--mono); font-size: 0.875em; padding: 0.05em 0.35em; border-radius: 4px; background: var(--surface-2); color: var(--ink); }

.built { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.built li { position: relative; padding-left: var(--s-4); color: var(--ink-2); }
.built li::before {
  content: ""; position: absolute; left: 0.15rem; top: 0.6em; width: 0.5rem; height: 0.5rem;
  border-radius: 2px; transform: rotate(45deg); border: 1.5px solid var(--violet);
}

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); counter-reset: flow; }
.flow li {
  position: relative; padding: 0.55rem 0.95rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--rule); font-size: 0.9375rem; counter-increment: flow;
}
.flow li::before { content: counter(flow); margin-right: 0.5rem; color: var(--sage); font-family: var(--mono); font-size: 0.8125rem; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -0.95rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 0.8rem; }
.flow li:not(:last-child) { margin-right: 0.6rem; }

.decisions { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.decisions article { padding: var(--s-4); border-radius: 12px; background: var(--surface); border: 1px solid var(--rule); }
.decisions h4 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.decisions p { margin-top: var(--s-2); }

.changed { font-size: 1.1875rem; color: var(--ink) !important; padding-left: var(--s-4); border-left: 3px solid var(--sage); }
.stack-line { margin-top: var(--s-5) !important; padding-top: var(--s-3); border-top: 1px solid var(--rule); font-size: 0.9375rem; }
.stack-line strong { margin-right: var(--s-2); }
.aside-link { font-size: 0.9375rem; }
.confidential { font-size: 0.875rem; color: var(--ink-3) !important; font-style: italic; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); padding-bottom: var(--s-6); }
.pager a {
  display: grid; gap: 0.15rem; padding: var(--s-4); border-radius: 12px; border: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; font-weight: 600; transition: border-color 0.2s ease;
}
.pager a:hover { border-color: var(--violet); }
.pager span { font-size: 0.8125rem; font-weight: 400; color: var(--ink-3); }
.pager-next { text-align: right; grid-column: 2; }

/* ---------- Experience page ---------- */

.timeline-strip { display: flex; gap: 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; margin-bottom: var(--s-4); }
.timeline-strip li { flex: 1; }
.timeline-strip li + li { border-left: 1px solid var(--rule); }
.timeline-strip a {
  display: grid; gap: 0.1rem; padding: var(--s-3) var(--s-4); color: var(--ink); text-decoration: none;
  font-weight: 500; background: var(--surface); transition: background-color 0.2s ease;
}
.timeline-strip a:hover { background: var(--violet-soft); }
.timeline-strip span { font-family: var(--mono); font-size: 0.8125rem; color: var(--sage); font-weight: 400; }

.job { display: grid; grid-template-columns: 1fr 1.618fr; gap: var(--s-6); scroll-margin-top: 4rem; }
.job-side { align-self: start; position: sticky; top: 5.5rem; }
.job-when { font-weight: 500; }
.job-where { color: var(--ink-3); }
.job-main h2 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); }
.job-org { color: var(--violet); font-weight: 500; margin-top: 0.15rem; }
.job-summary { margin-top: var(--s-3); color: var(--ink-2); font-size: 1.0625rem; max-width: var(--measure); }
.job-main h3 { font-size: 0.9375rem; font-weight: 600; margin-top: var(--s-5); color: var(--ink); }
.job-main > ul:not(.wins) { display: grid; gap: var(--s-1); margin-top: var(--s-2); }
.job-main > ul:not(.wins) li { position: relative; padding-left: var(--s-4); color: var(--ink-2); max-width: var(--measure); }
.job-main > ul:not(.wins) li::before { content: ""; position: absolute; left: 0.3rem; top: 0.8em; width: 0.6rem; height: 1px; background: var(--ink-3); }
.job-main > p { margin-top: var(--s-2); color: var(--ink-2); max-width: var(--measure); }
.wins { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.wins li { padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); font-size: 0.9375rem; }
.wins strong { color: var(--sage); }
.job-links { font-size: 0.9375rem; margin-top: var(--s-4) !important; }

/* ---------- Contact page ---------- */

.contact-grid { display: grid; grid-template-columns: 1.618fr 1fr; gap: var(--s-3); padding-bottom: var(--s-6); }
.contact-card { padding: var(--s-4); border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); }
.contact-card h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: var(--s-3); }
.primary-card { grid-row: span 2; background: linear-gradient(160deg, var(--violet-soft), var(--surface) 60%); }
.email-address { font-size: clamp(1rem, 0.8rem + 1vw, 1.375rem); color: var(--ink); overflow-wrap: anywhere; }
.primary-card .muted { margin-top: var(--s-2); }
.email-options { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.copy[data-copied="true"] { background: var(--ok); border-color: var(--ok); color: var(--accent-ink); }
.elsewhere { display: grid; }
.elsewhere a {
  display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0;
  border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-weight: 500;
}
.elsewhere li:last-child a { border-bottom: 0; }
.elsewhere a:hover span:first-child { color: var(--violet); }
.elsewhere .muted { font-weight: 400; font-size: 0.875rem; text-align: right; }

/* ---------- Call to action + footer ---------- */

.cta { border-top: 1px solid var(--rule); background: radial-gradient(60rem 30rem at 85% 100%, var(--violet-soft), transparent 70%); }
.cta-inner { display: grid; grid-template-columns: 1.618fr 1fr; gap: var(--s-5); align-items: end; padding-block: var(--s-6); }
.cta h2 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.8rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.12; text-wrap: balance; }
.cta p { margin-top: var(--s-3); color: var(--ink-2); max-width: var(--measure); }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: flex-end; }

.footer { border-top: 1px solid var(--rule); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: var(--s-3) var(--s-5); padding-block: var(--s-5); font-size: 0.9063rem; }
.footer-name { font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: center; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-build { grid-column: 1 / -1; font-size: 0.8125rem; }
.footer-build a { color: var(--ink-3); }

.not-found { min-height: 80vh; display: grid; align-content: center; gap: var(--s-3); padding-block: var(--s-6); }
.not-found h1 { max-width: 14em; }

/* ---------- Practice board ---------- */

.board-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
.board-stat { padding: var(--s-3) var(--s-4); border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.board-stat .num {
  display: block; font-family: var(--mono); font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.6rem);
  font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums;
}
.board-stat[data-kind="done"] .num { color: var(--ok); }
.board-stat[data-kind="building"] .num { color: var(--sage); }
.board-stat[data-kind="pipelines"] .num { color: var(--violet); }
.board-stat .lbl { display: block; color: var(--ink-2); font-size: 0.9375rem; }

.board-bar { display: flex; gap: 3px; height: 0.55rem; margin-top: var(--s-3); }
.board-bar span { flex: 1; border-radius: 2px; background: var(--bar-empty); }
.board-bar span[data-status="done"] { background: var(--ok); opacity: 0.85; }
.board-bar span[data-status="building"] { background: var(--sage); }

.board-filter { margin-top: var(--s-4); }
.board-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); margin-top: var(--s-4); }
.board-foot { margin-top: var(--s-4); font-size: 0.875rem; }
.board-failed, .board-nojs { margin-top: var(--s-4); color: var(--ink-2); }

.ticket {
  display: grid; align-content: start; gap: var(--s-2); padding: var(--s-4);
  border: 1px solid var(--rule); border-radius: 14px; background: var(--surface);
}
.ticket[data-status="open"] { border-style: dashed; background: transparent; }
.ticket-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: 0.8438rem; color: var(--ink-3); }
.ticket-id { font-family: var(--mono); color: var(--ink-2); }
.status {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.05rem 0.6rem;
  border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2);
}
.status::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; border: 1px solid var(--ink-3); }
.status[data-status="done"]::before { background: var(--ok); border-color: var(--ok); }
.status[data-status="building"]::before { background: var(--sage); border-color: var(--sage); }
.ticket h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
.ticket p { color: var(--ink-2); }
.ticket .cc-stack { margin-top: 0; }
.ticket-ci { display: flex; align-items: center; gap: var(--s-2); font-size: 0.9rem; }
.ticket-ci i { flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink-3); }
.ticket-ci[data-state="passing"] i { background: var(--ok); }
.ticket-ci[data-state="failing"] i { background: var(--bad); }
.ticket-done summary { cursor: pointer; color: var(--violet); font-weight: 500; }
.ticket-done ul { display: grid; gap: var(--s-1); margin-top: var(--s-2); }
.ticket-done li { position: relative; padding-left: var(--s-4); color: var(--ink-2); font-size: 0.9688rem; }
.ticket-done li::before { content: ""; position: absolute; left: 0.2rem; top: 0.7em; width: 0.4rem; height: 0.4rem; border-radius: 50%; border: 1px solid var(--ink-3); }
.ticket-links { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin-top: var(--s-1); font-size: 0.9375rem; font-weight: 500; }

/* ---------- Responsive ---------- */

@media (max-width: 62rem) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-5); padding-top: var(--s-6); }
  .deploy { max-width: 34rem; }
  .impact { grid-template-columns: repeat(2, 1fr); }
  .board-stats { grid-template-columns: repeat(2, 1fr); }
  .section-head { grid-template-columns: 1fr; gap: var(--s-2); }
  .sim-body { grid-template-columns: 1fr; }
  .pillars, .beliefs { grid-template-columns: 1fr 1fr; }
  .prose-grid, .job, .cta-inner, .contact-grid { grid-template-columns: 1fr; gap: var(--s-4); }
  .side-note, .job-side { position: static; }
  .case-body { grid-template-columns: 1fr; gap: var(--s-4); }
  .case-toc { position: static; display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .case-toc p { width: 100%; margin: 0; }
  .case-toc a { border: 1px solid var(--rule); border-radius: 999px; padding: 0.25rem 0.75rem; font-size: 0.8438rem; }
  .cta-actions { justify-content: flex-start; }
  .primary-card { grid-row: auto; }
  .work-list a { grid-template-columns: 5rem 1fr; }
  .wl-sub { grid-column: 2; }
}

@media (max-width: 53rem) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--s-2) max(1rem, calc((100% - 70rem) / 2)) var(--s-3);
    background: var(--paper); border-bottom: 1px solid var(--rule);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: var(--s-2) 0; font-size: 1.0625rem; border-bottom: 1px solid var(--rule); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a[aria-current]::after { display: none; }
  .wordmark-name { display: none; }
}

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .hero-grid { padding-top: var(--s-5); }
  .lede { font-size: 1.0625rem; }
  .impact { gap: var(--s-4) var(--s-3); padding-bottom: var(--s-5); }
  .section { padding-block: var(--s-5); }
  .page-head { padding-block: var(--s-5) var(--s-4); }
  .sim, .pillar, .case-card, .decisions article, .contact-card, .ticket { padding: var(--s-3); }
  .stages { grid-template-columns: repeat(7, minmax(2.6rem, 1fr)); overflow-x: auto; }
  .stages li { font-size: 0.6875rem; }
  .sim-log { height: 12rem; }
  .skills, .repos, .pillars, .beliefs, .case-grid, .pager, .board-list { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .timeline-strip { flex-wrap: wrap; }
  .timeline-strip li { flex: 1 1 50%; }
  .timeline-strip li:nth-child(3) { border-left: 0; }
  .timeline-strip li:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .footer-inner { grid-template-columns: 1fr; }
}

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

@media print {
  .masthead, .theme-toggle, .deploy, .actions, .playground, .aura, .cta, .case-toc { display: none; }
  body { background: #fff; color: #000; }
}

/* ---------- Hero, second pass ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-4); padding: 0.3rem 0.8rem;
  border: 1px solid var(--rule); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink-2); font-size: 0.875rem; letter-spacing: 0.01em;
}
.hero h1 { font-size: clamp(2.6rem, 1.1rem + 5vw, 5rem); line-height: 1.02; max-width: 11em; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--violet), var(--sage) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: 1.25rem; line-height: 1.55; color: var(--ink); max-width: 36em; text-wrap: wrap; }
.hero .lede { color: color-mix(in srgb, var(--ink) 82%, var(--ink-3)); }
.hero-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-3); font-size: 0.9688rem; }
.hero-links a { color: var(--ink-2); text-underline-offset: 0.25em; }
.hero-links a:hover { color: var(--ink); }

.stack-strip { margin-top: var(--s-5); }
.stack-label { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-2); }
.stack-strip ul { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.stack-strip li {
  padding: 0.25rem 0.7rem; border: 1px solid var(--rule); border-radius: 6px;
  font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-2); background: var(--surface);
}

/* ---------- Playground teaser and page ---------- */

.playground-teaser { background: linear-gradient(180deg, transparent, var(--violet-soft) 50%, transparent); }
.teaser { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; }
.teaser h2 { margin-bottom: var(--s-2); }
.teaser p { max-width: 36rem; color: var(--ink-2); }
.prose.narrow { max-width: 42rem; }
.prose.narrow p + p { margin-top: var(--s-3); }
.page-head + .playground { padding-top: 0; }

/* ---------- Photo ---------- */

.eyebrow { padding-left: 0.3rem; }
.eyebrow-photo { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; object-position: 50% 25%; border: 1px solid var(--rule); flex: none; }
.portrait {
  display: block; width: 100%; max-width: 15rem; aspect-ratio: 1; object-fit: cover; object-position: 50% 25%;
  border-radius: 12px; border: 1px solid var(--rule); margin-bottom: var(--s-4);
}

.eyebrow { gap: var(--s-3); padding: 0.4rem 1.1rem 0.4rem 0.4rem; font-size: 0.9375rem; }
.eyebrow-photo { width: 4.25rem; height: 4.25rem; border: 2px solid var(--violet); box-shadow: 0 0 0 4px var(--violet-soft); }
.portrait { height: auto; }
@media (max-width: 560px) { .eyebrow-photo { width: 3.5rem; height: 3.5rem; } }

/* ---------- Playground explanation ---------- */

.how-steps { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: grid; gap: var(--s-3); counter-reset: how; }
.how-steps li {
  counter-increment: how; display: grid; grid-template-columns: 2.5rem 1fr; column-gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface);
}
.how-steps li::before { content: counter(how); grid-row: 1 / span 2; font-family: var(--mono); color: var(--sage); font-size: 1.125rem; }
.how-steps h3 { font-size: 1.0625rem; }
.how-steps p { color: var(--ink-2); margin-top: 0.25rem; }
.how-sub { margin: var(--s-5) 0 var(--s-3); font-size: 1.25rem; }

@media (max-width: 560px) {
  .hero .lede { font-size: 1.0625rem; line-height: 1.6; }
  .hero h1 { font-size: clamp(2.2rem, 9.5vw, 2.8rem); }
  body::before { height: 40rem; }
}

/* ---------- Greeting ---------- */

.greeting { min-height: 1.6em; margin-bottom: var(--s-2); color: var(--ink-2); font-size: 0.9688rem; opacity: 0; transition: opacity 0.6s ease 0.15s; }
.greeting.shown { opacity: 1; }
