/* ---- tokens (§7.1). Demo pages carry a copy of this block (§7.11). ---- */
/* Tokens for brettadams0.github.io. Dark only. Demo pages copy this :root block (spec 7.11). */
:root {
  color-scheme: dark;

  /* Colour: existing values, unchanged */
  --bg: #0b0f14;
  --bg-2: #0e141b;
  --surface: #131a22;
  --surface-2: #18212b;
  --border: #222c38;
  --border-strong: #2f3b4a;
  --text: #e7ecf2;
  --soft: #c4ccd6;
  --muted: #8695a7;
  --faint: #5a6878;        /* list markers and control edges only; never words (3.37:1 on --bg) */
  --amber: #ffb454;
  --amber-hi: #ffc97f;
  --teal: #4fd6c4;
  --red: #ef6a5f;
  --good: #3ccf6e;

  /* Colour: new */
  --dim: #7b8a9c;          /* words that used --faint; >= 4.61:1 on every background */
  --good-text: #9fe3b7;    /* text on green washes: status line, Live demo badge */
  --on-amber: #1a1206;     /* text on --amber / --amber-hi fills */
  --term: var(--bg-2);     /* terminal and code panels */
  --focus: var(--amber);
  --amber-line: rgba(255, 180, 84, 0.5);
  --amber-wash: rgba(255, 180, 84, 0.1);
  --good-line: rgba(60, 207, 110, 0.3);
  --good-wash: rgba(60, 207, 110, 0.07);

  /* Type */
  --sans: "IBM Plex Sans", "IBM Plex Sans Fallback", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;                            /* 12px */
  --fs-sm: 0.875rem;                           /* 14px */
  --fs-base: 1rem;                             /* 16px */
  --fs-md: 1.0625rem;                          /* 17px */
  --fs-lg: 1.1875rem;                          /* 19px */
  --fs-xl: 1.375rem;                           /* 22px */
  --fs-2xl: clamp(2rem, 5vw, 2.75rem);         /* 32–44px */
  --fs-3xl: clamp(1.625rem, 4.5vw, 3rem);      /* 26–48px */
  --fs-display: clamp(2.75rem, 6vw, 4.5rem);   /* 44–72px */
  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-base: 1.6;
  --lh-loose: 1.75;
  --tracking-tight: -0.03em;
  --tracking-caps: 0.08em;

  /* Space (4 px base) */
  --space-1: 0.25rem;   /* 4 */
  --space-2: 0.5rem;    /* 8 */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.25rem;   /* 20 */
  --space-6: 1.5rem;    /* 24 */
  --space-7: 2rem;      /* 32 */
  --space-8: 3rem;      /* 48 */
  --space-9: 4rem;      /* 64 */
  --space-10: 5.5rem;   /* 88 */

  /* Layout */
  --container: 1200px;
  --container-demo: 1320px;
  --container-post: 760px;
  --gutter: 24px;
  --header-h: 56px;

  /* Shape and layers */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-pill: 999px;
  --shadow-focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--focus);
  --z-header: 10;
  --z-skip: 20;

  /* Motion (section 9) */
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 240ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; }
}

/* IBM Plex, self-hosted (7.5). Files are Google Fonts' latin subsets, byte for byte. Licence: ../fonts/OFL.txt */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-var.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-600.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;
}

/* Metric-matched fallbacks: shown until Plex arrives, sized so no line re-wraps on swap (7.5). */
@font-face {
  font-family: "IBM Plex Sans Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 100.3%;
  ascent-override: 102.2%;
  descent-override: 27.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "IBM Plex Sans Fallback";
  font-weight: 600 700;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold");
  size-adjust: 98%;
  ascent-override: 104.6%;
  descent-override: 28.1%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "IBM Plex Mono Fallback";
  src: local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono");
  size-adjust: 100%;
  ascent-override: 102.5%;
  descent-override: 27.5%;
  line-gap-override: 0%;
}
/* ---- end tokens ---- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/var(--lh-base) var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--amber);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--amber-hi);
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.site-nav a:focus-visible, .nav-sections a:focus-visible, .links a:focus-visible,
pre[tabindex]:focus-visible, .term:focus-visible, .table-scroll:focus-visible { outline-offset: 2px; }
main:focus { outline: none; }

/* Terminal prefixes: visual only, out of the accessible name (§7.10) */
.prefix { color: var(--amber); white-space: pre; }   /* pre keeps the trailing space inside inline-flex parents */
.kicker .prefix { color: var(--dim); }
.post-body h2 .prefix { font-family: var(--mono); font-size: 0.85em; }
@media (max-width: 640px) { .job-org .prefix { display: none; } }   /* replaces content: "" at :917-919 */
.nowrap { white-space: nowrap; }
.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; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -48px;
  z-index: var(--z-skip);
  padding: var(--space-2) var(--space-3);
  background: var(--amber);
  color: var(--bg);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: var(--space-3);
}

/* Header */

.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: rgba(11, 15, 20, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: var(--header-h); }
.site-name, .site-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-name { color: var(--text); font: 600 var(--fs-base) var(--mono); text-decoration: none; }
.site-name:hover { color: var(--text); }
.site-nav { display: flex; align-items: center; gap: var(--space-6); font-size: var(--fs-sm); }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }
.site-nav .nav-resume {
  min-height: 36px; padding: 0 14px; border: 1px solid var(--amber-line); border-radius: var(--radius);
  color: var(--amber); font-weight: 500;
}
.site-nav .nav-resume:hover { background: var(--amber-wash); color: var(--amber-hi); }
.nav-sections { display: none; border-bottom: 1px solid var(--border); background: var(--bg); }

/* ---- 8.2 Hero ---- */
.hero {
  position: relative;
  padding: var(--space-9) 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 420px at 85% 20%, rgba(79, 214, 196, 0.07), transparent 70%),
    radial-gradient(700px 380px at 10% 90%, rgba(255, 180, 84, 0.06), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); align-items: start; }
.status {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin: 0; padding: 5px 12px;
  border: 1px solid var(--good-line); border-radius: var(--radius-pill);
  background: var(--good-wash); color: var(--good-text);
  font: var(--fs-sm) / 1.4 var(--mono);
}
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(60, 207, 110, 0.2); }
.kicker { margin: var(--space-6) 0 var(--space-1); color: var(--teal); font: 500 var(--fs-sm) / 1.4 var(--mono); }
.hero h1 {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-display); font-weight: 700;
  line-height: var(--lh-tight); letter-spacing: var(--tracking-tight);
}
.lede { max-width: 34em; margin: 0 0 var(--space-6); color: var(--soft); font-size: var(--fs-lg); line-height: 1.55; }
.lede a { color: var(--text); text-decoration-color: var(--border-strong); }
.lede a:hover { text-decoration-color: var(--amber); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font: 500 var(--fs-base) var(--sans); text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.btn:hover { border-color: var(--muted); background: var(--surface-2); color: var(--text); }
.btn:active { background: var(--bg-2); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); font-weight: 600; }
.btn-primary:hover { background: var(--amber-hi); border-color: var(--amber-hi); color: var(--on-amber); }
.btn-primary:active { background: var(--amber); }
.hero-jump { margin: 20px 0 0; font: 500 var(--fs-sm) var(--mono); }
.hero-jump a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.hero-jump a:hover { text-decoration: underline; }

/* ---- 8.3 At a glance ---- */
.glance {
  padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.glance-title {
  margin: 0 0 var(--space-2);
  color: var(--muted); font: 600 var(--fs-xs) / 1.4 var(--mono);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.glance-list { margin: 0; }
.glance-list > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.glance-list dt { padding-top: 2px; color: var(--muted); font: var(--fs-xs) / 1.6 var(--mono); }
.glance-list dd { margin: 0; color: var(--soft); font-size: var(--fs-sm); line-height: 1.5; }

/* Chips (kept until §8.10, PR 6) */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  color: var(--soft);
  font: var(--fs-xs)/1.5 var(--mono);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Sections */

.section {
  padding: var(--space-9) 0;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0 0 var(--space-7);
  font: 600 var(--fs-sm) var(--mono);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted);
}

/* Experience */

.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 32px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(var(--amber), var(--border-strong) 25%, var(--border));
}

.job {
  position: relative;
  padding: 0 0 var(--space-7);
}

.job:last-child {
  padding-bottom: 0;
}

.job::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 7px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
}

.job-current::before {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 180, 84, 0.15);
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 20px;
}

.job-title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-snug);
}

.job-org {
  color: var(--muted);
  font-weight: 400;
}

.job-when {
  margin: 0;
  color: var(--muted);
  font: var(--fs-sm) var(--mono);
}

.job-points { max-width: 54em; margin: var(--space-3) 0 var(--space-4); padding-left: 1.1em; color: var(--soft); }
.job-points li { margin: 5px 0; }
.job-points li::marker { color: var(--faint); }

/* More bullets, one click away (§8.4). Native disclosure, no animation. */
.job-more { margin: 0 0 var(--space-4); }
.job-more > .job-points { margin-top: var(--space-1); }
.job-more summary {
  display: list-item; min-height: 24px;
  color: var(--amber); font: var(--fs-xs) / 24px var(--mono); cursor: pointer;
}
.job-more summary::marker { color: var(--amber); }
.job-more summary:hover { text-decoration: underline; }

/* Projects */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.project {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease-out);
}

.project:hover,
.project:focus-within {
  border-color: var(--border-strong);
}

.project-shot {
  display: block;
  aspect-ratio: 16 / 10;
  margin-bottom: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.project-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

/* Card loops (PR 20): a silent clip over the still screenshot, shown only while it plays. */
.project-shot { position: relative; }
.shot-loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
  opacity: 0;
  pointer-events: none;
}
.shot-loop.is-playing { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .shot-loop { display: none; } }

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--good-wash);
  border: 1px solid var(--good-line);
  color: var(--good-text);
  font: 600 var(--fs-xs) var(--mono);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.badge-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
}

/* The favourite demo gets the full row: screenshot left, details right. */
.project-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-rows: repeat(4, auto) 1fr;
  gap: 10px 28px;
}

.project-featured .project-shot {
  grid-row: 1 / -1;
  margin-bottom: 0;
}

.project-featured .project-name {
  margin-top: var(--space-2);
}

.project-name {
  margin: 0;
  font: 600 var(--fs-md) var(--mono);
}

.project p {
  margin: 0;
  color: var(--soft);
}

/* What the visitor can open first (§8.8). After the h3, before the line. */
.project .project-kind {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0;
  color: var(--muted); font: var(--fs-xs) var(--mono);
}

.project .links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: auto; padding-top: 4px; font-weight: 500; }
.project .links a { display: inline-flex; align-items: center; min-height: 24px; text-decoration: none; }
.project .links a:hover {
  text-decoration: underline;
}

.also {
  margin: var(--space-7) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.also li {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.also .also-more {
  grid-template-columns: minmax(0, 1fr);
}

.also-name,
.also a {
  font: 500 var(--fs-sm) var(--mono);
}

.also-name {
  color: var(--text);
}

.also-desc {
  color: var(--muted);
}

.also-links {
  justify-self: end;
}

.also a { display: inline-flex; align-items: center; min-height: 24px; }

/* Skills and education */

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 56px;
}

.skills {
  margin: 0;
}

.skills div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: var(--space-4);
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.skills div:last-child {
  border-bottom: 1px solid var(--border);
}

.skills dt {
  padding-top: 3px;
  color: var(--muted);
  font: var(--fs-sm) var(--mono);
}

.skills dd {
  margin: 0;
}

.edu {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.edu h3 {
  margin: 0 0 6px;
  font-size: var(--fs-md);
  font-weight: 600;
}

.edu p {
  margin: 0 0 var(--space-2);
  color: var(--soft);
}

.edu .job-when {
  margin: 0;
}

/* Article pages (the /mcp/ case study) */

.post {
  max-width: var(--container-post);
  margin: 0 auto;
  padding: var(--space-9) var(--space-6) var(--space-10);
}

.post-back {
  margin: 0 0 36px;
  font: var(--fs-sm) var(--mono);
}

.post-back a,
.post-next a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--muted);
  text-decoration: none;
}

.post-back a:hover,
.post-next a:hover {
  color: var(--text);
}

.post h1 {
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

.case-study .eyebrow {
  margin-bottom: var(--space-3);
}

.case-facts {
  margin: 16px 0 0;
}

/* Who the case study is for (§8.18) */
.case-for {
  max-width: 34em;
  margin: 16px 0 0;
  color: var(--soft);
  font-size: var(--fs-md);
}

/* Two-row diagram: what runs, and what checks it (§8.18). Chevrons are empty ::before boxes. */
.flow-figure { margin: var(--space-4) 0 44px; }
.flow-label {
  margin: var(--space-4) 0 var(--space-2);
  color: var(--muted); font: var(--fs-xs) var(--mono);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 0; padding: 0; list-style-position: inside; }
.flow li {
  position: relative; padding: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--soft); font-size: var(--fs-sm);
}
.flow li::marker { color: var(--amber); font-family: var(--mono); }
#flow-runtime + .flow { list-style: none; }
.flow li + li::before {
  content: ""; position: absolute; top: 50%; left: -19px; width: 8px; height: 8px;
  border-top: 2px solid var(--faint); border-right: 2px solid var(--faint);
  transform: translateY(-50%) rotate(45deg);
}
.flow-figure figcaption { margin-top: var(--space-3); color: var(--muted); font-size: var(--fs-sm); }

.post-next {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  margin: var(--space-8) 0 0;
  font: var(--fs-sm) var(--mono);
}

.post-body {
  color: var(--soft);
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
}

.post-body p,
.post-body ol,
.post-body ul {
  margin: 0 0 1.1em;
}

.post-body li {
  margin: 0.35em 0;
}

.post-body li::marker {
  color: var(--faint);
}

.post-body h2 {
  margin: 2.2em 0 0.6em;
  color: var(--text);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: var(--lh-snug);
}

.post-body h3 {
  margin: 1.75em 0 0.35em;
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: var(--lh-snug);
}

.post-body code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 0.88em var(--mono);
}

.post-body pre {
  overflow-x: auto;
  margin: 0 0 1.1em;
  padding: var(--space-4) 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--soft);
  font: var(--fs-sm)/1.65 var(--mono);
}

.post-body pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

.post-body figure {
  margin: 1.6em 0;
}

.post-body figure pre {
  margin: 0;
}

.post-body figcaption {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.post-body .also {
  margin: 1.25em 0;
}

.post-body .also li {
  grid-template-columns: 200px minmax(0, 1fr);
  margin: 0;
}

.post-body .also-name {
  font: 500 var(--fs-base) var(--mono);
}

.post-body .also-desc {
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.6;
}

/* Contact */

.contact {
  border-bottom: 0;
  background: radial-gradient(700px 300px at 20% 100%, rgba(255, 180, 84, 0.06), transparent 70%);
}

.contact-email {
  margin: 0 0 28px;
  font-size: var(--fs-3xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  overflow-wrap: anywhere;
}

.contact-email a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.contact-email a:hover {
  color: var(--amber);
  text-decoration-color: var(--amber);
}

/* 404 */

.not-found {
  padding-top: 120px;
  padding-bottom: 120px;
}

.not-found .actions { margin-top: var(--space-6); }

.not-found h1 {
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

.not-found p {
  color: var(--soft);
}

.eyebrow {
  margin: 0;
  color: var(--amber);
  font: 500 var(--fs-sm) var(--mono);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: 28px;
  padding-bottom: 40px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

/* Footer links: 24 px targets, 44 px on phones (§8.16) */
.footer-links { display: flex; flex-wrap: wrap; gap: 0 var(--space-6); }
.footer-links a { display: inline-flex; align-items: center; min-height: 24px; }

.site-footer a:hover {
  color: var(--text);
}

/* Narrow screens */

@media (max-width: 1000px) { .site-nav { gap: var(--space-4); } }

@media (max-width: 980px) { .hero { padding: 40px 0 var(--space-8); } }

@media (max-width: 980px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }
}

@media (max-width: 860px) {
  .site-nav .nav-section { display: none; }
  .nav-sections { display: block; }
  .nav-sections-inner { display: flex; justify-content: space-between; }
  .nav-sections a {
    flex: 1 1 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--soft); text-decoration: none; font: 500 var(--fs-sm) var(--sans);
  }
  .nav-sections a:hover { color: var(--text); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .hero-jump { display: none; }   /* row 2's "Projects" does the same job */
  .glance { max-width: 560px; }

  .projects {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-featured {
    display: flex;
  }

  .project-featured .project-shot {
    margin-bottom: 6px;
  }

  .project-featured .project-name {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 var(--gutter);
  }

  .section {
    padding: var(--space-8) 0;
  }

  .job-more summary { min-height: 32px; line-height: 32px; }

  .hero { padding: var(--space-7) 0 40px; }
  .status { font-size: var(--fs-xs); }
  .lede { font-size: var(--fs-md); }
  .hero .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
  .hero .actions .btn { justify-content: center; padding: 0 var(--space-2); }
  .hero .actions .btn-resume { grid-column: 1 / -1; }
  .glance { max-width: none; padding: 16px; }
  .glance-list > div { grid-template-columns: 88px minmax(0, 1fr); }
  .glance-list > .glance-now,
  .glance-list > .glance-tools { display: none; }   /* needs the child selector to beat .glance-list > div */

  .project .links a { min-height: 44px; }
  .post-back a, .post-next a { min-height: 44px; }
  .not-found { padding-top: var(--space-9); padding-bottom: var(--space-9); }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .flow li + li::before { top: -15px; left: 50%; transform: translateX(-50%) rotate(135deg); }
  .site-footer-inner { flex-direction: column; }
  .footer-links a { min-height: 44px; }
  .also a { min-height: 44px; }
  .also-links { justify-self: start; }

  .also li,
  .post-body .also li,
  .skills div {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .timeline {
    padding-left: 26px;
  }

  .job::before {
    left: -26px;
  }

  .job-org {
    display: block;
  }
}

/* Print */

@media print {
  .site-header,
  .nav-sections,
  .site-footer,
  .actions,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* Wide project card (8.7): the last half-width card when their count is odd. */
.project-wide { grid-column: 1 / -1; display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  grid-template-rows: repeat(4, auto) 1fr; gap: 10px 28px; }
.project-wide .project-shot { grid-row: 1 / -1; margin-bottom: 0; }
@media (max-width: 860px) { .project-wide { display: flex; } .project-wide .project-shot { margin-bottom: 6px; } }

/* /mcp/ replay (PR 21): scripted tool calls, one line at a time. */
.replay { margin: var(--space-6) 0; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.replay-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.replay-label { margin: 0; color: var(--muted); font: 500 var(--fs-sm)/1.4 var(--mono); }
.replay-controls { display: flex; gap: 8px; }
.replay-controls button { min-height: 44px; min-width: 44px; padding: 6px 12px; font: inherit; font-size: var(--fs-sm); color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.replay-controls button:hover { border-color: var(--amber); }
.replay-screen { margin: 0; padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font: 12.5px/1.55 var(--mono); }
.rl-note { color: var(--dim); }
.rl-call { color: var(--text); }
.rl-meta { color: var(--teal); }
.rl-result { color: var(--good); }
.rl-hidden { visibility: hidden; }
