/* By JTT — design tokens, typography and shared page styles.
 * Mobile-first, minimal, editorial. Ivory + obsidian + bronze — the By JTT digital palette.
 *
 * Token contract (single source of truth — site.css and page styles consume these):
 *   --paper                 page canvas
 *   --ink                   primary text / strong action fill
 *   --surface               raised panels (cards, tiles)
 *   --line                  hairline borders
 *   --line-strong           stronger hairlines (section rules)
 *   --muted                 secondary text
 *   --signal                accent / action (vermilion, used sparingly)
 *   --signal-soft           focus tint / soft accent
 *   --ok                    success
 *   --chip                  inline fill (code, tags)
 * Subdomain accents (portal dots): --accent-games / --accent-experiments / --accent-design
 */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin.woff2") 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: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  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: "Geist Mono";
  src: url("/assets/fonts/geist-mono-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ---- Colours ----
   * light-dark() resolves each token against the active color-scheme: the
   * render-blocking head script pins data-theme (stored choice, light when
   * nothing is stored), JS-off users get the system preference via `light dark`.
   *
   * WCAG AA pass: --signal-text is the accessible text/border variant
   * (≥4.5:1 on paper, chip and surface — small mono labels sit on chip);
   * --signal is the decorative/background variant. */
  color-scheme: light;
  --paper: #F4F1EA;
  --ink: #0B0B0B;
  --surface: #FFFDF8;
  --line: #DED8CD;
  --line-strong: #BDB4A4;
  --muted: #625E56;
  --signal: #D4A574;
  --signal-text: #7B552F;
  --signal-soft: #C9A06F;
  --focus-ring: #8B6238;
  --signal-deep: #7B552F;
  --ok: light-dark(#2e7d32, #5fbf77);
  --chip: #EBE5DA;

  /* Subdomain accents */
  --accent-games: #A66A45;
  --accent-experiments: #806F5C;
  --accent-design: #52675B;

  /* Chrome surfaces + scrim (blurred bars, modal backdrop) */
  --chrome-bg: rgba(244, 241, 234, 0.94);
  --scrim: rgba(11, 11, 11, 0.48);

  /* ---- Carbon (dark) mode ----
   * A designed mode: near-black carbon, warm off-white, muted charcoal
   * structure, restrained bronze. Same token contract; AA-checked against
   * the dark surfaces. Overrides every colour token above when pinned. */
  --paper-dark: #1C1A17;
  --ink-dark: #F0EADF;
  --surface-dark: #262320;
  --line-dark: #3A3630;
  --line-strong-dark: #504A40;
  --muted-dark: #A8A094;
  --signal-dark: #D4A574;
  --signal-text-dark: #D9B082;
  --signal-soft-dark: #C9A06F;
  --focus-ring-dark: #D4A574;
  --signal-deep-dark: #E0BD8C;
  --ok-dark: #5FBF77;
  --chip-dark: #2E2B26;
  --accent-games-dark: #C98A66;
  --accent-experiments-dark: #A89F90;
  --accent-design-dark: #6FA08C;
  --chrome-bg-dark: rgba(28, 26, 23, 0.9);
  --scrim-dark: rgba(8, 8, 6, 0.6);
  /* Text on decorative bronze stays dark in both modes (bronze is a light
     surface for text purposes). */
  --on-signal: #0B0B0B;

  /* ---- Type ---- */
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- Shape / depth ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-pop: 0 12px 32px rgba(11, 11, 11, 0.16);
  --shadow-float: 0 4px 16px rgba(11, 11, 11, 0.12);
  --shadow-card: 0 8px 24px rgba(11, 11, 11, 0.08);
  --shadow-elevated: 0 16px 40px rgba(11, 11, 11, 0.1);

  /* ---- Motion ----
   * Premium easing curves for fluid, tactile interactions. */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- Cursor glow ---- */
  --glow: color-mix(in srgb, var(--signal) 7%, transparent);

  /* ---- Layout ---- */
  --container: 720px;
  --tab-height: 64px;
  --masthead-height: 56px;
}

/* The head script pins data-theme before first paint; these rules make the
   light-dark() tokens resolve to the user's explicit choice. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: var(--paper-dark);
  --ink: var(--ink-dark);
  --surface: var(--surface-dark);
  --line: var(--line-dark);
  --line-strong: var(--line-strong-dark);
  --muted: var(--muted-dark);
  --signal: var(--signal-dark);
  --signal-text: var(--signal-text-dark);
  --signal-soft: var(--signal-soft-dark);
  --focus-ring: var(--focus-ring-dark);
  --signal-deep: var(--signal-deep-dark);
  --chip: var(--chip-dark);
  --accent-games: var(--accent-games-dark);
  --accent-experiments: var(--accent-experiments-dark);
  --accent-design: var(--accent-design-dark);
  --chrome-bg: var(--chrome-bg-dark);
  --scrim: var(--scrim-dark);
  --on-signal: #1C1A17;
}

html {
  scroll-behavior: smooth;
  /* Reserve the scrollbar gutter on every page so the scrollbar appearing or
     disappearing (short vs tall pages) never shifts the centred layout or
     the fixed floating dock sideways between navigations. */
  scrollbar-gutter: stable;
}

/* Smooth theme transition — animates color/background when toggling.
   Scoped to root + key surfaces to avoid conflicting with component animations. */
html, body, .card, .portal, .btn, .tab-item, .masthead, .tab-bar, .site-footer, .search-modal-panel {
  transition: background-color 0.3s var(--ease-out-expo), border-color 0.3s var(--ease-out-expo), color 0.3s var(--ease-out-expo);
}
@media (prefers-reduced-motion: reduce) {
  html, body, .card, .portal, .btn, .tab-item, .masthead, .tab-bar, .site-footer, .search-modal-panel {
    transition: none !important;
  }
}

/* Dark mode depth: subtle warm noise texture for premium feel */
:root[data-theme="dark"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { margin: 0; }

/* ---- Cursor radial glow ----
 * A subtle radial gradient follows the pointer on fine-pointer devices,
 * adding depth to the static page. Hidden on touch and when reduced-motion
 * is preferred. The --cursor-x/y custom properties are set by site.js. */
@media (pointer: fine) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(500px circle at var(--cursor-x, 50%) var(--cursor-y, 50%), var(--glow), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s var(--ease-out-expo);
  }
  body:hover::before { opacity: 1; }
}

/* Skip link — visually hidden until focused (keyboard users) */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 300;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Global visible focus — one consistent keyboard path on every control */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

::selection { background: var(--signal-soft); color: light-dark(var(--ink), #14130f); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ---- Typography scale ----
 * display → section → detail → meta. Fluid display sizes hold at 375px and 1440px. */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  font-weight: 600;
  text-wrap: balance;
}

/* Premium: tighter tracking on display headers for heavy tech look */
h1, h2, h3, h4 { letter-spacing: -0.01em; }
h1.title { font-size: clamp(2.8rem, 7vw, 4.5rem); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 8px; }
h2 { font-size: 22px; margin: 28px 0 8px; letter-spacing: -0.02em; }
h3 { font-size: 17px; margin: 24px 0 6px; }

p { margin: 0 0 14px; color: var(--ink); }
a { color: var(--ink); }
a:hover { color: var(--signal-text); }

.label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 6px;
}

.tagline {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
  max-width: 60ch;
}

/* ---- Page head ---- */
.page-head { padding: 24px 0 8px; }
.page-head h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin: 0 0 8px; letter-spacing: -0.02em; }

/* ---- Sections ---- */
.section { margin: 36px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.section-head h2 { margin: 0; font-size: 20px; }
/* Vermilion index marker: one small brand tick ahead of every section
   heading so section rules read as designed, not default. */
.section-head h2::before,
.now-col h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--signal);
  margin-right: 8px;
  vertical-align: baseline;
}
.section-head a {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
}
.section-head a:hover { color: var(--signal-text); }
.section-note {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---- Buttons ----
 * Premium: fluid cubic-bezier transitions, tactile lift on hover. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s var(--ease-out-expo), color 0.3s var(--ease-out-expo), border-color 0.3s var(--ease-out-expo), transform 0.15s var(--ease-out-quart), box-shadow 0.3s var(--ease-out-expo);
}
.btn svg { flex: 0 0 auto; }
.btn .icon { width: 15px; height: 15px; }
.btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: var(--shadow-float);
  transform: translateY(-1px);
}
.btn:active { transform: scale(0.97) translateY(0); box-shadow: none; }
.btn.btn-primary { background: var(--ink); color: var(--paper); }
.btn.btn-primary:hover {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--on-signal);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--signal) 25%, transparent);
}

/* ---- Lists: hairline-divided editorial rows (work / links / writing) ---- */
.work-list, .link-list, .post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}
.work-item, .link-list li, .post-item { border-bottom: 1px solid var(--line); }
.work-item a, .link-list a {
  display: flex;
  padding: 14px 0;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.work-item a {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.link-list a {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* Narrow screens: the uppercase mono notes don't share a row with the
   label — each note drops under its label so nothing crowds or overlaps. */
@media (max-width: 720px) {
  .link-list a {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .link-list .link-note {
    max-width: 100%;
    white-space: normal;
  }
}
.work-item a:hover, .link-list a:hover { color: var(--signal-text); }
/* Hover affordance: rows lift off the rule with a surface wash and a small
   inset so lists feel tactile rather than flat text. */
.work-item a, .link-list a, .post-item a, .topic-list a, .related-item a {
  border-radius: var(--radius-sm);
  transition: background 150ms ease, padding 150ms ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.work-item a:hover, .link-list a:hover, .post-item a:hover, .topic-list a:hover, .related-item a:hover {
  background: var(--surface);
}
.work-item .work-name { font-weight: 600; font-size: 18px; }
.work-item .work-kind, .link-note { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.work-item .work-desc { color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 56ch; }

/* Icons in list rows (external arrows, social marks) */
.link-list .row-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.link-list .row-label svg { flex: 0 0 auto; color: var(--muted); }
.link-list a:hover .row-label svg { color: var(--signal); }

/* ---- Writing list ----
 * Block-level links for full-row touch targets. */
.post-item { padding: 0; border-bottom: 1px solid var(--line); }
.post-item a {
  display: block;
  padding: 16px 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  transition: background 0.3s var(--ease-out-expo);
}
.post-item a:hover { background: var(--surface); color: var(--ink); }
.post-item .post-title { font-size: 19px; font-weight: 600; }
.post-item .post-meta { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 4px; }
.post-item .post-desc { color: var(--muted); font-size: 15px; margin-top: 6px; }
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.post-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
}

/* ---- Pagination (writing archive) ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}
.pagination-link {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
}
.pagination-link:hover { color: var(--signal); }
.pagination-link.is-disabled { color: var(--muted); pointer-events: none; }
.pagination-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---- Topic index (writing archive) ---- */
.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}
.topic-list li { border-bottom: 1px solid var(--line); }
.topic-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  text-decoration: none;
  color: var(--ink);
}
.topic-list a:hover { color: var(--signal-text); }
.topic-name { font-weight: 600; font-size: 17px; }
.topic-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---- Related posts (article footer) ---- */
.related { margin: 40px 0 8px; }
.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}
.related-item { border-bottom: 1px solid var(--line); }
.related-item a {
  display: block;
  padding: 14px 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  transition: background 0.3s var(--ease-out-expo);
}
.related-item a:hover { background: var(--surface); color: var(--ink); }
.related-title { display: block; font-weight: 600; font-size: 17px; }
.related-meta { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 3px; }

/* Category link inside the article label */
.label a { color: var(--signal-deep); text-decoration: none; }
.label a:hover { text-decoration: underline; }

/* ---- Cards (discrete units only: homepage portals, reference tiles) ----
 * Premium: micro-lift on hover with shadow, cursor-local radial glow. */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 16px 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: border-color 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}
.card:hover, .card:focus-visible {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.card:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.card .card-title { font-weight: 600; font-size: 18px; margin: 0 0 6px; letter-spacing: -0.01em; position: relative; }
.card .card-title .icon { width: 15px; height: 15px; vertical-align: -2px; margin-left: 6px; }
.card .card-kind { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); position: relative; }
.card .card-desc { color: var(--muted); font-size: 14px; margin: 10px 0 0; line-height: 1.55; position: relative; }

@media (min-width: 641px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  /* A trailing odd card spans the full row instead of leaving an orphan cell. */
  .card-grid > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---- Article (blog post / project) ---- */
.article-head { padding: 24px 0 8px; }
.article-head h1 { font-size: clamp(2rem, 5vw, 2.5rem); margin: 0 0 8px; letter-spacing: -0.02em; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 24px;
}

/* ---- Post hero image ----
 * Full-bleed featured image with gradient overlay for text readability.
 * Graceful fallback: if image is missing, shows a subtle gradient surface. */
.post-hero {
  position: relative;
  margin: 0 -20px 24px;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  aspect-ratio: 1200 / 630;
  background: linear-gradient(135deg, var(--surface) 0%, var(--chip) 100%);
}
.post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--paper) 100%);
  pointer-events: none;
  z-index: 2;
}
@media (min-width: 641px) {
  .post-hero { margin: 0 0 32px; border-radius: var(--radius-lg); }
}

/* ---- Key takeaways box ----
 * Prominent summary box at the top of blog posts. */
.key-takeaways {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 0 0 32px;
}
.key-takeaways h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal-text);
  margin: 0 0 12px;
}

/* Affiliate disclosure — mono, quiet, required on any page with affiliate
   links (policed by scripts/check-affiliate-links.mjs). */
.affiliate-disclosure {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 0 0 32px;
}
.affiliate-disclosure p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.key-takeaways ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.key-takeaways li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.key-takeaways li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
}

/* ---- Reading progress bar ----
 * Fixed-position bar at viewport top showing scroll progress through article. */
.post-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 2px;
  background: transparent;
  pointer-events: none;
}
.post-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--signal);
  transition: width 0.1s linear;
}

/* ---- Related post thumbnails ---- */
.related-item a { gap: 12px; align-items: center; }
.related-thumb {
  width: 80px;
  height: 42px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.related-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* ---- Tech stack badges ----
 * Visual display of technologies used in a project. */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 16px 0;
  padding: 0;
}

/* ---- Project meta enhancements ---- */
.project-role, .project-platform {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--signal-text);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
}
.project-timeline { margin: 32px 0; }
.timeline-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

/* ---- Project mission callout ---- */
.project-mission {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  border-left: 3px solid var(--signal);
  padding-left: 16px;
  margin: 16px 0;
}

/* ---- Changelog timeline ----
 * Vertical timeline of project updates. */
.changelog { margin: 40px 0; }
.changelog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
  margin-left: 8px;
}
.changelog-entry {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px 12px;
  align-items: baseline;
  padding: 8px 0 8px 20px;
  position: relative;
}
.changelog-entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.changelog-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.changelog-type {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}
.changelog-type-feature { background: color-mix(in srgb, var(--ok) 15%, transparent); color: light-dark(#1b5e20, #6fd18a); }
.changelog-type-fix { background: color-mix(in srgb, var(--signal) 15%, transparent); color: var(--signal-text); }
.changelog-type-improvement { background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--muted); }
.changelog-desc { font-size: 14px; line-height: 1.5; }

/* ---- Prose (blog / about / legal) ---- */
.prose { max-width: 680px; }
.prose a .icon { width: 15px; height: 15px; vertical-align: -2px; margin-right: 3px; }

/* Sentence-per-line copy (viral-post scannability): each sentence is its own
   line. Applied to page copy; long-form blog content keeps connected paragraphs. */
.copy-lines p { margin: 0 0 10px; }
.copy-lines p:last-child { margin-bottom: 0; }

.prose h1 { font-size: 36px; }
.prose h2 { font-size: 24px; margin-top: 32px; }
.prose h3 { font-size: 19px; margin-top: 24px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; padding: 0; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--chip); padding: 2px 5px; border-radius: 4px; }

/* ---- Code blocks ----
 * Enhanced: wrapper for copy button, language label, better styling. */
.prose pre {
  position: relative;
  /* Code blocks are always-dark carbon surfaces; text tokens are pinned so
     light/dark chrome never renders ink on near-black. */
  background: #100F0D;
  color: var(--paper);
  padding: 16px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--line);
}
.prose pre code { background: transparent; padding: 0; color: inherit; display: block; }

/* Code block header with language label + copy button */
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #0D0C0A;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--line-strong);
}
.code-block-header + pre {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-top: none;
}
.code-lang { color: var(--signal-soft); }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--line-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.copy-btn:hover, .copy-btn:focus-visible { color: var(--paper); border-color: var(--paper); }
.copy-btn.is-copied { color: var(--ok); border-color: var(--ok); }
.copy-btn svg { width: 12px; height: 12px; }

.prose blockquote { margin: 0 0 16px; padding: 4px 16px; border-left: 3px solid var(--signal); color: var(--muted); }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; font-size: 15px; }
.prose th { background: var(--chip); }

/* ---- Post nav ---- */
.post-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 40px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.post-nav a { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); text-decoration: none; }
.post-nav a:hover { color: var(--signal-text); }

/* ---- About page ----
 * Hero with portrait, timeline, and process list. */
.about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 24px 0;
}
.about-portrait {
  position: relative;
  width: 100px;
  height: 100px;
}
.about-portrait-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.about-portrait-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--signal);
  opacity: 0.3;
  pointer-events: none;
}
.about-hero-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.about-lede {
  font-size: 17px;
  color: var(--muted);
  max-width: 40ch;
  margin: 0 auto;
}
.about-content { padding-top: 16px; }

/* ---- Timeline ----
 * Visual timeline for background/education. */
.timeline {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  border-left: 2px solid var(--line);
  margin-left: 8px;
}
.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  align-items: baseline;
  padding: 8px 0 8px 20px;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.timeline-item:last-child::before { background: var(--signal); }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.timeline-desc { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---- Now page ---- */
.now-list { list-style: none; margin: 0; padding: 0; }
.now-list li { margin-bottom: 12px; padding-left: 16px; border-left: 2px solid var(--line); line-height: 1.6; }
.now-list li strong { color: var(--signal-text); }
.now-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.now-grid li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  line-height: 1.6;
}
.now-grid li strong { color: var(--signal-text); }
.now-updated { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 24px; }
@media (min-width: 720px) {
  .now-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- More page: grouped destination grid ---- */
.more-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.more-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal-text);
  margin: 0 0 8px;
}
@media (min-width: 720px) {
  .more-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 32px; align-items: start; }
}

/* ---- Process list ----
 * Numbered steps for "How the work is done". */
.process-list {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.process-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.process-step {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--signal-text);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  flex: 0 0 auto;
}
.process-item strong { display: block; margin-bottom: 2px; }
.process-item span:not(.process-step) { font-size: 14px; color: var(--muted); line-height: 1.5; }

@media (min-width: 641px) {
  .about-hero { flex-direction: row; text-align: left; gap: 28px; }
  .about-portrait { width: 120px; height: 120px; flex: 0 0 auto; }
  .about-lede { margin: 0; }
}

/* ---- Table of contents ----
 * Sticky sidebar-style TOC for long-form blog posts. */
.post-toc {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.post-toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--signal-text);
  margin: 0 0 12px;
}
.post-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-toc-list li { margin-bottom: 6px; }
.post-toc-list li:last-child { margin-bottom: 0; }
.post-toc-list a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.post-toc-list a:hover { color: var(--ink); border-left-color: var(--signal); }

/* ---- 404 ---- */
/* ---- 404 page ----
 * Personality-filled lost page with junction mark, suggestions, and search. */
.notfound {
  text-align: center;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.notfound-mark {
  color: var(--line-strong);
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  animation: notfound-float 3s ease-in-out infinite;
}
.notfound-mark svg { display: block; width: 100%; height: 100%; }
.notfound-code {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--signal-text);
  margin: 0;
}
.notfound h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}
.notfound-lede { color: var(--muted); font-size: 17px; max-width: 40ch; margin: 0; }
.notfound-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.notfound-suggestions { margin-top: 24px; }
.notfound-suggestions-title { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 12px; }
.notfound-links { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.notfound-links a { color: var(--ink); text-decoration: none; font-size: 14px; border-bottom: 1px solid var(--line); transition: border-color 0.2s ease; }
.notfound-links a:hover { border-color: var(--signal); }

@keyframes notfound-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .notfound-mark { animation: none; }
}

/* ---- Uses page (was a page-local <style> block; tokenised here) ---- */
.uses-page section { margin: 40px 0; }
.uses-list { list-style: none !important; margin: 0 !important; padding: 0 !important; border-top: 1px solid var(--line-strong); }
.uses-list li { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 15px 0; margin: 0 !important; border-bottom: 1px solid var(--line); }
.uses-list strong { font-size: 17px; }
.uses-list span { color: var(--muted); font-size: 14px; }
.uses-list a { justify-self: start; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none; color: var(--muted); }
.uses-list a:hover { color: var(--signal-text); }
.uses-icon { display: inline-flex; vertical-align: -3px; margin-right: 7px; color: var(--muted); flex: 0 0 auto; }
.uses-list strong { display: inline-flex; align-items: center; }

/* Hardware machine cards with brand marks */
.uses-hardware { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 16px 0; }
.uses-machine {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.uses-machine-icon { flex: 0 0 auto; color: var(--muted); display: inline-flex; }
.uses-machine-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.uses-machine-body strong { font-size: 17px; }
.uses-machine-meta { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.uses-machine-role { color: var(--muted); font-size: 14px; line-height: 1.5; }
.uses-machine-parts { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.uses-machine-parts li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.uses-machine-parts .icon { flex: 0 0 auto; color: var(--muted); }
@media (min-width: 641px) {
  .uses-hardware { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 641px) {
  .uses-list li { grid-template-columns: minmax(140px, 0.45fr) 1fr auto; align-items: center; gap: 18px; }
  .uses-list a { justify-self: end; }
}

/* Project detail: description under the headline */
.project-head-desc { color: var(--muted); font-size: 17px; line-height: 1.6; max-width: 60ch; margin: 4px 0 0; }

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.3s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(root) {
  animation-name: fade-out;
}
::view-transition-new(root) {
  animation-name: fade-in;
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* ---- Status pills ----
 * Crisp mini-pills with vibrant indicator dots for project metadata.
 * Usage: <span class="status-pill status-live"><span class="status-dot"></span>Live</span> */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  line-height: 1;
}
.status-pill .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.status-pill.status-live .status-dot,
.status-pill.status-active .status-dot,
.status-pill.status-shipped .status-dot {
  background: var(--ok);
  animation: status-pulse 2.5s var(--ease-out-expo) infinite;
}
.status-pill.status-development .status-dot,
.status-pill.status-in-development .status-dot {
  background: #f59e0b;
}
.status-pill.status-experiment .status-dot {
  background: #8b5cf6;
}

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---- Haptic ripple ----
 * Material-style ripple emanating from pointer position on buttons,
 * cards, and controls. Works on all devices as visual confirmation. */
.haptic-ripple-host {
  position: relative;
  overflow: hidden;
}
.haptic-ripple {
  position: absolute;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  transform: scale(0);
  animation: haptic-ripple 0.5s var(--ease-out-expo) forwards;
  pointer-events: none;
}
@keyframes haptic-ripple {
  to { transform: scale(2.5); opacity: 0; }
}

/* ---- Scroll reveal ----
 * Elements .reveal fade + slide into view when scrolled into viewport.
 * Staggered via inline transition-delay set by site.js IntersectionObserver. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Project detail: anchored sections + data sidebar ----
 * Information architecture inspired by complete listing pages (every fact a
 * visitor needs visible once), rendered in the By JTT paper-and-ink style. */
.project-head h1 { margin: 0 0 12px; }
.project-hero { margin: 0 0 24px; }
.project-tabs {
  border-bottom: 1px solid var(--line);
  margin: 8px 0 28px;
}
.project-tabs-list {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
}
.project-tabs .tab-item {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  background: var(--chip);
  white-space: nowrap;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.project-tabs .tab-item:hover { color: var(--signal-text); background: var(--surface); }
.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
@media (min-width: 941px) {
  .project-body { grid-template-columns: minmax(0, 1fr) 280px; }
  .project-side {
    position: sticky;
    top: calc(var(--masthead-height) + 16px);
    max-height: calc(100vh - var(--masthead-height) - 32px);
    overflow-y: hidden;
  }
}
.project-archive-note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
}
.project-archive-note a { color: var(--signal-text); }
.project-section { margin: 0 0 40px; }
.project-section h2 {
  font-size: 24px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.version-history-note {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 14px;
}
.release-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  border-top: 1px solid var(--line);
}
.release-item { border-bottom: 1px solid var(--line); }
.release-item a {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 12px 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  transition: background 150ms ease;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.release-item a:hover { background: var(--surface); color: var(--signal-text); }
.release-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal-text);
  background: var(--chip);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.release-name { font-size: 15px; font-weight: 500; flex: 1 1 auto; min-width: 0; }
.release-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.version-history-more { margin: 0; font-size: 14px; }

/* Project sidebar */
.side-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 16px;
  margin: 0 0 16px;
}
.side-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 12px;
}
.side-info { margin: 0; }
.side-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.side-row:last-child { border-bottom: none; }
.side-row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  flex: 0 0 auto;
}
.side-row dd { margin: 0; font-size: 14px; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.side-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-links .btn { display: inline-flex; justify-content: center; }
.side-links-block .side-links { gap: 6px; }
.side-links .btn { font-size: 13px; padding: 8px 12px; }
.side-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.side-gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: block;
}

/* ---- Tech stack in sidebar ---- */
.side-tech { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; align-items: center; }
.side-tech .tech-chip { padding: 3px 6px; }
.side-tech .tech-chip .brand-icon { width: 14px; height: 14px; margin-right: 4px; vertical-align: middle; }
.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--chip);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.tech-chip:hover { background: var(--surface); color: var(--ink); }
.tech-chip .tech-chip-text { color: inherit; }
.tech-sep { color: var(--line-strong); font-size: 10px; margin: 0 2px; }

/* ---- Updates section in sidebar ---- */
.side-updates { list-style: none; margin: 0; padding: 0; }
.update-item { border-bottom: 1px solid var(--line); }
.update-item:last-child { border-bottom: none; }
.update-item a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.update-item a:hover { color: var(--signal-text); background: var(--surface); border-radius: var(--radius-sm); }
.update-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal-text);
  background: var(--chip);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.update-date { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ---- Work index: catalog controls + enriched rows ---- */
.page-head-desc { color: var(--muted); font-size: 15px; margin: 0 0 8px; max-width: 60ch; }
.work-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.work-sort {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  touch-action: manipulation;
}
.work-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.filter-chip:hover { color: var(--signal-text); border-color: var(--line-strong); }
.filter-chip.is-active {
  color: var(--on-signal);
  background: var(--signal);
  border-color: var(--signal);
}
.work-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 0 auto;
  white-space: nowrap;
}
.work-item a { position: relative; }
.work-list .work-item a {
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
}
.work-thumb { flex: 0 0 auto; }
.work-thumb img {
  width: 168px;
  height: 94px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  display: block;
}
.work-item a { gap: 18px; padding: 18px 0; }
.work-item .work-name { font-size: 20px; }
.work-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.work-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.work-version { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.work-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 2px;
}
.work-links {
  position: absolute;
  top: 14px;
  right: 0;
  display: flex;
  gap: 6px;
}
.work-link-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.work-link-dot-gh { background: var(--muted); }
.work-empty { padding: 24px 0; color: var(--muted); }
@media (max-width: 940px) {
  .work-links { display: none; }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Public brand reference: the palette is intentionally small and flat. */
.brand-swatch-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
}
.brand-swatch {
  min-height: 104px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
}
.brand-swatch code { font-size: 10px; background: transparent; padding: 0; }
.brand-swatch-paper { background: #F4F1EA; color: #0B0B0B; }
.brand-swatch-ink { background: #0B0B0B; color: #F4F1EA; }
.brand-swatch-charcoal { background: #1A1A1A; color: #F4F1EA; }
.brand-swatch-bronze { background: #D4A574; color: #0B0B0B; }
@media (max-width: 700px) {
  .brand-swatch-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .brand-swatch-row { grid-template-columns: 1fr; }
  .brand-swatch { min-height: 64px; }
}
