/* Bridgeplay brand book kit: tokens, page shell, and the shared building blocks every chapter
   uses (sections, plates, specs, swatches, do/don't, copy blocks). Chapter CSS lives in
   brandbook/<chapter>.css and only styles that chapter's own pieces (prefix them). */

:root {
  /* brand tokens (same values as styles.css on the site) */
  --bp-black: #000;
  --bp-raise: #0b0b0d;
  --bp-raise-2: #141416;
  --bp-raise-3: #1c1c1f;
  --bp-white: #f5f5f7;
  --bp-grey: #a1a1a6;
  --bp-grey-quiet: #86868b;
  --bp-line: rgb(255 255 255 / 0.1);
  --bp-line-strong: rgb(255 255 255 / 0.18);
  --bp-violet: #8b7bff;
  --bp-blue: #4fb3ff;
  --bp-pink: #ff7ac6;
  --bp-light-ink: #1d1d1f;      /* text on the light ground */
  --bp-light-line: #d2d2d7;
  /* Glow = light, never a blob (Ray 2026-11-13: no blotchy or spinning radial glows). It rises evenly
     from one edge like a horizon: violet leads, blue only mixed in, pink only as a hairline accent. */
  --bp-glow: linear-gradient(0deg, rgb(139 123 255 / 0.34) 0%, rgb(118 140 255 / 0.14) 26%, rgb(0 0 0 / 0) 58%), #000;
  --bp-glow-soft: linear-gradient(0deg, rgb(139 123 255 / 0.16) 0%, rgb(118 140 255 / 0.06) 30%, rgb(0 0 0 / 0) 62%), #0b0b0d;
  --bp-glow-top: linear-gradient(180deg, rgb(139 123 255 / 0.22) 0%, rgb(118 140 255 / 0.08) 24%, rgb(0 0 0 / 0) 52%), #000;
  --bp-edge: linear-gradient(90deg, transparent, rgb(139 123 255 / .7) 30%, rgb(79 179 255 / .6) 70%, transparent); /* 1px horizon line */
  --bb-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bb-pad: clamp(16px, 4vw, 40px);
}

body.bb { background: #000; color: var(--bp-white); }
/* zero specificity, so any chapter class that sets a link colour wins */
:where(.bb) a { color: inherit; }

/* ─── cover ─────────────────────────────────────────────────────────────── */
.bb-cover { position: relative; min-height: min(92vh, 860px); overflow: hidden; display: grid; align-items: end; background: #000; }
.bb-cover-field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bb-cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 30%, rgb(0 0 0 / .92) 88%); }
.bb-cover-in { position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--bb-pad) 72px; }
.bb-cover-wm { display: block; height: 30px; width: auto; color: var(--bp-white); }
.bb-cover h1 { margin: 36px 0 20px; font-size: clamp(40px, 6.4vw, 80px); font-weight: 700; letter-spacing: -0.045em; line-height: 1.02; animation: bb-rise .9s var(--bb-ease) both; }
.bb-cover p { max-width: 520px; margin: 0; font-size: 17px; line-height: 1.55; color: var(--bp-grey); animation: bb-rise .9s .14s var(--bb-ease) both; }
.bb-cover-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 40px; font-family: var(--mono); font-size: 12px; color: var(--bp-grey-quiet); }
.bb-cover-meta a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--bp-line-strong); }
@keyframes bb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ─── sticky nav: tabs on top, the tab's sections below ─────────────────── */
.bb-nav { position: sticky; top: 0; z-index: 30; background: rgb(0 0 0 / .82); -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid var(--bp-line); }
.bb-nav-in { max-width: 1200px; margin: 0 auto; padding: 0 var(--bb-pad); height: 46px; display: flex; align-items: center; gap: 16px; }
.bb-nav-tabs { height: 52px; border-bottom: 1px solid var(--bp-line); }
.bb-tabs { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 26px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.bb-tabs::-webkit-scrollbar { display: none; }
.bb-tab { position: relative; flex-shrink: 0; padding: 0; border: 0; background: none; font: 500 15px var(--sans); color: var(--bp-grey-quiet); cursor: pointer; transition: color .15s; }
.bb-tab:hover, .bb-tab[aria-selected="true"] { color: var(--bp-white); }
.bb-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--bp-violet), var(--bp-blue), var(--bp-pink)); }
.bb-tab:focus-visible, .bb-link:focus-visible, .bb-btn:focus-visible { outline: 2px solid var(--bp-blue); outline-offset: 3px; }
.bb-nav-home svg { width: 24px; height: 24px; color: var(--bp-white); display: block; }
.bb-nav-links { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-right: 32px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.bb-nav-links::-webkit-scrollbar { display: none; }
.bb-link { flex-shrink: 0; height: 30px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; font-size: 12.5px; color: var(--bp-grey-quiet); text-decoration: none; white-space: nowrap; transition: color .15s, background .15s; }
.bb-link:hover { color: var(--bp-white); background: rgb(255 255 255 / .06); }
.bb-link.on { color: var(--bp-white); background: rgb(255 255 255 / .08); box-shadow: inset 0 0 0 1px var(--bp-line-strong); }

/* ─── main + sections ───────────────────────────────────────────────────── */
.bb-main { max-width: 1200px; margin: 0 auto; padding: 0 var(--bb-pad) 160px; }
.bb-panel > .bb-sec:first-of-type { padding-top: 56px; }
.bb-sec { padding-top: 112px; scroll-margin-top: 104px; }
.bb-sec-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 760px; margin-bottom: 40px; }
.bb-eyebrow { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bp-grey-quiet); }
.bb-eyebrow b { color: var(--bp-white); font-weight: 500; }
.bb-h2 { margin: 0; font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.bb-lede { margin: 0; font-size: 17px; line-height: 1.6; color: var(--bp-grey); }
.bb-sub { margin: 64px 0 20px; }
.bb-sub h3 { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.025em; }
.bb-sub p { margin: 0; max-width: 680px; font-size: 15px; line-height: 1.6; color: var(--bp-grey); }
.bb-p { max-width: 720px; margin: 0 0 14px; font-size: 15px; line-height: 1.65; color: var(--bp-grey); }
.bb-p strong, .bb-sub p strong { color: var(--bp-white); font-weight: 600; }
.bb-rule { height: 1px; margin: 48px 0; background: var(--bp-line); border: 0; }
.bb-note { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--bp-grey-quiet); }
.bb code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 4px; background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb pre { overflow-x: auto; margin: 0 0 16px; padding: 14px 16px; border-radius: 8px; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); font: 13px/1.6 var(--mono); color: var(--bp-white); }
.bb pre code { padding: 0; background: none; box-shadow: none; }

/* ─── grids ─────────────────────────────────────────────────────────────── */
.bb-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: var(--gap, 16px); margin: 0 0 16px; }
.bb-grid > .span-2 { grid-column: span 2; }
.bb-grid > .span-all { grid-column: 1 / -1; }
@media (max-width: 900px) { .bb-grid { --cols: 2 !important; } .bb-grid > .span-2 { grid-column: 1 / -1; } }
@media (max-width: 600px) { .bb-grid { --cols: 1 !important; } }

/* ─── plate: one item on a stage with a caption. Every plate gets a download button. ── */
.bb-plate { position: relative; margin: 0; min-width: 0; }
.bb-stage { position: relative; display: grid; place-items: center; aspect-ratio: var(--ar, 4 / 3); overflow: hidden; border-radius: 12px; background: var(--stage, var(--bp-raise)); box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb-stage.is-black { --stage: #000; }
.bb-stage.is-light { --stage: var(--bp-white); color: var(--bp-light-ink); }
.bb-stage.is-glow { background: var(--bp-glow); }
.bb-stage.is-desk { --stage: radial-gradient(120% 90% at 50% 0%, #1c1c1f, #050506 70%); background: var(--stage); }
.bb-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 10px 2px 0; font-size: 13px; line-height: 1.45; color: var(--bp-grey); }
.bb-cap b { color: var(--bp-white); font-weight: 500; }
.bb-cap span { font-family: var(--mono); font-size: 11.5px; color: var(--bp-grey-quiet); }
.bb-cap p { flex-basis: 100%; margin: 2px 0 0; }

/* export button + menu (kit.js adds them) */
.bb-exp { position: absolute; top: 10px; right: 10px; z-index: 5; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgb(0 0 0 / .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px var(--bp-line-strong); color: var(--bp-white);
  cursor: pointer; opacity: 0; transform: scale(.92); transition: opacity .2s, transform .2s var(--bb-ease); }
.bb-exp svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bb-plate:hover .bb-exp, .bb-exp:focus-visible, .bb-exp[aria-expanded="true"] { opacity: 1; transform: none; }
@media (hover: none) { .bb-exp { opacity: 1; transform: none; } }
.bb-exp-menu { position: absolute; top: 48px; right: 10px; z-index: 6; min-width: 210px; padding: 6px; border-radius: 10px; background: rgb(20 20 22 / .96);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--bp-line-strong), 0 20px 40px -12px rgb(0 0 0 / .8); }
.bb-exp-menu button { display: flex; width: 100%; justify-content: space-between; gap: 14px; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--bp-white); font: 500 13px var(--sans); text-align: left; cursor: pointer; }
.bb-exp-menu button span { font: 11px var(--mono); color: var(--bp-grey-quiet); }
.bb-exp-menu button:hover { background: rgb(255 255 255 / .08); }
.bb-exp-menu button[disabled] { opacity: .5; cursor: progress; }

/* ─── spec list ─────────────────────────────────────────────────────────── */
.bb-spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0; margin: 0 0 16px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb-spec > div { padding: 12px 14px; box-shadow: inset -1px -1px 0 var(--bp-line); }
.bb-spec dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--bp-grey-quiet); }
.bb-spec dd { margin: 4px 0 0; font-size: 14px; color: var(--bp-white); overflow-wrap: anywhere; }

/* ─── cards ─────────────────────────────────────────────────────────────── */
.bb-card { margin: 0; padding: 18px 20px; border-radius: 12px; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb-card h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.bb-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--bp-grey); }
.bb-card .bb-n { display: block; margin-bottom: 10px; font-family: var(--mono); font-size: 11px; color: var(--bp-grey-quiet); }
.bb-card.is-glow { background: var(--bp-glow-soft); box-shadow: inset 0 0 0 1px var(--bp-line-strong); }

/* ─── do / don't ────────────────────────────────────────────────────────── */
.bb-dd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 16px; }
.bb-dd > div { padding: 16px 18px; border-radius: 12px; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb-dd h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.bb-dd h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.bb-do h4 { color: #6fdc8c; } .bb-do h4::before { background: #30d158; }
.bb-dont h4 { color: #ff8a80; } .bb-dont h4::before { background: #ff453a; }
.bb-dd ul { margin: 0; padding: 0; list-style: none; }
.bb-dd li { padding: 8px 0; font-size: 14px; line-height: 1.5; color: var(--bp-grey); border-top: 1px solid var(--bp-line); }
.bb-dd li:first-child { padding-top: 0; border-top: 0; }
.bb-dd li b { color: var(--bp-white); font-weight: 600; }
@media (max-width: 700px) { .bb-dd { grid-template-columns: minmax(0, 1fr); } }
/* a "don't" plate gets a red cross badge */
.bb-plate.is-dont .bb-stage::after { content: ""; position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; border-radius: 50%; background: #ff453a
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7 7l6 6M13 7l-6 6' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.bb-plate.is-do .bb-stage::after { content: ""; position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; border-radius: 50%; background: #30d158
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.6 2.6L14 7.5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* ─── swatches ──────────────────────────────────────────────────────────── */
.bb-swatch { margin: 0; border-radius: 12px; overflow: hidden; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb-swatch i { display: block; height: 104px; background: var(--c); box-shadow: inset 0 -1px 0 var(--bp-line); }
.bb-swatch div { padding: 12px 14px; }
.bb-swatch b { display: block; font-size: 15px; font-weight: 600; }
.bb-swatch span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--bp-grey); }
.bb-swatch code { display: inline-block; margin-top: 8px; }

/* ─── buttons, chips, copy blocks ───────────────────────────────────────── */
.bb-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .08);
  box-shadow: inset 0 0 0 1px var(--bp-line-strong); color: var(--bp-white); font: 500 14px var(--sans); text-decoration: none; cursor: pointer; transition: background .2s; }
.bb-btn:hover { background: rgb(255 255 255 / .14); }
.bb-btn.is-primary { background: var(--bp-white); color: #000; box-shadow: none; }
.bb-btn.is-primary:hover { background: #fff; }
.bb-btn.is-sm { height: 28px; padding: 0 11px; font-size: 12px; }
.bb-btn.is-done { background: rgb(48 209 88 / .18); box-shadow: inset 0 0 0 1px rgb(48 209 88 / .5); }
.bb-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.bb-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--bp-line-strong); font: 11.5px var(--mono); color: var(--bp-white); }
.bb-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb-seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--bp-grey); font: 500 12.5px var(--sans); cursor: pointer; }
.bb-seg button[aria-pressed="true"] { background: rgb(255 255 255 / .1); color: var(--bp-white); }
.bb-copy { margin: 0 0 12px; padding: 16px 18px; border-radius: 12px; background: var(--bp-raise); box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb-copy header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bb-copy header span { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--bp-grey-quiet); }
.bb-copy p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--bp-white); }
.bb-copy p + p { margin-top: 10px; }

/* ─── tables ────────────────────────────────────────────────────────────── */
.bb-table { margin: 0 0 16px; overflow-x: auto; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--bp-line); }
.bb-table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.bb-table th, .bb-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--bp-line); color: var(--bp-grey); }
.bb-table thead th { border-top: 0; background: var(--bp-raise); color: var(--bp-white); font-weight: 600; white-space: nowrap; }
.bb-table td:first-child { color: var(--bp-white); }

/* ─── next tab + footer ─────────────────────────────────────────────────── */
.bb-next-wrap { display: flex; justify-content: flex-end; margin-top: 120px; }
.bb-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; max-width: 1200px; margin: 0 auto; padding: 40px var(--bb-pad); border-top: 1px solid var(--bp-line); font-size: 12.5px; color: var(--bp-grey-quiet); }
.bb-foot svg { height: 18px; width: auto; color: var(--bp-white); }
.bb-foot a { text-decoration: underline; text-underline-offset: 3px; }

/* shared mark helper: <svg class="bp-mk"><use href="#bp-mark"/></svg> */
.bp-mk { display: block; color: var(--bp-white); overflow: visible; }

@media (prefers-reduced-motion: reduce) {
  .bb-cover h1, .bb-cover p { animation: none; }
  .bb *, .bb *::before, .bb *::after { transition-duration: .01ms !important; }
}
