/* ==========================================================================
   Robert Boles — QA systems + builder lab
   Design system. Static, dependency-free, GitHub Pages friendly.
   Self-hosted fonts: IBM Plex Sans (body), Space Grotesk (display), JetBrains Mono (mono).
   ========================================================================== */

/* ---- Fonts (self-hosted, variable woff2) -------------------------------- */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans-latin.woff2') format('woff2');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  --bg: #f7f5f0;
  --surface: #fffdf8;
  --surface-2: #f1eee6;
  --ink: #1c1b18;
  --muted: #56524a;
  --faint: #8a8578;
  --fainter: #b8b3a6;
  --line: #e6e2d8;
  --line-soft: #ece8de;
  --accent: #1f8a5b;
  --accent-hi: #24a06a;
  --accent-soft: #e9f3ec;
  --accent-soft-line: #bfe0cc;
  --dark: #1c1b18;
  --dark-2: #26241f;
  --dark-3: #2f2d27;
  --dark-line: #33312b;
  --dark-line-2: #43413a;
  --dark-ink: #f7f5f0;
  --dark-muted: #b3aea3;
  --dark-faint: #9a958a;
  --dark-fainter: #6b6a64;

  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --wrap: 1140px;
  --pad: 32px;
  --radius: 8px;
}

/* ---- Reset / base ------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.12; margin: 0; }

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Layout helpers ----------------------------------------------------- */
.container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 56px 0; }
.section.tight { padding: 32px 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--dark-ink);
  font-family: var(--mono); font-size: 12px; padding: 10px 14px; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 240, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-shell {
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 7px; padding: 0; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  font-family: var(--mono); font-weight: 700; color: var(--accent); font-size: 0;
}
.brand-mark::before { content: '$'; font-size: 15px; }
.brand-text { display: flex; align-items: baseline; gap: 6px; }
.brand-text strong {
  font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--ink);
}
.brand-text small { font-family: var(--mono); color: var(--fainter); font-size: 13px; }

.site-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  position: relative;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  color: var(--muted); padding: 9px 11px; border-radius: 4px;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after {
  content: ''; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; background: var(--accent);
}
.nav-search { color: var(--accent); }

.nav-toggle {
  display: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  background: none; border: 1px solid var(--line); border-radius: 5px;
  color: var(--ink); padding: 8px 12px; cursor: pointer;
}
/* Theme toggle retired in the redesign (prototype is a single, refined light theme) */
.theme-toggle { display: none; }

/* ---- Buttons ------------------------------------------------------------ */
.button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  background: var(--ink); color: var(--dark-ink);
  border: none; border-radius: 4px; padding: 11px 16px;
  transition: background .14s ease;
}
.button:hover { background: var(--accent); color: var(--dark-ink); }
.button.secondary { background: none; color: var(--ink); border: 1px solid var(--line); }
.button.secondary:hover { border-color: var(--accent); color: var(--accent); background: none; }
.button.accent { background: var(--accent); }
.button.accent:hover { background: var(--accent-hi); }

/* ---- Eyebrow / hero / headings ------------------------------------------ */
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 14px;
}
.breadcrumbs { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-bottom: 18px; }
.breadcrumbs a { color: var(--accent); }

.page-hero { border-bottom: 1px solid var(--line); padding: 56px 0 44px; }
.page-hero.narrow { max-width: 820px; border: none; padding: 0; }
.page-hero h1 { font-size: 42px; font-weight: 700; margin: 0 0 16px; }
.lede { font-size: 18px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 62ch; }

.section-header { margin-bottom: 28px; }
.section-header h2 { font-size: 24px; font-weight: 600; margin: 0 0 6px; }
.section-header p { color: var(--muted); margin: 0; font-size: 15px; }

/* ---- Filter bar / search box -------------------------------------------- */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px;
}
.search-box {
  width: 100%; max-width: 480px;
  font-family: var(--mono); font-size: 13px;
  background: var(--surface); border: 1px solid #d8d3c8; border-radius: 6px;
  padding: 12px 14px; color: var(--ink); outline: none;
  transition: border-color .14s ease;
}
.search-box:focus { border-color: var(--accent); }
.search-box::placeholder { color: var(--fainter); }

/* ---- Card grids --------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.two-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.lane-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.card-topline {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--faint);
}
.card-topline span:first-child { color: var(--accent); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-row span {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  background: var(--surface-2); border-radius: 3px; padding: 3px 8px;
}

/* Post card */
.post-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 22px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.post-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 14px 30px -20px rgba(28, 27, 24, 0.4);
}
.post-card h3 { font-size: 19px; font-weight: 600; line-height: 1.25; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); flex: 1; }

/* Project card */
.project-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.project-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 16px 34px -22px rgba(28, 27, 24, 0.45);
}
.project-visual {
  height: 120px; background: var(--dark); display: flex; align-items: center; justify-content: center;
}
.project-visual span {
  font-family: var(--display); font-weight: 700; font-size: 40px; letter-spacing: 0.04em; color: var(--accent);
}
.project-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.project-body h3 { font-size: 20px; font-weight: 600; }
.project-body h3 a { color: var(--ink); }
.project-body h3 a:hover { color: var(--accent); }
.project-body p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }

/* Note card */
.note-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px;
}
.note-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.note-card h2 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); font-weight: 500; margin-bottom: 12px;
}
.note-card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.note-card a {
  display: block; font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  padding: 5px 0; border-bottom: 1px solid var(--line-soft);
}
.note-card a:last-child { border-bottom: none; }
.note-card a:hover { color: var(--accent); }

/* Empty state */
.empty-state {
  display: none; font-family: var(--mono); font-size: 13px; color: var(--faint);
  padding: 40px 0; text-align: center;
}
.empty-state.is-visible { display: block; }

/* ---- Article ------------------------------------------------------------ */
.article-meta {
  display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0 14px;
  font-family: var(--mono); font-size: 12px; color: var(--faint);
}
.article { padding: 48px 0 72px; }
.article-grid { display: grid; grid-template-columns: 1fr 280px; gap: 48px; align-items: start; }
.article-body { font-size: 17px; line-height: 1.7; color: #2a2823; max-width: 70ch; }
.article-body h2 {
  font-size: 24px; font-weight: 600; margin: 40px 0 14px; scroll-margin-top: 84px;
}
.article-body p { margin: 0 0 18px; }
.article-body .promise {
  font-family: var(--display); font-weight: 500; font-size: 21px; line-height: 1.4;
  color: var(--ink); border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin: 0 0 32px;
}
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body code {
  font-family: var(--mono); font-size: 0.88em; background: var(--surface-2);
  border-radius: 3px; padding: 2px 6px;
}
.article-body h2 + .two-grid, .article-body .two-grid { margin-top: 8px; }

.article-aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.article-nav-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px;
  transition: border-color .14s ease, transform .14s ease;
}
.article-nav-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.article-nav-card strong { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--ink); }
.article-nav-card span { font-family: var(--mono); font-size: 11px; color: var(--accent); }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); margin-top: 24px; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; padding: 48px 0 32px;
}
.footer-grid h2 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); font-weight: 500; margin-bottom: 12px;
}
.footer-grid > div > a { display: block; }
.footer-grid .footer-brand {
  font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); margin-bottom: 10px;
}
.footer-grid p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 38ch; }
.footer-grid > div > a:not(.footer-brand) {
  font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 4px 0;
}
.footer-grid > div > a:not(.footer-brand):hover { color: var(--accent); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 0 32px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--faint);
}

/* ==========================================================================
   Home page
   ========================================================================== */
.home-hero { border-bottom: 1px solid var(--line); }
.home-hero .container {
  padding-top: 72px; padding-bottom: 64px;
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center;
}
.hero-copy { animation: fadeup .5s ease both; }
.hero-status {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--faint);
  display: flex; align-items: center; gap: 10px; margin-bottom: 24px;
}
.hero-status .branch { color: var(--fainter); }
.hero-status .dot { color: #d8d3c8; }
.hero-status .passing { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.hero-status .passing::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block;
}
.hero-copy h1 {
  font-size: 52px; font-weight: 700; line-height: 1.04; margin: 0 0 22px; text-wrap: balance;
}
.hero-tagline {
  font-family: var(--mono); font-size: 14px; color: var(--accent); margin: 0 0 20px; letter-spacing: 0.01em;
}
.hero-copy .lede { font-size: 17px; max-width: 46ch; }

.hero-terminal {
  font-family: var(--mono); font-size: 13px; line-height: 1.85;
  background: var(--dark); color: var(--dark-muted);
  border-radius: var(--radius); padding: 22px 22px 20px;
  box-shadow: 0 18px 40px -22px rgba(28, 27, 24, 0.5);
}
.hero-terminal .prompt { color: var(--dark-fainter); margin-bottom: 8px; }
.hero-terminal .prompt .arrow { color: var(--accent); }
.hero-terminal .prompt .cmd { color: var(--dark-ink); }
.hero-terminal .role { color: var(--dark-faint); }
.hero-terminal .spacer { height: 14px; }
.hero-terminal .label { color: var(--dark-fainter); }
.hero-terminal .num { color: var(--accent); }
.hero-terminal .ship { color: var(--accent); }
.hero-terminal .cursor {
  display: inline-block; width: 8px; height: 15px; background: var(--accent);
  margin-left: 4px; vertical-align: -2px; animation: blink 1.1s step-end infinite;
}

/* Three lanes */
.lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lane-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.lane-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 14px 30px -20px rgba(28, 27, 24, 0.4);
}
.lane-card .prompt { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.lane-card h3 { font-size: 21px; font-weight: 600; }
.lane-card h3 a { color: var(--ink); }
.lane-card:hover h3 a { color: var(--accent); }
.lane-card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); flex: 1; }
.lane-card .meta {
  display: flex; align-items: center; justify-content: space-between; margin-top: 6px;
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}
.lane-card .meta .arrow { color: var(--accent); font-size: 14px; }

/* Section caption on home */
.caption {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 20px;
}
.row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px; border-bottom: 1px solid var(--line); padding-bottom: 14px;
}
.row-head h2 { font-size: 24px; font-weight: 600; }
.row-head .meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}

/* Recent writing list */
.post-list { display: flex; flex-direction: column; }
.post-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center;
  padding: 18px 8px; border-bottom: 1px solid var(--line-soft);
  transition: background .12s ease;
}
.post-row:hover { background: var(--surface); }
.post-row .date { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.post-row .mid { display: flex; flex-direction: column; gap: 4px; }
.post-row .title { font-family: var(--display); font-weight: 500; font-size: 17.5px; color: var(--ink); }
.post-row:hover .title { color: var(--accent); }
.post-row .cat { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--accent); }
.post-row .read { font-family: var(--mono); font-size: 11px; color: var(--fainter); }

/* Dark projects section */
.projects-dark { background: var(--dark); color: var(--dark-ink); }
.projects-dark .row-head { border-bottom: none; margin-bottom: 28px; padding-bottom: 0; }
.projects-dark .row-head h2 { color: var(--dark-ink); }
.projects-dark .row-head .meta { color: var(--dark-fainter); }
.projects-split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.project-feature {
  background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
}
.project-feature .featured-line {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}
.mana { display: inline-flex; gap: 5px; }
.mana span { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.mana .w { background: #f3eecf; border: 1px solid #cdc7a8; }
.mana .u { background: #3b7cc4; }
.mana .b { background: #3a3833; border: 1px solid #555149; }
.mana .r { background: #c0473a; }
.mana .g { background: var(--accent); }
.project-feature h3 { font-size: 30px; font-weight: 700; color: var(--dark-ink); }
.project-feature p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--dark-muted); max-width: 48ch; }
.stack-row { display: flex; flex-wrap: wrap; gap: 7px; }
.stack-row span {
  font-family: var(--mono); font-size: 11px; color: var(--dark-faint);
  border: 1px solid var(--dark-line-2); border-radius: 3px; padding: 3px 8px;
}
.project-mini-col { display: flex; flex-direction: column; gap: 14px; }
.project-mini {
  background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: var(--radius);
  padding: 18px 20px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  transition: border-color .14s ease;
}
.project-mini:hover { border-color: var(--accent); }
.project-mini h3 { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--dark-ink); }
.project-mini h3 a { color: var(--dark-ink); }
.project-mini:hover h3 a { color: var(--accent); }
.project-mini p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--dark-faint); }
.project-mini .tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--dark-fainter); margin-top: 2px;
}

/* About strip */
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: start; }
.about-grid h2 { font-size: 28px; font-weight: 600; line-height: 1.15; }
.about-copy { display: flex; flex-direction: column; gap: 18px; }
.about-copy p { margin: 0; line-height: 1.65; color: #3a3833; }
.about-copy p.sub { font-size: 16px; color: var(--muted); }
.about-copy strong { color: var(--ink); font-weight: 600; }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.chip-row span { border: 1px solid var(--line); border-radius: 3px; padding: 5px 10px; }

/* Subscribe */
.subscribe { border-top: 1px solid var(--line); background: var(--surface); }
.subscribe .container {
  display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap;
  padding-top: 56px; padding-bottom: 56px;
}
.subscribe h2 { font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.subscribe .blurb { max-width: 42ch; }
.subscribe .blurb p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.subscribe form { display: flex; gap: 10px; align-items: center; min-width: 340px; }
.subscribe input {
  flex: 1; font-family: var(--mono); font-size: 13px; background: var(--bg);
  border: 1px solid #d8d3c8; border-radius: 4px; padding: 12px 14px; color: var(--ink); outline: none;
}
.subscribe input:focus { border-color: var(--accent); }
.subscribe .confirm {
  min-width: 340px; font-family: var(--mono); font-size: 13px; color: var(--accent);
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-soft-line); border-radius: 4px; padding: 14px 16px;
}
.subscribe .confirm::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.is-hidden { display: none !important; }

/* Field-guide category blocks */
.guide-cat { padding: 36px 0; border-bottom: 1px solid var(--line-soft); }
.guide-cat .grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 40px; align-items: start; }
.guide-cat .idx-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.guide-cat .idx { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.guide-cat h2 { font-size: 23px; font-weight: 600; }
.guide-cat .topics { display: flex; flex-wrap: wrap; gap: 7px; }
.guide-cat .topics span {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 5px 9px;
}
.guide-cat .links { display: flex; flex-direction: column; }
.guide-cat .links a {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 4px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--display); font-weight: 500; font-size: 16px; color: var(--ink);
  transition: padding-left .14s ease, background .12s ease;
}
.guide-cat .links a:hover { padding-left: 12px; background: var(--surface); color: var(--accent); }
.guide-cat .links a .read { font-family: var(--mono); font-size: 11px; color: var(--fainter); font-weight: 400; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  :root { --pad: 22px; }
  .home-hero .container { grid-template-columns: 1fr; gap: 36px; }
  .hero-copy h1 { font-size: 40px; }
  .lanes { grid-template-columns: 1fr; }
  .projects-split { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .article-grid { grid-template-columns: 1fr; gap: 32px; }
  .article-aside { position: static; }
  .guide-cat .grid { grid-template-columns: 1fr; gap: 20px; }
  .card-grid, .two-grid, .lane-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--pad) 16px;
  }
  .site-nav.is-open { display: flex; }
  .nav-link { padding: 12px 4px; font-size: 13px; }
  .nav-link.is-active::after { display: none; }
}

/* ---- Filter buttons (article library) ----------------------------------- */
.filter-button {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 8px 13px; cursor: pointer;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.filter-button:hover { border-color: var(--accent); color: var(--ink); }
.filter-button.is-active { background: var(--ink); color: var(--dark-ink); border-color: var(--ink); }

/* ---- About: lists ------------------------------------------------------- */
.template-list { margin: 0; padding-left: 18px; }
.template-list li { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin-bottom: 7px; }

/* ---- Project case studies ----------------------------------------------- */
.case-study { padding: 8px 0 72px; }
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.case-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px;
}
.case-panel h2 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: 10px;
}
.case-panel p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.callout {
  background: var(--accent-soft); border: 1px solid var(--accent-soft-line); border-radius: 6px;
  padding: 16px 18px; font-size: 14.5px; line-height: 1.6; color: #25503b;
}
.callout strong { color: var(--accent); }

@media (max-width: 900px) {
  .case-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero-copy h1 { font-size: 32px; }
  .page-hero h1 { font-size: 32px; }
  .post-row { grid-template-columns: 1fr; gap: 6px; }
  .post-row .read { display: none; }
  .brand-text small { display: none; }
  .subscribe form, .subscribe .confirm { min-width: 0; width: 100%; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
  .filter-bar { gap: 6px; }
}

/* ==========================================================================
   Empty / drafting states (used while the library is being written)
   ========================================================================== */
.lane-note {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 24px 26px; max-width: 72ch;
}
.lane-note .caption { margin-bottom: 10px; }
.lane-note p { margin: 0 0 12px; font-size: 16px; line-height: 1.65; color: var(--muted); }
.lane-note p:last-child { margin-bottom: 0; }
.lane-note .lane-note-cta { font-size: 14.5px; color: var(--faint); }
.lane-note a { color: var(--accent); border-bottom: 1px solid var(--accent-soft-line); }
.lane-note a:hover { border-color: var(--accent); }
.links-soon { font-family: var(--mono); font-size: 12.5px; color: var(--faint); margin: 0; }

/* ==========================================================================
   Article template components (RBB-002 scaffolding)
   ========================================================================== */
/* Freshness / "last verified" line */
.article-verified {
  font-family: var(--mono); font-size: 12px; color: var(--faint);
  margin: 0 0 28px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.article-verified .dot { color: var(--accent); }

/* Callouts: tip (default, reuses .callout) + warn variant */
.callout { margin: 24px 0; }
.callout .callout-label {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 600; margin-bottom: 6px; color: var(--accent);
}
.callout p { margin: 0; }
.callout.warn { background: #fbf3e7; border-color: #ecd8b3; color: #5c4708; }
.callout.warn .callout-label { color: #b5810c; }
.callout.warn strong { color: #8a6308; }

/* Code blocks with language label + copy button */
.code-block { position: relative; margin: 24px 0; }
.code-block .code-label {
  position: absolute; top: 0; left: 0; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--dark-faint);
  background: var(--dark-3); padding: 4px 10px; border-radius: 6px 0 6px 0;
}
.code-block pre {
  margin: 0; background: var(--dark); color: #e9e6dd; border: 1px solid var(--dark-line);
  border-radius: 6px; padding: 34px 18px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65;
}
.code-block pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.code-copy {
  position: absolute; top: 6px; right: 6px; font-family: var(--mono); font-size: 11px;
  color: var(--dark-muted); background: var(--dark-3); border: 1px solid var(--dark-line-2);
  border-radius: 4px; padding: 4px 9px; cursor: pointer; transition: color .14s, border-color .14s;
}
.code-copy:hover { color: var(--accent-hi); border-color: var(--accent); }

/* Comparison / micro tables inside articles */
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14.5px; }
.article-body thead th {
  text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint); font-weight: 600;
  border-bottom: 2px solid var(--line); padding: 8px 12px;
}
.article-body tbody td { border-bottom: 1px solid var(--line); padding: 10px 12px; vertical-align: top; color: var(--muted); }
.article-body tbody tr:hover { background: var(--surface); }
.article-body .table-caption { font-size: 13px; color: var(--faint); margin: -14px 0 24px; font-style: italic; }

/* Mid-article inline newsletter CTA (placed after the first solved task) */
.cta-inline {
  margin: 36px 0; padding: 22px 24px; background: var(--accent-soft);
  border: 1px solid var(--accent-soft-line); border-radius: 8px;
}
.cta-inline h3 { font-family: var(--display); font-size: 18px; color: var(--ink); margin: 0 0 6px; }
.cta-inline p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; color: #2f5a43; }
.cta-inline form { display: flex; gap: 8px; flex-wrap: wrap; }
.cta-inline input[type=email] {
  flex: 1 1 220px; font-family: var(--mono); font-size: 13.5px; padding: 10px 12px;
  border: 1px solid var(--accent-soft-line); border-radius: 6px; background: var(--surface);
}

/* Reusable-asset / lead-magnet block (the anti-slop payload) */
.reusable-asset {
  margin: 28px 0; padding: 20px 22px; border: 1px dashed var(--accent-soft-line);
  border-radius: 8px; background: var(--surface);
}
.reusable-asset .caption { margin-bottom: 8px; }
.reusable-asset p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* Author bio block (links to the ProfilePage on /about/) */
.author-bio {
  display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: start;
  margin: 48px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line);
}
.author-bio .avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center;
  font-family: var(--mono); font-size: 18px; color: var(--accent); font-weight: 600;
}
.author-bio h2 { font-family: var(--display); font-size: 17px; margin: 0 0 4px; }
.author-bio p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.author-bio .bio-links a { font-family: var(--mono); font-size: 12.5px; color: var(--accent); margin-right: 14px; }

/* TOC active-section highlight (driven by IntersectionObserver) */
.note-card a.is-current { color: var(--accent); font-weight: 600; }

/* Home "start here" lanes — roadmap state for not-yet-live lanes */
.lane-card .soon-tag {
  display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; margin-bottom: 10px;
}
.lane-card.is-soon { opacity: .72; }
.lane-card.is-soon:hover { opacity: 1; }

@media (max-width: 760px) {
  .author-bio { grid-template-columns: 1fr; }
  .author-bio .avatar { display: none; }
}

/* ==========================================================================
   Field Kit (reusable artifacts library)
   ========================================================================== */
.narrow-body { max-width: 760px; margin: 0 auto; }
.narrow-body h2 { font-family: var(--display); font-size: 22px; font-weight: 600; margin: 36px 0 14px; }
.narrow-body > p { font-size: 16px; line-height: 1.7; color: var(--muted); margin: 0 0 18px; }
.narrow-body code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border-radius: 3px; padding: 2px 6px; }

.kit-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button.ghost:hover { border-color: var(--accent); color: var(--accent); }

.kit-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.kit-table thead th {
  text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint); font-weight: 600;
  border-bottom: 2px solid var(--line); padding: 9px 12px;
}
.kit-table tbody td { border-bottom: 1px solid var(--line); padding: 11px 12px; vertical-align: top; color: var(--muted); }
.kit-table tbody td strong { color: var(--ink); }

/* General table caption (article-scoped rule above still wins inside .article-body) */
.table-caption { font-size: 13px; color: var(--faint); margin: -6px 0 24px; font-style: italic; }

.kit-voice {
  margin: 16px 0; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px;
}
.kit-voice-label {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 600; color: var(--accent); margin-bottom: 6px;
}
.kit-voice p { margin: 0; font-size: 15px; line-height: 1.65; color: #2a2823; }
.kit-voice code { background: var(--surface-2); }

.kit-back { margin-top: 32px; font-family: var(--mono); font-size: 13px; }
.kit-back a { color: var(--accent); }

/* Print: strip the chrome so a Field Kit card saves clean to PDF */
@media print {
  .site-header, .site-footer, .skip-link, .kit-actions, .kit-back, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .page-hero { padding-top: 12px !important; }
  a { color: inherit; text-decoration: none; }
  .kit-voice, .kit-table, .callout { break-inside: avoid; }
}

/* ---- Card-name hover preview (Table Talk articles) ----------------------
   .cardname wraps an MTG card name in article body copy. The image shown on
   hover/focus is a small, locally-hosted thumbnail (assets/images/cards/) —
   fetched once at authoring time, not at runtime — so there is no live
   third-party request. The popup's outbound link still goes to Scryfall for
   whoever wants the current printing. See assets/js/site.js initCardHover(). */
.cardname {
  border-bottom: 1px dotted var(--fainter);
  cursor: help;
}
.cardname:hover, .cardname:focus { border-bottom-color: var(--accent); color: var(--accent); }

#cardpop {
  display: none; position: fixed; z-index: 60; width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 40px -22px rgba(28, 27, 24, 0.5);
  opacity: 0; transform: translateY(4px); transition: opacity .14s ease, transform .14s ease;
}
/* Not interactive until it has actually faded in — avoids a sliver of dead
   space intercepting clicks/hover during the fade, while still letting the
   reader move the pointer into the popup and click the Scryfall link once
   it's shown (see the hide-delay logic in assets/js/site.js). */
#cardpop:not(.on) { pointer-events: none; }
#cardpop.on { opacity: 1; transform: translateY(0); }
#cardpop img { display: block; width: 100%; border-radius: var(--radius) var(--radius) 0 0; }
#cardpop .cp-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; font-family: var(--mono); font-size: 11.5px;
}
#cardpop .cp-nm { color: var(--muted); }
#cardpop .cp-foot a { color: var(--accent); border-bottom: none; }
