/* THE BRAIN · AGEIS — VC-BUILD-01 shared foundation.
   Brand Guide v1.1: Deep Space field, indigo/violet line work, Signal White type,
   Montserrat (display/UI) + JetBrains Mono (status, labels, timecodes).
   Values come from /ageis-system/tokens.css (generated from web/src/design/tokens.json). */

:root {
  --b-bg: var(--ageis-color-canvas);
  --b-surface: var(--ageis-color-surface);
  --b-raised: var(--ageis-color-surface-raised);
  --b-selected: var(--ageis-color-surface-selected);
  --b-line: var(--ageis-color-border);
  --b-line-strong: var(--ageis-color-border-strong);
  --b-text: var(--ageis-color-text);
  --b-text-2: var(--ageis-color-text-secondary);
  --b-text-3: var(--ageis-color-text-tertiary);
  --b-indigo: var(--ageis-color-indigo);
  --b-indigo-2: var(--ageis-color-indigo-deep);
  --b-violet: var(--ageis-color-violet);
  --b-violet-2: var(--ageis-color-violet-deep);
  --b-accent: var(--ageis-color-accent);
  --b-amber: var(--ageis-color-amber);
  --b-ok: var(--ageis-color-success);
  --b-warn: var(--ageis-color-warning);
  --b-bad: var(--ageis-color-danger);
  --b-info: var(--ageis-color-info);
  --b-focus: var(--ageis-color-focus);
  --b-grad: linear-gradient(90deg, var(--b-indigo) 0%, var(--b-indigo-2) 38%, var(--b-violet-2) 62%, var(--b-violet) 100%);
  --b-sans: var(--ageis-font-sans);
  --b-mono: var(--ageis-font-mono);
  --b-ease: cubic-bezier(.16, 1, .3, 1);
  --b-ease-io: cubic-bezier(.65, 0, .35, 1);
  --b-radius: 16px;
  --b-radius-s: 10px;
  --b-gutter: clamp(16px, 4.2vw, 64px);
  --b-max: 1360px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.b-body {
  margin: 0; background: var(--b-bg); color: var(--b-text);
  font: 400 16px/1.6 var(--b-sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.b-body img, .b-body video { display: block; max-width: 100%; }
:where(.b-body) a { color: inherit; }
.b-body :focus-visible { outline: 2px solid var(--b-focus); outline-offset: 3px; border-radius: 4px; }
.b-body ::selection { background: var(--ageis-color-selection); }
.b-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.b-skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--b-text); color: var(--b-bg); border-radius: 8px; font-weight: 600; text-decoration: none; }
.b-skip:focus { top: 12px; }

/* Type */
.b-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 500 12px/1.3 var(--b-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--b-text-2); }
.b-eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--b-grad); }
.b-display { margin: 0; font: 800 clamp(2.5rem, 5.2vw, 5.4rem)/1 var(--b-sans); letter-spacing: -.035em; text-wrap: balance; }
.b-h1 { margin: 0; font: 800 clamp(2.2rem, 4.8vw, 4.4rem)/1.02 var(--b-sans); letter-spacing: -.03em; text-wrap: balance; }
.b-h2 { margin: 0; font: 700 clamp(1.8rem, 3.4vw, 3.1rem)/1.06 var(--b-sans); letter-spacing: -.025em; text-wrap: balance; }
.b-h3 { margin: 0; font: 700 clamp(1.15rem, 1.6vw, 1.4rem)/1.25 var(--b-sans); letter-spacing: -.01em; }
.b-lead { margin: 0; max-width: 58ch; font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.6; color: var(--b-text-2); }
.b-body p { text-wrap: pretty; }
.b-muted { color: var(--b-text-2); }
.b-mono { font-family: var(--b-mono); }
.b-em { background: var(--b-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons */
.b-btn { --h: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font: 600 15px/1 var(--b-sans); letter-spacing: -.005em; text-decoration: none; cursor: pointer; transition: transform .2s var(--b-ease), background-color .2s, border-color .2s, color .2s; white-space: nowrap; }
.b-btn:active { transform: translateY(1px); }
.b-btn--primary { background: var(--b-text); color: var(--b-bg); }
.b-btn--primary:hover { background: #fff; }
.b-btn--ghost { background: rgb(242 244 248 / .04); color: var(--b-text); border-color: rgb(242 244 248 / .18); backdrop-filter: blur(10px); }
.b-btn--ghost:hover { border-color: rgb(242 244 248 / .42); background: rgb(242 244 248 / .08); }
.b-btn--indigo { background: linear-gradient(135deg, var(--b-indigo), var(--b-indigo-2)); color: #fff; }
.b-btn--small { --h: 38px; padding: 0 16px; font-size: 14px; }
.b-btn svg { width: 18px; height: 18px; flex: none; }
.b-link { display: inline-flex; align-items: center; gap: 8px; color: var(--b-text); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgb(242 244 248 / .25); padding-bottom: 2px; }
.b-link:hover { border-color: var(--b-text); }

/* Truth-state chips: always from source, never decorative */
.b-chip { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 11px; border-radius: 999px; font: 500 11px/1 var(--b-mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--b-line); color: var(--b-text-2); background: rgb(11 13 20 / .55); white-space: nowrap; }
.b-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-chip--live { color: var(--b-ok); border-color: rgb(110 231 183 / .32); }
.b-chip--gated { color: var(--b-warn); border-color: rgb(252 211 77 / .3); }
.b-chip--dev { color: var(--b-text-2); }
.b-chip--off { color: var(--b-bad); border-color: rgb(252 165 165 / .3); }
.b-chip--demo { color: var(--b-info); border-color: rgb(169 193 247 / .32); }
.b-chip--plain::before { display: none; }

/* Media disclosure labels (handoff §5) */
.b-disclose { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 500 10.5px/1.4 var(--b-mono); letter-spacing: .06em; color: rgb(242 244 248 / .78); }
.b-unapproved { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 4px; background: var(--b-amber); color: #1a1405; font: 500 10px/1 var(--b-mono); letter-spacing: .12em; }

/* Cinematic media frame: poster first, silent loop on visibility, pause control */
.b-cine { position: relative; margin: 0; min-width: 0; width: 100%; overflow: hidden; border-radius: var(--b-radius); background: radial-gradient(120% 90% at 70% 40%, #1a2140 0%, #0f1220 55%, #0b0d14 100%); isolation: isolate; }
.b-cine::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(242 244 248 / .07); pointer-events: none; z-index: 3; }
.b-cine > picture, .b-cine > picture img, .b-cine > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-cine > video { opacity: 0; transition: opacity .4s ease; z-index: 1; }
.b-cine.is-playing > video { opacity: 1; }
.b-cine__meta { position: absolute; left: 14px; bottom: 12px; right: 60px; z-index: 4; pointer-events: none; text-shadow: 0 1px 8px rgb(0 0 0 / .6); }
.b-cine__ctrl { position: absolute; right: 12px; bottom: 10px; z-index: 5; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgb(242 244 248 / .3); background: rgb(11 13 20 / .55); color: var(--b-text); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.b-cine__ctrl:hover { border-color: var(--b-text); }
.b-cine__ctrl svg { width: 14px; height: 14px; }
.b-cine[data-static] .b-cine__ctrl { display: none; }

/* Real-UI capture frame */
.b-capture { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--b-surface); box-shadow: 0 40px 80px -30px rgb(0 0 0 / .8), 0 0 0 1px rgb(242 244 248 / .1); }
.b-capture img { width: 100%; height: auto; }
.b-capture figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--b-line); font: 500 11px/1.4 var(--b-mono); letter-spacing: .05em; color: var(--b-text-2); background: var(--b-surface); }
.b-capture__missing { display: grid; place-items: center; aspect-ratio: 16 / 10; padding: 24px; text-align: center; font: 500 12px/1.6 var(--b-mono); color: var(--b-text-3); background: repeating-linear-gradient(135deg, #10131e 0 12px, #121626 12px 24px); }

@media (prefers-reduced-motion: reduce) {
  .b-body *, .b-body *::before, .b-body *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.b-link svg { width: 18px; height: 18px; flex: none; }
.b-cine img.is-missing { visibility: hidden; }
:where(.p-head-block, .p-beat__copy, .p-stage__head, .p-card__body, .p-mode__copy) > .b-chip { justify-self: start; }
.b-cine[data-static="still"] { aspect-ratio: 43 / 24; }
.p-intro__bg .b-cine[data-static="still"] { aspect-ratio: auto; }
