/*
  assets/site.css — BfxOS marketing site shared design tokens + base rules.

  Phase 2 of the redesign (docs/website-redesign-plan.md). Extracted from the
  previously-inlined <style> block duplicated across every page, VERIFIED
  rule-by-rule before extraction — see the Phase 2 completion report for the
  full methodology.

  IMPORTANT: this file contains only the rules confirmed byte-identical on
  every page that declared them. Several rules that look shared at a glance
  (.btn, .wrap, .rv, footer, body, a, .navlinks base, ::selection,
  a:focus-visible) actually carry real, deliberate per-page/per-family
  differences (e.g. Field Notes article pages use 17px/1.65 body type vs.
  16px/1.6 on product pages; index.html alone uses a smooth-scroll + a
  var(--glow) button shadow other pages hardcode). Those stay in
  site-marketing.css / site-article.css / each page's own small local
  <style> override — forcing them into this universal file would be a real,
  if subtle, visual regression on some pages, which Phase 2 explicitly
  must not do. See docs/website-redesign-plan.md Phase 2 notes.

  Linked by every public page, including 404.html. A page that is one
  folder deep (/solutions/*.html etc., from Phase 3 onward) links this via
  a relative "../assets/site.css" path — verified safe from a plain
  file:// double-click open, see the Phase 2 report's nested-page check.
*/

:root{
  --bg:#EBEBF2; --surface:#FFFFFF; --surface-2:#F4F4F8; --surface-3:#E8E8EF;
  --ink:#1B1E27; --ink-muted:#4B5065; --ink-faint:#8A8FA3;
  --border:rgba(15,23,42,.09); --border-strong:rgba(15,23,42,.16);
  --grad:linear-gradient(135deg,#2563EB,#8B5CF6);
  --accent:#2563EB; --accent-ink:#FFFFFF; --accent2:#8B5CF6;
  --accent-soft:rgba(37,99,235,.08); --accent-soft-strong:rgba(99,102,241,.18);
  --accent2-soft:rgba(139,92,246,.10); --accent2-strong:rgba(139,92,246,.35);
  --violet:#8B5CF6; --cyan:#0E7490; --green:#059669; --blue:#2563EB;
  --glow:0 0 22px rgba(99,102,241,.4);
  --shadow:0 1px 2px rgba(15,23,42,.04), 0 20px 50px rgba(15,23,42,.08);
  --warn:#DC2626; --warnsoft:rgba(220,38,38,.10);
  --good:#059669; --bad:#DC2626;
  --code-bg:#181B21; --code-ink:#D6DAE1; --code-faint:#767F8C; --code-border:#2A2F38;
  --mono:'JetBrains Mono',ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace;
  --sans:'Manrope',-apple-system,'Segoe UI',Roboto,sans-serif;
  --display:'Space Grotesk','Manrope',sans-serif;
  /*
    index.html alone historically declared this with an extra -apple-system
    fallback (--display:'Space Grotesk','Manrope',-apple-system,sans-serif).
    That's the ONE real :root value conflict found across all 16 pages —
    functionally inert (both fonts load from Google Fonts reliably; the
    fallback almost never triggers) but preserved exactly via a local
    override in index.html's own <style> block rather than silently
    dropped, per Phase 2's "preserve all existing functionality" rule.
  */
}

*{ box-sizing:border-box; }

h1,h2,h3,h4{ text-wrap:balance; font-family:var(--display); font-weight:700; letter-spacing:-.02em; margin:0; }
button{ font-family:var(--sans); cursor:pointer; }

/* ── Nav (confirmed byte-identical on every page with a full nav — not 404.html, which has none) ── */
nav.top{ position:sticky; top:0; z-index:50; background:rgba(235,235,242,.78); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); border-bottom:1px solid var(--border); }
.top-inner{ display:flex; align-items:center; gap:36px; padding:16px 32px; max-width:1180px; margin:0 auto; }
/* Found via Phase 9's responsive QA pass: with .navlinks already hidden
   below 820px (see that rule above) and no hamburger-menu alternative built,
   the nav's own CTA button was the next thing to overflow narrow phone
   widths — logo + full button text together don't fit under ~480px.
   Extends the same already-established "minimal mobile nav" pattern
   (logo only) rather than inventing new shortened button copy; every page
   still has its own in-content CTAs for mobile visitors. */
@media (max-width:480px){ .top-inner .btn.primary{ display:none; } }
.logo-mark{ width:34px; height:34px; border-radius:10px; background:var(--grad); display:flex; align-items:center; justify-content:center; box-shadow:0 0 18px rgba(99,102,241,.5); position:relative; overflow:hidden; flex-shrink:0; }
.logo-mark::before{ content:""; position:absolute; top:0; left:0; right:0; height:24%; background:rgba(0,0,0,.22); }
.logo-mark svg{ margin-top:4px; }
.navlinks a:hover{ color:var(--accent2); }
/* !important is load-bearing here: site-marketing.css's unconditional
   .navlinks{display:flex} loads AFTER this file and has equal selector
   specificity, so without !important this media query silently never wins
   regardless of viewport width — found via Phase 9's responsive QA pass
   (every page was overflowing horizontally below 820px because of this). */
@media (max-width:820px){ .navlinks{ display:none !important; } }

/* ── Buttons (.btn base differs by page family — site-marketing.css /
     site-article.css / page-local override; everything else here is
     confirmed identical wherever it appears) ── */
.btn.ghost{ border:1px solid var(--border-strong); color:var(--ink); background:transparent; }
.btn.ghost:hover{ border-color:var(--accent2); color:var(--accent2); }
.btn.primary{ background:var(--grad); color:#fff; box-shadow:0 0 22px rgba(99,102,241,.4); }
.btn.primary:hover{ filter:brightness(1.06); }
.btn.lg{ padding:13px 24px; font-size:14.5px; }
::selection{ background:rgba(139,92,246,.28); }
a:focus-visible, button:focus-visible{ outline:2px solid var(--accent2); outline-offset:2px; }
/*
  Two confirmed singleton exceptions, each preserved via a tiny local
  override on that one page rather than silently dropped:
    - index.html's .btn.primary uses box-shadow:var(--glow) instead of the
      hardcoded value above (same visual result, different declaration).
    - pillar-govern-prove-value.html's ::selection and focus-visible outline
      use --accent instead of --accent2/the hardcoded violet.
*/

/* ── Reveal-on-scroll (.rv base timing differs by family — see
     site-marketing.css/site-article.css; the "revealed" end-state is
     identical everywhere, so it lives here) ── */
.rv.in{ opacity:1; transform:none; }
@media (prefers-reduced-motion:reduce){ .rv{ opacity:1 !important; transform:none !important; transition:none !important; } }

/* ── Visualization system — 10 bfxos-* IDs, hand-built as inline SVG/CSS
     (see docs/website-redesign-plan.md §6). No external asset pipeline: the
     original Canva poster/WebM/MP4 contract was replaced with this one after
     the design-team handoff fell through (no Canva access in-session) — the
     user opted to have these built directly in code instead.
     .viz-asset is the bordered container (shape/sizing contract unchanged
     from the old convention); .viz-scene is the inline <svg> itself, which
     inherits the page's CSS custom properties directly (fill/stroke can
     reference var(--accent) etc. since it's inline in the document). */
.viz-asset{ position:relative; border:1px solid var(--border); border-radius:16px; overflow:hidden; background:var(--surface-2); }
.viz-scene{ display:block; width:100%; height:100%; }
.viz-scene text{ font-family:var(--sans); fill:var(--ink-muted); }
.viz-scene .viz-label-strong{ font-family:var(--sans); font-weight:700; fill:var(--ink); }
.viz-scene .viz-mono{ font-family:var(--mono); fill:var(--ink-faint); letter-spacing:.03em; }
.viz-scene .viz-caption{ font-family:var(--sans); font-style:italic; fill:var(--ink-muted); }

/* Reveal + motion. One-shot entrance for every node/step/ring/band is tied to
   the page's own existing .rv/.rv.in reveal-on-scroll mechanism (added once,
   permanently, by each page's own IntersectionObserver script) — no new JS
   needed. The 2 signature loop visuals add a continuously-traveling glow dot
   on top, which starts the moment .rv.in lands and simply keeps looping. */
@media (prefers-reduced-motion:no-preference){
  .rv .viz-node{ opacity:0; transform:translateY(6px); transition:opacity .5s ease, transform .5s ease; }
  .rv.in .viz-node{ opacity:1; transform:none; }
  .rv .viz-node:nth-of-type(1){ transition-delay:0ms; }
  .rv .viz-node:nth-of-type(2){ transition-delay:70ms; }
  .rv .viz-node:nth-of-type(3){ transition-delay:140ms; }
  .rv .viz-node:nth-of-type(4){ transition-delay:210ms; }
  .rv .viz-node:nth-of-type(5){ transition-delay:280ms; }
  .rv .viz-node:nth-of-type(6){ transition-delay:350ms; }
  .rv .viz-node:nth-of-type(7){ transition-delay:420ms; }
  .rv .viz-node:nth-of-type(8){ transition-delay:490ms; }

  .viz-loop-glow, .viz-loop-halo{ opacity:0; }
  .rv.in .viz-loop-glow, .rv.in .viz-loop-halo{ opacity:1; animation:viz-travel 10s linear infinite; }
  @keyframes viz-travel{ from{ offset-distance:0%; } to{ offset-distance:100%; } }

  /* Synced "wave" pulse — a ring on a given node briefly flares as the
     traveling glow passes it. Each node sets its own animation-delay
     inline, timed to its angular position on the loop/spiral. Duration
     matches .viz-travel/.viz-float's 10s master cycle so all 3 stay synced. */
  .viz-pulse-ring{ transform-box:fill-box; transform-origin:50% 50%; opacity:0; }
  .rv.in .viz-pulse-ring{ animation:viz-pulse 10s ease-out infinite; }
  @keyframes viz-pulse{
    0%{ opacity:0; transform:scale(.7); }
    8%{ opacity:.9; transform:scale(1); }
    26%{ opacity:0; transform:scale(1.4); }
    100%{ opacity:0; transform:scale(1.4); }
  }

  /* Floating deliverable chips — pop up near a node and drift away as the
     traveling glow passes it, timed via the same per-node animation-delay
     scheme as .viz-pulse-ring (2 chips per node, the 2nd offset slightly
     later for a light cascading feel). Slower, longer-held float than the
     pulse-ring so the text has time to actually be read. */
  .viz-float{ transform-box:fill-box; transform-origin:50% 100%; opacity:0; }
  .rv.in .viz-float{ animation:viz-float 10s ease-out infinite; }
  @keyframes viz-float{
    0%{ opacity:0; transform:translateY(10px); }
    8%{ opacity:1; transform:translateY(-2px); }
    26%{ opacity:1; transform:translateY(-10px); }
    38%{ opacity:0; transform:translateY(-20px); }
    100%{ opacity:0; transform:translateY(-20px); }
  }

  /* Bar-chart "grow from baseline" one-shot entrance (bfxos-ai-value-gap
     and any future bar-chart visual). Separate from .viz-node's generic
     fade+rise since a bar reads better growing up from its own baseline
     than drifting in. Per-bar stagger is set inline (transition-delay)
     since each bar is the only rect in its own .viz-node wrapper, so
     nth-of-type can't distinguish them structurally. */
  .viz-bar{ transform-box:fill-box; transform-origin:50% 100%; transform:scaleY(0); opacity:0; transition:transform .7s cubic-bezier(.22,1,.36,1), opacity .4s ease; }
  .rv.in .viz-bar{ transform:scaleY(1); opacity:1; }

  /* "Chase light" — a bright overlay sized to match a flow-chain step,
     stacked directly on top of that step, that flares briefly then fades
     as a continuous sequence travels left to right through the chain
     (bfxos-start-with-work, bfxos-process-mining-flow, any future linear
     step-chain). Each step's overlay sets its own animation-delay inline. */
  .viz-chase{ opacity:0; transform-box:fill-box; transform-origin:50% 50%; }
  .rv.in .viz-chase{ animation:viz-chase 12s ease-in-out infinite; }
  @keyframes viz-chase{
    0%{ opacity:0; transform:scale(1); }
    2%{ opacity:1; transform:scale(1.07); }
    7.5%{ opacity:0; transform:scale(1); }
    100%{ opacity:0; transform:scale(1); }
  }
}
@media (prefers-reduced-motion:reduce){
  .viz-node{ opacity:1 !important; transform:none !important; }
  .viz-loop-glow, .viz-loop-halo{ opacity:1 !important; animation:none !important; offset-distance:0% !important; }
  .viz-pulse-ring, .viz-float{ opacity:0 !important; }
  .viz-bar{ opacity:1 !important; transform:none !important; transition:none !important; }
  .viz-chase{ opacity:0 !important; animation:none !important; }
}
/* Compact teaser instances (inside .story cards) skip the staggered-node
   reveal entirely — those containers aren't wrapped in .rv, so .viz-node
   would otherwise stay at opacity:0 forever; show them immediately. */
.viz-asset:not(.rv) .viz-node, .viz-asset:not(.rv) .viz-loop-glow{ opacity:1 !important; }

/* == uniform site chrome: dropdown nav + footer grid (shared) == */
.navlinks{ position:relative; }
.navlinks .has-sub{ position:relative; }
.navlinks .has-sub > a{ display:flex; align-items:center; gap:4px; }
.navlinks .has-sub > a::after{ content:"▾"; font-size:10px; opacity:.6; }
.submenu{
  position:absolute; top:calc(100% + 10px); left:0; min-width:230px;
  background:var(--surface); border:1px solid var(--border); border-radius:12px;
  box-shadow:var(--shadow); padding:8px; opacity:0; visibility:hidden; transform:translateY(-6px);
  transition:opacity .15s ease, transform .15s ease, visibility .15s; z-index:60;
}
.has-sub:hover .submenu, .has-sub:focus-within .submenu{ opacity:1; visibility:visible; transform:none; }
.submenu a{ display:flex; flex-direction:column; gap:2px; padding:9px 12px; border-radius:8px; font-size:13.5px; font-weight:500; color:var(--ink); border:none; }
.submenu a:hover{ background:var(--surface-2); color:var(--accent2); }
.submenu a small{ font-size:11.5px; font-weight:400; color:var(--ink-faint); }
@media (max-width:820px){ .submenu{ display:none; } }

footer{ padding:56px 0 40px; }
.foot-grid{ display:grid; grid-template-columns:1.4fr repeat(4,1fr); gap:32px; }
@media (max-width:760px){ .foot-grid{ grid-template-columns:repeat(2,1fr); } }
.foot-brand .logo{ margin-bottom:12px; }
.foot-brand p{ font-size:13px; color:var(--ink-muted); max-width:28ch; line-height:1.5; }
.foot-col h6{ font-family:var(--mono); font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-faint); margin-bottom:14px; }
.foot-col a{ display:block; font-size:13.5px; color:var(--ink-muted); padding:5px 0; border:none; }
.foot-col a:hover{ color:var(--accent2); }
.foot-bottom{ margin-top:48px; padding-top:24px; border-top:1px solid var(--border); display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.foot-bottom p{ font-family:var(--mono); font-size:11.5px; color:var(--ink-faint); }
