/*
 * Instrument theme stylesheet.
 * Design tokens sourced from mockups/new theme/README.md — do not
 * reintroduce shadows, radius, or transform-based hovers; the design
 * has no elevation language.
 *
 * Layout: .instrument-container carries the viewport gutter and caps
 * the content box at exactly --content-max, so every section's content
 * and rules share one left/right edge.
 */

:root {
  --bg: #0b0d0e;
  --panel: #0e1112;
  --border: #1e2224;
  --border-strong: #2b3134;
  --border-strong-hover: #4a5457;
  --chip-border: #23282a;

  --text: #e8eaea;
  --text-article: #c8cecd;
  --text-hero: #a8b0ae;
  --text-card: #98a09e;
  --text-muted: #6f7877;
  --text-dim: #5c6465;
  --text-axis: #4e5658;
  --text-disabled: #3c4447;
  --syntax-muted: #76807f;

  --accent: oklch(0.74 0.12 195);
  --accent-hover: oklch(0.8 0.12 195);
  --accent-muted: oklch(0.62 0.09 195);
  --accent-border: oklch(0.42 0.07 195);
  --accent-rule: oklch(0.5 0.08 195);
  --accent-on: #06181b;
  --amber: oklch(0.78 0.11 95);

  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --content-max: 1120px;
  --gutter: 44px;
  --section-pad-y: 76px;
  --head-rule-gap: 44px;
}

@media (max-width: 1119px) {
  :root { --gutter: 32px; }
}

@media (max-width: 699px) {
  :root {
    --gutter: 20px;
    --section-pad-y: 40px;
    --head-rule-gap: 32px;
  }
}

/* ---------- Reset & base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.instrument {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, p { margin: 0; }

button { font: inherit; }

.instrument-container {
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* radius: 0 everywhere, no shadows */
a, button, input, .btn, .card, .filter-chip { border-radius: 0; box-shadow: none; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-on);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 18px;
}

.skip-link:focus {
  left: 0;
}

/* Focus states — not in the mocks, required. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.filter-chip:focus-visible {
  outline: 2px solid var(--accent-muted);
  outline-offset: 2px;
}

/* ---------- Header / nav ---------- */

.site-header { border-bottom: 1px solid var(--border); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 10px;
  font-weight: 600;
  flex: 0 0 auto;
}

.brand__name { font-weight: 500; }

.primary-nav { color: var(--text-muted); }

.primary-nav__list {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a:hover,
.primary-nav a:focus-visible { color: var(--text); }

/* WordPress marks the active item; the fallback nav mirrors the class */
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a,
.primary-nav .current-menu-parent > a {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

.nav-contact {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-border);
  padding-bottom: 2px;
  white-space: nowrap;
}

.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -11px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  flex-direction: column;
  padding: 20px;
}

.mobile-overlay.is-open { display: flex; }

.mobile-overlay__close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.mobile-nav .primary-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav a {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  min-height: 44px;
  display: flex;
  align-items: center;
}

@media (max-width: 899px) {
  .primary-nav, .nav-contact.desktop-only { display: none; }
  .mobile-toggle { display: flex; }
  .site-header__inner { padding-top: 14px; padding-bottom: 14px; }
}

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 13px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
}

.btn--primary:hover, .btn--primary:focus-visible { background: var(--accent-hover); }

.btn--secondary {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn--secondary:hover, .btn--secondary:focus-visible { border-color: var(--border-strong-hover); }

.btn--tertiary {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border-strong);
}

.btn--tertiary:hover, .btn--tertiary:focus-visible { color: var(--text); }

/* Contact band buttons run one size up, per mock 2a */
.btn--band { font-size: 14px; padding: 16px 20px; }
.btn--band.btn--secondary { font-size: 13px; padding: 15px 20px; }

/* ---------- Hero ---------- */

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  padding-top: var(--section-pad-y);
  padding-bottom: 68px;
  align-items: start;
}

.hero__copy { display: flex; flex-direction: column; gap: 26px; }

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
  text-wrap: pretty;
}

.hero__lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-hero);
  max-width: 52ch;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

.hero__note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  padding-top: 8px;
}

@media (max-width: 899px) {
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 699px) {
  .hero__grid { padding-top: 40px; padding-bottom: 36px; gap: 32px; }
  .hero__copy { gap: 20px; }
  .hero__title { font-size: 31px; line-height: 1.15; }
  .hero__lede { font-size: 16px; }
  .hero__actions { flex-direction: column; gap: 10px; }
  .hero__actions .btn { width: 100%; padding: 16px; font-size: 14px; }
  .hero__actions .btn--tertiary { padding: 14px; border-bottom: none; }
}

/* ---------- Instrument panel ---------- */

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

.panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.panel__bar-right { display: flex; gap: 14px; }

.panel__live { color: var(--accent); }

.panel__ascii {
  margin: 0;
  padding: 22px 14px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  color: var(--accent-muted);
  white-space: pre;
  overflow: hidden;
}

.panel__axis {
  display: flex;
  justify-content: space-between;
  padding: 0 14px 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-axis);
  letter-spacing: 0.08em;
}

.panel__log {
  border-top: 1px solid var(--border);
  padding: 18px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.85;
  color: var(--text-hero);
}

.panel__log-prompt { color: var(--text-muted); }

.panel__log-line .check { color: var(--accent); }

.panel__log-final { color: var(--text); }

.cursor {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
}

@media (max-width: 699px) {
  .panel__bar { font-size: 10px; padding: 10px 12px; }
  .panel__ascii { font-size: 8px; padding: 16px 12px 10px; line-height: 1.3; }
  .panel__axis { padding: 0 12px 14px; }
  .panel__log { font-size: 11px; padding: 14px 12px; line-height: 1.8; }
}

/* ---------- Fact strip ---------- */

.fact-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.fact-strip__item {
  padding: 24px 32px;
  border-right: 1px solid var(--border);
}

.fact-strip__item:first-child { padding-left: 0; }
.fact-strip__item:last-child { padding-right: 0; border-right: none; }

.fact-strip__value { font-family: var(--font-mono); font-size: 22px; }

.fact-strip__label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 4px;
}

@media (max-width: 699px) {
  .fact-strip { grid-template-columns: 1fr; }
  .fact-strip__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 18px 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .fact-strip__item:last-child { border-bottom: none; }
  .fact-strip__value { font-size: 19px; white-space: nowrap; }
  .fact-strip__label { padding-top: 0; text-align: right; }
}

/* ---------- Sections ---------- */

.section { padding-bottom: var(--section-pad-y); }

/* First section after the fact strip carries its own top padding */
.section--lead { padding-top: var(--section-pad-y); }

.section > .instrument-container {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.section--lead > .instrument-container { gap: 44px; }

.section__head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: end;
}

/* Section heads that open with a hairline rule (cases, approach, blog) */
.section__head--ruled {
  border-top: 1px solid var(--border);
  padding-top: var(--head-rule-gap);
}

.section__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section__title {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.section__title--services { max-width: 34ch; }
.section__title--tools { max-width: 32ch; }
.section__title--approach { max-width: 36ch; }
.section__title--blog { max-width: 38ch; }

.section__head-stack { display: flex; flex-direction: column; gap: 14px; }

.section__intro {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-card);
  max-width: 62ch;
  text-wrap: pretty;
}

@media (max-width: 899px) {
  .section__head { grid-template-columns: 1fr; gap: 14px; align-items: start; }
}

@media (max-width: 699px) {
  .section__title { font-size: 24px; }
  .section__eyebrow { font-size: 11px; letter-spacing: 0.12em; }
  .section__intro { font-size: 15px; }
}

/* ---------- Hairline card grids (services / tools) ---------- */

.card-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.card-grid--2up { grid-template-columns: 1fr 1fr; }
.card-grid--4up { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card--tool { padding: 24px 22px; gap: 8px; }

.card__slug { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }

.card__title { font-size: 19px; font-weight: 500; }

.card__body { font-size: 15px; line-height: 1.6; color: var(--text-card); }

.tool__title { font-size: 16px; font-weight: 500; }

.tool__list {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-muted);
}

@media (max-width: 899px) {
  .card-grid--2up { grid-template-columns: 1fr; }
  .card-grid--4up { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 699px) {
  .card { padding: 22px 20px; gap: 8px; }
  .card__title { font-size: 17px; }
  .card__body { font-size: 14px; }
  .card-grid--4up { grid-template-columns: 1fr; }
  .card-grid--4up .card--tool {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
  }
  .card-grid--4up .card--tool .tool__title { white-space: nowrap; font-size: 14px; }
  .card-grid--4up .card--tool .tool__list { text-align: right; }
}

/* ---------- Case notes ---------- */

.case-list { display: flex; flex-direction: column; }

.case-row {
  display: grid;
  grid-template-columns: 300px 1fr 1fr;
  gap: 36px;
  padding: 30px 0;
  border-top: 1px solid var(--border);
}

.case-row:last-child { border-bottom: 1px solid var(--border); }

.case-row__meta { display: flex; flex-direction: column; gap: 8px; }
.case-row__path { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.case-row__title { font-size: 22px; font-weight: 500; line-height: 1.25; }
.case-row__stack { font-family: var(--font-mono); font-size: 11px; color: var(--accent); line-height: 1.7; }

.case-row__col { display: flex; flex-direction: column; gap: 6px; }
.case-row__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.case-row__body { font-size: 15px; line-height: 1.6; color: var(--text-card); }

@media (max-width: 899px) {
  .case-row { grid-template-columns: 300px 1fr; gap: 28px; }
  .case-row__col { grid-column: 2; }
}

@media (max-width: 699px) {
  .case-row { grid-template-columns: 1fr; gap: 8px; padding: 20px 0 0; }
  .case-row__col { grid-column: 1; }
  .case-row__title { font-size: 19px; }
  .case-row__body { font-size: 14px; }
  .case-row:last-child { border-bottom: none; }
}

/* ---------- How I work ---------- */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-strong);
  padding-top: 16px;
}

.step--first { border-top-color: var(--accent-rule); }
.step--first .step__label { color: var(--accent); }

.step__label { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.step__title { font-size: 17px; font-weight: 500; }
.step__body { font-size: 14px; line-height: 1.6; color: var(--text-card); }

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

@media (max-width: 699px) {
  .steps-grid { grid-template-columns: 1fr; gap: 18px; }
  .step { gap: 6px; padding-top: 14px; }
  .step__title { font-size: 16px; }
}

/* ---------- Blog teaser (home) ---------- */

.blog-teaser {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  border-top: 1px solid var(--border);
  padding-top: var(--head-rule-gap);
}

.blog-teaser__head { display: flex; flex-direction: column; gap: 14px; }

.blog-teaser__link-all {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-border);
  align-self: flex-start;
  padding-bottom: 2px;
}
.blog-teaser__link-all:hover, .blog-teaser__link-all:focus-visible { color: var(--accent-hover); }

.blog-teaser__body { display: flex; flex-direction: column; gap: 26px; }

.post-row {
  display: grid;
  grid-template-columns: 240px 1fr 90px;
  gap: 28px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.post-row:hover, .post-row:focus-visible { background: var(--panel); }

.post-row__meta { display: flex; flex-direction: column; gap: 6px; }
.post-row__date { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.post-row__title { font-size: 19px; font-weight: 500; }
.post-row__excerpt { font-size: 14px; line-height: 1.6; color: var(--text-card); max-width: 56ch; }
.post-row__tag { font-family: var(--font-mono); font-size: 11px; color: var(--accent); text-align: right; }

.post-row-end { border-top: 1px solid var(--border); }

.blog-teaser__all-mobile { display: none; }

@media (max-width: 899px) {
  .blog-teaser { grid-template-columns: 1fr; gap: 20px; }
  .post-row { grid-template-columns: 1fr; gap: 10px; }
  .post-row__tag { text-align: left; }
}

@media (max-width: 699px) {
  .blog-teaser__head .blog-teaser__link-all { display: none; }
  .blog-teaser__all-mobile {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 15px;
    text-align: center;
  }
  .post-row { padding: 18px 0; }
  .post-row__title { font-size: 17px; }
}

/* ---------- ASCII covers ---------- */

.ascii-cover {
  border: 1px solid var(--border);
  background: var(--panel);
  display: grid;
  place-items: center;
  overflow: hidden;
  height: 124px;
}

.ascii-cover pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.45;
  color: var(--text-muted);
  white-space: pre;
}

.ascii-cover .accent { color: var(--accent); }
.ascii-cover .amber { color: var(--amber); }

.ascii-cover--index { height: 214px; }
.ascii-cover--index pre { font-size: 12px; line-height: 1.5; color: var(--text-hero); }

.ascii-cover--figure { height: 280px; }
.ascii-cover--figure pre { font-size: 14px; line-height: 1.5; color: var(--text-hero); }

.ascii-cover--slug {
  height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 24px;
}

.ascii-cover--slug .slug-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.ascii-cover--slug .slug-text {
  font-family: var(--font-mono);
  font-size: 30px;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}

.ascii-cover--slug .slug-strip {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.2;
  color: var(--accent-muted);
  white-space: pre;
}

/* Home teaser + blog-index covers keep their row height */
.post-row .ascii-cover--slug,
.post-row .ascii-cover { height: 124px; padding: 14px 16px; }
.post-row .ascii-cover--slug .slug-text { font-size: 17px; }
.post-row .ascii-cover--slug .slug-strip { font-size: 7px; }

.post-list-row .ascii-cover--slug { height: 214px; }

@media (max-width: 699px) {
  .ascii-cover--index, .post-list-row .ascii-cover--slug { height: 130px; }
  .ascii-cover--index pre { font-size: 9px; }
  .ascii-cover--figure { height: 200px; }
  .ascii-cover--figure pre { font-size: 9px; }
  .ascii-cover pre { font-size: 8px; }
}

/* ---------- Contact band ---------- */

.contact-band {
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.contact-band__grid {
  padding-top: 64px;
  padding-bottom: 64px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: end;
}

.contact-band__copy { display: flex; flex-direction: column; gap: 18px; }
.contact-band__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.contact-band__title { font-size: 34px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; max-width: 30ch; }
.contact-band__body { font-size: 16px; line-height: 1.65; color: var(--text-card); max-width: 52ch; }

.contact-band__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-mono);
}

.contact-band__note { font-size: 11px; line-height: 1.9; color: var(--text-muted); }

@media (max-width: 899px) {
  .contact-band__grid { grid-template-columns: 1fr; gap: 28px; align-items: start; }
}

@media (max-width: 699px) {
  .contact-band__grid { padding-top: 40px; padding-bottom: 40px; gap: 16px; }
  .contact-band__copy { gap: 16px; }
  .contact-band__title { font-size: 26px; max-width: none; }
  .contact-band__body { font-size: 15px; }
}

/* ---------- Footer ---------- */

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

@media (max-width: 699px) {
  .site-footer__inner { flex-direction: column; gap: 4px; line-height: 1.8; padding-top: 16px; padding-bottom: 16px; }
}

/* ---------- Blog index ---------- */

.blog-masthead {
  padding-top: 64px;
  padding-bottom: 40px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: end;
  border-bottom: 1px solid var(--border);
}

.blog-masthead--single-col { grid-template-columns: 1fr; }

.blog-masthead__copy { display: flex; flex-direction: column; gap: 18px; }
.blog-masthead__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.blog-masthead__title { font-size: 40px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 500; max-width: 24ch; }
.blog-masthead__intro { font-size: 16px; line-height: 1.65; color: var(--text-hero); max-width: 56ch; text-wrap: pretty; }

.subscribe-box {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subscribe-box__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.subscribe-box__row {
  display: flex;
  border: 1px solid var(--border-strong);
}

.subscribe-box__input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: none;
}

.subscribe-box__input::placeholder { color: var(--text-dim); }

.subscribe-box__submit {
  background: var(--accent);
  color: var(--accent-on);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 13px 18px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.subscribe-box__submit:hover, .subscribe-box__submit:focus-visible { background: var(--accent-hover); }

.subscribe-box__note { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); line-height: 1.7; }
.subscribe-box__status { font-family: var(--font-mono); font-size: 11px; line-height: 1.7; }
.subscribe-box__status--ok { color: var(--accent); }
.subscribe-box__status--error { color: var(--amber); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  align-items: center;
}

.filter-bar__label { color: var(--text-dim); letter-spacing: 0.08em; padding-right: 6px; }

.filter-chip {
  border: 1px solid var(--chip-border);
  color: var(--text-muted);
  padding: 6px 12px;
}

.filter-chip:hover, .filter-chip:focus-visible { border-color: var(--border-strong-hover); }

.filter-chip.is-active {
  border-color: var(--accent-border);
  color: var(--accent);
}

.post-list-row {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 36px;
  align-items: start;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.post-list-row:hover, .post-list-row:focus-visible { background: var(--panel); }

.post-list-row__body { display: flex; flex-direction: column; gap: 12px; }
.post-list-row__meta { display: flex; flex-wrap: wrap; gap: 18px; font-family: var(--font-mono); font-size: 12px; }
.post-list-row__tags { color: var(--accent); }
.post-list-row__date { color: var(--text-muted); }
.post-list-row__readtime { color: var(--text-dim); }
.post-list-row__title { font-size: 26px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.post-list-row__excerpt { font-size: 15px; line-height: 1.65; color: var(--text-card); max-width: 58ch; }
.post-list-row__cta { font-family: var(--font-mono); font-size: 12px; color: var(--accent); padding-top: 4px; }

.blog-empty { padding: 32px 0; color: var(--text-card); font-size: 15px; }

.pagination {
  display: flex;
  gap: 10px;
  padding: 32px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.pagination a:hover, .pagination a:focus-visible { color: var(--accent); }

@media (max-width: 899px) {
  .blog-masthead { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .post-list-row { grid-template-columns: 280px 1fr; gap: 28px; }
}

@media (max-width: 699px) {
  .blog-masthead { padding-top: 40px; padding-bottom: 32px; gap: 24px; }
  .blog-masthead__title { font-size: 28px; }
  .blog-masthead__intro { font-size: 15px; }
  .post-list-row { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; }
  .post-list-row__title { font-size: 22px; }
}

/* ---------- Single post ---------- */

.post-header { display: flex; flex-direction: column; gap: 16px; }

.post-back {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  align-self: flex-start;
}
.post-back:hover, .post-back:focus-visible { color: var(--accent); }

.post-meta-row {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.post-meta-row__tags { color: var(--accent); }

.post-title { font-size: 40px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 500; }
.post-standfirst { font-size: 19px; line-height: 1.6; color: var(--text-hero); text-wrap: pretty; }

.post-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 64px;
  padding-top: 56px;
  padding-bottom: 72px;
}

.post-article {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 68ch;
  min-width: 0;
}

.post-figure { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.post-figcaption { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); line-height: 1.6; }

.post-rule { border-top: 1px solid var(--border); }

.post-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-article);
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-wrap: pretty;
}

.post-body h2 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding-top: 8px;
  color: var(--text);
  scroll-margin-top: 24px;
}

.post-body h3 { font-size: 19px; font-weight: 500; color: var(--text); }

/* Imported content carries empty paragraphs; as flex items each would add a
   full 28px gap and tear the article apart. */
.post-body p:empty,
.post-body p:has(> br:only-child) { display: none; }

.post-body ul, .post-body ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

.post-body a { color: var(--accent); border-bottom: 1px solid var(--accent-border); }

.post-body pre {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-article);
  overflow: auto;
}

.post-body code { font-family: var(--font-mono); font-size: 0.92em; }
.post-body pre code { font-size: inherit; }
.post-body pre .kw { color: var(--syntax-muted); }
.post-body pre .type { color: var(--accent); }
.post-body pre .str { color: var(--amber); }

/* Enlighter keeps doing the language parsing, but its bundled Dracula skin
   does not belong to the Instrument visual system. These selectors are
   deliberately scoped to article content and outrank the plugin stylesheet,
   which Enlighter prints after the theme stylesheet. */
.post-body .enlighter-default {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-article);
  text-shadow: none;
  white-space: normal;
  word-wrap: normal;
}

.post-body .enlighter-default.enlighter-v-standard,
.post-body .enlighter-default.enlighter-v-codegroup {
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.post-body .enlighter-default .enlighter-code {
  padding: 20px 22px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong-hover) var(--panel);
}

.post-body .enlighter-default .enlighter-code::-webkit-scrollbar { height: 8px; }
.post-body .enlighter-default .enlighter-code::-webkit-scrollbar-track {
  background: var(--panel);
  border-top: 1px solid var(--border);
}
.post-body .enlighter-default .enlighter-code::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 2px solid var(--panel);
  border-radius: 0;
}
.post-body .enlighter-default .enlighter-code::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong-hover);
}

.post-body .enlighter-default .enlighter-code:focus-visible {
  outline: 2px solid var(--accent-muted);
  outline-offset: -3px;
}

.post-body .enlighter-default div.enlighter {
  width: 100%;
  min-width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
}

.post-body .enlighter-default div.enlighter > div,
.post-body .enlighter-default.enlighter-hover div.enlighter > div:hover {
  min-height: 0;
  padding: 0 !important;
  line-height: inherit;
  color: inherit;
  background: transparent !important;
}

.post-body .enlighter-default div.enlighter > div > div {
  padding: 0;
}

.post-body .enlighter-default div.enlighter > div > div::before,
.post-body .enlighter-default.enlighter-linenumbers div.enlighter > div::before {
  display: none;
  content: none;
}

.post-body .enlighter-default .enlighter span {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-style: normal;
  font-weight: 400;
  text-decoration: none;
}

.post-body .enlighter-default .enlighter-text,
.post-body .enlighter-default .enlighter [class^="enlighter-g"],
.post-body .enlighter-default .enlighter-t7,
.post-body .enlighter-default .enlighter-t8 {
  color: var(--text-article);
}

/* The approved syntax palette has three semantic levels: structural words
   recede, identifiers carry the cyan accent, and values use amber. */
.post-body .enlighter-default .enlighter [class^="enlighter-c"],
.post-body .enlighter-default .enlighter [class^="enlighter-k"],
.post-body .enlighter-default .enlighter-t0 {
  color: var(--syntax-muted);
}

.post-body .enlighter-default .enlighter .enlighter-k10,
.post-body .enlighter-default .enlighter [class^="enlighter-e"],
.post-body .enlighter-default .enlighter [class^="enlighter-m"],
.post-body .enlighter-default .enlighter [class^="enlighter-x"],
.post-body .enlighter-default .enlighter-t1,
.post-body .enlighter-default .enlighter-t2,
.post-body .enlighter-default .enlighter-t3,
.post-body .enlighter-default .enlighter-t4,
.post-body .enlighter-default .enlighter-t5,
.post-body .enlighter-default .enlighter-t6 {
  color: var(--accent);
}

.post-body .enlighter-default .enlighter [class^="enlighter-s"],
.post-body .enlighter-default .enlighter [class^="enlighter-n"] {
  color: var(--amber);
}

.post-body .enlighter-default .enlighter-toolbar { display: none !important; }

.post-body .enlighter-default.enlighter-v-inline {
  margin: 0 0.12em;
  padding: 0.08em 0.32em;
  color: var(--text-article);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  vertical-align: baseline;
}

.post-body blockquote {
  border-left: 2px solid var(--accent-rule);
  padding: 4px 0 4px 22px;
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-hero);
  font-style: italic;
}

.post-body figure { margin: 0; }
.post-body img { height: auto; }

.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 24px;
  align-self: start;
}

.toc { display: flex; flex-direction: column; gap: 10px; }
.toc__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.toc__item {
  font-size: 14px;
  color: var(--text-muted);
  border-left: 2px solid var(--chip-border);
  padding-left: 12px;
  line-height: 1.5;
}
.toc__item:hover, .toc__item:focus-visible { color: var(--text); }
.toc__item.is-active { color: var(--text); border-left-color: var(--accent); }

.author-card {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.author-card__label { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.author-card__name { font-size: 15px; font-weight: 500; }
.author-card__bio { font-size: 13px; line-height: 1.6; color: var(--text-card); }
.author-card__link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-border);
  align-self: flex-start;
  padding-bottom: 2px;
  margin-top: 4px;
}

.post-end-cta {
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.post-end-cta__inner {
  padding-top: 44px;
  padding-bottom: 44px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}

.post-end-cta__copy { display: flex; flex-direction: column; gap: 12px; }
.post-end-cta__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-end-cta__title { font-size: 26px; font-weight: 500; letter-spacing: -0.015em; max-width: 34ch; line-height: 1.25; }
.post-end-cta .btn { white-space: nowrap; }

@media (max-width: 899px) {
  .post-layout { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; padding-bottom: 56px; }
  .post-sidebar { position: static; }
}

@media (max-width: 699px) {
  .post-title { font-size: 28px; }
  .post-standfirst { font-size: 16px; }
  .post-layout { padding-top: 32px; padding-bottom: 48px; gap: 32px; }
  .post-body { font-size: 16px; gap: 22px; }
  .post-body h2 { font-size: 20px; }
  .post-body .enlighter-default { font-size: 12px; }
  .post-body .enlighter-default .enlighter-code { padding: 16px 14px; }
  .post-end-cta__inner { padding-top: 32px; padding-bottom: 32px; flex-direction: column; align-items: stretch; gap: 20px; }
  .post-end-cta__title { font-size: 22px; }
  .post-end-cta .btn { width: 100%; padding: 16px; }
}

/* ---------- Plain pages (page.php, search.php, 404.php) ---------- */

.plain-page {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.plain-page > * { max-width: 68ch; }

.plain-page h1 { font-size: 40px; line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; }
.plain-page .entry-content { font-size: 17px; line-height: 1.75; color: var(--text-article); display: flex; flex-direction: column; gap: 20px; }
.plain-page .entry-content a { color: var(--accent); border-bottom: 1px solid var(--accent-border); }

@media (max-width: 699px) {
  .plain-page h1 { font-size: 28px; }
}

.searchform {
  display: flex;
  border: 1px solid var(--border-strong);
  max-width: 480px;
}

.searchform__input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: none;
}

.searchform__input::placeholder { color: var(--text-dim); }

.searchform__submit {
  background: var(--accent);
  color: var(--accent-on);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 13px 18px;
  border: none;
  cursor: pointer;
}

.searchform__submit:hover, .searchform__submit:focus-visible { background: var(--accent-hover); }
