/* ---- Committed single dark world (a mothership in daylight breaks the spell).
         Tokens defined once; the theme toggle can't wash it out. ---- */
  :root,
  :root[data-theme="dark"],
  :root[data-theme="light"] {
    --void:   #06080f;
    --void-2: #090d17;
    --hull:   #0d1320;
    --line:   #1c2434;
    --chrome: #cdd6e3;
    --steel:  #838f9f;
    --steel-dim: #5a6576;
    --star:   #7cc4ff;
    --star-soft: rgba(124,196,255,.5);
    --star-faint: rgba(124,196,255,.14);
  }

  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
  body {
    background: var(--void);
    color: var(--chrome);
    font-family: "Helvetica Neue", "Segoe UI", system-ui, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    min-height: 100svh;
  }
  .mono { font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace; }

  /* Starfield canvas + deep radial light from the "star" above the deck */
  #stars { position: fixed; inset: 0; z-index: 0; display: block; }
  .aurora {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background:
      radial-gradient(120% 80% at 50% -8%, rgba(124,196,255,.16), transparent 46%),
      radial-gradient(90% 60% at 50% 118%, rgba(90,120,180,.10), transparent 55%),
      linear-gradient(180deg, var(--void), var(--void-2) 60%, var(--void));
  }
  .vignette {
    position: fixed; inset: 0; z-index: 2; pointer-events: none;
    box-shadow: inset 0 0 220px 40px rgba(0,0,0,.75);
  }

  /* Reticle brackets framing the viewport */
  .reticle { position: fixed; z-index: 5; width: 46px; height: 46px; pointer-events: none;
    border: 1px solid var(--star-faint); opacity: .8; }
  .reticle.tl { top: 22px; left: 22px; border-right: 0; border-bottom: 0; }
  .reticle.tr { top: 22px; right: 22px; border-left: 0; border-bottom: 0; }
  .reticle.bl { bottom: 22px; left: 22px; border-right: 0; border-top: 0; }
  .reticle.br { bottom: 22px; right: 22px; border-left: 0; border-top: 0; }

  /* Top status bar */
  .topbar {
    position: relative; z-index: 6;
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 34px; gap: 16px;
    font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
    color: var(--steel);
  }
  .topbar .brandline { color: var(--chrome); }
  .topbar .sep { color: var(--steel-dim); }
  .status { display: inline-flex; align-items: center; gap: 8px; color: var(--steel); }
  .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--star);
    box-shadow: 0 0 8px 1px var(--star-soft); animation: pulse 2.6s ease-in-out infinite; }

  /* Deck / hero */
  .deck {
    position: relative; z-index: 6;
    min-height: calc(100svh - 62px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 24px 24px 60px;
  }
  .eyebrow {
    font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--steel);
    margin: 0 0 18px; display: inline-flex; align-items: center; gap: 12px;
  }
  .eyebrow::before, .eyebrow::after { content: ""; width: 30px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--steel-dim)); }
  .eyebrow::after { background: linear-gradient(90deg, var(--steel-dim), transparent); }

  .emblem { position: relative; width: 132px; margin: 0 auto 14px; }
  .emblem::before {
    content: ""; position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%);
    width: 270px; height: 270px; border-radius: 50%;
    background: radial-gradient(circle, rgba(124,196,255,.30), rgba(124,196,255,.06) 42%, transparent 66%);
    z-index: -1; filter: blur(2px);
  }
  .crest {
    display: block; width: 132px; height: auto; margin: 0 auto;
    filter: drop-shadow(0 0 22px rgba(124,196,255,.45)) drop-shadow(0 4px 40px rgba(124,196,255,.18));
  }

  .nameplate { margin: 6px 0 0; line-height: 1; }
  .wordmark {
    font-weight: 200; font-size: clamp(2.3rem, 7.4vw, 5rem);
    letter-spacing: clamp(.14em, 2.4vw, .5em);
    text-transform: uppercase; margin: 0; padding-left: .5em; /* optical: balance the tracking */
    color: var(--chrome);
    text-wrap: balance;
    background: linear-gradient(180deg, #eef3fa 0%, #c3cdda 46%, #8794a6 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
  .subplate {
    margin: 14px 0 0; font-size: 12px; letter-spacing: .62em; text-transform: uppercase;
    color: var(--star); padding-left: .62em; opacity: .9;
  }

  .thesis {
    font-weight: 300; font-size: clamp(1.25rem, 3.2vw, 1.9rem);
    letter-spacing: .01em; color: var(--chrome); margin: 26px 0 0; text-wrap: balance;
  }
  .lede {
    max-width: 40rem; margin: 13px auto 0; color: var(--steel);
    font-size: clamp(.95rem, 1.6vw, 1.05rem); line-height: 1.65; text-wrap: pretty;
  }

  .actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 26px; }
  .btn {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 12px; letter-spacing: .22em; text-transform: uppercase; text-decoration: none;
    padding: 15px 30px; border-radius: 2px; border: 1px solid transparent;
    transition: transform .2s ease, box-shadow .3s ease, border-color .3s ease, background .3s ease, color .2s ease;
  }
  .btn .arrow { transition: transform .25s ease; }
  .btn:hover .arrow { transform: translateX(4px); }
  .btn.primary {
    color: #05131f; background: linear-gradient(180deg, #a9d8ff, #6fb4f2);
    border-color: rgba(124,196,255,.7);
    box-shadow: 0 0 0 1px rgba(124,196,255,.25), 0 0 26px rgba(124,196,255,.35);
    font-weight: 600;
  }
  .btn.primary:hover { transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(124,196,255,.5), 0 0 40px rgba(124,196,255,.55); }
  .btn.ghost {
    color: var(--chrome); border-color: var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  }
  .btn.ghost:hover { border-color: var(--steel); transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(124,196,255,.12); }
  .btn:focus-visible { outline: 2px solid var(--star); outline-offset: 3px; }

  .telemetry {
    margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center;
    font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--steel-dim);
  }
  .telemetry span { display: inline-flex; align-items: center; gap: 8px; }
  .tick { width: 5px; height: 5px; background: var(--star); border-radius: 50%; opacity: .8;
    box-shadow: 0 0 6px var(--star-soft); }

  /* Entrance sequence */
  .rise { opacity: 0; transform: translateY(14px); animation: rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
  .d1 { animation-delay: .05s; } .d2 { animation-delay: .18s; } .d3 { animation-delay: .32s; }
  .d4 { animation-delay: .46s; } .d5 { animation-delay: .60s; } .d6 { animation-delay: .74s; }
  .d7 { animation-delay: .88s; }
  .emblem.rise { animation: powerup 1.3s cubic-bezier(.2,.7,.2,1) forwards; }

  @keyframes rise { to { opacity: 1; transform: none; } }
  @keyframes powerup {
    0% { opacity: 0; transform: translateY(14px) scale(.94); filter: brightness(.4); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: none; filter: brightness(1); }
  }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
  @keyframes drift { to { transform: translateY(-6px); } }
  .float { animation: drift 6s ease-in-out infinite alternate; }

  @media (prefers-reduced-motion: reduce) {
    .rise, .emblem.rise { animation: none; opacity: 1; transform: none; filter: none; }
    .dot, .float { animation: none; }
  }
  /* Scroll cue */
  .scrollcue {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
    font-size: 10px; letter-spacing: .34em; text-transform: uppercase;
    color: var(--steel-dim); text-decoration: none;
  }
  .scrollcue:hover { color: var(--steel); }
  .scrollcue .chev { font-size: 13px; animation: bob 2.2s ease-in-out infinite; }
  .scrollcue:focus-visible { outline: 2px solid var(--star); outline-offset: 4px; }

  /* ---- Fleet registry ---- */
  .fleet { position: relative; z-index: 6; max-width: 1120px; margin: 0 auto; padding: 96px 26px 30px; }
  /* The gap is load-bearing: the constellation fans out through it. */
  .fleet-head { text-align: center; margin-bottom: 116px; }
  @media (max-width: 560px) { .fleet-head { margin-bottom: 82px; } }
  .fleet-eyebrow {
    font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--steel);
    display: inline-flex; align-items: center; gap: 12px; margin: 0;
  }
  .fleet-eyebrow::before, .fleet-eyebrow::after { content: ""; width: 30px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--steel-dim)); }
  .fleet-eyebrow::after { background: linear-gradient(90deg, var(--steel-dim), transparent); }
  .fleet-title {
    font-weight: 200; font-size: clamp(1.6rem, 4.2vw, 2.7rem); letter-spacing: .01em;
    margin: 16px 0 0; text-wrap: balance;
    background: linear-gradient(180deg, #eef3fa, #b7c2d1 70%, #8794a6);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
  .fleet-sub { color: var(--steel); max-width: 36rem; margin: 14px auto 0;
    font-size: clamp(.92rem,1.5vw,1rem); line-height: 1.6; text-wrap: pretty; }

  /* Flex, not grid, purely so an incomplete last row centres instead of
     hanging off the left edge. Cards are sized to the same four columns a
     grid would give, so full rows are pixel-identical. */
  .grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
  .grid > .node { flex: 0 1 calc((100% - 48px) / 4); }
  .node {
    --ac: var(--star);
    position: relative; display: flex; flex-direction: column; gap: 9px;
    padding: 24px 20px 18px; min-height: 218px;
    background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)) , var(--hull);
    border: 1px solid var(--line); border-radius: 3px; text-decoration: none; color: inherit;
    transition: transform .22s ease, border-color .3s ease, box-shadow .35s ease;
  }
  .node::before {
    content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--ac), transparent);
    opacity: .45; transition: opacity .3s ease;
  }
  a.node:hover { transform: translateY(-4px); border-color: var(--ac);
    box-shadow: 0 14px 40px -18px var(--ac), 0 0 0 1px rgba(124,196,255,.05); }
  a.node:hover::before { opacity: 1; }
  .node:focus-visible { outline: 2px solid var(--star); outline-offset: 3px; }
  .node.tra    { --ac: #7de0c6; }
  .node.intel  { --ac: #ffb173; }
  .node.studio { --ac: #7cc4ff; }
  .node.pro    { --ac: #9d8cff; }
  .node.phleb  { --ac: #ff9aa9; }   /* Station 05. Rose, kept clear of
                                        tra mint and studio blue. */   /* Station 04 beacon - matches nexavorix.pro.
                                        Was #7de0c6, which collided with .node.tra. */

  .node-code { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--ac); }
  .node-name { font-size: 1.16rem; font-weight: 400; letter-spacing: .01em; color: var(--chrome); }
  .node-domain { font-size: 11px; letter-spacing: .05em; color: var(--steel-dim); word-break: break-all; }
  .node-desc { font-size: .88rem; line-height: 1.55; color: var(--steel); margin-top: 2px; flex: 1; }
  .node-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
  .pill { display: inline-flex; align-items: center; gap: 7px; font-size: 9.5px; letter-spacing: .18em;
    text-transform: uppercase; color: var(--steel); padding: 4px 10px; border: 1px solid var(--line);
    border-radius: 999px; }
  .pill.standby { color: var(--steel-dim); }
  .pill .tick { width: 5px; height: 5px; border-radius: 50%; background: var(--ac);
    box-shadow: 0 0 6px var(--ac); }
  .pill.online .tick { animation: pulse 2.6s ease-in-out infinite; }
  .node .arrow { color: var(--ac); transition: transform .25s ease; }
  a.node:hover .arrow { transform: translateX(4px); }

  .site-footer { position: relative; z-index: 6; text-align: center; margin-top: 26px;
    padding: 26px 20px 42px; border-top: 1px solid var(--line);
    font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--steel-dim); }

  @keyframes bob { 0%,100% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(4px); opacity: .5; } }

  @media (max-width: 900px) { .grid > .node { flex-basis: calc((100% - 16px) / 2); } }
  @media (max-width: 560px) {
    .topbar { padding: 16px 20px; letter-spacing: .18em; }
    .topbar .brandline .sep + span { display: none; }
    .reticle { width: 30px; height: 30px; }
    .grid > .node { flex-basis: 100%; }
    .fleet { padding-top: 72px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .scrollcue .chev, .pill.online .tick { animation: none; }
  }

/* ---- live telemetry ---------------------------------------------------
   Stations show real uptime, latency, SSL countdown and a 24h sparkline,
   fetched from /network-status.php. Everything below is hidden until the
   data actually lands, so a failed fetch degrades to the static card. */
.node-spark { display:block; width:100%; height:26px; margin:14px 0 6px; opacity:0; transition:opacity .5s ease; }
.node.is-live .node-spark { opacity:.9; }
.node-stats { display:flex; flex-direction:column; gap:2px; min-height:2.2em;
              opacity:0; transform:translateY(3px);
              transition:opacity .45s ease, transform .45s ease; }
.node-stats .s1 { font-size:.64rem; letter-spacing:.05em; color:#c3d2e6; }
.node-stats .s2 { font-size:.6rem;  letter-spacing:.05em; color:var(--muted, #7c8ba1); }
.node-stats.is-live { opacity:1; transform:none; }
.pill.offline { border-color:#ff7a7a; color:#ff9a9a; }
.pill.offline .tick { background:#ff7a7a; }
#fleet-readout { transition:opacity .4s ease; }
#fleet-readout span { font-variant-numeric:tabular-nums; }

/* ---- constellation ----------------------------------------------------
   Sits behind the cards on purpose: links run under the card bodies and
   reappear between them, which reads as depth rather than clutter. */
#constellation { position:absolute; inset:0; z-index:0; pointer-events:none;
                 opacity:0; animation:conFade 1.4s ease .5s forwards; }
@keyframes conFade { to { opacity:1; } }
.fleet-head, .fleet .grid { position:relative; z-index:1; }
@media (prefers-reduced-motion: reduce) { #constellation { animation:none; opacity:1; } }
