/* =====================================================================
   PROTOCOLS.IS BRAND SIGNATURES — §14 canonical CSS
   =====================================================================
   Single source of truth for animated illustrative SVG components that
   are the brand signature (SignalPath, company records, evidence flows,
   domain sigils, specimen cards).

   Used across: protocols.is (Ghost, via default.hbs include), any future
   property (elonmuskular.com, app shells) via import.

   All class names prefixed `.bsig-*` (brand-signature) to avoid
   collisions. Platform-neutral.

   Change rule: this file is shared. Edits require explicit operator
   approval and should be synced to every consuming property.

   Canonical reference: /framework/ hero SignalPath SVG.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Design tokens (CSS custom properties)
   --------------------------------------------------------------------- */
:root {
  --bsig-emerald:        #10B981;
  --bsig-emerald-muted:  rgba(16, 185, 129, 0.55);
  --bsig-emerald-faint:  rgba(16, 185, 129, 0.35);
  --bsig-emerald-wash:   rgba(16, 185, 129, 0.06);
  --bsig-blue:           #3B82F6;
  --bsig-blue-muted:     rgba(59, 130, 246, 0.25);
  --bsig-card-bg:        #0D1320;
  --bsig-card-border:    rgba(255, 255, 255, 0.08);
  --bsig-divider:        rgba(255, 255, 255, 0.05);
  --bsig-text-primary:   rgba(255, 255, 255, 0.72);
  --bsig-text-muted:     rgba(255, 255, 255, 0.38);
  --bsig-text-faint:     rgba(255, 255, 255, 0.22);
  --bsig-mono:           'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ---------------------------------------------------------------------
   2. Motion primitives — always include these; respect reduced-motion
   --------------------------------------------------------------------- */
@keyframes bsig-flow {
  to { stroke-dashoffset: -40; }
}
@keyframes bsig-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
@keyframes bsig-wave {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-3px); }
}

/* Reusable animation classes (apply to any SVG element) */
.bsig-flow       { animation: bsig-flow 5s linear infinite; }
.bsig-pulse      { animation: bsig-pulse 2.4s ease-in-out infinite; }
.bsig-pulse--d2  { animation: bsig-pulse 2.4s ease-in-out infinite; animation-delay: 0.6s; }
.bsig-pulse--d3  { animation: bsig-pulse 2.4s ease-in-out infinite; animation-delay: 1.2s; }
.bsig-pulse--d4  { animation: bsig-pulse 2.4s ease-in-out infinite; animation-delay: 1.8s; }
.bsig-wave       { transform-origin: center; animation: bsig-wave 6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .bsig-flow, .bsig-pulse, .bsig-pulse--d2, .bsig-pulse--d3, .bsig-pulse--d4, .bsig-wave {
    animation: none;
  }
}

/* Disable @property fallback across all pages — pairs with stroke-dashoffset fallback */
@supports (background: paint(foo)) {
  @property --bsig-border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
  }
}
@keyframes bsig-rotate-border {
  to { --bsig-border-angle: 360deg; }
}

/* ---------------------------------------------------------------------
   3. SVG container sizing
   --------------------------------------------------------------------- */
.bsig-svg {
  width: 100%;
  height: auto;
  display: block;
  max-width: 560px;
  margin: 0 auto;
}
.bsig-svg--narrow  { max-width: 420px; }
.bsig-svg--wide    { max-width: 720px; }
.bsig-svg--full    { max-width: 100%; }

/* ---------------------------------------------------------------------
   4. SVG text styles (apply to `<text>` elements inside .bsig-svg)
   --------------------------------------------------------------------- */
.bsig-label {
  font-family: var(--bsig-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  fill: var(--bsig-text-muted);
  font-weight: 500;
}
.bsig-header {
  font-family: var(--bsig-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  fill: var(--bsig-emerald);
}
.bsig-sub {
  font-family: var(--bsig-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--bsig-text-muted);
}
.bsig-data {
  font-family: var(--bsig-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  fill: var(--bsig-text-primary);
}
.bsig-data-unit {
  font-family: var(--bsig-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  fill: rgba(16, 185, 129, 0.62);
}
.bsig-item {
  font-family: var(--bsig-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  fill: var(--bsig-text-primary);
}
.bsig-meta {
  font-family: var(--bsig-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  fill: var(--bsig-emerald-muted);
}
.bsig-status {
  font-family: var(--bsig-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  fill: var(--bsig-emerald);
  font-weight: 500;
}

/* ---------------------------------------------------------------------
   5. SVG shape styles
   --------------------------------------------------------------------- */
.bsig-card-rect {
  fill: var(--bsig-card-bg);
  stroke: var(--bsig-card-border);
  stroke-width: 1;
}
.bsig-tick {
  stroke: var(--bsig-emerald-muted);
  stroke-width: 1;
  fill: none;
}
.bsig-divider {
  stroke: var(--bsig-divider);
  stroke-width: 1;
}
.bsig-underline {
  stroke: var(--bsig-emerald-faint);
  stroke-width: 1;
}
.bsig-connector {
  stroke: var(--bsig-emerald);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  fill: none;
  opacity: 0.55;
}
.bsig-connector--faint  { opacity: 0.35; }
.bsig-connector--ghost  { opacity: 0.28; }
.bsig-dot {
  fill: var(--bsig-emerald);
}

/* ---------------------------------------------------------------------
   6. Opacity tiers for layered bars (tier weights in filter/methodology)
   --------------------------------------------------------------------- */
.bsig-tier-1 { fill: var(--bsig-emerald); opacity: 0.95; }
.bsig-tier-2 { fill: var(--bsig-emerald); opacity: 0.65; }
.bsig-tier-3 { fill: var(--bsig-emerald); opacity: 0.42; }
.bsig-tier-4 { fill: var(--bsig-emerald); opacity: 0.25; }

/* ---------------------------------------------------------------------
   7. Composition helpers (for Handlebars / React wrapper containers)
   --------------------------------------------------------------------- */
.bsig-container {
  display: flex;
  justify-content: center;
  margin: 32px auto;
  max-width: 100%;
}
.bsig-container--tight { margin: 16px auto; }
.bsig-container--loose { margin: 48px auto; }
