/* Page-specific styles for /behind-the-build — extracted from in-page <style> block. */
  /* ============================================================
     BEHIND THE BUILD — bespoke dot-matrix figures (page-scoped).
     Page chrome (hero, section, CTA) uses the shared dm-* kit;
     the readout figures below are one-off, so they live here.
     All colors reference the dm-* tokens from sp-dotmatrix.css.
     ============================================================ */

  /* ---- INTRO ---- */
  .bb-intro-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
  .bb-lead { font-family: var(--dm-display); font-weight: 800; font-size: clamp(26px, 3.2vw, 42px); line-height: 1.1; letter-spacing: 0.01em; color: var(--dm-ink); max-width: 15ch; margin: 0 0 24px; text-shadow: var(--dm-glow); }
  .bb-intro-body { font-family: var(--dm-mono); font-size: 15px; line-height: 1.7; color: var(--dm-body); max-width: 50ch; margin: 0; }

  /* x-ray browser wireframe scan */
  .bb-xray { position: relative; padding: 8px 30px; }
  .bb-browser { position: relative; border: 1px solid var(--dm-line-2); background: var(--dm-well); box-shadow: 0 40px 80px -50px rgba(0,0,0,0.9); overflow: visible; }
  .bb-browser-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--dm-line); }
  .bb-browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--dm-line-2); }
  .bb-browser-url { margin-left: 10px; font-family: var(--dm-mono); font-size: 11px; color: var(--dm-muted); }
  .bb-browser-page { position: relative; padding: 24px; display: grid; gap: 14px; }
  .bb-bp-nav { height: 13px; width: 52%; background: var(--dm-line-2); }
  .bb-bp-title { height: 26px; width: 76%; background: var(--dm-line-2); }
  .bb-bp-img { height: 92px; background-color: var(--dm-well); background-image: radial-gradient(var(--dm-accent-line) 1px, transparent 1.4px); background-size: 9px 9px; border: 1px solid var(--dm-line); }
  .bb-bp-lines { display: grid; gap: 7px; }
  .bb-bp-lines i { height: 8px; background: repeating-linear-gradient(90deg, var(--dm-line-2) 0 2px, transparent 2px 6px); }
  .bb-bp-lines i:nth-child(2) { width: 90%; } .bb-bp-lines i:nth-child(3) { width: 64%; }
  .bb-bp-btn { margin-top: 4px; width: 112px; height: 30px; background: var(--dm-accent); }
  /* the "invisible layer" annotations — LED tags around the frame */
  .bb-anno { position: absolute; z-index: 3; font-family: var(--dm-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dm-accent-2); background: var(--dm-bg); border: 1px solid var(--dm-accent-line); padding: 5px 9px; white-space: nowrap; }
  .bb-anno::before { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--dm-accent); box-shadow: 0 0 6px rgba(103,160,232,0.8); }
  .bb-anno.a-schema { top: 58px; left: -26px; } .bb-anno.a-schema::before { right: -13px; top: 50%; transform: translateY(-50%); }
  .bb-anno.a-alt { top: 128px; right: -22px; } .bb-anno.a-alt::before { left: -13px; top: 50%; transform: translateY(-50%); }
  .bb-anno.a-ga { top: 18px; right: -30px; } .bb-anno.a-ga::before { left: -13px; top: 50%; transform: translateY(-50%); }
  .bb-anno.a-focus { bottom: 40px; left: -30px; } .bb-anno.a-focus::before { right: -13px; top: 50%; transform: translateY(-50%); }
  .bb-anno.a-wcag { bottom: -13px; right: 40px; } .bb-anno.a-wcag::before { left: 50%; top: -13px; transform: translateX(-50%); }
  @media (max-width: 540px) { .bb-anno { display: none; } .bb-xray { padding: 8px 0; } }

  /* ---- THE WORK ---- */
  .bb-work-h { font-family: var(--dm-display); font-weight: 800; font-size: clamp(32px, 4.5vw, 60px); line-height: 1; color: var(--dm-ink); text-shadow: var(--dm-glow); margin: 0 0 clamp(40px, 6vw, 76px); max-width: 20ch; }
  .bb-work-h .dm-em { color: var(--dm-accent); }

  .bb-steps { display: flex; flex-direction: column; gap: clamp(56px, 8vw, 112px); }
  .bb-step { display: grid; align-items: center; gap: clamp(28px, 5vw, 72px); }
  .g-even { grid-template-columns: 1fr 1fr; }
  .g-vizbig { grid-template-columns: 0.85fr 1.15fr; }
  .g-feature { grid-template-columns: 0.72fr 1.28fr; }
  .g-vizsmall { grid-template-columns: 1.2fr 0.8fr; }
  .g-vizsmall-l { grid-template-columns: 0.82fr 1.18fr; }
  @media (max-width: 860px) {
    .bb-step { grid-template-columns: 1fr !important; gap: 26px; }
    .bb-step-text { order: 0; } .bb-step-viz { order: 1; }
  }

  .bb-step-index { font-family: var(--dm-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dm-accent); margin-bottom: 14px; }
  .bb-step-title { font-family: var(--dm-display); font-weight: 700; font-size: clamp(24px, 3vw, 36px); line-height: 1.05; color: var(--dm-ink); margin-bottom: 14px; text-shadow: var(--dm-glow-2); }
  .bb-step-desc { font-family: var(--dm-mono); font-size: 15px; line-height: 1.6; color: var(--dm-body); max-width: 44ch; margin: 0 0 20px; }
  .bb-step-list { list-style: none; display: grid; gap: 9px; margin: 0 0 20px; padding: 0; }
  .bb-step-list li { position: relative; padding-left: 22px; font-family: var(--dm-mono); font-size: 13.5px; line-height: 1.5; color: var(--dm-muted); }
  .bb-step-list li::before { content: "✓"; position: absolute; left: 0; top: 0; font-size: 12px; color: var(--dm-accent); }
  .bb-step-source { font-family: var(--dm-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dm-muted); }
  .bb-step-source strong { color: var(--dm-body); font-weight: 400; }
  .bb-step-source a { color: var(--dm-accent); border-bottom: 1px solid var(--dm-accent-line); padding-bottom: 1px; }
  .bb-step-source a:hover { border-bottom-color: var(--dm-accent); }

  /* polished per-section reveal (a clean fade + rise; replaces the generic v2 one) */
  .bb-step-text.reveal, .bb-step-viz.reveal { opacity: 0; transform: translateY(22px); }
  .bb-step-text.reveal.is-entering, .bb-step-viz.reveal.is-entering { animation: none; opacity: 1; transform: none; transition: opacity 720ms cubic-bezier(0.2,0.7,0.2,1), transform 780ms cubic-bezier(0.2,0.7,0.2,1); }
  .bb-step-viz.reveal.rd-1.is-entering { transition-delay: 90ms; }
  @media (prefers-reduced-motion: reduce) { .bb-step-text.reveal, .bb-step-viz.reveal { opacity: 1; transform: none; } }

  /* ---- figure panel (captioned readout) ---- */
  .bb-fig { border: 1px solid var(--dm-line); background: var(--dm-panel); }
  .bb-fig-head { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 16px; border-bottom: 1px solid var(--dm-line); font-family: var(--dm-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dm-muted-2); }
  .bb-fig-no { color: var(--dm-accent); }
  .bb-fig-body { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
  .bb-fig--flush .bb-fig-body { padding: 0; gap: 0; }

  /* 01 Foundation — product tiles */
  .bb-builds { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 480px) { .bb-builds { grid-template-columns: 1fr; } }
  .bb-build { display: block; border: 1px solid var(--dm-line-2); background: var(--dm-panel); overflow: hidden; transition: transform 320ms ease, border-color 320ms ease; }
  .bb-build:hover { transform: translateY(-4px); border-color: var(--dm-accent); }
  .bb-build-shot { aspect-ratio: 16 / 11; overflow: hidden; background: var(--dm-well); }
  .bb-build-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .bb-build-meta { padding: 13px 15px; border-top: 1px solid var(--dm-line); }
  .bb-build-meta strong { display: block; font-family: var(--dm-mono); font-size: 13.5px; color: var(--dm-ink); }
  .bb-build-meta span { display: block; font-family: var(--dm-mono); font-size: 9.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--dm-muted); margin-top: 4px; }

  /* 02 Analytics — metric readout + sparkline */
  .bb-num { font-family: var(--dm-display); font-weight: 800; font-size: clamp(44px, 5.5vw, 64px); line-height: 1; color: var(--dm-ink); text-shadow: var(--dm-glow); }
  .bb-num small { display: block; font-family: var(--dm-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dm-muted); margin-top: 10px; }
  .bb-spark { width: 100%; height: 50px; }
  .bb-spark polyline { stroke: var(--dm-accent); stroke-dasharray: 430; stroke-dashoffset: 430; filter: drop-shadow(0 0 3px rgba(103,160,232,0.55)); }
  .reveal.is-entering .bb-spark polyline { animation: bb-spark-draw 1100ms ease 350ms forwards; }
  @keyframes bb-spark-draw { to { stroke-dashoffset: 0; } }
  .bb-mrows { display: flex; gap: 22px; font-family: var(--dm-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--dm-body); }
  .bb-mrows b { color: var(--dm-accent); font-weight: 400; }

  /* 03 Discoverability — search results */
  .bb-search-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--dm-line-2); background: var(--dm-well); font-family: var(--dm-mono); font-size: 13px; color: var(--dm-ink); }
  .bb-search-bar svg { width: 16px; height: 16px; color: var(--dm-accent); flex: none; }
  .bb-results { display: grid; gap: 8px; }
  .bb-res { padding: 12px 14px; border: 1px solid var(--dm-line); }
  .bb-res .r-title { font-family: var(--dm-mono); font-size: 14px; line-height: 1.3; }
  .bb-res .r-url { font-family: var(--dm-mono); font-size: 10.5px; letter-spacing: 0.04em; margin-top: 3px; }
  .bb-res-hit { border-color: var(--dm-accent-line); background: rgba(103,160,232,0.06); }
  .bb-res-hit .r-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .bb-res-hit .r-title { color: var(--dm-ink); }
  .bb-res-hit .r-tag { font-family: var(--dm-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dm-accent); flex: none; }
  .bb-res-hit .r-url { color: var(--dm-accent-2); }
  .bb-res-hit .r-snip { font-family: var(--dm-mono); font-size: 12px; line-height: 1.45; color: var(--dm-body); margin-top: 6px; }
  .bb-res-dim .r-title { color: var(--dm-muted); }
  .bb-res-dim .r-url { color: var(--dm-label); }

  /* 04 Accessibility — focus ring + contrast */
  .bb-a11y-btn { align-self: flex-start; padding: 12px 22px; background: var(--dm-accent); color: var(--dm-bg); font-family: var(--dm-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; outline: 3px solid rgba(103,160,232,0.5); outline-offset: 3px; }
  .bb-contrast { width: 100%; display: grid; grid-template-columns: 1fr 1fr; height: 42px; border: 1px solid var(--dm-line-2); overflow: hidden; }
  .bb-contrast .cd { background: var(--dm-bg); } .bb-contrast .cl { background: var(--dm-ink); }
  .bb-a11y-meta { font-family: var(--dm-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--dm-body); }
  .bb-a11y-meta b { color: var(--dm-accent); }

  /* 05 Sharing — dark-mode Messages thread */
  .bb-imsg { display: grid; gap: 10px; width: 100%; max-width: 420px; margin: 0 auto; }
  .bb-bubble-in { justify-self: start; max-width: 70%; background: var(--dm-line-2); color: var(--dm-ink); padding: 10px 15px; border-radius: 18px; border-bottom-left-radius: 5px; font-family: var(--dm-mono); font-size: 13px; line-height: 1.35; }
  .bb-imsg-link { justify-self: end; width: 80%; max-width: 300px; border-radius: 16px; overflow: hidden; background: var(--dm-panel); border: 1px solid var(--dm-line-2); }
  .bb-imsg-link img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; display: block; }
  .bb-imsg-link-meta { padding: 11px 14px; }
  .bb-imsg-link-meta strong { display: block; font-family: var(--dm-mono); font-size: 14px; color: var(--dm-ink); }
  .bb-imsg-link-meta span { display: block; font-family: var(--dm-mono); font-size: 12.5px; color: var(--dm-muted); margin: 2px 0 7px; }
  .bb-imsg-link-meta em { display: block; font-family: var(--dm-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dm-muted); font-style: normal; }
  .bb-imsg-tail { justify-self: end; font-family: var(--dm-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dm-muted); }
  .bb-bubble-in, .bb-imsg-link, .bb-imsg-tail { opacity: 0; }
  .reveal.is-entering .bb-bubble-in { animation: bb-msg-in 420ms ease 150ms both; }
  .reveal.is-entering .bb-imsg-link { animation: bb-msg-in 500ms ease 660ms both; }
  .reveal.is-entering .bb-imsg-tail { animation: bb-msg-tail 300ms ease 1240ms both; }
  @keyframes bb-msg-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
  @keyframes bb-msg-tail { from { opacity: 0; } to { opacity: 1; } }

  /* 06 Trust — privacy document */
  .bb-doc { border: 1px solid var(--dm-line-2); background: var(--dm-well); padding: 16px 18px; }
  .bb-doc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .bb-doc-lock { width: 28px; height: 28px; border: 1px solid var(--dm-accent-line); display: grid; place-items: center; flex: none; }
  .bb-doc-lock svg { width: 15px; height: 15px; color: var(--dm-accent); }
  .bb-doc-head strong { font-family: var(--dm-mono); font-size: 13px; color: var(--dm-ink); }
  .bb-doc-lines { display: grid; gap: 8px; }
  .bb-doc-lines i { height: 7px; background: repeating-linear-gradient(90deg, var(--dm-line-2) 0 2px, transparent 2px 6px); display: block; }
  .bb-doc-lines i:nth-child(2) { width: 88%; } .bb-doc-lines i:nth-child(3) { width: 72%; }
  .bb-doc-call { margin-top: 13px; padding: 11px 13px; border-left: 2px solid var(--dm-accent); background: rgba(103,160,232,0.05); font-family: var(--dm-mono); font-size: 12px; line-height: 1.5; color: var(--dm-body); }
  .bb-doc-call b { color: var(--dm-ink); font-weight: 400; }
  .bb-doc-tags { font-family: var(--dm-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dm-muted); }

  /* 07 Performance — Core Web Vitals use the shared .dm-meter component (sp-dotmatrix.css) */

  /* 08 Launch — live / verified */
  .bb-live { display: flex; align-items: center; gap: 12px; }
  .bb-live .dot { width: 11px; height: 11px; border-radius: 50%; background: #eef3fb; box-shadow: 0 0 8px rgba(210,225,245,0.7); flex: none; }
  .bb-live strong { font-family: var(--dm-display); font-weight: 800; font-size: clamp(32px, 4vw, 46px); color: var(--dm-ink); text-shadow: var(--dm-glow); }
  .bb-verify { display: grid; gap: 9px; font-family: var(--dm-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--dm-body); }
  .bb-verify span { position: relative; padding-left: 22px; text-transform: uppercase; }
  .bb-verify span::before { content: "✓"; position: absolute; left: 0; color: var(--dm-accent); }

  /* 09 Recovery — 404 mock (echoes the real 404 page) */
  .bb-nf-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--dm-line); background: var(--dm-well); }
  .bb-nf-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--dm-line-2); }
  .bb-nf-url { margin-left: 10px; font-family: var(--dm-mono); font-size: 11px; color: var(--dm-muted); }
  .bb-nf-body { padding: 30px 26px; text-align: center; }
  .bb-nf-code { font-family: var(--dm-display); font-weight: 800; font-size: clamp(52px, 7vw, 80px); line-height: 1; color: var(--dm-ink); text-shadow: var(--dm-glow); }
  .bb-nf-code em { color: var(--dm-line-2); font-style: normal; }
  .bb-nf-msg { font-family: var(--dm-mono); font-size: 14px; color: var(--dm-body); margin: 14px 0 20px; }
  .bb-nf-btn { display: inline-block; padding: 11px 20px; border: 1px solid var(--dm-accent); color: var(--dm-ink); font-family: var(--dm-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }

  /* 10 Interaction — live motion demo (links to the showcase) */
  .bb-motion { text-decoration: none; align-items: center; text-align: center; transition: transform 360ms ease, border-color 360ms ease; }
  .bb-motion:hover { transform: translateY(-4px); border-color: var(--dm-accent); }
  .bb-motion .bb-fig-body { gap: 24px; }
  .bb-mo-stage { display: flex; flex-direction: column; align-items: center; gap: 26px; }
  .bb-mo-tabs { position: relative; display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--dm-line-2); background: var(--dm-well); }
  .bb-mo-tab { width: 62px; padding: 7px 0; text-align: center; font-family: var(--dm-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dm-muted); position: relative; z-index: 1; }
  .bb-mo-pill { position: absolute; top: 3px; left: 3px; width: 62px; height: calc(100% - 6px); background: var(--dm-panel); border: 1px solid var(--dm-accent-line); animation: bb-mo-slide 4200ms ease infinite; }
  @keyframes bb-mo-slide { 0%,16% { transform: translateX(0); } 30%,46% { transform: translateX(65px); } 60%,78% { transform: translateX(130px); } 92%,100% { transform: translateX(0); } }
  .bb-mo-check { display: flex; align-items: center; gap: 12px; }
  .bb-mo-check svg { width: 30px; height: 30px; }
  .bb-mo-check path { fill: none; stroke: var(--dm-accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: bb-mo-draw 4200ms ease infinite; }
  .bb-mo-check span { font-family: var(--dm-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dm-body); opacity: 0; animation: bb-mo-fade 4200ms ease infinite; }
  @keyframes bb-mo-draw { 0% { stroke-dashoffset: 40; } 22%,82% { stroke-dashoffset: 0; } 96%,100% { stroke-dashoffset: 40; } }
  @keyframes bb-mo-fade { 0%,12% { opacity: 0; } 30%,82% { opacity: 1; } 96%,100% { opacity: 0; } }
  .bb-mo-cta { font-family: var(--dm-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dm-accent); display: inline-flex; align-items: center; gap: 7px; }
  .bb-mo-cta svg { width: 13px; height: 13px; transition: transform 360ms ease; }
  .bb-motion:hover .bb-mo-cta svg { transform: translateX(3px); }

  /* ---- reduced motion: land every figure in its final state ---- */
  @media (prefers-reduced-motion: reduce) {
    .bb-spark polyline { stroke-dashoffset: 0; }
    .bb-bubble-in, .bb-imsg-link, .bb-imsg-tail { opacity: 1; }
    .bb-mo-pill { animation: none; }
    .bb-mo-check path { animation: none; stroke-dashoffset: 0; }
    .bb-mo-check span { animation: none; opacity: 1; }
  }
