/* Self-hosted brand fonts — variable, latin subset. Replaces the Google Fonts <link>. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('./fonts/Archivo.woff2') format('woff2');
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('./fonts/WorkSans.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('./fonts/Caveat.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/SpaceMono.woff2') format('woff2');
}

/* Baseheads global stylesheet (emitted to _static/base.css).
   Globals + article/prose styling + shared layout helpers + responsive rules.
   Per-component chrome lives in each component's own CSS (components.css). */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--bh-body);
  background: var(--bh-cream);
  color: var(--bh-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--bh-ink); color: var(--bh-cream); }

a { color: inherit; }

img { max-width: 100%; }

@keyframes bh-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes bh-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

input::placeholder { color: var(--bh-faint); }

/* ---- Shared layout scaffolding ---- */
.bh-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bh-cream); }
.bh-main { flex: 1; }
.bh-wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.bh-narrow { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* Live-stock pulse dot (server-rendered, JS may refine the label) */
.bh-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bh-ink);
  display: inline-block; animation: bh-pulse 1.4s ease-in-out infinite; }

/* ---- Section eyebrow + heading ---- */
.bh-eyebrow { font-family: var(--bh-display); font-weight: 900; font-size: 15px;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--bh-ink); margin-bottom: 8px; }

/* =====================================================================
   ARTICLE (SCREEN-005) — the themed page.html body
   The Markdown content renders into .bh-prose.
   ===================================================================== */
.bh-article-head { background: var(--bh-cream); padding: 36px 32px 44px; border-bottom: var(--bh-rule) solid var(--bh-ink); }
.bh-breadcrumb { font-family: var(--bh-body); font-weight: 600; font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--bh-mute); margin-bottom: 22px; }
.bh-breadcrumb a { text-decoration: none; }
.bh-breadcrumb a:hover { color: var(--bh-ink); }
.bh-breadcrumb .sep { color: var(--bh-oncream-sep); }
.bh-article-title { font-family: var(--bh-display); font-weight: 900;
  font-size: clamp(36px, 5.4vw, 72px); line-height: 0.94; text-transform: uppercase;
  letter-spacing: -0.02em; margin: 0 0 22px; max-width: 20ch; }
.bh-article-meta { display: flex; gap: 22px; flex-wrap: wrap; font-family: var(--bh-body);
  font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bh-mute); }
.bh-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.bh-tag { font-family: var(--bh-body); font-weight: 600; font-size: 11px; letter-spacing: 0.02em;
  color: var(--bh-ink); border: var(--bh-rule) solid var(--bh-ink); padding: 4px 10px; }

.bh-article-grid { display: grid; grid-template-columns: 220px 1fr; gap: 52px; align-items: start;
  max-width: 1080px; margin: 0 auto; padding: 56px 32px 84px; }
.bh-toc-label { font-family: var(--bh-body); font-weight: 700; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px; }
.bh-toc { display: flex; flex-direction: column; gap: 12px; border-left: var(--bh-rule) solid var(--bh-ink); padding-left: 16px; }
.bh-toc a { font-size: 14px; line-height: 1.35; color: var(--bh-text); text-decoration: none; }
.bh-toc a:hover { color: var(--bh-ink); text-decoration: underline; }
.bh-sticky { position: sticky; top: 24px; }
.bh-buildnote { margin-top: 26px; padding-top: 20px; border-top: var(--bh-rule) solid var(--bh-line); }
.bh-buildnote strong { font-family: var(--bh-body); font-weight: 700; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--bh-ink); display: block; margin-bottom: 6px; }
.bh-buildnote span { font-family: var(--bh-body); font-size: 12px; line-height: 1.5; color: var(--bh-faint); }

/* prose (rendered Markdown body) */
.bh-prose { max-width: 640px; }
.bh-prose > p:first-of-type { font-size: 21px; line-height: 1.5; color: var(--bh-lede); font-weight: 500; margin: 0 0 38px; }
.bh-prose h2 { font-family: var(--bh-display); font-weight: 800; font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.02; text-transform: uppercase; letter-spacing: -0.01em; margin: 38px 0 14px; }
.bh-prose h3 { font-family: var(--bh-display); font-weight: 800; font-size: 20px; text-transform: uppercase; margin: 28px 0 12px; }
.bh-prose p { font-size: 17px; line-height: 1.7; color: var(--bh-text); margin: 0 0 16px; }
.bh-prose ul, .bh-prose ol { font-size: 17px; line-height: 1.7; color: var(--bh-text); padding-left: 20px; }
.bh-prose a { color: var(--bh-ink); text-decoration: none; border-bottom: var(--bh-rule) solid var(--bh-ink); }
.bh-prose a:hover { background: var(--bh-ink); color: var(--bh-cream); }
/* Tip callouts authored as blockquotes (ADR-003) */
.bh-prose blockquote { background: var(--bh-ink); color: var(--bh-cream); padding: 18px 20px;
  margin: 24px 0; border: none; }
.bh-prose blockquote p { color: var(--bh-cream); font-size: 15px; line-height: 1.55; margin: 0; }
.bh-prose blockquote strong { font-family: var(--bh-script); font-weight: 700; font-size: 20px; }
.bh-prose code { font-family: var(--bh-mono); background: var(--bh-panel); padding: 1px 5px; border: 1px solid var(--bh-line); }

/* Backlinks / linked-from (zetl-generated block, restyled) */
.bh-links-head { font-family: var(--bh-body); font-weight: 700; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; margin: 44px 0 4px; }
.bh-links-sub { font-family: var(--bh-body); font-size: 12px; color: var(--bh-faint); margin-bottom: 14px; }
.bh-prose + .bh-backlinks { border-top: var(--bh-rule) solid var(--bh-ink); }
.zetl-backlinks { list-style: none; padding: 0; margin: 0; }
.zetl-backlink { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 0; border-bottom: var(--bh-rule) solid var(--bh-line); }
.zetl-backlink a { font-family: var(--bh-mono); font-weight: 700; font-size: 15px; text-decoration: none; }
.zetl-backlink a:hover { opacity: 0.55; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 860px) {
  .bh-article-grid { grid-template-columns: 1fr; gap: 28px; }
  .bh-sticky { position: static; }
}
@media (max-width: 640px) {
  .bh-wrap, .bh-narrow { padding: 0 20px; }
  .bh-article-head { padding: 28px 20px 32px; }
  .bh-article-grid { padding: 32px 20px 64px; }
}

/* =====================================================================
   Shopfront layout (SCREEN-001/002/003) — used by static jinja pages
   ===================================================================== */
.bh-btn { display: inline-block; font-family: var(--bh-body); font-weight: 600; font-size: 14px;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 15px 30px; border: var(--bh-rule) solid var(--bh-ink);
  text-decoration: none; cursor: pointer; }
.bh-btn-primary { background: var(--bh-ink); color: var(--bh-cream); }
.bh-btn-primary:hover { background: transparent; color: var(--bh-ink); }
.bh-btn-ghost { background: transparent; color: var(--bh-ink); }
.bh-btn-ghost:hover { background: var(--bh-ink); color: var(--bh-cream); }

.bh-sec { background: var(--bh-cream); padding: 80px 0; }
.bh-sec-tight { background: var(--bh-cream); padding: 0 0 84px; }
.bh-sec-ink { background: var(--bh-ink); color: var(--bh-cream); }

/* Hero */
.bh-hero-sec { background: var(--bh-cream); padding: 72px 0 64px; border-bottom: var(--bh-rule) solid var(--bh-ink); }
.bh-hero { display: grid; grid-template-columns: 1fr 0.95fr; gap: 56px; align-items: center; }
.bh-hero-eyebrow { font-family: var(--bh-body); font-weight: 600; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--bh-nav); margin-bottom: 22px; }
.bh-hero-h1 { font-family: var(--bh-display); font-weight: 900; letter-spacing: -0.02em; font-size: clamp(52px, 8.5vw, 116px); line-height: 0.9; text-transform: uppercase; margin: 0; }
.bh-hero-h2 { font-family: var(--bh-display); font-weight: 900; letter-spacing: -0.02em; font-size: clamp(24px, 3.4vw, 44px); text-transform: uppercase; margin: 10px 0 26px; }
.bh-hero-p { font-size: 18px; line-height: 1.6; max-width: 46ch; color: var(--bh-text); margin: 0 0 32px; }
.bh-hero-cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.bh-hero-script { margin-top: 30px; font-family: var(--bh-script); font-weight: 700; font-size: 24px; color: var(--bh-ink); }
.bh-hero-img { border: var(--bh-rule) solid var(--bh-ink); background: var(--bh-panel); padding: 16px; }
.bh-hero-img img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }

/* How it works */
.bh-howhead { text-align: center; margin-bottom: 52px; }
.bh-howtitle { font-family: var(--bh-display); font-weight: 900; font-size: clamp(30px, 4vw, 50px); text-transform: uppercase; letter-spacing: -0.02em; margin: 0; color: var(--bh-cream); }

/* Story */
.bh-story { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center; max-width: 1120px; }
.bh-story-title { font-family: var(--bh-display); font-weight: 900; letter-spacing: -0.02em; font-size: clamp(26px, 3.4vw, 42px); text-transform: uppercase; line-height: 0.95; margin-bottom: 6px; }
.bh-story-sub { font-family: var(--bh-display); font-weight: 900; letter-spacing: -0.02em; font-size: clamp(18px, 2.2vw, 26px); text-transform: uppercase; color: var(--bh-nav); margin-bottom: 26px; }
.bh-story-p { font-size: 17px; line-height: 1.65; color: var(--bh-text); margin: 0 0 16px; }
.bh-story-p + .bh-btn { margin-top: 10px; }

/* Shop + product page heads */
.bh-shophead { border-bottom: var(--bh-rule) solid var(--bh-ink); padding-bottom: 26px; }
.bh-shophead h1 { font-family: var(--bh-display); font-weight: 900; font-size: clamp(40px, 6vw, 78px); line-height: 0.9; text-transform: uppercase; letter-spacing: -0.03em; margin: 0; }

@media (max-width: 860px) {
  .bh-hero { grid-template-columns: 1fr; gap: 34px; }
  .bh-story { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .bh-hero-h1 { font-size: 48px; }
  .bh-sec { padding: 56px 0; }
}

/* =====================================================================
   Wiki hub (SCREEN-004)
   ===================================================================== */
.bh-wikihero { background: var(--bh-cream); padding: 64px 32px 48px; border-bottom: var(--bh-rule) solid var(--bh-ink); }
.bh-wikihero-eyebrow { font-family: var(--bh-body); font-weight: 600; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bh-nav); margin-bottom: 16px; }
.bh-wikihero-h1 { font-family: var(--bh-display); font-weight: 900; letter-spacing: -0.02em; font-size: clamp(46px, 7.5vw, 104px); line-height: 0.9; text-transform: uppercase; margin: 0 0 18px; }
.bh-wikihero-p { font-size: 18px; line-height: 1.55; color: var(--bh-text); max-width: 56ch; margin: 0 0 30px; }
.bh-wiki-search { display: flex; align-items: center; max-width: 520px; border: var(--bh-rule) solid var(--bh-ink); background: var(--bh-panel); }
.bh-wiki-search-ic { padding: 0 14px; font-size: 18px; color: var(--bh-mute); }
.bh-wiki-search input { flex: 1; background: transparent; border: none; outline: none; color: var(--bh-ink); font-family: var(--bh-body); font-size: 16px; padding: 15px 12px 15px 0; }
.bh-wiki-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 20px; font-family: var(--bh-body); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; color: var(--bh-mute); }
.bh-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 34px; }
.bh-chip { font-family: var(--bh-body); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 9px 16px; border: var(--bh-rule) solid var(--bh-ink); background: transparent; color: var(--bh-ink); cursor: pointer; }
.bh-chip.is-active { background: var(--bh-ink); color: var(--bh-cream); }
.bh-noresults { text-align: center; padding: 60px 0; color: var(--bh-mute); font-family: var(--bh-script); font-weight: 700; font-size: 24px; }
.bh-buildinfo { margin-top: 44px; border-top: var(--bh-rule) solid var(--bh-line); padding-top: 22px; font-family: var(--bh-body); font-size: 12px; line-height: 1.6; color: var(--bh-mute); letter-spacing: 0.02em; max-width: 74ch; }
.bh-buildinfo b { color: var(--bh-ink); font-weight: 600; }
.bh-buildinfo code { font-family: var(--bh-mono); }

/* =====================================================================
   Accessibility — focus indicators (WCAG 2.2 SC 2.4.7) + sr-only
   ===================================================================== */
.bh-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible,
.bh-wiki-search:focus-within {
  outline: 3px solid var(--bh-ink); outline-offset: 2px;
}
.bh-nav-wrap a:focus-visible, .bh-footer a:focus-visible, .bh-reviews a:focus-visible,
.bh-sec-ink a:focus-visible { outline-color: var(--bh-cream); }
