/* ademkabayel.dev — one stylesheet for every page. Tokens first; DESIGN.md
   explains the choices. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/assets/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/assets/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* palette */
  --ground: #f2f3ef;      /* concrete: the page */
  --surface: #ffffff;     /* windows and cards */
  --ink: #15171a;         /* headings */
  --ink-2: #393d44;       /* body copy */
  --muted: #646a72;       /* secondary copy */
  --rule: #d6d9d2;
  --accent: #2747e6;      /* cobalt: the trace, links, the one action */
  --accent-deep: #1b33b5;
  --accent-wash: #e5e9fd;
  --pass: #137a43;
  --pass-wash: #e1f1e7;

  /* faux UI inks (on white) */
  --ui-text: #1f2226;
  --ui-text-2: #5d636b;
  --ui-faint: #6c727a;
  --ui-fill: rgba(0, 0, 0, 0.055);
  --ui-fill-2: rgba(0, 0, 0, 0.085);
  --ui-line: rgba(0, 0, 0, 0.07);
  --ui-side: #f6f7f5;

  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
  /* distance from the content edge to the viewport edge, for figures that bleed right */
  --bleed: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));

  --ease-travel: cubic-bezier(0.45, 0, 0.1, 1);
  --ease-arrive: cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-hero: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 30px 60px -12px rgba(50, 50, 93, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
  --shadow-raised: 0 0 0 1px rgba(0, 0, 0, 0.07), 0 16px 32px -10px rgba(40, 45, 80, 0.28), 0 6px 12px -6px rgba(0, 0, 0, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-2);
  font: 400 1.125rem/1.6 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
main { overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
::selection { background: var(--accent-wash); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px;
  text-decoration: none; font-size: 0.9375rem;
}
.skip:focus { top: 12px; }

.icon { width: 1em; height: 1em; flex: none; }

/* ---------- links and buttons ---------- */

.link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transition: text-decoration-color 0.15s;
}
.link:hover { text-decoration-color: currentColor; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: background-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--accent-deep); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn--ghost:hover { background: var(--surface); box-shadow: inset 0 0 0 1.5px #c5c9c0; }
.btn--small { height: 36px; padding: 0 16px; font-size: 0.9375rem; }
.btn .icon { width: 18px; height: 18px; }

/* ---------- header ---------- */

.site-header { padding: 22px 0; }
.site-header__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark {
  font-weight: 750; font-size: 1.1875rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.site-nav { display: flex; align-items: center; gap: 4px; font-size: 0.9375rem; }
.site-nav a:not(.btn) {
  padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2);
  transition: background-color 0.15s;
}
.site-nav a:not(.btn):hover { background: rgba(0, 0, 0, 0.05); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.site-nav .btn { margin-left: 8px; }

@media (max-width: 560px) {
  .site-header__row { flex-wrap: wrap; row-gap: 10px; }
  .site-nav { width: 100%; margin-left: -12px; }
  .site-nav .btn { margin-left: auto; }
}

/* ---------- type ---------- */

.display {
  font-size: clamp(2.75rem, 1.5rem + 3.6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 750;
}
.h-page {
  font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 750;
  max-width: 17ch;
}
.h-section {
  font-size: clamp(1.875rem, 1.3rem + 1.6vw, 2.625rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 720;
}
.h-item {
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.lede { font-size: clamp(1.1875rem, 1.05rem + 0.4vw, 1.375rem); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.muted { color: var(--muted); }

/* ---------- hero ---------- */

.hero { padding: clamp(32px, 6vw, 88px) 0 clamp(72px, 9vw, 128px); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(40px, 5vw, 72px);
  align-items: center;
}
.hero__copy .display { max-width: 12ch; }
.hero__copy .lede { margin-top: 28px; max-width: 30em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__facts {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  margin-top: 32px; list-style: none;
  font-size: 0.9375rem; color: var(--muted);
}
.hero__facts li { display: flex; align-items: center; gap: 8px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22a35a;
  box-shadow: 0 0 0 3px rgba(34, 163, 90, 0.18);
}

.hero__stage {
  position: relative;
  height: 470px;
  margin-right: calc(-1 * var(--bleed));
}

@media (max-width: 1099px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__copy .display { max-width: 11ch; }
  .hero__stage { margin-top: 8px; }
}

/* ---------- faux UI: shared window ---------- */

.win {
  position: absolute;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-hero);
  overflow: hidden;
  color: var(--ui-text);
  font: 400 13px/1.4 var(--font);
  letter-spacing: 0;
}
.win__bar {
  height: 38px; display: flex; align-items: center; gap: 6px;
  padding: 0 14.5px;
  border-bottom: 1px solid var(--ui-line);
}
.win__dots { display: flex; gap: 6px; flex: none; }
.win__dots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.win__dots i:nth-child(1) { background: #ff5f57; }
.win__dots i:nth-child(2) { background: #febc2e; }
.win__dots i:nth-child(3) { background: #28c840; }
.win__title { flex: 1; text-align: center; margin-right: 39px; font-size: 12.5px; font-weight: 600; color: #3b3e43; }
.win__body { display: grid; height: calc(100% - 38px); }

.bar {
  display: block; height: 7px; border-radius: 4px;
  width: var(--w, 60%); background: var(--ui-fill-2);
}
.bar--faint { background: var(--ui-fill); }

.side {
  background: var(--ui-side);
  border-right: 1px solid var(--ui-line);
  padding: 14px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.side__group { padding: 10px 8px 8px; }
.side__group .bar { height: 6px; background: var(--ui-fill); }
.side__row {
  display: flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 8px; border-radius: 6px;
  color: var(--ui-text-2); font-size: 12.5px; white-space: nowrap;
}
.side__row .icon { width: 14px; height: 14px; color: #b3b8bf; }
.side__row.is-selected { background: rgba(0, 0, 0, 0.06); color: var(--ui-text); font-weight: 500; }
.side__row.is-selected .icon { color: var(--accent); }

.pane-label { font-size: 11.5px; font-weight: 600; color: var(--ui-faint); }

/* ---------- hero demo: the test run ---------- */

/* The window bleeds off the right edge of the screen. Its width follows the
   stage, so the cut always lands inside the inspector, which still reads as a
   third panel. Narrower stages slim, then drop, the sidebar, so the run and
   its "Run again" button are never cut. */
.hero__stage { container-type: inline-size; }
.win--hero { top: 0; left: 0; width: calc(100% + 106px); height: 392px; } /* 130px of the inspector shows */
.run { grid-template-columns: 172px minmax(0, 1fr) 236px; }
@container (max-width: 779px) {
  .win--hero { width: calc(100% + 152px); } /* 84px shows */
  .run { grid-template-columns: 160px minmax(0, 1fr) 236px; }
}
@container (max-width: 679px) {
  .win--hero { width: calc(100% + 140px); } /* 96px shows */
  .run { grid-template-columns: minmax(0, 1fr) 236px; }
  .run .side { display: none; }
  .run__main { padding-left: 20px; padding-right: 20px; }
}
.run__main { padding: 20px 22px 0; display: flex; flex-direction: column; min-width: 0; }
.run__head { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--ui-line); }
.run__name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; margin-right: auto; white-space: nowrap; }

.pill {
  display: inline-grid; flex: none;
  height: 24px; padding: 0 10px 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  align-items: center;
  transition: background-color 0.2s, color 0.2s;
}
.pill__label { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 5px; transition: opacity 0.2s, transform 0.25s var(--ease-arrive); }
.pill__label .icon { width: 13px; height: 13px; }
.pill[data-status="running"] { background: var(--accent-wash); color: var(--accent-deep); }
.pill[data-status="passed"] { background: var(--pass-wash); color: var(--pass); }
.pill[data-status="running"] .pill__label--passed,
.pill[data-status="passed"] .pill__label--running { opacity: 0; transform: translateY(4px); }

.spin {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  border: 1.6px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.run__btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 28px; padding: 0 11px 0 9px; border-radius: 7px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
  font-size: 12.5px; font-weight: 550; color: var(--ui-text);
  transition: background-color 0.12s, transform 0.12s;
}
.run__btn .icon { width: 13px; height: 13px; color: var(--ui-text-2); }
.run__btn.is-pressed { background: #eef0f2; transform: scale(0.97); }

.steps { list-style: none; padding: 10px 0 12px; }
.step {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) 40px; gap: 10px;
  align-items: center; height: 36px;
  font-size: 13.5px; color: var(--ui-text);
}
.step b { font-weight: 650; }
.step__mark { position: relative; width: 16px; height: 16px; }
.step__mark > * { position: absolute; inset: 0; margin: auto; transition: opacity 0.18s, transform 0.3s var(--ease-arrive); }
.step__mark .ring { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #c9cdd2; }
.step__mark .spin { width: 13px; height: 13px; color: var(--accent); }
.step__mark .icon { width: 16px; height: 16px; color: var(--pass); }
.step__time { text-align: right; font: 400 12px/1 var(--mono); color: var(--ui-faint); transition: opacity 0.25s; }
.step[data-state="idle"] .spin, .step[data-state="idle"] .icon,
.step[data-state="running"] .ring, .step[data-state="running"] .icon,
.step[data-state="passed"] .ring, .step[data-state="passed"] .spin { opacity: 0; }
.step[data-state="idle"] .icon, .step[data-state="running"] .icon { transform: scale(0.6); }
.step[data-state="idle"] { color: var(--ui-text-2); }
.step:not([data-state="passed"]) .step__time { opacity: 0; }

.run__output { border-top: 1px solid var(--ui-line); padding: 14px 0; display: grid; gap: 9px; }
.run__output .bar { height: 6px; background: var(--ui-fill); }

.run__inspect { border-left: 1px solid var(--ui-line); padding: 20px 18px; display: grid; align-content: start; gap: 12px; background: #fcfcfb; }
.run__inspect .bar { height: 6px; }
.inspect__block { border-radius: 8px; background: var(--ui-fill); height: 86px; }

/* the satellite: where the event went */
.trace {
  position: absolute; left: -36px; bottom: 0;
  width: 352px; padding: 14px 18px 16px;
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-raised);
  font: 400 12.5px/1.35 var(--font); color: var(--ui-text);
}
.trace__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.trace__title { font-weight: 650; font-size: 13px; }
.trace__dlq { color: var(--ui-text-2); display: inline-flex; gap: 6px; }
.trace__dlq-val { display: inline-grid; min-width: 50px; }
.trace__dlq-val > span { grid-area: 1 / 1; transition: opacity 0.2s; text-align: right; }
.trace__dlq-val .is-empty { color: var(--pass); font-weight: 600; }
.trace[data-dlq="waiting"] .is-empty, .trace[data-dlq="empty"] .is-waiting { opacity: 0; }

.hops { position: relative; margin-top: 16px; }
.hops ol { list-style: none; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); }
.hops::before, .hops__fill {
  content: ""; position: absolute; top: 5px; height: 2px; border-radius: 1px;
  left: 12.5%; right: 12.5%; background: #e3e5e8;
}
.hops__fill { background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 1)); transition: transform 0.45s var(--ease-travel); }
.hops li { position: relative; display: grid; justify-items: center; gap: 8px; color: var(--ui-text-2); }
.hops li::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 0 0 2px #cfd3d8;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.3s var(--ease-arrive);
}
.hops li.is-lit { color: var(--ui-text); }
.hops li.is-lit::before { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-wash); }

/* the pointer */
.cursor {
  position: absolute; left: 0; top: 0; z-index: 3; width: 24px; height: 24px;
  pointer-events: none; opacity: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
.cursor svg { transition: transform 0.12s; transform-origin: 9px 6px; }
.cursor.is-pressing svg { transform: scale(0.88); }

@media (max-width: 699px) {
  .hero__stage { height: 452px; }
  /* compact: the window runs off the right edge of the screen, its content stays clear of it */
  .win--hero { width: 100%; height: 360px; }
  .run { grid-template-columns: minmax(0, 1fr); }
  .run .side, .run__inspect { display: none; }
  .run__main { padding: 16px calc(var(--gutter) + 12px) 0 16px; }
  .run__name { font-size: 14px; }
  .step { font-size: 13px; grid-template-columns: 16px minmax(0, 1fr) 34px; }
  .step__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .trace { left: 12px; width: calc(100% - 24px - var(--gutter)); max-width: 352px; }
  .cursor { display: none; }
}
@media (max-width: 400px) {
  .run__btn span { display: none; }
  .run__btn { padding: 0 8px; }
}

/* ---------- sections ---------- */

.section { padding: clamp(72px, 9vw, 128px) 0; border-top: 1px solid var(--rule); }
.section__head { display: grid; gap: 16px; margin-bottom: clamp(40px, 5vw, 64px); max-width: 40em; }
.section__head p { color: var(--ink-2); }

/* selected work */
.work { display: grid; gap: clamp(88px, 10vw, 136px); }
.work__item {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 5vw, 72px);
  align-items: center;
}
.work__meta { list-style: none; display: grid; gap: 2px; margin-top: 14px; font-size: 0.9375rem; color: var(--muted); }
.work__meta li:first-child { color: var(--ink); font-weight: 600; }
.work__text p { margin-top: 18px; max-width: 32em; }
.work__text .link { display: inline-block; margin-top: 22px; }
.work__item h3 a { text-decoration: none; }
.work__item h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }

.figure {
  position: relative;
  height: 400px;
  margin-right: calc(-1 * var(--bleed));
}
@media (max-width: 1099px) {
  .work__item { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .figure { order: 2; }
}
@media (max-width: 699px) {
  .figure { height: 360px; }
}

/* principles */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px clamp(40px, 6vw, 96px); list-style: none; }
.principles h3 { font-size: 1.3125rem; letter-spacing: -0.015em; line-height: 1.25; }
.principles p { margin-top: 10px; max-width: 30em; }
@media (max-width: 760px) { .principles { grid-template-columns: minmax(0, 1fr); gap: 36px; } }

/* projects */
.projects { list-style: none; border-top: 1px solid var(--rule); }
.project {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) auto; gap: 16px 40px;
  padding: 28px 0; border-bottom: 1px solid var(--rule); align-items: baseline;
}
.project h3 { font-size: 1.25rem; letter-spacing: -0.015em; }
.project h3 a { text-decoration: none; }
.project h3 a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
.project__state { display: block; margin-top: 4px; font-size: 0.9375rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.project p { max-width: 36em; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags li { font-size: 0.8125rem; line-height: 1; padding: 6px 9px; border-radius: 6px; background: rgba(0, 0, 0, 0.05); color: var(--ink-2); }
.project__link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9375rem; white-space: nowrap; }
.project__link .icon { width: 15px; height: 15px; }
@media (max-width: 860px) {
  .project { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* notes list */
.notes { list-style: none; border-top: 1px solid var(--rule); }
.notes li { border-bottom: 1px solid var(--rule); }
.notes a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 32px;
  padding: 24px 0; text-decoration: none;
}
.notes__title { font-size: 1.25rem; font-weight: 650; color: var(--ink); letter-spacing: -0.015em; line-height: 1.3; }
.notes a:hover .notes__title { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.15em; }
.notes__date { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }
.notes__sum { grid-column: 1; color: var(--ink-2); max-width: 40em; }
@media (max-width: 640px) {
  .notes a { grid-template-columns: minmax(0, 1fr); }
  .notes__date { grid-row: 1; }
}

/* toolkit */
.toolkit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 48px; }
.toolkit dt { font-weight: 650; color: var(--ink); font-size: 1rem; }
.toolkit dd { margin: 6px 0 0; font-size: 1rem; line-height: 1.55; }
@media (max-width: 960px) { .toolkit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .toolkit { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

.credential {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  margin-top: clamp(48px, 6vw, 72px); padding: 20px 24px;
  background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.credential strong { color: var(--ink); font-weight: 650; }
.credential span { color: var(--muted); font-size: 0.9375rem; }

/* ---------- footer ---------- */

.site-footer { background: var(--ink); color: #c9ccd1; padding: clamp(72px, 9vw, 120px) 0 36px; }
.contact { max-width: 46em; }
.contact__title { color: #fff; font-size: clamp(1.875rem, 1.3rem + 1.6vw, 2.625rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 720; }
.contact__text { margin-top: 16px; max-width: 34em; }
.contact__email {
  display: inline-block; margin-top: 28px;
  color: #fff; font-weight: 650; text-decoration: none; letter-spacing: -0.025em;
  font-size: clamp(1.5rem, 0.9rem + 2.6vw, 3rem); line-height: 1.1;
  border-bottom: 2px solid #8a9cff; padding-bottom: 4px;
  overflow-wrap: anywhere;
}
.contact__email:hover { border-bottom-color: #fff; }
.site-footer :focus-visible { outline-color: #8a9cff; }
.site-footer__row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px;
  margin-top: clamp(64px, 8vw, 104px); padding-top: 24px; border-top: 1px solid #2e3237;
  font-size: 0.9375rem;
}
.site-footer__links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer__links a { color: #fff; text-decoration: none; }
.site-footer__links a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.site-footer__small { color: #8e949c; }

/* ---------- article pages: case studies, notes, resume ---------- */

.page-head { padding: clamp(40px, 6vw, 88px) 0 clamp(40px, 5vw, 64px); }
.crumb { display: inline-block; margin-bottom: 28px; font-size: 0.9375rem; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.page-head .lede { margin-top: 24px; }

.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; gap: 16px 56px;
  margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--rule);
}
.facts dt { font-size: 0.875rem; color: var(--muted); }
.facts dd { margin: 4px 0 0; color: var(--ink); font-weight: 550; font-size: 1rem; }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; } }

.case-figure { padding-bottom: clamp(56px, 7vw, 96px); }
.case-figure .figure { height: 440px; }
@media (max-width: 699px) { .case-figure .figure { height: 380px; } }

.prose { max-width: 40rem; padding-bottom: clamp(64px, 8vw, 112px); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem); letter-spacing: -0.025em; line-height: 1.2;
  margin-top: 2.2em;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 + * { margin-top: 0.7em; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.55em; }
.prose li::marker { color: var(--muted); }
.prose a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose code { font: 0.86em/1.4 var(--mono); background: rgba(0, 0, 0, 0.055); padding: 0.12em 0.36em; border-radius: 5px; color: var(--ink); }
.prose pre {
  margin-left: calc(-1 * min(24px, var(--gutter) - 4px)); margin-right: calc(-1 * min(24px, var(--gutter) - 4px));
  padding: 20px 24px; border-radius: 12px; overflow-x: auto;
  background: #15171a; color: #e6e8eb; font: 0.875rem/1.65 var(--mono);
}
.prose pre code { background: none; padding: 0; color: inherit; font: inherit; }
.prose .tok-k { color: #9fb2ff; }
.prose .tok-s { color: #9fe0b5; }
.prose .tok-c { color: #8a9099; }
.prose .tok-f { color: #ffd38a; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--accent); color: var(--ink); }

.next {
  display: grid; gap: 6px; padding: 32px 0 clamp(72px, 9vw, 112px); border-top: 1px solid var(--rule);
  text-decoration: none;
}
.next span { color: var(--muted); font-size: 0.9375rem; }
.next strong { color: var(--ink); font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem); letter-spacing: -0.02em; line-height: 1.2; }
.next:hover strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.14em; }

.note-meta { margin-top: 20px; color: var(--muted); font-size: 0.9375rem; }

/* resume */
.resume { max-width: 52rem; padding-bottom: clamp(64px, 8vw, 112px); }
.resume__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.resume__contact { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 24px; font-size: 1rem; }
.resume__contact a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.resume section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--rule); }
.resume h2 { font-size: 1.375rem; letter-spacing: -0.02em; }
.resume h2 + * { margin-top: 18px; }
.job + .job { margin-top: 36px; }
.job__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; align-items: baseline; }
.job h3 { font-size: 1.1875rem; letter-spacing: -0.015em; }
.job__org { color: var(--ink-2); margin-top: 2px; }
.job__when { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }
.job ul { margin-top: 12px; padding-left: 1.2em; }
.job li + li { margin-top: 0.45em; }
.job li::marker { color: var(--muted); }
.skills { display: grid; grid-template-columns: 13em minmax(0, 1fr); gap: 10px 24px; margin: 0; }
.skills dt { color: var(--ink); font-weight: 600; }
.skills dd { margin: 0; }
@media (max-width: 640px) { .skills { grid-template-columns: minmax(0, 1fr); gap: 2px; } .skills dd { margin-bottom: 12px; } }

/* 404 */
.not-found { padding: clamp(64px, 10vw, 160px) 0; }
.not-found .lede { margin-top: 20px; }

/* ---------- case-study figures ---------- */

/* RFID: a message on a topic, with the assertions that checked it */
.win--topic { top: 0; left: 0; width: max(860px, calc(100% + 40px)); height: 360px; }
.topic { grid-template-columns: 188px minmax(0, 1fr); }
.topic__main { padding: 18px 22px; min-width: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); align-content: start; gap: 14px 20px; }
.topic__head { grid-column: 1 / -1; }
.topic__head { display: flex; align-items: center; gap: 10px; }
.topic__name { font-size: 14.5px; font-weight: 650; }
.topic__offset { font: 400 11.5px/1 var(--mono); color: var(--ui-faint); }
.msgs { display: grid; gap: 2px; }
.msg { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; align-items: center; height: 32px; padding: 0 10px; border-radius: 6px; }
.msg.is-selected { background: var(--accent-wash); }
.msg__k { font: 400 12px/1 var(--mono); color: var(--ui-text-2); }
.msg.is-selected .msg__k { color: var(--accent-deep); }
.json {
  margin: 0; padding: 14px 16px; border-radius: 8px; background: #f7f8f6;
  font: 400 12.5px/1.65 var(--mono); color: var(--ui-text); white-space: pre; overflow: hidden;
}
.json .k { color: #5a6270; }
.json .s { color: #116b3c; }
.json .hl { background: #fff3c4; border-radius: 3px; box-shadow: 0 0 0 2px #fff3c4; }

.asserts {
  position: absolute; left: -36px; bottom: 0; width: 300px;
  padding: 14px 16px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-raised);
  font: 400 12.5px/1.35 var(--font); color: var(--ui-text);
}
.asserts__title { font-weight: 650; font-size: 13px; margin-bottom: 8px; }
.asserts ul { list-style: none; display: grid; gap: 7px; }
.asserts li { display: flex; align-items: center; gap: 8px; }
.asserts .icon { width: 15px; height: 15px; color: var(--pass); }

/* Kinaxis: an editor and the terminal that ran it */
.win--editor { top: 0; left: 0; width: max(860px, calc(100% + 40px)); height: 350px; }
.editor { grid-template-columns: 196px minmax(0, 1fr); }
.code {
  margin: 0; padding: 18px 0; font: 400 12.5px/1.75 var(--mono); color: #2b2f35; white-space: pre; overflow: hidden;
  counter-reset: ln;
}
.code > span { display: block; padding-left: 52px; position: relative; }
.code > span::before {
  counter-increment: ln; content: counter(ln);
  position: absolute; left: 0; width: 34px; text-align: right; color: #b7bbc1;
}
.code .kw { color: #7a3fc4; }
.code .fn { color: #1b55c7; }
.code .str { color: #116b3c; }
.code .cm { color: #9aa0a7; }
.code .cur { background: #f2f5ff; }

.term {
  position: absolute; left: -36px; bottom: 0; width: 360px;
  padding: 14px 16px 16px; border-radius: 12px;
  background: #16181c; color: #d9dce0; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow-raised);
  font: 400 12px/1.7 var(--mono); white-space: pre;
}
.term .dim { color: #7d838b; }
.term .ok { color: #6fdc99; }
.term .ink { color: #fff; }

/* Wells Fargo: reconciliation table and the scenario behind it */
.win--recon { top: 0; left: 0; width: max(860px, calc(100% + 40px)); height: 340px; }
.recon { grid-template-columns: minmax(0, 1fr); }
.recon__main { padding: 18px 22px; display: grid; align-content: start; gap: 14px; }
.recon__title { font-size: 14.5px; font-weight: 650; }
.table { display: grid; }
.tr { display: grid; grid-template-columns: 150px 120px 120px 110px minmax(0, 1fr); gap: 20px; align-items: center; height: 38px; padding: 0 12px; border-bottom: 1px solid var(--ui-line); }
.tr--head { height: 30px; color: var(--ui-faint); font-size: 11.5px; font-weight: 600; }
.tr.is-selected { background: #f5f7ff; border-radius: 6px; border-bottom-color: transparent; }
.num { font: 400 12.5px/1 var(--mono); text-align: right; }
.tag-ok { display: inline-flex; align-items: center; gap: 5px; color: var(--pass); font-weight: 600; font-size: 12px; }
.tag-ok .icon { width: 14px; height: 14px; }
.tr .icon.only { width: 14px; height: 14px; color: #8fc9a6; }

.gherkin {
  position: absolute; left: -36px; bottom: 0; width: 380px;
  padding: 14px 18px 16px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-raised);
  font: 400 12.5px/1.7 var(--mono); color: var(--ui-text); white-space: pre;
}
.gherkin .kw { color: #7a3fc4; font-weight: 500; }
.gherkin .amt { background: #fff3c4; border-radius: 3px; box-shadow: 0 0 0 2px #fff3c4; }

@media (max-width: 699px) {
  .win--topic, .win--editor, .win--recon { width: 100%; height: 300px; }
  .topic__main, .recon__main { padding-right: calc(var(--gutter) + 12px); }
  .topic, .editor { grid-template-columns: minmax(0, 1fr); }
  .topic .side, .editor .side { display: none; }
  .topic__main { grid-template-columns: minmax(0, 1fr); }
  .msgs { display: none; }
  .tr { grid-template-columns: minmax(0, 1fr) 56px 56px 64px; gap: 10px; padding: 0 8px; }
  .tr > :nth-child(5) { display: none; }
  .asserts, .term, .gherkin { left: 12px; width: auto; right: calc(var(--gutter) + 0px); max-width: 380px; }
  .code > span { padding-left: 40px; }
  .gherkin { font-size: 11.5px; }
  .code > span::before { width: 26px; }
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- print (the resume page prints cleanly) ---------- */

@media print {
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .skip, .resume__actions, .crumb { display: none !important; }
  .page-head { padding: 0 0 12pt; }
  .resume section { padding-top: 12pt; margin-top: 12pt; }
  a { color: inherit !important; text-decoration: none; }
}

/* case pages: the figure starts a quarter in and runs off the right edge */
@media (min-width: 1100px) {
  .case-figure .figure { margin-left: 25%; }
  .case-figure .win { width: calc(100% + 80px); }
}
@media (min-width: 700px) and (max-width: 1099px) {
  .trace, .asserts, .term, .gherkin { left: -16px; }
}
