/* ============================================================================
   NodePilot — THEME
   ----------------------------------------------------------------------------
   This is the file to edit to change how the site LOOKS.

   Everything below the "PALETTE" heading is a value you can change freely. You
   cannot break the site's behaviour from this file: no checkout, pricing or
   navigation logic reads anything here. The worst outcome of a bad edit is that
   the page looks wrong, and reverting one line puts it back.

   Two rules, and they are the only two:

     1. Edit values, not names. `--accent` is referenced ~40 times across the
        site; renaming it makes those references fall back to nothing.
     2. Every colour is declared twice — once for dark, once for light. Change
        both, or the site will look right in one theme and wrong in the other.

   Preview every token and component side by side, in both themes, by opening
   theme-preview.html in a browser. Nothing needs to be running.
   ============================================================================ */

:root {

  /* ==========================================================================
     PALETTE — the values to edit
     ==========================================================================
     Named for the JOB each colour does, not for the colour it currently is,
     so the names stay honest after you change them. `--accent` can become
     orange without anything being renamed.

     Dark is this site's default: a visitor whose browser states no preference
     gets dark. That is deliberate, and the wiring section below depends on it.
     -------------------------------------------------------------------------- */

  /* --- surfaces, back to front ------------------------------------------- */
  --d-bg:         #05070F;   --l-bg:         #F5F8FD;   /* page behind everything */
  --d-surface:    #0A0F1F;   --l-surface:    #FFFFFF;   /* cards, panels          */
  --d-surface-2:  #0D1428;   --l-surface-2:  #F7FAFE;   /* insets, code blocks    */
  --d-raise:      #111A33;   --l-raise:      #FFFFFF;   /* menus, the thing on top*/

  /* --- borders ------------------------------------------------------------ */
  --d-line:       #16233F;   --l-line:       #DDE4EC;   /* ordinary hairline      */
  --d-line-2:     #1C3F73;   --l-line-2:     #B8C4D0;   /* emphasised / hover     */

  /* --- text, loudest to quietest ------------------------------------------ */
  --d-text:       #DDE4EC;   --l-text:       #05070F;   /* body and headings      */
  --d-muted:      #B8C4D0;   --l-muted:      #3C4A63;   /* secondary copy         */
  --d-faint:      #7C8896;   --l-faint:      #7C8896;   /* captions, disabled     */

  /* --- brand -------------------------------------------------------------- */
  /* --accent carries the identity: links, the logo, focus rings, primary
     buttons. --accent-ink is what sits ON the accent, so those two must stay
     legible against each other — check the contrast pair in theme-preview.html
     after changing either. Light mode's accent is darker on purpose: the dark
     teal fails contrast on a white background. */
  --d-accent:     #5B9BF0;   --l-accent:     #1C3F73;   /* primary brand          */
  --d-accent-2:   #2E67B7;   --l-accent-2:   #2E67B7;   /* hover / gradient end   */
  --d-accent-ink: #05070F;   --l-accent-ink: #FFFFFF;   /* text ON the accent     */

  /* --- status ------------------------------------------------------------- */
  /* Meaning, not decoration: --good marks a synced node, --amber a healing one.
     Recolour them, but keep them distinguishable from --accent and from each
     other, including for red/green colour blindness. */
  --d-good:       #1FBF5C;   --l-good:       #17914A;   /* healthy, synced        */
  --d-amber:      #C9A876;   --l-amber:      #9C8459;   /* working, healing       */

  /* --- logo gradient ------------------------------------------------------ */
  /* The hexagon outline in the wordmark. Same in both themes today; give them
     separate values here if a future light-mode logo needs them. */
  --d-brand-1:    #5B9BF0;   --l-brand-1:    #2E67B7;
  --d-brand-2:    #5B46C9;   --l-brand-2:    #5B46C9;

  /* --- depth -------------------------------------------------------------- */
  /* Dark mode leans on a deeper, more opaque shadow because there is less
     tonal separation between a card and the page behind it. */
  --d-shadow: 0 30px 70px -34px rgba(0,0,0,.8);
  --l-shadow: 0 26px 56px -34px rgba(16,32,54,.32);


  /* ==========================================================================
     TYPE, SHAPE AND MEASURE — identical in both themes
     ========================================================================== */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* The company's display face. Headings, the wordmark and nav use it; body copy does not —
     Orbitron is a display type and a paragraph set in it is hard work to read. */
  --display: "Orbitron", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* The mono stack is doing real work, not decoration — it sets the install
     command, metrics and node names, where a tabular figure and an unambiguous
     0/O matter. Keep a monospace stack here. */
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  /* Corner roundness, small to large. Change --r-md and the whole site's
     character shifts; set them all to 0 for a hard-edged look. */
  --r-sm:  8px;    /* buttons, nav links, focus rings */
  --r-md:  10px;   /* pills, small cards              */
  --r-lg:  14px;   /* panels                          */
  --r-xl:  16px;   /* pricing tiers                   */
  --r-2xl: 20px;   /* the hero panel, overlays        */

  --maxw:  1140px; /* content column — the page centres inside this */
  --nav-h: 64px;   /* sticky header height; scroll anchors are offset by it,
                      so changing it keeps section headings clear of the bar */


  /* ==========================================================================
     WIRING — below this line, leave it alone
     ==========================================================================
     This maps the palette above onto the names the rest of the site actually
     uses, and switches between them. It repeats because CSS has no way to say
     "use this set of values" in one place — but you never need to edit it, and
     editing it is how the two themes drift apart.

     Order matters. An explicit choice (data-theme, set by the header toggle)
     has to beat the browser's preference, so those rules come last.
     ========================================================================== */

  --bg: var(--d-bg);                 --surface: var(--d-surface);
  --surface-2: var(--d-surface-2);   --raise: var(--d-raise);
  --line: var(--d-line);             --line-2: var(--d-line-2);
  --text: var(--d-text);             --muted: var(--d-muted);
  --faint: var(--d-faint);           --accent: var(--d-accent);
  --accent-2: var(--d-accent-2);     --accent-ink: var(--d-accent-ink);
  --good: var(--d-good);             --amber: var(--d-amber);
  --brand-1: var(--d-brand-1);       --brand-2: var(--d-brand-2);
  --shadow: var(--d-shadow);
  color-scheme: dark;
}

/* The visitor's OS says light, and they have not chosen otherwise. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: var(--l-bg);                 --surface: var(--l-surface);
    --surface-2: var(--l-surface-2);   --raise: var(--l-raise);
    --line: var(--l-line);             --line-2: var(--l-line-2);
    --text: var(--l-text);             --muted: var(--l-muted);
    --faint: var(--l-faint);           --accent: var(--l-accent);
    --accent-2: var(--l-accent-2);     --accent-ink: var(--l-accent-ink);
    --good: var(--l-good);             --amber: var(--l-amber);
    --brand-1: var(--l-brand-1);       --brand-2: var(--l-brand-2);
    --shadow: var(--l-shadow);
    color-scheme: light;
  }
}

/* An explicit choice from the header toggle. Higher specificity than the
   rules above, so it wins in both directions. */
:root[data-theme="light"] {
  --bg: var(--l-bg);                 --surface: var(--l-surface);
  --surface-2: var(--l-surface-2);   --raise: var(--l-raise);
  --line: var(--l-line);             --line-2: var(--l-line-2);
  --text: var(--l-text);             --muted: var(--l-muted);
  --faint: var(--l-faint);           --accent: var(--l-accent);
  --accent-2: var(--l-accent-2);     --accent-ink: var(--l-accent-ink);
  --good: var(--l-good);             --amber: var(--l-amber);
  --brand-1: var(--l-brand-1);       --brand-2: var(--l-brand-2);
  --shadow: var(--l-shadow);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: var(--d-bg);                 --surface: var(--d-surface);
  --surface-2: var(--d-surface-2);   --raise: var(--d-raise);
  --line: var(--d-line);             --line-2: var(--d-line-2);
  --text: var(--d-text);             --muted: var(--d-muted);
  --faint: var(--d-faint);           --accent: var(--d-accent);
  --accent-2: var(--d-accent-2);     --accent-ink: var(--d-accent-ink);
  --good: var(--d-good);             --amber: var(--d-amber);
  --brand-1: var(--d-brand-1);       --brand-2: var(--d-brand-2);
  --shadow: var(--d-shadow);
  color-scheme: dark;
}

/* ============================================================================
   BACKDROP — the company site's, rebuilt
   ============================================================================
   www.chainwise.info lays down a vertical navy gradient, floats four large
   blurred orbs over it (silver 10%, blue 25%, violet 20%, gold 6%, each
   blur(64px) and pulsing 0.3 -> 0.8 over 3s), then knocks the whole thing back
   with a navy overlay at 55-75%.

   Rebuilt here with radial-gradients rather than blurred elements. A blurred
   circle IS a radial falloff, so it looks the same, but filter:blur(64px) on
   four viewport-sized layers is a real compositing cost on every scroll and
   this page has none of it. It also needs no extra markup.

   The overlay is folded into the alphas instead of being a fifth layer: navy
   at ~65% over an orb multiplies its alpha by roughly a third, so the values
   below are the company's post-overlay result. That keeps the backdrop where
   it belongs — behind the text, never competing with it — and leaves the
   contrast ratios measured for the palette untouched.
   -------------------------------------------------------------------------- */
:root {
  --orb-silver: rgba(184, 196, 208, .065);   /* #b8c4d0 — top left */
  --orb-blue:   rgba(46, 103, 183, .163);    /* #2e67b7 — bottom right */
  --orb-violet: rgba(91, 70, 201, .130);     /* #5b46c9 — centre */
  --orb-gold:   rgba(201, 168, 118, .060);   /* #c9a876 — upper right */
}

/* Light keeps the same geometry, at a fraction of the strength: on a white
   page these read as a faint wash rather than glow, and anything stronger
   turns body copy grey. */
@media (prefers-color-scheme: light) {
  :root {
    --orb-silver: rgba(124, 136, 150, .090);
    --orb-blue:   rgba(46, 103, 183, .085);
    --orb-violet: rgba(91, 70, 201, .065);
    --orb-gold:   rgba(156, 132, 89, .050);
  }
}
:root[data-theme="light"] {
  --orb-silver: rgba(124, 136, 150, .090);
  --orb-blue:   rgba(46, 103, 183, .085);
  --orb-violet: rgba(91, 70, 201, .065);
  --orb-gold:   rgba(156, 132, 89, .050);
}
:root[data-theme="dark"] {
  --orb-silver: rgba(184, 196, 208, .065);
  --orb-blue:   rgba(46, 103, 183, .163);
  --orb-violet: rgba(91, 70, 201, .130);
  --orb-gold:   rgba(201, 168, 118, .060);
}

/* The base wash itself is set in site.css, on the body rule already there: this file is
   linked FIRST, so a background declared here loses to that one. Tokens here, paint there. */

/* Two layers, two orbs each, so they can breathe out of step. One layer would
   make all four pulse together, which reads as the page flashing rather than
   glowing. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;                 /* behind everything, including the nav */
  pointer-events: none;        /* never eats a click */
  animation: np-glow 3s ease-in-out infinite;
}
body::before {
  background:
    radial-gradient(38vmax 38vmax at 25% 0%,   var(--orb-silver), transparent 62%),
    radial-gradient(50vmax 50vmax at 50% 50%,  var(--orb-violet), transparent 60%);
}
body::after {
  background:
    radial-gradient(38vmax 38vmax at 75% 100%, var(--orb-blue),   transparent 62%),
    radial-gradient(28vmax 28vmax at 67% 33%,  var(--orb-gold),   transparent 60%);
  animation-delay: -1.5s;      /* half a cycle out of phase with ::before */
}

/* The site's own curve and cadence: 0.3 -> 0.8 over 3s. The two layers run half a
   cycle apart, so the four orbs breathe against each other instead of the whole
   page flashing in unison. If it ever reads as busy, this duration is the one
   number to change. */
@keyframes np-glow {
  0%, 100% { opacity: .30; }
  50%      { opacity: .80; }
}

/* Someone who has asked for less motion gets the backdrop, held still. */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; opacity: .55; }
}

/* ----------------------------------------------------------------------------
   BACKGROUND VIDEO
   ----------------------------------------------------------------------------
   www.chainwise.info runs a muted loop across the viewport at opacity .2 and
   lays a navy gradient over it (navy-deep/70 -> navy/55 -> navy-deep/75). The
   overlay is not decoration: the video's own brightness varies frame to frame,
   and it is what keeps text contrast constant regardless of what is on screen.
   -------------------------------------------------------------------------- */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: -1;                 /* with the orbs, behind all content */
  overflow: hidden;
  pointer-events: none;
}
.bg-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;           /* fill the viewport, never letterbox */
  display: block;
  opacity: .2;
}
.bg-video::after {             /* the overlay, over the video */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 70%, transparent) 0%,
    color-mix(in srgb, var(--surface) 55%, transparent) 50%,
    color-mix(in srgb, var(--bg) 75%, transparent) 100%);
}

/* Light mode shows the loop too (owner, 2026-10-13). The footage is dark, so it runs at a lower
   opacity and the same overlay, which is built from the theme tokens, washes it with the light
   surface instead of the navy. Both selectors so an explicit choice and the OS default agree. */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .bg-video video { opacity: .13; filter: saturate(.85); } }
:root[data-theme="light"] .bg-video video { opacity: .13; filter: saturate(.85); }
:root[data-theme="dark"]  .bg-video video { opacity: .2; filter: none; }

/* Asked for less motion: the wash and the orbs stay, the footage goes. A loop of moving video
   is exactly what that setting is about.

   Both selectors are listed because a media query adds no specificity: on its own, `.bg-video`
   (0,1,0) loses to the `:root[data-theme="dark"] .bg-video` (0,2,1) above it, so a visitor who
   had chosen dark AND asked for less motion would have been served the video anyway. */
@media (prefers-reduced-motion: reduce) {
  .bg-video,
  :root[data-theme="dark"] .bg-video,
  :root[data-theme="light"] .bg-video { display: none; }
}
