/* alethi.dev: the whole site's stylesheet.
 *
 * Plain CSS, no build step. The React site styled with Tailwind utilities
 * and inline styles keyed off src/lib/theme.ts; here the palette is a set of
 * custom properties per [data-theme] and each component gets a class. The
 * sizes, spacings and colors are the React pages' own (Tailwind's sm: is
 * 640px, md: 768px). */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Fira Code";
  src: url("/static/fonts/FiraCode-latin-wght.woff2?v=771bf4b79a97") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  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 Sans";
  src: url("/static/fonts/IBMPlexSans-latin-400.woff2?v=3b646991d300") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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 Sans";
  src: url("/static/fonts/IBMPlexSans-latin-500.woff2?v=0717336fb31f") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  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 Sans";
  src: url("/static/fonts/IBMPlexSans-latin-600.woff2?v=8960851d691c") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  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 Sans";
  src: url("/static/fonts/IBMPlexSans-latin-700.woff2?v=42e7b0c143c1") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  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;
}

/* ---------- Palette (src/lib/theme.ts) ---------- */
:root,
[data-theme="dark"] {
  --bg: #1c1e26;
  --bg-secondary: #232530;
  --bg-tertiary: #2a2c38;
  --bg-code: #181a22;
  --text: #d5d8e0;
  --text-muted: #9da2b0;
  --text-dim: #6a6e7a;
  --heading: #d5d8e0;
  --accent: #e95678;
  --accent-dim: #c94a68;
  --secondary: #25b0bc;
  --tertiary: #b877db;
  --border: #2e3140;
  --border-glow: rgba(233, 86, 120, 0.12);

  --accent-bg-subtle: #e956780a;
  --accent-bg-inline-code: #e956780d;
  --accent-border-subtle: #e9567833;
  --accent-border-hover: #e9567844;

  --nav-bg: rgba(28, 30, 38, 0.92);
  --menu-bg: rgba(28, 30, 38, 0.95);
  --float-bg: rgba(28, 30, 38, 0.8);
  --code-head-bg: rgba(0, 0, 0, 0.15);
  --code-shadow: 0 0 16px var(--border-glow), inset 0 0 20px rgba(0, 0, 0, 0.25);
  --img-shadow: 0 0 12px var(--border-glow), inset 0 0 20px rgba(0, 0, 0, 0.3);
  --scan-line: rgba(213, 216, 224, 0.025);
  --glow: rgba(233, 86, 120, 0.03);
  --disclaimer-bg: rgba(233, 86, 120, 0.03);
  --copy-hover-bg: rgba(233, 86, 120, 0.06);
  --copied-bg: rgba(37, 176, 188, 0.08);
  --copied-border: rgba(37, 176, 188, 0.3);
  --scroll-thumb: #2e3140;
  --scroll-thumb-hover: #6a6e7a;
  --photo-filter: grayscale(0.35);
  --hr: linear-gradient(to right, transparent, #e9567818, #b877db18, transparent);
  --theme-toggle: var(--secondary);
  --search-bg: rgba(46, 49, 64, 0.4);
  --search-bg-hover: rgba(46, 49, 64, 0.7);
  --kbd-bg: rgba(46, 49, 64, 0.6);
  --overlay: rgba(0, 0, 0, 0.6);
  --popup-bg: rgba(28, 30, 38, 0.98);
  --popup-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(233, 86, 120, 0.08);
  --row-selected: rgba(102, 217, 239, 0.08);
  --slide-bg: rgba(28, 30, 38, 0.95);

  --callout-info: #25b0bc;
  --callout-tip: #09f7a0;
  --callout-warn: #fab795;
  --callout-error: #e95678;

  /* Code (the React site's blog-dark highlighter theme) */
  --code-text: #d5d8e0;
  --code-comment: #6a6e7a;
  --code-keyword: #e95678;
  --code-string: #fab795;
  --code-number: #b877db;
  --code-function: #25b0bc;
  --code-type: #b877db;
  --code-attr: #fab795;
  --code-mark-bg: rgba(37, 176, 188, 0.1);
  --code-mark-bar: #25b0bc;

  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ffffff;
  --bg-secondary: #f6f6f8;
  --bg-tertiary: #ededf0;
  --bg-code: #f8f8fa;
  --text: #1a1c24;
  --text-muted: #555868;
  --text-dim: #6d7179;
  --heading: #1a1c24;
  --accent: #e95678;
  --accent-dim: #c94a68;
  --secondary: #1ea8b8;
  --tertiary: #b877db;
  --border: #e4e4ea;
  --border-glow: transparent;

  --accent-bg-subtle: #e956780a;
  --accent-bg-inline-code: #e956780a;
  --accent-border-subtle: #e9567822;
  --accent-border-hover: #e9567844;

  --nav-bg: rgba(255, 255, 255, 0.92);
  --menu-bg: rgba(255, 255, 255, 0.98);
  --float-bg: rgba(255, 255, 255, 0.8);
  --code-head-bg: rgba(0, 0, 0, 0.02);
  --code-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --img-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --scan-line: rgba(26, 28, 36, 0.018);
  --glow: rgba(233, 86, 120, 0.02);
  --disclaimer-bg: rgba(233, 86, 120, 0.02);
  --copy-hover-bg: rgba(233, 86, 120, 0.04);
  --copied-bg: rgba(30, 168, 184, 0.08);
  --copied-border: rgba(30, 168, 184, 0.3);
  --scroll-thumb: #d0d0d6;
  --scroll-thumb-hover: #b0b0b8;
  --photo-filter: grayscale(0.35) brightness(1.12);
  --hr: linear-gradient(to right, transparent, var(--border), transparent);
  --theme-toggle: var(--tertiary);
  --search-bg: rgba(237, 237, 240, 0.5);
  --search-bg-hover: rgba(237, 237, 240, 0.8);
  --kbd-bg: rgba(228, 228, 234, 0.6);
  --overlay: rgba(0, 0, 0, 0.3);
  --popup-bg: rgba(255, 255, 255, 0.98);
  --popup-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(233, 86, 120, 0.08);
  --row-selected: rgba(47, 158, 184, 0.08);
  --slide-bg: rgba(255, 255, 255, 0.95);

  --callout-info: #1ea8b8;
  --callout-tip: #09a06a;
  --callout-warn: #d07020;
  --callout-error: #e95678;

  /* Code (blog-light) */
  --code-text: #1a1c24;
  --code-comment: #999ca8;
  --code-keyword: #e95678;
  --code-string: #c86820;
  --code-number: #9050a8;
  --code-function: #1ea8b8;
  --code-type: #b877db;
  --code-attr: #e87840;
  --code-mark-bg: rgba(30, 168, 184, 0.08);
  --code-mark-bar: #1ea8b8;

  color-scheme: light;
}

/* ---------- Base (Tailwind preflight, the parts the pages lean on) ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}
html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}
a {
  color: inherit;
  text-decoration: inherit;
}
img,
svg,
video,
canvas,
picture {
  display: block;
  vertical-align: middle;
}
img,
video {
  max-width: 100%;
  height: auto;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
}
ol,
ul {
  list-style: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}
code,
kbd,
pre,
samp {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1em;
}
[hidden] {
  display: none !important;
}

/* Theme changes fade, as on the React site. */
*,
*::before,
*::after {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, fill 0.3s ease, stroke 0.3s ease;
}

.mono,
.wordmark,
.eyebrow,
.lede,
.nav-link,
.theme-toggle {
  font-family: "Fira Code", monospace;
}
.font-heading {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
}
.accent {
  color: var(--accent);
}
.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-width: 0;
}
.skip-link {
  position: absolute;
  left: 8px;
  top: -40px;
  z-index: 60;
  padding: 6px 10px;
  font: 12px "Fira Code", monospace;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
}
.skip-link:focus {
  top: 8px;
}

/* ---------- Motion ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes scanDrift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-80px);
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes livePulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}
.fade-in {
  animation: fadeInUp 0.35s ease-out both;
}
.delay-1 { animation-delay: 40ms; }
.delay-3 { animation-delay: 120ms; }
.delay-5 { animation-delay: 200ms; }
.delay-7 { animation-delay: 280ms; }
.delay-9 { animation-delay: 360ms; }
.row-delay-1 { animation-delay: 60ms; }
.row-delay-2 { animation-delay: 120ms; }
.row-delay-3 { animation-delay: 180ms; }
.row-delay-4 { animation-delay: 240ms; }
.row-delay-5 { animation-delay: 300ms; }
.row-delay-6 { animation-delay: 360ms; }
.row-delay-7 { animation-delay: 420ms; }
.row-delay-8 { animation-delay: 480ms; }
.row-delay-9 { animation-delay: 540ms; }
.row-delay-10 { animation-delay: 600ms; }
.row-delay-11 { animation-delay: 660ms; }
.row-delay-12 { animation-delay: 720ms; }
.spinner {
  animation: spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .page-bg-scan,
  .live-dot,
  .spinner {
    animation: none !important;
  }
}

/* ---------- Focus ---------- */
:focus {
  outline: none;
}
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #e95678;
  outline-offset: 3px;
  border-radius: 3px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(233, 86, 120, 0.18);
}

/* ---------- Selection, scrollbars, autofill ---------- */
.neon-select ::selection {
  background: #e9567833;
  color: #e95678;
}
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}
.custom-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-tertiary) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s, -webkit-text-fill-color 0.3s ease, -webkit-box-shadow 0.3s ease;
}

/* ---------- Background: scan lines, glow, wandering dots ---------- */
.page-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.page-bg-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -80px;
  bottom: 0;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, var(--scan-line) 3px, var(--scan-line) 4px);
  animation: scanDrift 12s linear infinite;
  will-change: transform;
}
.page-bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 25% 40%, var(--glow) 0%, transparent 55%);
}
.page-bg-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.site-nav-inner {
  max-width: 1100px;
  height: 48px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
.wordmark-name {
  color: var(--heading);
}
.site-nav-desktop {
  display: none;
  align-items: center;
}
.site-nav-links {
  display: flex;
  align-items: center;
}
.nav-link {
  font-size: 12px;
  line-height: 16px;
  padding: 6px;
  border-radius: 4px;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.nav-link:hover:not(.is-active) {
  color: var(--accent);
}
.nav-link.is-active {
  color: var(--accent);
  background: var(--accent-bg-subtle);
  border-color: var(--accent-border-subtle);
}
/* Search trigger: the bar's "search..." field (desktop) and icon (phone). */
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  margin-left: 8px;
  padding: 5px 8px 5px 10px;
  font: 12px/16px "Fira Code", monospace;
  color: var(--text-dim);
  background: var(--search-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.2s;
}
.nav-search:hover {
  border-color: var(--accent-border-hover);
  background: var(--search-bg-hover);
}
.nav-search svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-search-label {
  flex: 1;
  text-align: left;
}
.nav-search kbd {
  flex-shrink: 0;
  font: 10px/1.4 "Fira Code", monospace;
  color: var(--text-dim);
  background: var(--kbd-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.nav-search-icon {
  display: flex;
  align-items: center;
  padding: 6px;
  color: var(--text-muted);
}
.site-nav-rule {
  width: 1px;
  height: 20px;
  margin: 0 12px;
  background: var(--border);
}
/* Holds the place of the React nav's focus-mode button (a follow-up), so
 * the theme toggle sits where readers are used to it. */
.site-nav-focus-spacer {
  width: 89px;
}
.theme-toggle {
  font-size: 12px;
  line-height: 1;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--theme-toggle);
}
.theme-toggle-small {
  font-size: 10px;
}
.site-nav-rule-tight {
  margin: 0 8px;
}
.focus-btn {
  min-width: 72px;
  text-align: center;
  color: var(--text-dim);
}
.theme-toggle-to-dark,
[data-theme="light"] .theme-toggle-to-light {
  display: none;
}
[data-theme="light"] .theme-toggle-to-dark {
  display: inline;
}
.site-nav-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-nav-menu-toggle {
  font: 14px/20px "Fira Code", monospace;
  padding: 6px;
  color: var(--text-muted);
}
.menu-close-glyph,
.site-nav-menu-toggle[aria-expanded="true"] .menu-open-glyph {
  display: none;
}
.site-nav-menu-toggle[aria-expanded="true"] .menu-close-glyph {
  display: inline;
}
.site-nav-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  background: var(--menu-bg);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: max-height 0.25s ease-in-out, opacity 0.2s ease-in-out, transform 0.25s ease-in-out, border-color 0.2s ease-in-out;
}
.site-nav-menu.is-open {
  max-height: 400px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  border-bottom-color: var(--border);
}
.site-nav-menu-inner {
  padding: 4px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-nav-menu-link {
  font: 14px/20px "Fira Code", monospace;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--text-muted);
}
.site-nav-menu-link.is-active {
  color: var(--accent);
  background: var(--accent-bg-subtle);
}
@media (min-width: 640px) {
  .site-nav-inner {
    padding: 0 24px;
  }
  .site-nav-desktop {
    display: flex;
  }
  .site-nav-mobile,
  .site-nav-menu {
    display: none;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 16px;
}
.site-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}
.site-footer-id {
  grid-column: span 3 / span 3;
}
.site-footer-mark {
  margin-bottom: 8px;
}
.site-footer-address,
.site-footer-links a,
.site-footer-label,
.site-footer-bottom {
  font-family: "Fira Code", monospace;
}
.site-footer-address {
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-dim);
}
.site-footer-address a,
.site-footer-links a,
.site-footer-bottom a {
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.site-footer-address a:hover,
.site-footer-links a:hover,
.site-footer-bottom a:hover {
  color: var(--accent);
}
.site-footer-label {
  font-size: 11px;
  margin-bottom: 12px;
  color: var(--text-dim);
  opacity: 0.6;
}
.site-footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.site-footer-links a {
  font-size: 12px;
}
.site-footer-bottom {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.6;
}
@media (min-width: 640px) {
  .site-footer-inner {
    padding: 48px 24px;
  }
  .site-footer-grid {
    grid-template-columns: 1fr auto auto auto;
    gap: 40px;
  }
  .site-footer-id {
    grid-column: span 1 / span 1;
  }
}

/* ---------- Scroll to top ---------- */
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 8px;
  border-radius: 4px;
  background: var(--float-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  opacity: 0.4;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeInUp 0.2s ease-out;
}
.scroll-top:hover {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent-border-hover);
}

/* ---------- Page frames ---------- */
.container {
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.container-640 { max-width: 640px; }
.container-680 { max-width: 680px; }
.container-700 { max-width: 700px; }
.container-720 { max-width: 720px; }
.container-760 { max-width: 760px; }
.container-1000 { max-width: 1000px; }
.page-pad {
  padding-top: 48px;
  padding-bottom: 48px;
}
.page-pad-lg {
  padding-top: 48px;
  padding-bottom: 48px;
}
#main {
  min-height: 100vh;
}
@media (min-width: 640px) {
  .container {
    padding-left: 24px;
    padding-right: 24px;
  }
  .page-pad {
    padding-top: 64px;
    padding-bottom: 64px;
  }
  .page-pad-lg {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

.eyebrow {
  font-size: 11px;
  margin-bottom: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.eyebrow-tight {
  margin-bottom: 8px;
}
.page-header {
  margin-bottom: 32px;
}
.h1-page,
.h1-section,
.h1-projects,
.h2-section,
.h2-list,
.h2-projects,
.post-row-title,
.offering-title,
.engagement-name,
.consult-cta-title,
.proj-name {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
  color: var(--heading);
}
.h1-section {
  font-size: 26px;
  line-height: 1.5;
  font-weight: 700;
  margin-bottom: 12px;
}
.lede {
  font-size: 13px;
  line-height: 1.625;
  color: var(--text-muted);
}
@media (min-width: 640px) {
  .eyebrow {
    font-size: 12px;
  }
  .h1-section {
    font-size: 34px;
  }
  .lede {
    font-size: 14px;
  }
}
.link-accent,
.link-quiet {
  color: var(--accent);
}
.link-quiet:hover {
  opacity: 0.8;
}
.rule-fade {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 25%, var(--border) 75%, transparent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: 12px/1.5 "Fira Code", monospace;
  padding: 8px 16px;
  border-radius: 4px;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(0, 0, 0, 0.14);
  transition: box-shadow 0.18s ease, transform 0.1s ease, filter 0.15s ease;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: scale(1.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 0 0 3.5px rgba(233, 86, 120, 0.32), 0 0 24px rgba(233, 86, 120, 0.28), 0 2px 4px rgba(0, 0, 0, 0.2);
}
.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
  filter: brightness(0.96);
  transition: transform 0.08s ease, filter 0.08s ease, box-shadow 0.08s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.btn-primary:disabled {
  filter: saturate(0.55) brightness(0.85);
  cursor: not-allowed;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-border-subtle);
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease, transform 0.1s ease;
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background-color: rgba(233, 86, 120, 0.08);
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(233, 86, 120, 0.12);
}
.btn-secondary:active:not(:disabled) {
  transform: scale(0.97);
  transition: transform 0.08s ease, background-color 0.08s ease;
}
.btn-solid {
  display: inline-block;
  font: 13px/1.5 "Fira Code", monospace;
  padding: 10px 20px;
  border-radius: 4px;
  background: var(--accent);
  color: #ffffff;
  transition: opacity 0.2s ease;
}
.btn-solid:hover {
  opacity: 0.85;
}
@media (min-width: 640px) {
  .btn {
    font-size: 13px;
  }
}

/* ---------- About ---------- */
.about-eyebrow {
  margin-bottom: 16px;
}
.about-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}
.about-photo {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
}
.about-photo img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid var(--border);
  filter: var(--photo-filter);
  object-fit: cover;
  object-position: 50% 50%;
  transition: filter 0.3s ease;
}
.about-name {
  min-width: 0;
}
.h1-page {
  font-size: 28px;
  line-height: 1.5;
  font-weight: 700;
  margin-bottom: 4px;
}
.about-tagline {
  font: 12px/1.375 "Fira Code", monospace;
  color: var(--text-muted);
}
.about-status {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font: 12px/1.7 "Fira Code", monospace;
}
.status-key {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 108px;
  color: var(--text-dim);
}
.status-prompt {
  color: var(--accent);
  opacity: 0.65;
}
.status-value {
  flex: 1;
  color: var(--text-muted);
}
.status-value a {
  color: var(--accent);
}
.sm-inline {
  display: none;
}
.live-dot {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: livePulse 2.4s ease-in-out infinite;
}
.about-bio {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.about-bio p {
  font: 13px/1.95 "Fira Code", monospace;
  color: var(--text-muted);
}
.about-bio p.bio-lead {
  color: var(--text);
}
.about-divider {
  margin-top: 40px;
}
.about-socials {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  font: 11px/1.5 "Fira Code", monospace;
}
.about-socials a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.about-socials a:hover {
  color: var(--accent);
}
.dot-sep {
  color: var(--text-dim);
  opacity: 0.4;
}
@media (min-width: 640px) {
  .about-hero {
    gap: 20px;
  }
  .h1-page {
    font-size: 36px;
    margin-bottom: 8px;
  }
  .about-tagline {
    font-size: 14px;
  }
  .about-status {
    margin-top: 40px;
  }
  .status-row {
    font-size: 13px;
    gap: 16px;
  }
  .sm-inline {
    display: inline;
  }
  .about-bio {
    margin-top: 48px;
  }
  .about-bio p {
    font-size: 14px;
  }
  .about-divider {
    margin-top: 48px;
  }
  .about-socials {
    font-size: 13px;
    column-gap: 16px;
  }
}

/* ---------- Posts index ---------- */
.post-rows {
  display: flex;
  flex-direction: column;
}
.post-row {
  display: block;
  padding: 16px 12px 16px 16px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.post-row:hover {
  border-left-color: var(--accent);
}
.post-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.post-row-title {
  font-size: 15px;
  font-weight: 600;
  text-transform: capitalize;
}
.post-row-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.post-row-source,
.post-row-date,
.post-row-desc {
  font-family: "Fira Code", monospace;
}
.post-row-source {
  font-size: 10px;
  color: var(--accent);
}
.post-row-date {
  font-size: 10px;
  color: var(--text-dim);
}
.post-row-desc {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
@media (min-width: 640px) {
  .post-row-title {
    font-size: 16px;
  }
  .post-row-source,
  .post-row-date {
    font-size: 11px;
  }
  .post-row-desc {
    font-size: 12px;
  }
}

/* ---------- Email signup ---------- */
.signup {
  margin-top: 48px;
  padding: 24px;
  border-radius: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.4s ease;
}
.signup-label {
  font: 11px/1.5 "Fira Code", monospace;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  transition: margin-bottom 0.35s ease;
}
.signup-label > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.signup-label-done,
.signup.is-done .signup-label-idle {
  display: none !important;
}
.signup.is-done .signup-label-done {
  display: flex !important;
  animation: fadeIn 0.3s ease;
}
.signup.is-done {
  border-color: rgba(233, 86, 120, 0.27);
}
.signup.is-done .signup-label {
  margin-bottom: 0;
}
.signup-form {
  max-height: 80px;
  transition: max-height 0.35s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  font: 13px "Fira Code", monospace;
  color: var(--text-muted);
}
.signup.is-done .signup-form {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}
.signup-pill {
  flex: 1;
  display: flex;
  align-items: stretch;
  border-radius: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}
.signup-pill:focus-within,
[data-signup].is-error .signup-pill {
  border-color: var(--accent);
}
.signup-pill input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font: 13px/1.5 "Fira Code", monospace;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}
.signup-pill input:focus-visible {
  box-shadow: none;
}
.signup-submit,
.signup-busy,
.signup-error {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font: 13px/1.5 "Fira Code", monospace;
}
.signup-submit {
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.signup-submit:hover {
  color: var(--accent);
}
.signup-busy {
  gap: 8px;
  color: var(--text-dim);
}
.signup-error {
  color: var(--accent);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signup-busy,
.signup-error,
[data-signup].is-busy .signup-submit,
[data-signup].is-error .signup-submit {
  display: none;
}
[data-signup].is-busy .signup-busy,
[data-signup].is-error .signup-error {
  display: flex;
}
.signup-error:empty {
  display: none !important;
}
@media (min-width: 640px) {
  .signup {
    padding: 32px;
  }
  .signup-label {
    font-size: 12px;
  }
}

/* ---------- Post ---------- */
.post-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px;
  display: flex;
  gap: 32px;
}
.toc {
  display: none;
  flex-shrink: 0;
  width: 176px;
}
.toc-inner {
  position: sticky;
  top: 64px;
  width: 176px;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
}
.toc-label {
  font: 10px/1.5 "Fira Code", monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--text-dim);
}
.toc-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border);
}
.toc-link {
  display: block;
  font: 11px/1.375 "Fira Code", monospace;
  padding: 3px 0 3px 10px;
  margin-left: -1px;
  color: var(--text-dim);
  border-left: 2px solid transparent;
  transition: all 150ms;
}
.toc-link:hover {
  color: var(--text-muted);
}
.toc-title {
  font-size: 13px;
  font-weight: 600;
  padding-bottom: 6px;
  margin-bottom: 4px;
  color: var(--text);
}
.toc-link.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
}
.post-main {
  flex: 1;
  min-width: 0;
}
.post-byline {
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.badge {
  display: inline-block;
  font: 11px/1.5 "Fira Code", monospace;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-dim);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.byline-sep {
  margin: 0 6px;
  opacity: 0.6;
}
.post-disclaimer {
  margin-top: 48px;
  padding: 12px 12px 12px 16px;
  font: italic 11px/1.8 "Fira Code", monospace;
  color: var(--text-dim);
  border-left: 2px solid var(--accent-border-subtle);
  background: var(--disclaimer-bg);
  border-radius: 0 4px 4px 0;
}
.prev-next {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.prev-next a {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 12px/1.5 "Fira Code", monospace;
  text-transform: capitalize;
  color: var(--text-muted);
}
.prev-next a:hover {
  color: var(--accent);
}
.prev-next-arrow {
  color: var(--text-dim);
}
@media (min-width: 640px) {
  .post-layout {
    padding: 32px 24px;
  }
  .post-disclaimer {
    font-size: 12px;
  }
}
@media (min-width: 768px) {
  .toc {
    display: block;
  }
}

/* ---------- Legal ---------- */
.legal-updated {
  font: 12px/1.5 "Fira Code", monospace;
  margin-bottom: 24px;
  color: var(--text-dim);
}

/* ---------- Prose (rendered markdown) ---------- */
.prose h1 {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
  font-size: 28px;
  line-height: 1.5;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--heading);
}
.prose h2 {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
  font-size: 22px;
  line-height: 1.5;
  font-weight: 600;
  margin: 56px 0 16px;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--heading);
  scroll-margin-top: 64px;
}
.prose h3 {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--heading);
  scroll-margin-top: 64px;
}
.prose h4 {
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--heading);
}
.site-heading-anchor {
  margin-left: 8px;
  color: var(--text-dim);
  opacity: 0.4;
  transition: color 150ms, opacity 150ms;
}
.site-heading-anchor:hover {
  opacity: 1;
  color: var(--accent);
}
.prose p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
  color: var(--text-muted);
}
.prose a:not(.site-heading-anchor) {
  color: var(--accent);
  transition: color 0.2s;
}
.prose a:not(.site-heading-anchor):hover {
  color: var(--accent-dim);
}
.prose ul,
.prose ol {
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 16px 16px;
  color: var(--text-muted);
}
.prose ul {
  list-style: disc;
}
.prose ol {
  list-style: decimal;
}
.prose li {
  margin-bottom: 6px;
}
.prose li > p {
  margin-bottom: 0;
}
.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
  margin-top: 6px;
  margin-bottom: 0;
}
.prose strong {
  font-weight: 700;
}
.prose em {
  font-style: italic;
}
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-muted);
}
.prose :not(pre) > code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-bg-inline-code);
  color: var(--accent);
  border: 1px solid transparent;
}
.prose hr {
  height: 1px;
  margin: 32px 0;
  background: var(--hr);
}
.prose img {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--img-shadow);
}
@media (min-width: 640px) {
  .prose h1 {
    font-size: 36px;
    margin-bottom: 32px;
  }
  .prose h2 {
    font-size: 26px;
    margin-top: 64px;
  }
  .prose h3 {
    font-size: 19px;
  }
  .prose p,
  .prose ul,
  .prose ol {
    font-size: 15px;
  }
}

/* Code frames */
.site-code {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-code);
  border: 1px solid var(--border);
  box-shadow: var(--code-shadow);
}
.site-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--code-head-bg);
}
.site-code-lang {
  font: 9px/1.5 "Fira Code", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 6px;
  color: var(--text-dim);
}
.site-code-copy {
  display: flex;
  align-items: center;
  font: 11px/1.5 "Fira Code", monospace;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.site-code-copy:hover {
  color: var(--accent);
  background: var(--copy-hover-bg);
}
.site-code-copy > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-code-copy-done,
.site-code-copy.is-copied .site-code-copy-idle {
  display: none !important;
}
.site-code-copy.is-copied .site-code-copy-done {
  display: flex !important;
}
.site-code-copy.is-copied {
  color: var(--secondary);
  background: var(--copied-bg);
  border-color: var(--copied-border);
}
.site-code-body {
  padding: 16px 20px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}
.site-code-body pre {
  font-size: 12px;
  line-height: 1.7;
  color: var(--code-text);
}
.site-code-body pre code {
  font-size: 12px;
}
@media (min-width: 640px) {
  .site-code-body pre,
  .site-code-body pre code {
    font-size: 13px;
  }
}
/* Highlighted code is 12px text on a 24px row pitch at every width: on the
 * React site Shiki's <pre> kept the page's 16px/24px line box and only its
 * <code> took 12px (its sm: override never applied). Plain fences keep
 * 12px/13px at 1.7. */
.site-code-body pre.chroma,
.site-code-marks .chroma .site-code-line {
  font-size: 16px;
  line-height: 24px;
}
.site-code-body pre.chroma code {
  font-size: 12px;
  line-height: 20.4px;
}
/* Marked lines (```go {2,5-7}): the marked lines take a tint with a bar at
 * the frame's left edge and the rest dim. Each line is a block as wide as
 * the frame's padding box; the <pre> grows to its longest line. */
.site-code-marks .site-code-body pre {
  width: max-content;
  min-width: 100%;
}
.site-code-marks .site-code-line {
  display: inline-block;
  width: calc(100% + 40px);
  margin: 0 -20px;
  padding: 0 20px;
  vertical-align: top;
}
.site-code-marks .site-code-line:empty::before {
  content: "\200b";
}
.site-code-marks .site-code-line-marked {
  background: var(--code-mark-bg);
  box-shadow: inset 2px 0 0 var(--code-mark-bar);
}
.site-code-marks .site-code-line:not(.site-code-line-marked) {
  opacity: 0.5;
}

/* Code colors: the React site's two Shiki themes mapped onto the
 * tree-sitter classes (ts-*, most fences), chroma's (the rest) and the gsx
 * scanner's (chroma's names). Punctuation, variables, properties, builtin
 * types and anything unlisted take the code's own color, as in Shiki. */
.chroma .ts-comment, .chroma .c, .chroma .ch, .chroma .cm, .chroma .c1, .chroma .cs, .chroma .cp, .chroma .cpf { color: var(--code-comment); }
.chroma .ts-keyword, .chroma .ts-operator, .chroma .ts-tag, .chroma .k, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .nt, .chroma .o, .chroma .ow { color: var(--code-keyword); }
.chroma .ts-type, .chroma .nc { color: var(--code-type); }
.chroma .ts-number, .chroma .ts-constant, .chroma .kc, .chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi, .chroma .il, .chroma .mo, .chroma .se { color: var(--code-number); }
.chroma .ts-string, .chroma .s, .chroma .s1, .chroma .s2, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .sd, .chroma .sh, .chroma .si, .chroma .sr, .chroma .ss, .chroma .sx, .chroma .dl, .site-json-key { color: var(--code-string); }
.chroma .ts-function, .chroma .nf, .chroma .fm, .chroma .nb, .chroma .bp { color: var(--code-function); }
.chroma .ts-variable-parameter, .chroma .ts-attribute, .chroma .na { color: var(--code-attr); }
.chroma .err { color: inherit; background: none; }

/* Callouts and details */
.site-callout {
  margin: 16px 0;
  padding-left: 16px;
  border-left: 2px solid var(--callout-color);
}
.site-callout-info { --callout-color: var(--callout-info); }
.site-callout-tip { --callout-color: var(--callout-tip); }
.site-callout-warn { --callout-color: var(--callout-warn); }
.site-callout-error { --callout-color: var(--callout-error); }
.site-callout-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--callout-color);
}
.site-callout-icon {
  font-size: 11px;
  line-height: 1;
}
.site-callout-title {
  font: 600 11px/1.5 "Fira Code", monospace;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.site-callout-body > :last-child,
.site-details-body > :last-child {
  margin-bottom: 0;
}
.site-details {
  margin: 16px 0;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}
.site-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  list-style: none;
  cursor: pointer;
  color: var(--text-muted);
  font: 500 12px/1.5 "Fira Code", monospace;
}
.site-details > summary::-webkit-details-marker {
  display: none;
}
.site-details > summary:hover {
  color: var(--heading);
}
.site-details > summary svg {
  flex-shrink: 0;
  transition: transform 0.2s ease-in-out;
}
.site-details[open] > summary svg {
  transform: rotate(90deg);
}
.site-details-body {
  padding-top: 4px;
}

/* Tables: the table on wide screens, cards on phones */
.site-table-wide {
  display: none;
  overflow-x: auto;
  margin-bottom: 16px;
}
.site-table-wide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.site-table-wide thead {
  border-bottom: 2px solid var(--border);
}
.site-table-wide th {
  font-family: "Fira Code", monospace;
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--heading);
}
.site-table-wide tr {
  border-bottom: 1px solid var(--border);
}
.site-table-wide tbody tr:hover {
  background: var(--bg-tertiary);
}
.site-table-wide td {
  padding: 8px 12px;
  color: var(--text-muted);
}
.site-table-cards {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-table-card {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.site-table-cell + .site-table-cell {
  margin-top: 6px;
}
.site-table-label {
  font: 10px/1.5 "Fira Code", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  color: var(--text-dim);
}
.site-table-value {
  color: var(--text-muted);
}
.site-table-cell:first-child .site-table-value {
  color: var(--heading);
}
@media (min-width: 640px) {
  .site-table-wide {
    display: block;
  }
  .site-table-wide table {
    font-size: 13px;
  }
  .site-table-cards {
    display: none;
  }
}

/* Themed diagrams and videos */
.site-themed {
  display: block;
  margin-bottom: 16px;
}
.prose .site-themed img {
  margin-bottom: 0;
}
.site-themed-light,
[data-theme="light"] .site-themed-dark {
  display: none;
}
[data-theme="light"] .site-themed-light {
  display: block;
}
.site-video {
  position: relative;
  display: block;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--img-shadow);
}
.site-video video {
  display: block;
  width: 100%;
  height: auto;
}
.site-video-toggle {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
}
.site-video-state {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: rgb(0 0 0 / 0.6);
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 6px;
}
.site-video[data-state="playing"] .site-video-pause,
.site-video[data-state="paused"] .site-video-play,
.site-video[data-state="idle"] .site-video-play {
  display: grid;
}
.site-video[data-state="playing"] .site-video-pause {
  opacity: 0.45;
}
.site-video-toggle:hover .site-video-pause,
.site-video-toggle:focus-visible .site-video-pause {
  opacity: 1;
}
/* Never played (reduced motion): a larger play button in the middle. */
.site-video[data-state="idle"] .site-video-play {
  right: auto;
  bottom: auto;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
}
.site-video[data-state="idle"] .site-video-play svg {
  width: 22px;
  height: 22px;
}
.site-video-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Charts: the islands bundle mounts into these; hold their space until it
 * does, so the page does not jump. */
.site-chart {
  margin-bottom: 24px;
}
.site-chart:empty {
  min-height: 300px;
}

/* ---------- Projects ---------- */
.projects-header {
  margin-bottom: 56px;
}
.h1-projects {
  font-size: 32px;
  line-height: 1.5;
  font-weight: 700;
  margin-bottom: 16px;
}
.projects-lede {
  font: 13px/1.625 "Fira Code", monospace;
  max-width: 560px;
  color: var(--text-dim);
}
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.tag-filter {
  font: 11px/1.5 "Fira Code", monospace;
  padding: 6px 12px;
  border-radius: 9999px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.tag-filter:hover {
  border-color: var(--accent);
  color: var(--text-muted);
}
.tag-filter[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.project-section {
  margin-bottom: 56px;
}
.h2-projects {
  font-size: 22px;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 8px;
}
.project-section-sub {
  font: 12px/1.625 "Fira Code", monospace;
  max-width: 600px;
  margin-bottom: 24px;
  color: var(--text-dim);
}
.project-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}
.proj-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all 0.3s;
}
.proj-featured {
  grid-column: 1 / -1;
}
.proj-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.proj-card:hover::after {
  background: var(--accent);
  box-shadow: 0 0 12px #e9567855, 0 2px 20px #e9567822;
}
.proj-body {
  padding: 24px;
  flex: 1;
}
.proj-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.proj-name {
  font-size: 22px;
  line-height: 1.5;
  font-weight: 600;
  transition: color 0.3s;
}
.proj-card:hover .proj-name {
  color: var(--accent);
}
.proj-head-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.proj-stars,
.proj-lang,
.proj-meta,
.proj-arrow,
.proj-relationship {
  font: 11px/1.5 "Fira Code", monospace;
  color: var(--text-dim);
}
.proj-stars {
  display: flex;
  align-items: center;
  gap: 4px;
}
.proj-stars svg {
  display: inline-block;
}
.proj-rule {
  width: 32px;
  height: 2px;
  margin-bottom: 16px;
  background: var(--accent);
  opacity: 0.5;
  border-radius: 1px;
}
.proj-desc {
  font: 13px/1.7 "Fira Code", monospace;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.proj-detail {
  font: 11px/1.75 "Fira Code", monospace;
  color: var(--text-dim);
}
.proj-relationship {
  display: inline-block;
  margin-top: 16px;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
}
.proj-og-wrap {
  padding: 0 24px 20px;
}
.proj-og-image {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  transition: border-color 0.3s ease;
}
.proj-card:hover .proj-og-image {
  border-color: #e9567833;
}
.proj-og-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.proj-foot {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}
.proj-arrow {
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.proj-card:hover .proj-arrow {
  opacity: 1;
  transform: translateX(0);
}
.projects-empty {
  font: 13px/1.5 "Fira Code", monospace;
  text-align: center;
  padding: 48px 0;
  color: var(--text-dim);
}
.projects-more {
  margin-top: 48px;
  padding-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  font: 12px/1.5 "Fira Code", monospace;
  color: var(--text-dim);
  animation-delay: 300ms;
}
.projects-more a {
  color: var(--accent);
  transition: color 0.2s;
}
.projects-more a:hover {
  color: var(--heading);
}
@media (min-width: 640px) {
  .projects-header {
    margin-bottom: 64px;
  }
  .h1-projects {
    font-size: 42px;
  }
  .projects-lede {
    font-size: 14px;
  }
  .tag-filter {
    font-size: 12px;
  }
  .project-section {
    margin-bottom: 64px;
  }
  .h2-projects {
    font-size: 28px;
  }
  .project-section-sub {
    font-size: 13px;
  }
  .project-grid {
    gap: 24px;
  }
  .proj-body {
    padding: 28px;
  }
  .proj-name {
    font-size: 24px;
  }
  .proj-desc {
    font-size: 14px;
  }
  .proj-detail {
    font-size: 12px;
  }
  .proj-og-wrap {
    padding: 0 28px 20px;
  }
  .proj-foot {
    padding: 16px 28px;
  }
  .projects-more {
    margin-top: 56px;
    font-size: 13px;
  }
}

/* ---------- Consulting ---------- */
.hero {
  margin-bottom: 40px;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.consult-section {
  margin-top: 56px;
}
.consult-section.consult-first {
  margin-top: 48px;
}
.h2-section {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 24px;
}
.h2-section.h2-tight {
  margin-bottom: 12px;
}
.offering-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.offering-row:last-child {
  border-bottom: 1px solid var(--border);
}
.offering-num {
  font: 12px/1.5 "Fira Code", monospace;
  padding-top: 2px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  transition: color 0.25s ease;
}
.offering-title {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 6px;
  transition: color 0.25s ease;
}
.offering-row:hover .offering-num,
.offering-row:hover .offering-title {
  color: var(--accent);
}
.offering-body,
.engagement-detail {
  font: 12px/1.8 "Fira Code", monospace;
  color: var(--text-muted);
}
.engagements {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.engagement-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.engagement-name {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 600;
}
.engagement-cadence {
  font: 11px/1.5 "Fira Code", monospace;
  white-space: nowrap;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.engagement-rule {
  margin-top: 10px;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}
.engagement-detail {
  margin-top: 12px;
}
.consult-note {
  font: 12px/1.75 "Fira Code", monospace;
  margin-top: 32px;
  color: var(--text-dim);
}
.consult-copy {
  font: 13px/1.75 "Fira Code", monospace;
  color: var(--text-muted);
}
.consult-cta {
  margin-top: 56px;
  padding: 24px;
  border-radius: 8px;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.consult-cta-title {
  font-size: 17px;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 8px;
}
.consult-cta-copy {
  font: 12px/1.7 "Fira Code", monospace;
  margin-bottom: 20px;
  color: var(--text-muted);
}
@media (min-width: 640px) {
  .hero {
    margin-bottom: 48px;
  }
  .h2-section {
    font-size: 24px;
  }
  .offering-row {
    padding: 24px 0;
  }
  .offering-num,
  .offering-body,
  .engagement-detail {
    font-size: 13px;
  }
  .offering-title,
  .engagement-name {
    font-size: 18px;
  }
  .engagements {
    gap: 28px;
  }
  .engagement-cadence {
    font-size: 12px;
  }
  .consult-cta {
    padding: 32px;
  }
  .consult-cta-title {
    font-size: 20px;
  }
  .consult-cta-copy {
    font-size: 13px;
  }
}

/* ---------- Contact ---------- */
.card {
  border-radius: 6px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font: 12px/1.5 "Fira Code", monospace;
  color: var(--text-muted);
}
.field input,
.field select,
.field textarea {
  font: 13px/1.5 "Fira Code", monospace;
  padding: 8px 12px;
  border-radius: 4px;
  outline: none;
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
}
.field textarea {
  resize: vertical;
}
.contact-submit {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  font: 13px/1.5 "Fira Code", monospace;
  padding: 10px 16px;
  border-radius: 4px;
  border: none;
}
.contact-submit-busy {
  display: none;
  align-items: center;
  gap: 8px;
}
.contact.is-busy .contact-submit-idle {
  display: none;
}
.contact.is-busy .contact-submit-busy {
  display: flex;
}
.contact-error {
  font: 12px/1.5 "Fira Code", monospace;
  color: var(--accent);
}
.contact-error a {
  color: var(--accent);
  text-decoration: underline;
}
.contact-done {
  border-color: #e9567844;
}
.contact-done-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font: 13px/1.5 "Fira Code", monospace;
  color: var(--text-muted);
}
.contact-done-head svg {
  color: var(--accent);
}
.contact-done p {
  font: 12px/1.625 "Fira Code", monospace;
  color: var(--text-dim);
}
.strong-text {
  color: var(--text);
}
.contact-alt {
  margin-top: 24px;
  font: 12px/1.75 "Fira Code", monospace;
  color: var(--text-dim);
}
.contact-break {
  margin: 64px 0 24px;
}
.h2-list {
  font-size: 19px;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 8px;
}
.list-copy {
  font: 12px/1.625 "Fira Code", monospace;
  color: var(--text-muted);
}
@media (min-width: 640px) {
  .card {
    padding: 32px;
  }
  .contact-done p,
  .list-copy {
    font-size: 13px;
  }
  .h2-list {
    font-size: 22px;
  }
}

/* ---------- Search popup (islands/search.ts) ---------- */
@keyframes searchModalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.ss-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(20vh, 160px);
  background: var(--overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 0.15s ease-out;
  animation: fadeIn 0.15s ease-out;
}
.ss-pop {
  width: min(560px, calc(100vw - 32px));
  max-height: min(480px, 60vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--popup-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--popup-shadow);
  animation: searchModalIn 0.2s ease-out;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}
.ss-backdrop.is-closing {
  opacity: 0;
}
.ss-backdrop.is-closing .ss-pop {
  transform: scale(0.97) translateY(-4px);
  opacity: 0;
}
.ss-q {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.ss-prompt {
  flex-shrink: 0;
  font: 600 14px "Fira Code", monospace;
  color: var(--accent);
}
.ss-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font: 14px "Fira Code", monospace;
  letter-spacing: -0.01em;
  color: var(--text);
  caret-color: var(--accent);
}
.ss-input:focus-visible {
  box-shadow: none;
}
.ss-q kbd,
.ss-foot kbd {
  font-family: "Fira Code", monospace;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.ss-q kbd {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}
.ss-results {
  flex: 1;
  overflow-y: auto;
}
.ss-results.has-rows {
  padding: 6px;
}
.ss-empty {
  padding: 32px 16px;
  text-align: center;
  font: 13px "Fira Code", monospace;
  color: var(--text-dim);
}
.ss-row {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: "Fira Code", monospace;
  transition: background 0.1s ease;
}
.ss-row[aria-selected="true"] {
  background: var(--row-selected);
}
.ss-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ss-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.1s ease;
}
.ss-row[aria-selected="true"] .ss-title {
  color: var(--text);
}
.ss-sep {
  margin: 0 5px;
  font-weight: 400;
  color: var(--text-dim);
}
.ss-section {
  font-weight: 400;
}
.ss-enter {
  display: none;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-dim);
}
.ss-row[aria-selected="true"] .ss-enter {
  display: inline;
}
.ss-snippet {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}
.ss-snippet mark {
  background: none;
  color: var(--accent);
  font-weight: 600;
}
.ss-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font: 10px "Fira Code", monospace;
  color: var(--text-dim);
}
.ss-foot span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ss-foot kbd {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--kbd-bg);
}

/* ---------- Focus mode (reader.js) ----------
 * data-site-focus on <html>: the bar slides away (hovering the strip at
 * the top, or the bar itself, brings it back), the contents column folds and
 * slides out from the left edge instead, the article column narrows a
 * touch, and the footer and the wandering dots go. */
.site-nav {
  transition: transform 0.25s ease-in-out, background-color 0.3s ease, border-color 0.3s ease;
}
[data-site-focus] .site-nav {
  transform: translateY(-100%);
}
.focus-top-edge {
  display: none;
}
[data-site-focus] .focus-top-edge {
  position: fixed;
  top: 0;
  left: 0;
  right: 140px;
  z-index: 50;
  display: block;
  height: 12px;
}
[data-site-focus] .focus-top-edge:hover + .site-nav,
[data-site-focus] .site-nav:hover {
  transform: translateY(0);
}
[data-site-focus] .site-footer,
[data-site-focus] .page-bg-dots {
  display: none;
}
.post-layout {
  transition: max-width 0.4s ease-in-out;
}
[data-site-focus] .post-layout {
  max-width: 1050px;
}
.toc {
  overflow: clip;
  transition: width 0.4s ease-in-out, opacity 0.3s ease-in-out;
}
[data-site-focus] .toc {
  width: 0;
  opacity: 0;
}
.focus-slide-edge,
.focus-slide,
.exit-focus,
.focus-edge-hint {
  display: none;
}
[data-site-focus] .focus-slide-edge {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: block;
  width: 12px;
  height: 100%;
}
[data-site-focus] .focus-slide {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: block;
  width: 208px;
  height: 100%;
  padding: 64px 16px 32px;
  overflow-y: auto;
  background: var(--slide-bg);
  border-right: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transform: translateX(-100%);
  transition: transform 0.25s ease-in-out;
}
[data-site-focus] .focus-slide-edge:hover + .focus-slide,
[data-site-focus] .focus-slide:hover,
[data-site-focus] .focus-slide:focus-within {
  transform: translateX(0);
}
[data-site-focus] .exit-focus {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  display: block;
  padding: 4px 10px;
  font: 10px/1.5 "Fira Code", monospace;
  color: var(--text-dim);
  background: var(--float-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  opacity: 0.4;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease-in-out, color 0.2s, border-color 0.2s;
}
[data-site-focus] .exit-focus:hover,
[data-site-focus] .exit-focus:focus-visible {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent-border-hover);
}
[data-site-focus] .focus-edge-hint {
  position: fixed;
  top: 50%;
  left: 4px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
  opacity: 0.3;
  transform: translateY(-50%);
  pointer-events: none;
}
.focus-edge-hint > div {
  width: 14px;
  height: 1.5px;
  background: var(--text-dim);
  border-radius: 1px;
}
.focus-edge-hint > div:nth-child(2) {
  width: 10px;
}
/* The bar's focus button and the fixed Exit focus button share one
 * view-transition-name, only ever on the visible one, so a toggle morphs
 * one into the other. The page itself is not cross-faded: its own
 * transitions (the bar sliding, the columns folding) run live underneath. */
.focus-btn {
  view-transition-name: focus-toggle;
}
[data-site-focus] .focus-btn {
  view-transition-name: none;
}
[data-site-focus] .exit-focus {
  view-transition-name: focus-toggle;
}
::view-transition-group(focus-toggle) {
  animation-duration: 400ms;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

/* ---------- Arrival and reading progress (reader.js) ---------- */
/* A heading the reader was just taken to sits on an accent tint that fades
 * out over 1.5s; reduced motion keeps it still until the class comes off.
 * The tint is drawn behind the heading's text, out past its edges, and
 * skips an h2's padding above its text. */
.prose :is(h2, h3).is-arrived {
  position: relative;
  isolation: isolate;
}
.prose :is(h2, h3).is-arrived::after {
  content: "";
  position: absolute;
  inset: var(--arrive-top, -4px) -10px -4px;
  z-index: -1;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 4px;
  pointer-events: none;
}
.prose h2 {
  --arrive-top: 10px;
}
@media (prefers-reduced-motion: no-preference) {
  .prose :is(h2, h3).is-arrived::after {
    animation: arrive 1.5s ease-out both;
  }
}
@keyframes arrive {
  0%,
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/* Reading progress: an accent line filling as the article scrolls through
 * the window (from its top reaching the top of the window to its end
 * reaching the bottom), along the bar's bottom edge, or along the top edge
 * in focus mode, where the bar slides away. Pure CSS: the line is the post
 * layout's ::before, driven by a view timeline on the article that
 * timeline-scope lifts to the layout. Without scroll timelines there is no
 * line. */
@supports (timeline-scope: --post-article) and (animation-timeline: view()) {
  .post-layout[data-site-reader] {
    timeline-scope: --post-article;
  }
  .post-layout[data-site-reader] .post {
    view-timeline: --post-article block;
  }
  .post-layout[data-site-reader]::before {
    content: "";
    position: fixed;
    top: 48px;
    left: 0;
    z-index: 45;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    pointer-events: none;
    animation: reading-progress linear both;
    animation-timeline: --post-article;
    animation-range: contain 0% contain 100%;
  }
  [data-site-focus] .post-layout[data-site-reader]::before {
    top: 0;
  }
}
@keyframes reading-progress {
  to {
    transform: scaleX(1);
  }
}

/* ---------- Image lightbox (reader.js) ---------- */
[data-site-zoom] {
  cursor: zoom-in;
}
/* The dialog covers the window, so a click anywhere lands on it (and closes
 * it); reader.js fits the image to the window. */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox::backdrop {
  background: rgb(0 0 0 / 0.78);
}
.lightbox-img {
  display: block;
  max-width: none;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.5);
}
.lightbox-close {
  position: fixed;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.lightbox-close:hover {
  color: var(--accent);
  background: var(--bg-tertiary);
}
:root:has(.lightbox[open]) {
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] .lightbox-img {
    animation: lightbox-in 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .lightbox[open]::backdrop {
    animation: lightbox-fade 180ms ease-out;
  }
}
@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}
@keyframes lightbox-fade {
  from {
    opacity: 0;
  }
}

/* ---------- Contents / Map tabs and the minimap (reader.js, minimap.ts) */
.rail-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.rail-tab {
  font: 10px/1.5 "Fira Code", monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.6;
  transition: color 0.15s, opacity 0.15s;
}
.rail-tab:hover {
  opacity: 1;
}
.rail-tab[aria-selected="true"] {
  opacity: 1;
}
.smm-map {
  position: relative;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.smm-map.is-dragging {
  cursor: grabbing;
}
.smm-inner {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
}
.smm-canvas {
  position: absolute;
  top: 0;
  left: 0;
}
.smm-clones {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.smm-view {
  position: absolute;
  right: 0;
  left: 0;
  pointer-events: none;
  background: color-mix(in srgb, var(--text-dim) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-dim) 60%, transparent);
  border-radius: 3px;
  transition: background-color 150ms, border-color 150ms;
}
.smm-map:hover .smm-view,
.smm-map.is-dragging .smm-view {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.smm-head {
  position: absolute;
  right: 0;
  left: 0;
  display: block;
  overflow: hidden;
  padding: 0 2px;
  font: 600 10.5px/14px "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--text-muted);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.smm-head:hover {
  color: var(--text);
}
.smm-head.is-title {
  font-size: 11.5px;
  color: var(--text);
}
.smm-head.is-active {
  color: var(--accent);
}

/* ---------- Signup banner (reader.js; posts like the card, site.js) ---------- */
.signup-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, background 0.2s ease, border-color 0.4s ease;
}
.signup-banner.is-shown {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.signup-banner.is-dismissed {
  display: none;
}
.signup-banner.is-done {
  border-top-color: #e9567844;
}
.signup-banner-inner {
  max-width: 1050px;
  min-height: 36px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.signup-banner-form,
.signup-banner-done {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 12px/1.5 "Fira Code", monospace;
  color: var(--text-muted);
}
.signup-banner-done {
  display: none;
}
.signup-banner-done svg {
  color: var(--accent);
  animation: fadeIn 0.3s ease;
}
.signup-banner.is-done .signup-banner-done {
  display: flex;
}
.signup-banner.is-done .signup-banner-form {
  display: none;
}
.signup-banner-label {
  font-size: 11px;
  white-space: nowrap;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.signup-banner-pill {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 320px;
}
.signup-banner-pill input,
.signup-banner-pill .signup-submit,
.signup-banner-pill .signup-busy,
.signup-banner-pill .signup-error {
  padding: 4px 8px;
  font-size: 12px;
}
.signup-banner-pill .signup-error {
  max-width: 160px;
}
.signup-banner-dismiss {
  margin-left: 4px;
  border-radius: 4px;
  color: var(--text-dim);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.signup-banner-dismiss:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.dismiss-x {
  display: inline-block;
  padding: 8px 12px;
  font-size: 20px;
  line-height: 1;
}
@media (min-width: 640px) {
  .signup-banner-inner {
    padding: 8px 24px;
  }
  .signup-banner-label {
    font-size: 12px;
  }
}
/* The scroll-to-top button rides up over the banner while it shows. */
.scroll-top {
  transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s, color 0.2s, border-color 0.2s;
}
body:has(.signup-banner.is-shown) .scroll-top {
  bottom: 72px;
}

/* ---------- Copy as markdown (reader.js) ---------- */
.copy-md {
  display: inline-flex;
  align-items: center;
  font: 11px/1.5 "Fira Code", monospace;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.copy-md:hover {
  color: var(--accent);
  background: var(--copy-hover-bg);
}
.copy-md > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.copy-md-done,
.copy-md[data-copied] .copy-md-idle {
  display: none !important;
}
.copy-md[data-copied] .copy-md-done {
  display: inline-flex !important;
}
.copy-md[data-copied] {
  color: var(--secondary);
  background: var(--copied-bg);
  border-color: var(--copied-border);
}

/* ---------- Tags ---------- */
.tag-chip {
  display: inline-block;
  font: 11px/1.5 "Fira Code", monospace;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}
a.tag-chip:hover {
  color: var(--accent);
  border-color: var(--accent-border-hover);
}
.tag-chip.is-current {
  color: var(--accent);
}
.tag-filter-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font: 12px/1.5 "Fira Code", monospace;
  color: var(--text-dim);
}

/* /projects: each card fades in 80ms after the one before it in its
 * section. */
.card-delay-1 { animation-delay: 80ms; }
.card-delay-2 { animation-delay: 160ms; }
.card-delay-3 { animation-delay: 240ms; }
.card-delay-4 { animation-delay: 320ms; }
.card-delay-5 { animation-delay: 400ms; }
.card-delay-6 { animation-delay: 480ms; }
.card-delay-7 { animation-delay: 560ms; }
.card-delay-8 { animation-delay: 640ms; }
.card-delay-9 { animation-delay: 720ms; }
