/* edwardplata.com. Tokens and rules: docs/BRIEF.md sections 2 and 5. Plain CSS, no build step. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* Tokens. Light is the default; `.dark` on <html> switches. */
:root {
  --bg: #f4f1ea;
  --surface: #ebe7dd;
  --fg: #15161a;
  --muted: #5c5a55;
  --border: #d9d4c8;
  --accent: #e2581f;
  --accent-ink: #b8441a;
  --on-accent: #f4f1ea;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --text-hero: clamp(3.25rem, 9vw, 10.5rem);
  --text-page: clamp(2.5rem, 6vw, 5.5rem);
  --text-h2: clamp(1.75rem, 3.2vw, 2.75rem);
  --text-h3: 1.375rem;
  --text-prose: 1.1875rem;
  --text-ui: 0.9375rem;
  --text-label: 0.75rem;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(6rem, 14vh, 11rem);
  --prose: 68ch;
  --radius-xs: 2px;
  --radius-sm: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 4.5rem;
  color-scheme: light;
}

.dark {
  --bg: #0e0f12;
  --surface: #16171b;
  --fg: #f1ede4;
  --muted: #9a978f;
  --border: #2a2b31;
  --accent: #ff6b2c;
  --accent-ink: #ff6b2c;
  --on-accent: #0e0f12;
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  background: var(--bg);
  color: var(--fg);
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-serif);
  font-size: var(--text-prose);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2 {
  font-family: var(--font-display);
  font-weight: 650;
  text-wrap: balance;
  line-height: 1.05;
}
h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-h3); line-height: 1.2; }
em, i { font-style: italic; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.muted { color: var(--muted); }

.container-site {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  /* iPhone in landscape: keep text clear of the notch and the rounded corners. */
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--accent-ink);
  color: var(--on-accent);
  border-radius: var(--radius-xs);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Header: hides on scroll down, returns on scroll up (site.js sets data-hidden / data-scrolled). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: transform 0.35s var(--ease), border-color 0.3s var(--ease);
}
.site-header[data-scrolled] { border-bottom-color: var(--border); }
.site-header[data-hidden] { transform: translateY(-100%); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  margin-right: auto;
}
.nav-list { display: flex; gap: 1.25rem; }
.nav-link, .more-link, .contact-links a, .prose-edward a { position: relative; }
.nav-link { color: var(--muted); transition: color 0.3s var(--ease); }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--fg); }

/* Two-bar underline: out to the right, in from the left. */
.nav-link::before, .nav-link::after,
.more-link::before, .more-link::after,
.contact-links a::before, .contact-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}
.nav-link::before, .more-link::before, .contact-links a::before { transform: scaleX(0); transform-origin: left; }
.nav-link::after, .more-link::after, .contact-links a::after { transform: scaleX(0); transform-origin: right; }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link:hover::before, .more-link:hover::before, .contact-links a:hover::before { transform: scaleX(1); }
.more-link::after, .contact-links a::after { transform: scaleX(1); }
.more-link:hover::after, .contact-links a:hover::after { transform: scaleX(0); }

.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  color: var(--muted);
}
.theme-toggle:hover { color: var(--fg); }
.theme-toggle span { grid-area: 1 / 1; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.icon-moon { opacity: 0; transform: rotate(-90deg); }
.dark .icon-sun { opacity: 0; transform: rotate(90deg); }
.dark .icon-moon { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 0.25rem 1rem; padding-block: 0.75rem; }
  .nav-list { order: 3; width: 100%; gap: 1rem; }
}

.site-footer { margin-top: var(--section); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-block: 2rem;
  color: var(--muted);
}

/* Shared pieces */
.page-title { font-size: var(--text-page); line-height: 0.95; letter-spacing: -0.03em; }
.lede { font-size: 1.375rem; line-height: 1.45; max-width: 52ch; color: var(--muted); margin-top: 1.25rem; }
.dek { font-style: italic; font-size: 1.375rem; line-height: 1.45; color: var(--muted); margin-top: 1.25rem; max-width: 52ch; }
.more { margin-top: 2.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.02em;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}
.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
}
.status[data-status="live"]::before, .status[data-status="active"]::before { background: var(--accent); }
.button-primary {
  background: var(--accent-ink);
  color: var(--on-accent);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-xs);
}

/* Home: lineage spine in the left gutter */
.lineage { position: relative; }
.spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--gutter) / 2 - 1px);
  width: 2px;
  height: 100%;
  overflow: visible;
  display: none;
}
.spine-track { stroke: var(--border); stroke-width: 1px; fill: none; }
.spine-edge { stroke: var(--accent); stroke-width: 1.5px; fill: none; }
@media (min-width: 1024px) { .spine { display: block; } }

.section-head { position: relative; }
.node {
  position: absolute;
  left: calc(var(--gutter) / -2 - 5px);
  top: 0.05rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  display: none;
  transition: background-color 0.3s var(--ease);
}
@media (min-width: 1024px) { .node { display: block; } }
.spine-live [data-node]:not(.is-lit) .node { background: var(--bg); }
.node-label { color: var(--accent-ink); }
.section-head h2 { font-size: var(--text-h2); margin-top: 0.75rem; }

.hero { padding-block: clamp(4rem, 12vh, 9rem) var(--section); }
.hero-title {
  font-size: var(--text-hero);
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin-top: 1.5rem;
}
.hero-line { display: block; }
.runlog { margin-top: 2.5rem; color: var(--muted); text-transform: none; }
@media (min-width: 1024px) { .runlog { margin-left: 50%; } }

.section { padding-bottom: var(--section); }
.section-head + * { margin-top: 2.5rem; }

/* Project rows (index rows, not cards) */
.project-rows { border-top: 1px solid var(--border); }
.project-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.5rem 1.5rem;
  padding: 1.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s var(--ease);
}
.project-row:hover { background: var(--surface); }
.row-num { color: var(--muted); padding-top: 0.6rem; }
.row-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--text-h2);
  line-height: 1.05;
  transition: transform 0.3s var(--ease);
}
.row-arrow {
  display: inline-block;
  margin-left: 0.5rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-0.5rem);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.project-row:hover .row-title { transform: translateX(6px); }
.project-row:hover .row-arrow { opacity: 1; transform: none; }
.row-summary { display: block; color: var(--muted); margin-top: 0.5rem; max-width: 62ch; }
.row-side { grid-column: 2; }
@media (min-width: 900px) {
  .project-row { grid-template-columns: 4rem 1fr 10rem; }
  .row-side { grid-column: 3; text-align: right; padding-top: 0.6rem; }
}

/* Post rows: date column + title/dek */
.post-rows { border-top: 1px solid var(--border); }
.post-row {
  display: grid;
  gap: 0.5rem 2rem;
  padding: 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s var(--ease);
}
.post-row:hover { background: var(--surface); }
.post-meta { color: var(--muted); padding-top: 0.35rem; }
.post-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: var(--text-h3); line-height: 1.2; }
.post-dek { display: block; color: var(--muted); margin-top: 0.35rem; }
@media (min-width: 900px) { .post-row { grid-template-columns: 1fr 2fr; } }

.contact-links { display: flex; flex-wrap: wrap; gap: 1rem 2rem; font-size: 1rem; }
.contact-links .label { font-size: 0.875rem; }

/* Motion pre-state: hide text that motion.js reveals, only when JS will run it (html.motion).
   Failsafe: show it after 2.5 s if the script never ran. */
.motion [data-hero], .motion [data-title], .motion [data-runlog] {
  visibility: hidden;
  animation: motion-failsafe 0s 2.5s forwards;
}
.motion .motion-ready { visibility: visible; animation: none; }
@keyframes motion-failsafe { to { visibility: visible; } }

/* Reading pages */
.reading-page { padding-top: clamp(3rem, 8vh, 6rem); }
.reading-page > .page-title { margin-top: 1rem; margin-bottom: 3rem; }
.reading-page .lede { margin-bottom: 3rem; margin-top: -1.5rem; }
.year-group { display: grid; gap: 1rem; padding-block: 2rem; border-top: 1px solid var(--border); }
.year { font-size: var(--text-h2); color: var(--muted); }
@media (min-width: 1024px) {
  .year-group { grid-template-columns: 12rem 1fr; }
  .year { position: sticky; top: 6rem; align-self: start; }
}
.blog-row {
  display: grid;
  gap: 0.35rem 1.5rem;
  padding: 1.25rem 0.75rem;
  border-radius: var(--radius-xs);
  transition: background-color 0.3s var(--ease);
}
.blog-row:hover { background: var(--surface); }
.blog-row time, .blog-row > .muted { color: var(--muted); padding-top: 0.35rem; }
.blog-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-h3); line-height: 1.2; }
.blog-row .tags { margin-top: 0.25rem; }
@media (min-width: 900px) {
  .blog-row { grid-template-columns: 8rem 1fr 5rem; }
  .blog-row .tags { grid-column: 2 / -1; }
}

/* Post page */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 60;
}
.post-grid, .case-grid {
  display: grid;
  gap: 3rem;
  padding-top: clamp(3rem, 8vh, 6rem);
}
.post-header .page-title, .case-header .page-title { margin-top: 1rem; }
.post-aside, .case-aside { display: none; }
.post-footer { border-top: 1px solid var(--border); padding-top: 2rem; display: grid; gap: 1rem; max-width: var(--prose); }
.post-footer a:not(.more-link) { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1280px) {
  .post-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 2rem; }
  .post-header, .post-body, .post-footer { grid-column: 3 / span 8; }
  .post-aside { display: block; grid-column: 11 / span 2; grid-row: 2; }
}

.toc { position: sticky; top: 6rem; font-size: 0.9375rem; line-height: 1.4; }
.toc ol { margin-top: 0.75rem; border-left: 1px solid var(--border); position: relative; }
.toc li a { display: block; padding: 0.35rem 0 0.35rem 0.9rem; color: var(--muted); transition: color 0.3s var(--ease); }
.toc li.toc-sub a { padding-left: 1.6rem; font-size: 0.875rem; }
.toc li a:hover, .toc li a[aria-current="true"] { color: var(--fg); }
.toc li a[aria-current="true"] { box-shadow: inset 2px 0 0 var(--accent); margin-left: -1px; }

/* Case study */
.case-meta { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; margin-top: 1.5rem; }
.case-meta a { color: var(--accent-ink); }
.case-posts { max-width: var(--prose); }
/* "At a glance" strip under a case-study title */
.glance { display: grid; gap: 1rem; margin-top: 2rem; padding: 1.25rem 1.5rem; max-width: 62rem; background: var(--surface); border-left: 2px solid var(--accent); border-radius: var(--radius-xs); font-size: 1.0625rem; }
.glance > div { display: grid; gap: 0.25rem 1.5rem; }
.glance dt { color: var(--muted); padding-top: 0.3rem; }
.glance ul { list-style: none; display: grid; gap: 0.4rem; }
.glance li::before { content: "▸ "; color: var(--accent); font-family: var(--font-mono); }
@media (min-width: 800px) { .glance > div { grid-template-columns: 6rem 1fr; } }
.case-posts h2 { margin-bottom: 1.5rem; color: var(--muted); }
@media (min-width: 1024px) {
  .case-grid { grid-template-columns: 14rem minmax(0, 1fr); column-gap: 4rem; }
  .case-header { grid-column: 1 / -1; }
  .case-aside { display: block; grid-column: 1; }
  .case-body, .case-posts { grid-column: 2; }
}

/* About */
.about-grid { display: grid; gap: 3rem; padding-top: clamp(3rem, 8vh, 6rem); }
.monogram {
  width: 6rem;
  height: 6rem;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.25rem;
  border-radius: var(--radius-xs);
}
.facts { display: grid; gap: 1rem; margin-top: 2rem; font-size: 1rem; }
.facts dt { color: var(--muted); }
.about-main .prose-edward { margin-top: 2.5rem; }
@media (min-width: 1024px) {
  .about-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 2rem; }
  .about-side { grid-column: 1 / span 4; position: sticky; top: 7rem; align-self: start; }
  .about-main { grid-column: 6 / span 7; }
}

/* Resume */
.resume { padding-top: clamp(3rem, 8vh, 6rem); }
.resume > * { max-width: 1100px; }
.resume-header .label { margin-top: 0.75rem; }
.resume-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem; }
.resume-summary { margin-top: 2.5rem; max-width: var(--prose); }
.resume-section { margin-top: 4rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.resume-section > h2 { color: var(--muted); margin-bottom: 1.5rem; }
.job { display: grid; gap: 0.25rem 2rem; padding-block: 1.25rem; }
.job-company { color: var(--muted); margin-top: 0.15rem; }
.job-scope { color: var(--accent-ink); margin-top: 0.6rem; text-transform: none; letter-spacing: 0.02em; }
.job ul { margin-top: 0.75rem; list-style: disc; padding-left: 1.2em; font-size: 1.0625rem; }
.job li + li { margin-top: 0.4em; }
.skills { display: grid; gap: 1rem; }
.skills > div { display: grid; gap: 0.25rem 2rem; }
.skills dt { color: var(--muted); padding-top: 0.3rem; }
.resume .contact-links { margin-top: 4rem; }
@media (min-width: 800px) {
  .job, .skills > div { grid-template-columns: 12rem 1fr; }
  .job-dates { padding-top: 0.45rem; }
}

/* 404 */
.not-found { padding-top: clamp(4rem, 12vh, 9rem); }
.error-line {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(1.5rem, 4vw, 3rem);
  line-height: 1.2;
  margin-top: 1rem;
  overflow-wrap: anywhere;
}
.error-line span { color: var(--accent-ink); }
.not-found p:last-child { margin-top: 2.5rem; display: flex; gap: 2rem; }

/* Prose (Markdown bodies) */
.prose-edward { max-width: var(--prose); min-width: 0; }
.prose-edward > * + * { margin-top: 1.25em; }
.prose-edward h2 { font-size: var(--text-h2); margin-top: 2.5em; scroll-margin-top: 6rem; }
.prose-edward h3 { margin-top: 2em; scroll-margin-top: 6rem; }
.prose-edward a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose-edward ul, .prose-edward ol { padding-left: 1.4em; }
.prose-edward ul { list-style: disc; }
.prose-edward ol { list-style: decimal; }
.prose-edward li + li { margin-top: 0.4em; }
.prose-edward blockquote { border-left: 2px solid var(--accent); padding-left: 1em; color: var(--muted); }
.prose-edward hr { border: 0; border-top: 1px solid var(--border); }
.prose-edward :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-xs);
}
.prose-edward table { width: 100%; border-collapse: collapse; font-size: var(--text-ui); display: block; overflow-x: auto; }
.prose-edward th, .prose-edward td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose-edward th { font-family: var(--font-mono); font-size: var(--text-label); text-transform: uppercase; letter-spacing: 0.08em; }
.prose-edward .anchor-link { margin-left: 0.4em; opacity: 0; color: var(--muted); text-decoration: none; }
.prose-edward :is(h2, h3):hover .anchor-link, .prose-edward .anchor-link:focus-visible { opacity: 1; }

/* Code blocks (highlighted at build time; colours in /syntax.css) */
.code {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-block: 1.5em;
}
.code-label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--muted);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.code pre { overflow-x: auto; padding: 1rem; font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6; }
.code code { font-family: inherit; }
.code-copy { position: absolute; top: 0.35rem; right: 0.5rem; padding: 0.25rem 0.5rem; color: var(--muted); }
.code-copy:hover { color: var(--fg); }

/* Mermaid diagrams (drawn in the browser by /js/mermaid-init.js) */
.mermaid-figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
}
.mermaid:not([data-processed]) { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); white-space: pre; }
.mermaid svg { margin-inline: auto; height: auto; }
/* Mermaid's SVG uses its own `.label` class: undo the site's mono label style inside diagrams. */
.mermaid .label { font-family: inherit; font-size: inherit; letter-spacing: normal; text-transform: none; font-weight: inherit; }

/* ---- Wayfinding and touch (UX pass 2026-10-28) ---- */

/* Hit areas: at least 24 px tall everywhere, 44 px on touch screens. The padding grows the
   hit area; the negative margin keeps the layout where it was. */
:root { --hit: 5px; }
@media (pointer: coarse) { :root { --hit: 15px; } }
.nav-link, .more-link, .contact-links a, .crumb, .footer-link {
  display: inline-block;
  padding-block: var(--hit);
  margin-block: calc(-1 * var(--hit));
}
.nav-link::before, .nav-link::after,
.more-link::before, .more-link::after,
.contact-links a::before, .contact-links a::after { bottom: calc(var(--hit) - 4px); }
@media (pointer: coarse) {
  .nav-link { padding-inline: 4px; margin-inline: -4px; }
  .theme-toggle { width: 2.75rem; height: 2.75rem; }
  /* Pills and list links: a larger invisible tap area, same look. */
  a.tag, .toc-mobile li a { position: relative; }
  a.tag::after, .toc-mobile li a::after { content: ""; position: absolute; inset: -9px 0; }
  .tags { gap: 0.75rem 0.5rem; }
}
.brand { display: inline-block; padding-block: var(--hit); margin-block: calc(-1 * var(--hit)); }

/* Theme toggle icons (SVG) */
.theme-toggle svg { display: block; }

/* Touch screens have no hover, so show the row arrow all the time. */
@media (hover: none) {
  .row-arrow { opacity: 1; transform: none; }
}

/* Breadcrumb line above a title */
.crumb-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.4rem; }
.crumb { color: var(--accent-ink); }
.crumb:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Tags are links; the project stack is plain text. */
a.tag { transition: border-color 0.3s var(--ease), color 0.3s var(--ease); }
a.tag:hover { border-color: var(--accent); color: var(--fg); }
.tags { position: relative; z-index: 1; }
.stack { margin-top: 1rem; text-transform: none; letter-spacing: 0.02em; line-height: 1.7; }
.blog-rows > li { padding-bottom: 0.25rem; }
.blog-rows > li > .tags { margin: -0.5rem 0 0.75rem; padding-inline: 0.75rem; }
@media (min-width: 900px) { .blog-rows > li > .tags { padding-left: calc(8rem + 2.25rem); } }

/* First outcome line in project rows */
.row-outcome { display: block; margin-top: 0.6rem; color: var(--accent-ink); text-transform: none; letter-spacing: 0.02em; }

/* Hero: one line of who + two actions */
.hero-intro { margin-top: 2.5rem; max-width: 46rem; }
.hero-lede { color: var(--muted); font-size: 1.25rem; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 1.5rem; }

/* Pager and related cards at the end of posts and case studies */
.pager { display: grid; gap: 1rem; }
@media (min-width: 700px) { .pager { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pager-card, .related-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.pager-card:hover, .related-card:hover { background: var(--surface); border-color: var(--accent); }
.pager-card[rel="next"] { text-align: right; }
@media (min-width: 700px) { .pager-card[rel="next"]:only-child { grid-column: 2; } }
.pager-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-h3); line-height: 1.2; }
.pager-meta { color: var(--muted); font-size: 1rem; line-height: 1.5; }
.post-footer a.related-card, .post-footer a.pager-card { color: inherit; text-decoration: none; }
.post-footer { max-width: var(--prose); gap: 1.5rem; }
.case-footer { display: grid; gap: 1.5rem; max-width: var(--prose); padding-top: 1rem; }
.case-footer .pager { grid-template-columns: 1fr; }
.case-footer .pager-card[rel="next"]:only-child { grid-column: auto; text-align: left; }
@media (min-width: 1024px) { .case-footer { grid-column: 2; } }

/* Fold-out table of contents on small screens */
.toc-mobile { margin-top: 1.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.toc-mobile summary { cursor: pointer; padding: 0.9rem 1rem; color: var(--muted); list-style: none; display: flex; justify-content: space-between; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; font-size: 1rem; }
.toc-mobile[open] summary::after { content: "−"; }
.toc-mobile ol { padding: 0 1rem 1rem; font-size: 1rem; }
.toc-mobile li a { display: block; padding: 0.45rem 0; color: var(--muted); }
.toc-mobile li.toc-sub a { padding-left: 1rem; font-size: 0.9375rem; }
@media (min-width: 1280px) { .post-header .toc-mobile { display: none; } }
@media (min-width: 1024px) { .case-header .toc-mobile { display: none; } }

/* Site footer */
.footer-grid { display: grid; gap: 2rem; padding-top: 3rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); max-width: 40rem; margin-inline: 0; }
.footer-list { display: grid; gap: 0.6rem; margin-top: 0.9rem; font-size: 1rem; }
.footer-link { color: var(--fg); }
.footer-link:hover { color: var(--accent-ink); }
.site-footer .footer-inner { border-top: 1px solid var(--border); margin-top: 2.5rem; }

/* Moving between pages: a short cross-fade; the header stays put. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Reduced motion: no transitions anywhere. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reading-progress { display: none; }
}

/* Print (resume): light tokens, no chrome. */
@media print {
  :root, .dark {
    --bg: #fff; --surface: #fff; --fg: #15161a; --muted: #5c5a55; --border: #d9d4c8;
    --accent: #e2581f; --accent-ink: #b8441a; --on-accent: #fff;
  }
  .site-header, .site-footer, .skip-link, .reading-progress, [data-print], .theme-toggle { display: none !important; }
  body { font-size: 11pt; }
  .resume { padding-top: 0; }
  .resume-section { margin-top: 1.5rem; break-inside: auto; }
  .job { break-inside: avoid; }
  a { text-decoration: none; }
}

/* Diff blocks hold prose (resume bullets), so wrap lines instead of scrolling sideways on a phone. */
.code[data-lang="diff"] pre { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Task lists: the checkbox is the marker, so drop the bullet. */
.prose-edward ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: 0; }
.prose-edward li > input[type="checkbox"] { accent-color: var(--accent); width: 1em; height: 1em; margin: 0 0.6em 0 0; vertical-align: -0.1em; }
