/* ==========================================================================
   justmazz: "annotated disassembly"
   Layered near-black surfaces, hairline rules, one amber accent (the color
   of a highlighted line in a debugger), mono as a design material.
   ========================================================================== */

/* ---------- fonts: self-hosted latin subsets (see .eleventy.js) ----------
   Same-origin and preloaded in base.njk, so the UI fonts are ready before
   first paint and pages don't flash the fallback font on navigation. */
@font-face { font-family: "Azeret Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/azeret-mono-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Azeret Mono"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("/fonts/azeret-mono-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 100 700; font-display: swap; src: url("/fonts/ibm-plex-sans-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;

  /* surfaces: one cool hue, four depths */
  --bg: #0a0b10;
  --bg-raise: #0e1016;
  --surface: #12141c;
  --surface-2: #181b25;
  --code-bg: #0c0e14;

  /* hairlines */
  --line: rgba(196, 204, 228, 0.085);
  --line-strong: rgba(196, 204, 228, 0.16);

  /* ink */
  --ink: #e7e9f0;
  --ink-soft: #b4b9c8;
  --ink-mute: #7f8598;
  --ink-faint: #4f5466;

  /* accent (--accent-rgb must match --accent; used for translucent tints) */
  --accent: #f4b45f;
  --accent-strong: #ffc87d;
  --accent-ink: #1b1305;
  --accent-rgb: 244, 180, 95;
  --accent-dim: rgba(var(--accent-rgb), 0.12);
  --accent-line: rgba(var(--accent-rgb), 0.38);
  /* secondary ambient glow (top-right of the page) */
  --glow-rgb: 111, 198, 216;

  /* component surfaces */
  --header-bg: rgba(10, 11, 16, 0.78);
  --dump-bg: linear-gradient(180deg, rgba(24, 27, 37, 0.85), rgba(14, 16, 22, 0.92));
  --dump-hex: #8b91a5;
  --code-ink: #cfd3df;

  /* category marks */
  --cat-vibe-coded: #f4b45f;
  --cat-re-with-ai: #6fc6d8;
  --cat-sans-ai: #e98d70;
  --cat-thoughts: #aab7cd;

  /* type */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Azeret Mono", ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --font-code: "IBM Plex Mono", ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  --step--2: 0.6875rem;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
  --step-4: clamp(1.875rem, 1.4rem + 2.2vw, 2.75rem);
  --step-5: clamp(2.5rem, 1.6rem + 4.6vw, 4.75rem);

  --tracking-micro: 0.14em;

  /* shape + depth */
  --radius: 16px;
  --radius-sm: 9px;
  --shadow-soft:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 8px 24px -12px rgba(0, 0, 0, 0.55);
  --shadow-raised:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 18px 48px -18px rgba(0, 0, 0, 0.7),
    0 40px 80px -40px rgba(var(--accent-rgb), 0.08);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 220ms;

  --shell: 1344px;
  --shell-narrow: 740px;
  --gutter: clamp(1.25rem, 3.35vw, 3rem);
  --header-h: 64px;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  background:
    radial-gradient(1100px 620px at 8% -8%, rgba(var(--accent-rgb), 0.075), transparent 62%),
    radial-gradient(900px 700px at 105% 18%, rgba(var(--glow-rgb), 0.045), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { flex: 1; outline: none; }
img, svg { display: block; max-width: 100%; }
.icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
p, ul, ol, dl, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
::selection { background: rgba(var(--accent-rgb), 0.28); color: #fff; }

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

html { scrollbar-color: var(--surface-2) var(--bg); scrollbar-width: thin; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 0.75rem; }

.shell {
  width: 100%;
  max-width: calc(var(--shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell-narrow { max-width: calc(var(--shell-narrow) + var(--gutter) * 2); }

/* ---------- shared atoms ---------- */
.kicker,
.section-label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--ink-mute);
}
.kicker-accent { color: var(--accent); }
.prompt { color: var(--accent); opacity: 0.85; }
/* section label marker: a static echo of the wordmark's blinking caret */
.mark { flex-shrink: 0; align-self: center; width: 0.5rem; height: 0.8rem; background: var(--accent); opacity: 0.85; }

.cat {
  --cat-color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color var(--dur) var(--ease-out);
}
.cat::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 1px;
  background: var(--cat-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--cat-color) 55%, transparent);
}
a.cat:hover { color: var(--ink); }
.cat-vibe-coded { --cat-color: var(--cat-vibe-coded); }
.cat-re-with-ai { --cat-color: var(--cat-re-with-ai); }
.cat-sans-ai { --cat-color: var(--cat-sans-ai); }
.cat-thoughts { --cat-color: var(--cat-thoughts); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0 1.15rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.btn .icon-arrow-right { transition: transform var(--dur) var(--ease-out); }
.btn:hover .icon-arrow-right { transform: translateX(3px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 28px -12px rgba(var(--accent-rgb), 0.55);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.015);
}
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent-strong); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--accent);
  transition: color var(--dur) var(--ease-out);
}
.text-link:hover { color: var(--accent-strong); }
.text-link .icon-arrow-right { transition: transform var(--dur) var(--ease-out); }
.text-link:hover .icon-arrow-right { transform: translateX(3px); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.wordmark-prompt { color: var(--accent); margin-right: 0.15em; }
.wordmark-caret {
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.2em;
  background: var(--accent);
  opacity: 0.85;
  animation: caret 1.1s steps(1, end) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.nav-toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  margin-right: -10px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle-close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-close { display: inline-flex; }

.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  list-style: none;
}
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  min-height: 44px;
  align-items: center;
  padding: 0 0.8rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.nav-index { font-size: var(--step--2); color: var(--ink-faint); font-variant-numeric: tabular-nums; transition: color var(--dur) var(--ease-out); }
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }
.nav-link[aria-current] { color: var(--ink); }
.nav-link[aria-current] .nav-index { color: var(--accent); }
.nav-link[aria-current]::after {
  content: "";
  position: absolute;
  left: 0.8rem; right: 0.8rem; bottom: 8px;
  height: 1px;
  background: var(--accent);
}

/* ---------- theme picker ---------- */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}
.no-js .theme-picker { display: none; }
.theme-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 34px;
  min-height: 34px;
  padding: 0 0.4rem;
  font: 500 var(--step--1) var(--font-mono);
  color: var(--ink-mute);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.theme-option:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-option[aria-pressed="true"] { color: var(--ink); border-color: var(--accent-line); }
.theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-bg) 50%, var(--sw-accent) 50%);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.theme-picker .theme-option[hidden] { display: none; }
/* themed tooltip: replaces the native title tooltip on the swatches */
.tip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  font: 500 var(--step--2) / 1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
  pointer-events: none;
}
.tip::before {
  /* the same cursor block used on section labels */
  content: "";
  flex-shrink: 0;
  width: 0.4rem;
  height: 0.65rem;
  background: var(--accent);
  opacity: 0.85;
}
.tip::after {
  /* pointer up toward the swatch */
  content: "";
  position: absolute;
  top: -5px;
  right: 12px;
  width: 8px;
  height: 8px;
  background: var(--surface-2);
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.theme-option:focus-visible .tip { opacity: 1; transform: none; }
@media (hover: hover) {
  .theme-option:hover .tip { opacity: 1; transform: none; }
}
@media (min-width: 760px) {
  .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 759.98px) {
  .tip { display: none; }
}

@media (max-width: 759.98px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: grid-template-rows 320ms var(--ease-out), visibility 0s linear 320ms, border-color 320ms;
  }
  .js .site-header.is-open .site-nav {
    grid-template-rows: 1fr;
    visibility: visible;
    border-bottom-color: var(--line);
    transition: grid-template-rows 320ms var(--ease-out), visibility 0s, border-color 320ms;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  }
  .js .site-nav-inner {
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-inline: var(--gutter);
  }
  .js .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding-top: 0.5rem; }
  .js .nav-link {
    display: flex;
    min-height: 54px;
    padding: 0;
    font-size: var(--step-1);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .js .nav-link:hover { background: transparent; }
  .js .nav-link[aria-current]::after { display: none; }
  .js .nav-link[aria-current] { color: var(--accent); }
  .js .theme-picker { flex-wrap: wrap; gap: 0.5rem; padding: 1rem 0 1.25rem; border-left: 0; }
  .js .theme-option { min-height: 44px; padding: 0 0.9rem; border-color: var(--line-strong); }
  .js .theme-option[aria-pressed="true"] { border-color: var(--accent-line); }

  /* no JS: keep everything reachable, just compact */
  .no-js .header-inner { flex-wrap: wrap; padding-block: 0.5rem; }
  .no-js .nav-link { padding: 0 0.6rem; }
}

/* ---------- page heads ---------- */
.page-head {
  position: relative;
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2.25rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}
.page-head .kicker { margin-bottom: 1.25rem; }
.page-title {
  font-size: var(--step-5);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  max-width: 18ch;
}
.page-lead {
  margin-top: 1.5rem;
  max-width: 60ch;
  font-size: var(--step-1);
  line-height: 1.65;
  color: var(--ink-soft);
}

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-label, .kicker:has(> .mark) { display: flex; gap: 0.75rem; }
.section-title { font-size: var(--step-3); margin-top: 0.6rem; }

/* ---------- home: hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}
.hero::before {
  /* faint measurement grid, anchored top right, fading out */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 10%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}
.hero-name {
  font-size: var(--step-5);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.98;
}
/* "Just" + "Mazz" spell the handle */
.hero-handle { color: var(--accent); }
.hero-tagline {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.9;
  color: var(--ink-mute);
}
.hero-tagline .seg { white-space: nowrap; }
.hero-tagline .sep { color: var(--ink-faint); margin-right: 0.4em; margin-left: 0.15em; }
.hero-tagline .hl {
  color: var(--accent);
  text-decoration: line-through;
  text-decoration-color: rgba(var(--accent-rgb), 0.45);
  text-decoration-thickness: 1px;
}
.hero-hook {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: var(--step-1);
  line-height: 1.65;
  color: var(--ink-soft);
}
.hero-hook strong { color: var(--ink); font-weight: 500; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* hex dump panel */
.dump {
  position: relative;
  font-family: var(--font-mono);
  background: var(--dump-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
}
.dump-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}
.dump-bar span:first-child { color: var(--ink-soft); }
.dump-body {
  margin: 0;
  padding: 1rem 1rem 1.1rem;
  font-size: clamp(0.5rem, 1.95cqi, 0.8rem);
  line-height: 1.85;
  display: grid;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.dump-row { display: flex; gap: 1.1em; white-space: pre; }
.dump-off { color: var(--ink-mute); opacity: 0.75; }
.dump-hex { color: var(--dump-hex); }
.dump-asc { color: var(--ink-mute); }
.dump-gap { color: var(--ink-faint); }
.dump-row.is-hot .dump-hex { color: var(--ink-soft); }
.dump-row.is-hot .dump-asc { color: var(--accent); }
.dump-row.is-hot { position: relative; }
.dump-row.is-hot::before {
  content: "";
  position: absolute;
  inset: 0 -1rem;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.075), transparent 85%);
  pointer-events: none;
}
.dump-foot {
  display: flex;
  gap: 1.25rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line);
  font-size: var(--step--2);
  color: var(--ink-mute);
}
.dump-foot b { color: var(--ink-soft); font-weight: 500; }

.dump { container-type: inline-size; }
@container (max-width: 500px) {
  .dump-body { font-size: clamp(0.5rem, 2.75cqi, 0.8rem); }
  .dump-hex-hi { display: none; }
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .dump { transform: perspective(1400px) rotateY(-5deg) rotateX(2deg); transform-origin: left center; }
}

/* ---------- post rows (home + blog) ---------- */
.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.post-row { border-bottom: 1px solid var(--line); }
.post-row[hidden] { display: none; }
.post-link {
  position: relative;
  display: grid;
  gap: 0.6rem;
  padding: 1.6rem 0;
  transition: background-color var(--dur) var(--ease-out);
}
.post-link::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -0.5);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  pointer-events: none;
}
.post-link:hover::before { opacity: 1; }
.post-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
}
.post-date {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.post-row-title {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.3;
  transition: color var(--dur) var(--ease-out);
}
.post-link:hover .post-row-title { color: var(--accent-strong); }
.post-excerpt {
  max-width: 64ch;
  color: var(--ink-soft);
  line-height: 1.65;
}
.post-go {
  display: none;
  color: var(--ink-faint);
  transition: color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.post-link:hover .post-go { color: var(--accent); transform: translateX(4px); }

@media (min-width: 760px) {
  .post-link {
    grid-template-columns: 9.5rem minmax(0, 1fr) auto;
    grid-template-areas: "date body go";
    column-gap: 2rem;
    align-items: start;
    padding: 2rem 0;
  }
  .post-link > .post-date { grid-area: date; padding-top: 0.3rem; }
  .post-body { grid-area: body; display: grid; gap: 0.6rem; }
  .post-go { grid-area: go; display: block; padding-top: 0.35rem; }
  .post-link .post-meta-line .post-date { display: none; }
  .post-link > .post-date { display: block; }
}
@media (max-width: 759.98px) {
  .post-link > .post-date { display: none; }
  .post-body { display: grid; gap: 0.6rem; }
}

/* ---------- home: categories (one xmm0, four 32-bit lanes) ---------- */
.lanes-sub {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-mute);
}
.lanes {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
  overflow: hidden;
}
.lanes-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.5rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}
.lanes-reg { color: var(--accent); }
.cat-grid {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
}
.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  min-height: 13rem;
  padding: 1.5rem;
  background: var(--bg-raise);
  transition: background-color var(--dur) var(--ease-out);
  overflow: hidden;
}
.cat-tile:focus-visible { outline-offset: -3px; }
.cat-tile:hover, .cat-tile:focus-visible { background: var(--surface); }
.cat-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1rem;
}
.cat-tile-op {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--ink-faint);
  transition: color var(--dur) var(--ease-out);
}
.cat-tile:hover .cat-tile-op, .cat-tile:focus-visible .cat-tile-op { color: var(--accent); }
/* lane index watermark: element number within xmm0 */
.cat-tile-lane {
  position: absolute;
  right: 1rem; bottom: -1.1rem;
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--ink) 4%, transparent);
  pointer-events: none;
  transition: color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.cat-tile:hover .cat-tile-lane,
.cat-tile:focus-visible .cat-tile-lane { color: rgba(var(--accent-rgb), 0.12); transform: translateY(-0.25rem); }
.cat-tile-name {
  font-size: var(--step-2);
  font-weight: 600;
  transition: color var(--dur) var(--ease-out);
}
.cat-tile:hover .cat-tile-name, .cat-tile:focus-visible .cat-tile-name { color: var(--accent-strong); }
.cat-tile-blurb { color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.6; max-width: 32ch; }
.cat-tile-count {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.cat-tile .icon-arrow-right { transition: transform var(--dur) var(--ease-out); }
.cat-tile:hover .icon-arrow-right,
.cat-tile:focus-visible .icon-arrow-right { transform: translateX(3px); color: var(--accent); }
/* lanes with no posts yet: not a link, no hover, just "Soon" */
.cat-tile.is-empty { pointer-events: none; }
.cat-tile.is-empty .cat-tile-name { color: var(--ink-soft); }
.cat-tile.is-empty .cat-tile-count { color: var(--ink-faint); }

@media (min-width: 600px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- home: closing band ---------- */
.band {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(var(--accent-rgb), 0.07), transparent 70%),
    var(--bg-raise);
  box-shadow: var(--shadow-soft);
}
.band-title { font-size: var(--step-3); max-width: 26ch; margin-top: 0.6rem; }
.band-title + p { color: var(--ink-soft); max-width: 58ch; margin-top: 0.75rem; }
@media (min-width: 860px) {
  .band { grid-template-columns: 1fr auto; align-items: center; gap: 3rem; }
}

/* ---------- blog: filters ---------- */
.filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-block: 1.75rem 1.5rem;
}
.filter-group {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  margin-inline: calc(var(--gutter) * -1);
  padding: 0.25rem var(--gutter);
  scrollbar-width: none;
}
.filter-group::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0 1rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}
.filter-btn:hover { color: var(--ink); border-color: rgba(196, 204, 228, 0.28); }
.filter-btn[aria-pressed="true"] {
  color: var(--accent-strong);
  background: var(--accent-dim);
  border-color: var(--accent-line);
}
.filter-btn .cat-swatch {
  width: 7px; height: 7px; border-radius: 1px;
  background: var(--cat-color, var(--ink-mute));
}
.filter-count {
  font-size: var(--step--2);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.filter-btn[aria-pressed="true"] .filter-count { color: var(--accent); }
.no-js .filters { display: none; }
.filter-status {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.filter-status b { color: var(--ink-soft); font-weight: 500; }
@media (min-width: 760px) {
  .filters { flex-direction: row; align-items: center; justify-content: space-between; }
  .filter-group { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
}

/* ---------- empty state ---------- */
.empty {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  margin-block: 1rem 2rem;
  padding: 2.25rem clamp(1.25rem, 4vw, 2.25rem);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raise);
}
.empty[hidden] { display: none; }
.empty-standalone { margin-top: 2.5rem; }
.list-end { height: clamp(3rem, 7vw, 5rem); }
.empty .icon { color: var(--accent); }
.empty-title { font-size: var(--step-2); }
.empty p { color: var(--ink-soft); max-width: 52ch; }
.empty-btn {
  margin-top: 0.5rem;
  min-height: 44px;
  padding: 0 1rem;
  font: 500 var(--step--1) var(--font-mono);
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.empty-btn:hover { background: var(--accent-dim); }

/* ---------- about ---------- */
.about-layout {
  display: grid;
  gap: 3rem;
  padding-block: clamp(3rem, 7vw, 5rem);
}
@media (min-width: 980px) {
  .about-layout { grid-template-columns: minmax(0, var(--shell-narrow)) 18rem; justify-content: space-between; gap: 5rem; }
  .facts { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
}
.facts {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.facts-head {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.facts dl { display: grid; }
.facts dl > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.facts dl > div:last-child { border-bottom: 0; }
.facts dt {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--ink-mute);
}
.facts dd { margin: 0; font-size: 0.9375rem; color: var(--ink); }
.facts dd small { display: block; color: var(--ink-mute); font-size: var(--step--1); }
.facts dd a { color: var(--accent); }
.facts dd a:hover { color: var(--accent-strong); }
.facts .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.chapter + .chapter { margin-top: clamp(3rem, 6vw, 4.5rem); }
.chapter-head { margin-bottom: 1.25rem; }
.chapter-head .section-label { margin-bottom: 0.6rem; }
.chapter-title { font-size: var(--step-3); }

.timeline {
  position: relative;
  margin: 2rem 0 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 4px; top: 0.6rem; bottom: 0.6rem;
  width: 1px;
  background: linear-gradient(180deg, var(--accent-line), var(--line-strong) 30%, var(--line) 100%);
}
.tl-item { position: relative; padding-bottom: 2.25rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem + 0.5px);
  top: 0.45rem;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--bg);
  border: 1px solid var(--ink-mute);
}
.tl-item.is-current::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim), 0 0 18px rgba(var(--accent-rgb), 0.45);
}
.tl-dates {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.tl-item.is-current .tl-dates { color: var(--accent); }
.tl-role { margin-top: 0.35rem; font-size: var(--step-1); font-weight: 600; }
.tl-org { color: var(--ink-soft); font-size: 0.9375rem; margin-top: 0.15rem; }
.tl-org .redacted {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.05em 0.4em;
  background: var(--ink-mute);
  color: var(--ink-mute);
  border-radius: 2px;
  user-select: none;
}
.tl-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.tl-steps li + li::before { content: "\2192"; margin-right: 0.35rem; color: var(--accent); }
.tl-body { margin-top: 0.7rem; color: var(--ink-soft); line-height: 1.7; max-width: 62ch; }

.skills { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 680px) { .skills { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 2rem; } }
.skill-group h3 {
  margin-bottom: 0.75rem;
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--ink-mute);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; list-style: none; }
.chips li {
  padding: 0.35rem 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.callout {
  margin-top: 1.75rem;
  padding: 1.25rem 1.4rem;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-dim), transparent 80%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
}

/* ---------- prose (posts, about, legal) ---------- */
.prose {
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--ink-soft);
}
@media (min-width: 760px) { .prose { font-size: 1.125rem; } }
.prose > * + * { margin-top: 1.25em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink); }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--dur) var(--ease-out), text-decoration-color var(--dur) var(--ease-out);
}
.prose a:hover { color: var(--accent-strong); text-decoration-color: var(--accent); }
.prose h2 {
  margin-top: 2.4em;
  font-size: var(--step-3);
  color: var(--ink);
}
/* post section headings: the site's cursor-block marker, not a literal "## " */
.prose h2::before {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.62em;
  margin-right: 0.45em;
  vertical-align: 0.04em;
  background: var(--accent);
  opacity: 0.85;
}
.prose h3 { margin-top: 2em; font-size: var(--step-2); color: var(--ink); }
.prose h4 { margin-top: 1.75em; font-size: var(--step-1); color: var(--ink); }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.75em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); font-family: var(--font-mono); }
.prose ul > li::marker { content: "\203A  "; }
.prose blockquote {
  padding: 0.25em 0 0.25em 1.25em;
  border-left: 2px solid var(--accent-line);
  color: var(--ink);
  font-style: italic;
}
.prose blockquote > * + * { margin-top: 0.85em; }
/* Fine print: a paragraph that is only <small>…</small> (table footnotes). */
.prose p:has(> small:only-child) {
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--ink-mute);
}
.prose p > small:only-child { font-size: inherit; }
.prose .table-wrap + p:has(> small:only-child) { margin-top: 0.6em; }
.prose p:has(> img) + p:has(> small:only-child) { margin-top: 0.6em; }
.prose hr {
  height: 1px;
  margin-block: 3em;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.prose img, .prose video {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* ---------- image lightbox (built by main.js) ---------- */
.prose img.zoomable { cursor: zoom-in; }
.prose img.zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.prose img.is-lifted { visibility: hidden; }
html.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}
.lightbox::backdrop { background: transparent; }
.lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 11, 0.9);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.lightbox-img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  transform-origin: center;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.lightbox-img.is-zoomed { cursor: grab; }
.lightbox-img.is-zoomed:active { cursor: grabbing; }
.lightbox-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}
.lightbox-btn {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
.lightbox-btn:hover, .lightbox-btn:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.lightbox-zoom { min-width: 58px; font-variant-numeric: tabular-nums; }
.prose figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-mute);
}
.prose .table-wrap { overflow-x: auto; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.prose th {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: left;
}
.prose th, .prose td { padding: 0.7rem 1rem 0.7rem 0; border-bottom: 1px solid var(--line); }
.prose td:first-child { white-space: nowrap; }
.prose td { font-variant-numeric: tabular-nums; }

/* inline code */
.prose :not(pre) > code {
  padding: 0.12em 0.4em;
  font-family: var(--font-code);
  font-size: 0.84em;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow-wrap: break-word;
}

/* code blocks: <details class="code-block"> with the header strip as its <summary> */
.prose .code-block {
  margin-block: 1.75em;
  color: var(--code-ink);
  background: var(--code-bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.prose .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  line-height: 1.7;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--ink-mute);
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid transparent; /* constant height, so main.js can measure the folded size */
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.prose .code-head::-webkit-details-marker { display: none; }
.prose .code-head:hover { color: var(--ink); }
.prose .code-head:focus-visible { outline-offset: -2px; border-radius: 11px 11px 0 0; }
/* .is-closing: main.js is animating the fold, so show the folded state right away */
.prose .code-block:is(:not([open]), .is-closing) > .code-head:focus-visible { border-radius: 11px; }
.prose .code-block[open]:not(.is-closing) > .code-head { border-bottom-color: var(--line); }
.prose .code-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  white-space: nowrap;
  text-transform: none;
}
.prose .code-toggle::before { content: "show " attr(data-lines); }
.prose .code-block[open]:not(.is-closing) .code-toggle::before { content: "hide"; }
.prose .code-toggle::after {
  /* chevron: down when folded, up when open */
  content: "";
  width: 0.45em;
  height: 0.45em;
  margin-top: -0.25em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease-out);
}
.prose .code-block[open]:not(.is-closing) .code-toggle::after { margin-top: 0.25em; transform: rotate(-135deg); }
.prose .code-block pre {
  margin: 0;
  padding: 0.375rem 1.25rem 1.25rem;
  font-family: var(--font-code);
  font-size: 0.84rem;
  line-height: 1.7;
  overflow-x: auto;
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 559.98px) {
  .prose .code-block {
    margin-inline: calc(var(--gutter) * -1);
    border-radius: 0;
    border-inline: 0;
  }
  .prose .code-head, .prose .code-block pre { padding-inline: var(--gutter); }
  .prose .code-block pre { font-size: 0.8rem; }
  .prose .code-head:focus-visible, .prose .code-block:is(:not([open]), .is-closing) > .code-head:focus-visible { border-radius: 0; }
}
.prose pre code {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
}

/* syntax tokens (Prism) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #5f6679; font-style: italic; }
.token.punctuation { color: #8a90a3; }
.token.keyword, .token.important, .token.atrule, .token.rule { color: #f4b45f; }
.token.function, .token.function-variable { color: #7fcbe0; }
.token.class-name, .token.builtin, .token.type, .token.namespace { color: #e6c890; }
.token.string, .token.char, .token.attr-value, .token.regex, .token.template-string { color: #a5d6a7; }
.token.number, .token.boolean, .token.constant, .token.symbol { color: #ef9c80; }
.token.operator, .token.entity, .token.url { color: #cfd3df; }
.token.property, .token.attr-name, .token.tag, .token.selector { color: #9fb6e0; }
.token.macro, .token.directive, .token.register { color: #d7a6e8; }
.token.variable, .token.parameter { color: #e7e9f0; }
.token.deleted { color: #ef8a80; }
.token.inserted { color: #a5d6a7; }
.token.bold { font-weight: 600; }
.token.italic { font-style: italic; }

/* ---------- post ---------- */
.post-header {
  position: relative;
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.25rem, 5vw, 3.25rem);
  margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
  border-bottom: 1px solid var(--line);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-mute);
  transition: color var(--dur) var(--ease-out);
}
.back-link:hover { color: var(--accent); }
.back-link .icon { transition: transform var(--dur) var(--ease-out); }
.back-link:hover .icon { transform: translateX(-3px); }
.post-header .kicker { margin-bottom: 1rem; }
.post-title {
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.post-dek {
  margin-top: 1.1rem;
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--ink-soft);
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  margin-top: 1.75rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.post-meta > div { display: flex; align-items: center; }
.post-meta dd { margin: 0; }
.post-meta > div + div::before { content: "/"; margin-inline: 0.75rem; color: var(--ink-faint); }
.post-meta a:hover { color: var(--accent); }

/* article column under the wordmark; the contents rail takes the right side */
.post-head, .post-main { max-width: var(--shell-narrow); }
.post-main { min-width: 0; }
.post-rail { display: none; }
@media (min-width: 1120px) {
  .post-layout:has(> .post-rail) {
    display: grid;
    grid-template-columns: minmax(0, var(--shell-narrow)) minmax(13rem, 17rem);
    justify-content: space-between;
    column-gap: 3rem;
  }
  .post-rail {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 4rem);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}
.toc-list { display: grid; gap: 0.1rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.toc-link {
  position: relative;
  display: block;
  padding: 0.3rem 0 0.3rem 1.1rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--ink-mute);
  transition: color var(--dur) var(--ease-out);
}
/* the section you're reading gets the h2's cursor block */
.toc-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 0.4rem;
  height: 0.7rem;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}
.toc-link:hover, .toc-link[aria-current="true"] { color: var(--ink); }
.toc-link[aria-current="true"]::before { opacity: 0.85; }

.post-footer {
  display: grid;
  gap: 2rem;
  margin-top: clamp(3rem, 7vw, 4.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.signoff {
  display: grid;
  gap: 0.4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.signoff-label { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: var(--tracking-micro); text-transform: uppercase; color: var(--ink-mute); }
.signoff-name { font-family: var(--font-mono); font-size: var(--step-1); font-weight: 600; }
.signoff-name a:hover { color: var(--accent); }
.signoff-bio { color: var(--ink-soft); max-width: 56ch; margin-bottom: 0.4rem; }
.signoff .text-link { min-height: 44px; }

/* changes since publishing: one folded diff per entry, styled like a code block */
.post-changes { margin-top: clamp(3rem, 7vw, 4.5rem); }
.post-changes .change-list { display: grid; gap: 0.75rem; padding: 0; list-style: none; }
.post-changes .change-list > li { margin: 0; }
.post-changes .code-block { margin-block: 0; }
.change-body { padding: 0.75rem 1.25rem 1.25rem; }
.post-changes .change-msg { font-family: var(--font-mono); font-size: var(--step--1); line-height: 1.6; color: var(--ink); }
.post-changes .change-diff {
  font-family: var(--font-code);
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--code-ink);
  overflow-wrap: anywhere;
}
.post-changes .change-msg + .change-diff { margin-top: 0.85rem; }
/* the hunk header names the section the change is in and links to it */
.post-changes .diff-hunk { display: block; width: fit-content; margin-bottom: 0.2rem; color: var(--ink-mute); }
.diff-line { display: grid; grid-template-columns: 2ch minmax(0, 1fr); }
.diff-sign { user-select: none; }
.diff-mod .diff-sign { color: var(--ink-faint); }
.change-diff :is(ins, del) { padding-inline: 0.1em; border-radius: 3px; background: color-mix(in srgb, currentColor 16%, transparent); }
.change-diff ins { text-decoration: none; }
.change-diff del { text-decoration: line-through; text-decoration-thickness: 1px; }
.change-diff del + ins { margin-left: 0.25em; }
@media (max-width: 559.98px) {
  .change-body { padding-inline: var(--gutter); }
  .post-changes .change-diff { font-size: 0.8rem; }
}

.pager { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager-link {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--bg-raise);
  transition: background-color var(--dur) var(--ease-out);
}
.pager-link:hover { background: var(--surface); }
.pager-newer { text-align: right; justify-items: end; }
.pager-older:only-child { grid-column: 1 / -1; }
.pager-newer:only-child { grid-column: 1 / -1; }
.pager-dir { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: var(--tracking-micro); text-transform: uppercase; color: var(--ink-mute); }
.pager-title { font-family: var(--font-mono); font-weight: 600; line-height: 1.35; transition: color var(--dur) var(--ease-out); }
.pager-link:hover .pager-title { color: var(--accent-strong); }

/* ---------- legal ---------- */
.legal { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(3rem, 7vw, 5rem); }

/* ---------- 404 ---------- */
.lost {
  display: grid;
  align-content: center;
  min-height: 70vh;
  padding-block: 4rem;
}
.lost-code {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 14vw, 8.5rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
  user-select: none;
}
.lost-title { margin-top: 1.5rem; font-size: var(--step-4); letter-spacing: -0.035em; }
.lost-log {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  max-width: 40rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.8;
  color: var(--ink-mute);
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.lost-log .hl { color: var(--accent); }
.lost-log .lost-payload { color: var(--ink); }
.lost-red { color: #ff4d4d; }

/* CS2-style vote-kick panel: HUD, not page, so it ignores the theme */
.vote-panel {
  margin-top: 1.5rem;
  width: min(100%, 24rem);
  padding: 0.9rem 1.1rem 1rem;
  font-family: var(--font-sans);
  color: #ececec;
  background: linear-gradient(180deg, rgba(38, 36, 36, 0.96), rgba(28, 27, 27, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}
.vote-by { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; }
.vote-icon { width: 30px; height: 30px; flex-shrink: 0; }
.vote-by-text { overflow: hidden; white-space: nowrap; }
.vote-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.vote-target { font-size: 1.05rem; line-height: 1.3; }
.vote-img {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  aspect-ratio: 4 / 5;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}
.vote-img svg { width: 36px; height: 36px; }
.vote-tally { display: grid; grid-template-columns: auto auto; gap: 0.7rem 0.9rem; align-items: center; }
.vote-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: #1b1b1b;
  border: 0;
  cursor: pointer;
  transition: filter 120ms, transform 120ms;
}
.vote-btn svg { width: 30px; height: 30px; }
.vote-btn:hover { filter: brightness(1.15); }
.vote-btn:active { transform: scale(0.94); }
.vote-yes { background: #3fa142; border-radius: 4px; }
.vote-no { background: #e5333a; border-radius: 50%; }
.vote-count { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.vote-count-yes { color: #3fa142; }
.vote-count-no { color: #e5333a; }
.vote-you { margin-top: 0.9rem; text-align: right; font-size: 1.05rem; }
.vote-you span { color: #e5333a; }
.vote-you span.is-yes { color: #3fa142; }
.lost-code { white-space: nowrap; }
.lost-log a.hl {
  text-decoration: underline dotted;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease-out), text-decoration-color var(--dur) var(--ease-out);
}
.lost-log a.hl:hover { color: var(--accent-strong); text-decoration-style: solid; text-decoration-color: var(--accent); }
.lost p.lead { margin-top: 1.5rem; max-width: 46ch; color: var(--ink-soft); font-size: var(--step-1); }
.lost .hero-actions { margin-top: 2rem; }

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.025));
  overflow: hidden;
}
/* Flex, not grid: the links stay on one line, beside the wordmark when they
   fit and on their own line under it when they don't. */
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-top: clamp(2.5rem, 6vw, 4rem);
}
.footer-sign { flex: 1 1 0; } /* never narrower than the wordmark; the quip wraps */
.footer-mark {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 15vw, 9.5rem);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.85;
  background: linear-gradient(180deg, rgba(231, 233, 240, 0.14), rgba(231, 233, 240, 0.02));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}
.footer-quip {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-mute);
}
.footer-quip::before { content: "// "; color: var(--accent); opacity: 0.7; }
.footer-nav ul { display: flex; gap: 0.25rem 1.5rem; padding: 0; list-style: none; }
/* phones: too narrow for one line, so wrap under the wordmark at full width */
@media (max-width: 559.98px) {
  .footer-nav { flex-basis: 100%; }
  .footer-nav ul { flex-wrap: wrap; }
}
.footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-soft);
  transition: color var(--dur) var(--ease-out);
}
.footer-nav a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
  padding-block: 1.25rem 1.75rem;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--ink-mute);
}
.footer-legal { display: flex; gap: 1.25rem; }
.footer-legal a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -0.75rem; }
.footer-legal a:hover { color: var(--accent); }
.footer-bottom > p:first-child a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.footer-bottom > p:first-child a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .wordmark-caret { animation: none; }
  .dump { transform: none !important; }
}

/* ---------- light mode: the flashbang ---------- */
.flashbang {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.flashbang.is-fading {
  opacity: 0;
  transition: opacity 1.9s cubic-bezier(0.3, 0, 0.2, 1) 0.45s;
}

/* CS-style killfeed, deliberately theme-independent (it's HUD, not page) */
.killfeed {
  position: fixed;
  top: calc(var(--header-h) + 1rem);
  right: 1rem;
  z-index: 9999;
  display: grid;
  justify-items: end;
  gap: 0.4rem;
  max-width: min(22rem, calc(100vw - 2rem));
  font-family: var(--font-mono);
  color: #f1f1f1;
  cursor: pointer;
  animation: killfeed-in 220ms var(--ease-out);
}
.killfeed.is-leaving { opacity: 0; transform: translateX(8px); transition: opacity 300ms, transform 300ms; }
.killfeed-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  font-size: var(--step--1);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.72);
  border: 2px solid #e0392b;
  border-radius: 4px;
}
.kf-name { color: #eabe54; }
.kf-icon { width: 22px; height: 22px; color: #f1f1f1; }
.killfeed-note {
  padding: 0.45rem 0.75rem;
  font-size: var(--step--2);
  line-height: 1.5;
  text-align: right;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}
@keyframes killfeed-in { from { opacity: 0; transform: translateX(12px); } }
