/* Self-hosted variable fonts (SIL OFL 1.1, licences in static/fonts/). Latin subset. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-var.260c81a4759b.woff2") format("woff2-variations"), url("../fonts/inter-latin-var.260c81a4759b.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/instrument-sans-latin-var.fa41c43a3d8e.woff2") format("woff2-variations"), url("../fonts/instrument-sans-latin-var.fa41c43a3d8e.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Grayscale wireframe tokens. Brand is not approved; swap values here only. */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --ink: #1d1f21;
  --muted: #55575a;
  --line: #d6d6d2;
  --accent: #1d1f21;
  --on-accent: #fafaf8;
  --on-accent-muted: #d9d9d4;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Instrument Sans", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 8px;
  --gutter: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.55; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; line-height: 1.1; }
h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); line-height: 1.05; }
h2 { font-size: clamp(1.625rem, 3vw, 2rem); }
h3 { font-size: 1.1875rem; }
p { margin: 0; }
a { color: var(--ink); }
a:hover { color: #000; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.125rem; max-width: 35rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-xl { display: flex; flex-direction: column; gap: 96px; padding: 80px 0 96px; }
.grid { display: grid; gap: 16px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.section-head a { padding: 10px 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 20px; border: 1.5px solid var(--ink); border-radius: 6px;
  text-decoration: none; font-weight: 600; font-size: .9375rem; color: var(--ink); background: transparent;
}
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--solid:hover { color: var(--on-accent); opacity: .9; }
.btn--inverse { border-color: var(--on-accent); color: var(--on-accent); }
.btn--inverse:hover { color: var(--on-accent); background: rgba(255, 255, 255, .08); }

.card {
  display: flex; flex-direction: column; gap: 10px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none;
}
.card:hover { border-color: var(--muted); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.wordmark {
  display: inline-block; min-height: 2.1em; /* two lines reserved, so the header never shifts while typing */
  font-family: var(--font-head); font-weight: 700; font-size: 1.375rem; line-height: 1.05; text-decoration: none;
}
/* The full stop is drawn, not typed, so it can be a cursor first and glow afterwards.
   .wordmark__dot is a fixed, full-stop-sized box that never changes size, so the text
   never moves; ::after draws on top of it, as the block cursor or as the glowing dot. */
.wordmark__dot {
  position: relative; display: inline-block; width: .24em; height: .24em; margin-left: .05em;
  vertical-align: baseline;
}
.wordmark__dot::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: .24em; height: .24em;
  border-radius: 50%; background: var(--ink);
  transition: width .45s cubic-bezier(.2, .7, .2, 1), height .45s cubic-bezier(.2, .7, .2, 1),
    bottom .45s cubic-bezier(.2, .7, .2, 1), border-radius .45s ease;
  animation: wm-glow 4s ease-in-out infinite;
}
/* While the intro runs, ::after is a terminal block cursor sitting on the baseline. */
.wm-intro .wordmark__dot::after,
.wm-running .wordmark__dot::after {
  width: .55em; height: .95em; bottom: -.16em; border-radius: 1px;
  animation: wm-blink 1s steps(1, end) infinite;
}
/* Solid while characters are going in, like a real terminal; it blinks only when idle. */
.wm-typing .wordmark__dot::after { animation: none; }
/* Before the script takes over, hide both the server-rendered text and the cursor (the
   cursor would otherwise appear at the end of the hidden text, then jump). If the script
   never runs, show everything again after 3s. */
.wm-intro .wordmark__text,
.wm-intro .wordmark__dot { visibility: hidden; animation: wm-failsafe 0s linear 3s forwards; }
@keyframes wm-failsafe { to { visibility: visible; } }
@keyframes wm-blink { 50% { opacity: 0; } }
@keyframes wm-glow {
  0%, 100% { background: var(--ink); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  50% { background: #22c55e; box-shadow: 0 0 .45em .08em rgba(34, 197, 94, .6); }
}
.site-nav { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; font-size: .9375rem; }
.site-nav a:not(.btn) { text-decoration: none; padding: 10px 0; }
.site-nav a[aria-current="page"]:not(.btn) { text-decoration: underline; text-underline-offset: 6px; }
.menu-button { display: none; }

/* Hero */
.hero { display: flex; }
.hero__text { max-width: 52rem; display: flex; flex-direction: column; gap: 20px; }
.hero .lead { max-width: 44rem; }
/* Footer */
.site-footer { border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.site-footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 32px; padding-bottom: 32px; }
.site-footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

@media (max-width: 960px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .stack-xl { gap: 48px; padding: 32px 0 48px; }
  .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .site-header__inner { padding-top: 16px; padding-bottom: 16px; }
  .wordmark { font-size: 1.25rem; }
  .menu-button {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1px solid #9a9a94; border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .site-nav { width: 100%; flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav { display: none; }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 12px; }
  .hero__text { gap: 16px; }
  .lead { font-size: 1rem; }
  .actions .btn { width: 100%; }
  .card { padding: 18px; }
  .site-footer__inner { flex-direction: column; gap: 8px; padding-top: 24px; padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Inner pages (M2) ---- */
.page { display: flex; flex-direction: column; gap: 64px; padding: 72px 0 96px; }
.page-head { display: flex; flex-direction: column; gap: 16px; }
.prose-width { max-width: 46rem; }
.page.methodology { max-width: 64rem; }
article.page { gap: 40px; }
.h3 { font-size: 1.1875rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.back-link { font-size: .875rem; color: var(--muted); align-self: flex-start; padding: 10px 0; }
.signature { font-weight: 600; }

.btn--small { min-height: 44px; padding: 8px 16px; font-size: .875rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: -32px; }

.empty-state {
  padding: 48px 24px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface);
}

.callout {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center;
  padding: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}

.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-row {
  display: grid; grid-template-columns: 8rem minmax(0, 1fr) auto; gap: 24px; align-items: baseline;
  padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.post-row:hover h2 { text-decoration: underline; text-underline-offset: 4px; }

.prose { font-size: 1.0625rem; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose blockquote { margin-left: 0; padding-left: 1em; border-left: 3px solid var(--line); color: var(--muted); }
.prose code { font-size: .9em; background: #efefeb; padding: .1em .3em; border-radius: 4px; }
.prose pre { overflow-x: auto; background: #efefeb; padding: 16px; border-radius: var(--radius); }
.post-feedback { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }

@media (max-width: 720px) {
  .page { gap: 40px; padding: 32px 0 48px; }
  article.page { gap: 28px; }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .filters { margin-bottom: -16px; }
  .callout { padding: 24px; flex-direction: column; align-items: stretch; }
  .post-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 20px 0; }
  .prose { font-size: 1rem; }
}

/* ---- Forms (M3) ---- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 64px; align-items: start; }
.form { display: flex; flex-direction: column; gap: 20px; padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: .9375rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid #9a9a94; border-radius: 6px;
}
textarea { resize: vertical; min-height: 9rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
[aria-invalid="true"] { border-color: #a8071a; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: .9375rem; }
.checkboxes > div { display: flex; flex-direction: column; gap: 2px; }
.checkboxes label { display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 400; cursor: pointer; }
.checkboxes input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex: none; }
.checkboxes input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.errorlist { list-style: none; margin: 0; padding: 0; color: #a8071a; font-size: .875rem; order: 3; }
.helptext { font-size: .8125rem; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.form-alert { padding: 12px 16px; border: 1px solid #e6a4ab; background: #fdf1f2; color: #a8071a; border-radius: 6px; }
.form-success { font-weight: 600; }
button { font: inherit; cursor: pointer; }

.subscribe { align-items: flex-start; }
.subscribe > .stack-sm { flex: 1 1 260px; }
.subscribe-form { flex: 1 1 380px; display: flex; flex-direction: column; gap: 12px; }
.subscribe-form__row { display: flex; gap: 12px; align-items: flex-end; }
.subscribe-form__row > .field { flex: 1; }

@media (max-width: 720px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .form { padding: 20px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .form-actions { flex-direction: column; align-items: stretch; }
  .subscribe-form__row { flex-direction: column; align-items: stretch; }
}

/* ---- Images (M4) ---- */
.card__image { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: #efefeb; }
.detail-image { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.callout > .stack-sm { flex: 1 1 420px; max-width: 46rem; }

/* ---- Text links ---- */
.text-link { align-self: flex-start; font-weight: 600; padding: 10px 0; text-underline-offset: 4px; }

.prose h3 + p { margin-top: .4em; }

/* ---- Methodology: strategy to done ---- */
.levels {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px;
}
.level {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
/* Chevron between levels, pointing to the next one. */
.level:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: -22px; width: 12px; height: 12px;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted);
  transform: translateY(-50%) rotate(45deg);
}
.level__name { font-family: var(--font-head); font-weight: 600; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.level p:last-child { font-size: .9375rem; color: var(--muted); }
.levels__loop { padding: 12px 16px; border-left: 3px solid var(--ink); background: var(--surface); }

@media (max-width: 960px) {
  .levels { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .level:not(:last-child)::after { top: auto; right: auto; bottom: -21px; left: 32px; transform: rotate(135deg); }
}

/* ---- Announcement banner (managed in the admin) ---- */
.announce { background: #22c55e; color: var(--ink); font-size: .9375rem; transition: background-color .3s ease; }
.announce[data-tone="offer"] { background: #febc2e; }
.announce__inner { display: flex; align-items: center; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
/* All messages share one grid cell, so the bar is as tall as the longest and never jumps. */
.announce__items { flex: 1; display: grid; }
.announce__item {
  grid-area: 1 / 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  visibility: hidden; opacity: 0; transition: opacity .3s ease, visibility 0s linear .3s;
}
.announce__item.is-active { visibility: visible; opacity: 1; transition: opacity .3s ease; }
.announce__message { font-weight: 500; }
.announce__link {
  display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; white-space: nowrap;
  border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); font-weight: 600; text-decoration: none;
}
.announce__link:hover { background: var(--ink); color: #fafaf8; }
.announce__link:focus-visible, .announce__arrow:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.announce__controls { flex: none; display: flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; font-size: .8125rem; }
.announce__controls[hidden] { display: none; }
.announce__arrow {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer;
}
.announce__arrow:hover { background: rgba(29, 31, 33, .1); }
.announce__arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 720px) {
  .announce { font-size: .875rem; }
  .announce__inner { gap: 8px; }
}

/* ---- Blog video embeds ---- */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video--short { aspect-ratio: 9 / 16; max-width: 360px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- About: résumé and skills (managed in the admin) ----
   One grid for every section: a narrow left column (dates, or the skill group) and the
   content on the right, with a hairline between rows. No pills or boxes. */
.resume { display: flex; flex-direction: column; gap: 8px; }
.resume > h2 { padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
/* Résumé tabs: underlined like the section headings, quiet until chosen. */
.tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs[hidden] { display: none; }
.tabs__tab {
  position: relative; flex: none; padding: 0 0 14px; border: 0; background: none; cursor: pointer;
  font-family: var(--font-head); font-size: clamp(1.125rem, 2.2vw, 1.5rem); font-weight: 600; letter-spacing: -.01em;
  color: var(--muted); transition: color .2s ease;
}
.tabs__tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.tabs__tab:hover { color: var(--ink); }
.tabs__tab[aria-selected="true"] { color: var(--ink); }
.tabs__tab[aria-selected="true"]::after { transform: scaleX(1); }
.tabs__tab:focus-visible { outline-width: 2px; outline-offset: 4px; border-radius: 4px; }
.tabs__panel:focus-visible { outline-offset: 8px; border-radius: 4px; }
/* Without JS each panel keeps its own heading; with tabs the tab is the heading. */
.tabs__heading { padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.is-tabbed .tabs__heading { display: none; }
.resume[data-tabs]:not(.is-tabbed) .tabs__panel + .tabs__panel { margin-top: 48px; }
.resume__list { list-style: none; margin: 0; padding: 0; }
.resume__row { display: grid; grid-template-columns: 14rem minmax(0, 46rem); gap: 32px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.resume__row:last-child { border-bottom: 0; }
.resume__dates { padding-top: 3px; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.resume__body { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.resume__body h3 { font-size: 1.125rem; }
.resume__body h3 a { text-decoration: none; }
.resume__body h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.resume__meta { color: var(--muted); font-size: .9375rem; }
.resume__details { margin-top: 8px; font-size: 1rem; }
/* Several roles at one organization: a thin rule ties them together under its name. */
.resume__roles { list-style: none; margin: 12px 0 0; padding: 0 0 0 20px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.resume__role { display: flex; flex-direction: column; gap: 2px; }
.resume__role h4 { margin: 0; font-family: var(--font-head); font-size: 1rem; font-weight: 600; }
.skills__group { display: flex; align-items: flex-start; gap: 8px; padding-top: 1px; font-family: var(--font-head); font-weight: 600; font-size: .9375rem; }
.skills__badge {
  flex: none; width: 18px; height: 18px; margin-top: 1px;
  fill: rgba(34, 197, 94, .14); stroke: #16a34a; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.skills__list { list-style: none; margin: 0; padding: 0; line-height: 1.7; display: flex; flex-wrap: wrap; }
.skills__list li { white-space: nowrap; }
.skills__list li:not(:last-child)::after { content: "·"; margin: 0 .55em; color: var(--muted); }
@media (max-width: 720px) {
  .resume__row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 20px 0; }
  /* Narrow screens: the tabs wrap instead of scrolling out of sight. */
  .tabs { flex-wrap: wrap; gap: 4px 24px; border-bottom: 0; }
  .tabs__tab { padding: 8px 0 10px; font-size: 1.0625rem; }
  .tabs__tab::after { bottom: 0; }
}

/* ---- Work: under construction ---- */
.notice { display: flex; flex-direction: column; gap: 12px; padding: 24px 28px; border: 1px solid var(--line); border-left: 4px solid #febc2e; border-radius: var(--radius); background: var(--surface); }
.staff-strip { margin: 0; padding: 8px var(--gutter); background: #febc2e; color: var(--ink); font-size: .875rem; text-align: center; }
/* The home headline is a full sentence, so it runs a step smaller than other page titles. */
.hero__title { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; }
