:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --ink: #161513;
  --ink-2: #4a4740;
  --muted: #8a857a;
  --line: #e2dccf;
  --accent: #1f8a52;
  --accent-soft: #e2f3e8;
  --warn: #b45309;
  --warn-soft: #fbeedb;
  --fail: #b42318;
  --fail-soft: #fbe4e1;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11110f; --surface: #1a1a17; --ink: #f1ede4; --ink-2: #c4beb1; --muted: #8b867b;
    --line: #2c2b27; --accent: #57c785; --accent-soft: #15301f; --warn: #f0a24b; --warn-soft: #33240f;
    --fail: #f2766a; --fail-soft: #3a1714; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11110f; --surface: #1a1a17; --ink: #f1ede4; --ink-2: #c4beb1; --muted: #8b867b;
  --line: #2c2b27; --accent: #57c785; --accent-soft: #15301f; --warn: #f0a24b; --warn-soft: #33240f;
  --fail: #f2766a; --fail-soft: #3a1714; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.mono { font-family: var(--mono); }
.small { font-size: 0.8rem; }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h4 { margin: 0 0 .5rem; font-size: 1rem; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .9rem clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--mono); font-weight: 500; text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.nav { display: flex; gap: 1.25rem; margin-left: auto; font-size: .9rem; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a.on { color: var(--ink); }
.nav a.on { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.theme { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }

main { max-width: 1040px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

/* hero */
.hero { padding: clamp(64px, 12vw, 140px) 0 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--accent); background: var(--accent-soft); padding: .35rem .8rem; border-radius: 99px; margin: 0 0 1.75rem; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(3rem, 9vw, 6.5rem); line-height: .95; }
.lede { font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--ink-2); max-width: 36ch; margin: 1.5rem 0 2rem; line-height: 1.45; }
.lede em { font-family: var(--serif); font-style: italic; color: var(--ink); }
.small-lede { font-size: 1.15rem; margin-top: 0; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; padding: .65rem 1.1rem; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 500; font-size: .92rem;
  transition: transform .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.claims-note { margin-top: 3rem; font-size: .8rem; color: var(--muted); }
.cite-demo, .cite {
  font-family: var(--mono); font-size: .72em; color: var(--accent); text-decoration: none;
  vertical-align: super; cursor: help; padding: 0 2px; border-radius: 4px;
}
.cite:hover, .cite:focus-visible { background: var(--accent-soft); outline: none; }
.cite-demo { vertical-align: baseline; font-size: 1em; }

/* blocks */
.block { padding: 72px 0; border-top: 1px solid var(--line); }
.block-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 2.25rem; }
.block-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.num { color: var(--muted); font-size: .85rem; }

/* placeholders — visible locally so you know what to fill in */
.fill { background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 0 .3em; outline: 1px dashed var(--warn); outline-offset: 1px; }

/* brief */
.brief { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.brief dl { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.brief dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; padding: .95rem 1.25rem; border-bottom: 1px solid var(--line); }
.brief dl > div:last-child { border-bottom: 0; }
.brief dt { font-family: var(--mono); font-size: .78rem; color: var(--muted); padding-top: .15rem; }
.brief dd { margin: 0; }
.checks { list-style: none; padding: 0; margin: .75rem 0 0; }
.checks li { padding: .55rem 0 .55rem 1.75rem; position: relative; border-bottom: 1px dashed var(--line); }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 600; }

/* project */
.project { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: clamp(20px, 4vw, 40px); }
.project-top { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; }
.project h3 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: .25rem 0 .5rem; }
.project-sub { color: var(--ink-2); max-width: 60ch; margin: 0; }
.pull { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2.6vw, 1.6rem); margin: 2rem 0; padding-left: 1.25rem; border-left: 3px solid var(--accent); line-height: 1.35; }

.arch { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }
.arch-diagram { display: flex; flex-direction: column; align-items: stretch; gap: .35rem; }
.arch-label { margin: 0 0 .5rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.node {
  font: inherit; font-size: .9rem; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem;
  display: flex; flex-direction: column; gap: .1rem; transition: border-color .15s, background .15s;
}
.node .k { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.node:hover { border-color: var(--ink-2); }
.node.active { border-color: var(--accent); background: var(--accent-soft); }
.node.gate { border-style: dashed; }
.wire { font-family: var(--mono); font-size: .7rem; color: var(--muted); padding-left: 1rem; }
.arch-detail { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.4rem; align-self: stretch; }
.arch-detail h4 { font-family: var(--serif); font-size: 1.25rem; }
.arch-detail ul { padding-left: 1.1rem; margin: .5rem 0 0; color: var(--ink-2); }
.arch-detail li { margin: .3rem 0; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 2rem 0; }
.metric { background: var(--surface); padding: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.metric .big { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1; }
.metric .small { color: var(--muted); line-height: 1.4; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.decisions { padding-left: 1.2rem; margin: 0; }
.decisions li { margin-bottom: .75rem; color: var(--ink-2); }
.decisions strong { color: var(--ink); }
.limits { list-style: none; padding: 0; margin: 0; }
.limits li { padding: .5rem 0 .5rem 1.5rem; position: relative; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.limits li::before { content: "!"; position: absolute; left: .3rem; color: var(--warn); font-family: var(--mono); font-weight: 600; }
.tag { font-family: var(--mono); font-size: .68rem; font-weight: 500; background: var(--warn-soft); color: var(--warn); padding: .15rem .45rem; border-radius: 99px; vertical-align: middle; }

.next-slot { margin-top: 1.25rem; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; color: var(--ink-2); }
.next-slot p { margin: .3rem 0 0; }

/* principles */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.principle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.principle p { margin: 0; color: var(--ink-2); }
.step { font-size: .75rem; color: var(--accent); display: block; margin-bottom: .75rem; }

.gate-demo { margin-top: 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.5rem; }
.gate-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.gate-head p { margin: 0; }
.gate-q { margin: 1rem 0 .75rem; font-size: .92rem; color: var(--ink-2); }
.gate-q code { font-family: var(--mono); font-size: .85em; background: var(--bg); padding: .1em .35em; border-radius: 4px; }
.gate-cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.case {
  font: inherit; font-size: .88rem; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; line-height: 1.45;
}
.case:hover { border-color: var(--ink-2); }
.case.sel { border-color: var(--ink); }
.case .mono { display: block; font-size: .68rem; color: var(--muted); margin-bottom: .35rem; }
.gate-result { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; background: var(--bg); font-size: .82rem; color: var(--muted); min-height: 3rem; }
.gate-result.pass { background: var(--accent-soft); color: var(--accent); }
.gate-result.fail { background: var(--fail-soft); color: var(--fail); }
.gate-result.review { background: var(--warn-soft); color: var(--warn); }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li { display: grid; grid-template-columns: 180px 1fr; gap: 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.timeline > li:last-child { border-bottom: 0; }
.when { font-size: .8rem; color: var(--muted); padding-top: .15rem; }
.timeline p { margin: 0; color: var(--ink-2); }

/* contact */
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.contact-card {
  display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.2rem; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: transform .15s, border-color .15s;
}
.contact-card:hover { transform: translateY(-2px); border-color: var(--ink-2); }

.foot { display: flex; justify-content: space-between; max-width: 1040px; margin: 0 auto; padding: 2rem clamp(16px, 4vw, 48px) 3rem; border-top: 1px solid var(--line); }

/* citation popover */
.pop {
  position: absolute; z-index: 50; max-width: 320px; background: var(--ink); color: var(--bg);
  padding: .8rem .95rem; border-radius: 10px; font-size: .82rem; line-height: 1.45; box-shadow: 0 10px 30px rgb(0 0 0 / .2);
}
.pop .mono { font-size: .7rem; opacity: .7; display: block; margin-bottom: .3rem; }
.pop a { color: inherit; text-decoration-color: var(--accent); }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .pulse { animation: none; }
}

/* responsive */
@media (max-width: 860px) {
  .brief, .arch, .two-col, .principles { grid-template-columns: 1fr; }
  .metrics, .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .gate-cases { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .theme { margin-left: auto; }
  .project-top { flex-direction: column; }
  .brief dl > div { grid-template-columns: 1fr; gap: .2rem; }
  .timeline > li { grid-template-columns: 1fr; gap: .4rem; }
  .pair { grid-template-columns: 1fr; }
}

/* experience details */
.bullets { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--ink-2); }
.bullets li { margin: .35rem 0; }
.role-tag { font-family: var(--mono); font-size: .68rem; font-weight: 500; background: var(--accent-soft); color: var(--accent); padding: .15rem .45rem; border-radius: 99px; vertical-align: middle; }
.toolbox { margin-top: 2.5rem; }
.toolbox dl { margin: .75rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.toolbox dl > div { background: var(--surface); padding: 1rem 1.2rem; }
.toolbox dt { font-family: var(--mono); font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.toolbox dd { margin: 0; font-size: .92rem; }
@media (max-width: 640px) { .toolbox dl { grid-template-columns: 1fr; } }
.edu .timeline > li { padding: 1rem 0; }
.edu .timeline h4 { margin: 0; }
@media (max-width: 380px) { .metrics, .contact-grid { grid-template-columns: 1fr; } }

/* mobile section menu (the nav links are hidden below 640px) */
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; line-height: 1; align-items: center; justify-content: center; }
.nav-toggle:hover, .theme:hover { border-color: var(--ink-2); }
.nav-toggle:focus-visible, .theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .theme { margin-left: 0; }
  .nav.open {
    display: flex; flex-direction: column; gap: 0; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: .25rem clamp(16px, 4vw, 48px) .75rem;
    box-shadow: 0 12px 24px rgb(0 0 0 / .08);
  }
  .nav.open a { padding: .75rem 0; font-size: 1rem; border-top: 1px dashed var(--line); }
  .nav.open a:first-child { border-top: 0; }
}

/* ── Agentic Compass card + case-study page ── */
.project.work { margin-bottom: 1.5rem; }
.project .role-tag { margin-right: .4rem; }
.case-hero { padding: clamp(48px, 9vw, 110px) 0 48px; }
.case-hero h1 { font-size: clamp(2.6rem, 8vw, 5rem); line-height: .98; }
.case-hero .motto { font-family: var(--mono); font-size: .9rem; color: var(--accent); margin: 1rem 0 0; }
.case-hero .lede { max-width: 48ch; }
.back { display: block; width: fit-content; margin-bottom: 1.25rem; font-size: .85rem; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--ink); }
.prose { max-width: 68ch; color: var(--ink-2); }
.prose p { margin: 0 0 1rem; }
.prose strong { color: var(--ink); }
.flow { list-style: none; padding: 0; margin: 1.5rem 0 1rem; display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem; }
.flow li { display: flex; align-items: center; gap: .5rem; }
.flow li:not(:last-child)::after { content: "→"; font-family: var(--mono); color: var(--muted); }
.flow .stepbox { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem; font-size: .88rem; line-height: 1.3; }
.flow .stepbox .k { display: block; font-family: var(--mono); font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.flow .human .stepbox { border: 1.5px dashed var(--accent); background: var(--accent-soft); }
.flow-legend { font-size: .78rem; color: var(--muted); margin: 0 0 1.5rem; }
.flow-legend .swatch { display: inline-block; width: .8rem; height: .8rem; border: 1.5px dashed var(--accent); background: var(--accent-soft); border-radius: 3px; vertical-align: -1px; margin-right: .35rem; }
.results { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.results li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; color: var(--ink-2); font-size: .93rem; }
.results .mono { display: block; font-size: .7rem; color: var(--muted); margin-bottom: .3rem; }
.note { font-size: .8rem; color: var(--muted); margin-top: 1rem; }
@media (max-width: 860px) { .results { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .flow { flex-direction: column; align-items: stretch; }
  .flow li { flex-direction: column; align-items: stretch; }
  .flow li:not(:last-child)::after { content: "↓"; text-align: center; }
}
