/* ============================================================
   nexus — Intelligence Suite · Shared site stylesheet
   Tokens + base + global chrome (header, footer, buttons, cards)
   Navy-first, green-as-accent. Light + Dark themes.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Light.ttf") format("truetype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Semibold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Semibold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --nx-navy-deep: #001a3b;
  --nx-navy: #112f58;
  --nx-green: #3dae2b;
  --nx-green-deep: #4a8b2c;
  --nx-paper: #f5f6f7;
  --nx-white: #ffffff;

  /* Slate ramp (cool, navy-tinted) */
  --slate-900: #1c2f4f;
  --slate-800: #2a3e5e;
  --slate-700: #3a516f;
  --slate-600: #556a85;
  --slate-500: #7a8aa1;
  --slate-400: #a3aebf;
  --slate-300: #c8d0dc;
  --slate-200: #e3e7ee;
  --slate-100: #eef1f5;
  --slate-50:  #f5f6f7;

  /* Semantic */
  --success: #3dae2b;
  --warning: #c98b1a;
  --danger:  #b3331e;
  --info:    #2a6fa3;

  --nx-gradient-x: linear-gradient(90deg, #112f58 0%, #4a8b2c 100%);
  /* Text gradient — readable in both themes (navy fades into dark backgrounds, so use fg-strong instead) */
  --nx-gradient-text: linear-gradient(90deg, var(--fg-strong) 0%, var(--nx-green) 100%);

  /* Icon tiles (shared "premium" pattern) */
  --icon-tile-bg: color-mix(in srgb, var(--nx-green) 14%, transparent);
  --icon-tile-border: color-mix(in srgb, var(--nx-green) 30%, transparent);
  --icon-tile-shadow: 0 6px 18px -10px color-mix(in srgb, var(--nx-green) 40%, transparent);

  /* Radii */
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-pill: 999px;

  /* Type */
  --font-sans: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Consolas", monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 0.84, 0.24, 1);
  --ease-move: cubic-bezier(0.65, 0, 0.35, 1);

  /* Layout */
  --header-h: 64px;
  --maxw: 1200px;

  color-scheme: light;
}

/* ---------- Light theme (semantic surface vars) ---------- */
:root,
[data-theme="light"] {
  --bg: var(--nx-paper);
  --bg-grid: rgba(17, 47, 88, 0.04);
  --surface: var(--nx-white);
  --surface-2: #fbfcfd;
  --surface-inset: var(--slate-100);
  --fg: var(--nx-navy-deep);
  --fg-strong: var(--nx-navy-deep);
  --fg-muted: var(--slate-600);
  --fg-subtle: #64779c;
  --border: var(--slate-200);
  --border-default: var(--slate-300);
  --border-strong: var(--slate-400);
  --header-bg: rgba(245, 246, 247, 0.78);
  --header-border: var(--slate-200);

  --btn-fg: var(--nx-paper);
  --btn-bg: var(--nx-navy);
  --btn-bg-hover: var(--nx-navy-deep);

  --shadow-1: 0 1px 2px rgba(17,47,88,0.06), 0 1px 3px rgba(17,47,88,0.04);
  --shadow-2: 0 4px 12px rgba(17,47,88,0.08), 0 2px 4px rgba(17,47,88,0.05);
  --shadow-3: 0 12px 32px rgba(17,47,88,0.12), 0 4px 8px rgba(17,47,88,0.06);
  --shadow-4: 0 24px 64px rgba(17,47,88,0.14);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: var(--nx-navy-deep);
  --bg-grid: rgba(255, 255, 255, 0.035);
  --surface: #07223f;
  --surface-2: #0a2748;
  --surface-inset: #061d36;
  --fg: var(--nx-paper);
  --fg-strong: #ffffff;
  --fg-muted: var(--slate-400);
  --fg-subtle: #8fa0b8;
  --border: rgba(255, 255, 255, 0.10);
  --border-default: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --header-bg: rgba(0, 26, 59, 0.72);
  --header-border: rgba(255, 255, 255, 0.08);

  --btn-fg: var(--nx-navy-deep);
  --btn-bg: var(--nx-paper);
  --btn-bg-hover: var(--slate-300);

  --shadow-1: 0 1px 2px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
  --shadow-2: 0 4px 14px rgba(0,0,0,0.36), 0 2px 4px rgba(0,0,0,0.24);
  --shadow-3: 0 14px 40px rgba(0,0,0,0.46), 0 4px 8px rgba(0,0,0,0.30);
  --shadow-4: 0 28px 72px rgba(0,0,0,0.55);
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .32s var(--ease-out), color .32s var(--ease-out);
  overflow-x: hidden;
}

h1,h2,h3,h4 { color: var(--fg-strong); line-height: 1.12; margin: 0; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

/* ---------- Layout helpers ---------- */
.nx-container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.nx-section { padding: 96px 0; }
.nx-section--tight { padding: 64px 0; }
@media (max-width: 720px){ .nx-section{ padding: 64px 0; } }

/* Breadcrumbs */
.nx-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  margin-bottom: 26px; font-size: 13.5px; color: var(--fg-subtle);
}
.nx-breadcrumb a { color: var(--fg-subtle); transition: color .12s var(--ease-out); }
.nx-breadcrumb a:hover { color: var(--nx-green); }
.nx-breadcrumb .sep { color: var(--border-strong); user-select: none; }
.nx-breadcrumb .cur { color: var(--fg-muted); }

.nx-overline {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--nx-green);
  display: inline-flex; align-items: center; gap: 8px;
}
.nx-overline::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px;
  background: var(--nx-gradient-x);
}

.nx-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-subtle); }

.nx-lead { font-size: clamp(17px, 1.4vw, 20px); color: var(--fg-muted); line-height: 1.65; max-width: 62ch; }

.nx-h2 { font-size: clamp(28px, 3.6vw, 44px); }
.nx-h3 { font-size: clamp(20px, 2vw, 26px); font-weight: 700; }

/* Gradient accent rule */
.nx-rule { height: 3px; width: 56px; border-radius: 3px; background: var(--nx-gradient-x); }

/* X-mark monogram (reusable) */
.nx-xmark { display: inline-block; }
.nx-xmark svg { width: 100%; height: 100%; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 14.5px; font-weight: 600;
  line-height: 1; padding: 0 18px; height: 44px; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .12s var(--ease-out), color .12s var(--ease-out),
              border-color .12s var(--ease-out), box-shadow .12s var(--ease-out),
              transform .12s var(--ease-out);
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--btn-bg-hover); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn-primary:active { box-shadow: none; transform: translateY(0); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); transform: translateY(-1px); }
.btn-outline:active { transform: translateY(0); }
.btn-accent { background: var(--nx-green); color: #fff; box-shadow: var(--shadow-1); }
.btn-accent:hover { background: color-mix(in srgb, var(--nx-green) 84%, #000); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn-accent:active { box-shadow: none; transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); }
.btn-sm { height: 36px; font-size: 13.5px; padding: 0 14px; }
.btn-lg { height: 50px; font-size: 15.5px; padding: 0 26px; }

/* ---------- Cards ---------- */
.nx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.nx-card--hover { transition: box-shadow .25s var(--ease-out), border-color .25s var(--ease-out), transform .25s var(--ease-out); }
.nx-card--hover:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--nx-green) 40%, var(--border));
  box-shadow:
    var(--shadow-2),
    0 0 0 1px color-mix(in srgb, var(--nx-green) 18%, transparent),
    0 10px 34px -10px color-mix(in srgb, var(--nx-green) 32%, transparent);
}

/* ---------- Badge / pill ---------- */
.nx-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--border); color: var(--fg-muted); background: var(--surface);
}
.nx-pill--green { color: var(--nx-green); border-color: color-mix(in srgb, var(--nx-green) 35%, transparent); background: color-mix(in srgb, var(--nx-green) 10%, transparent); }
.nx-pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ---------- Header ---------- */
.nx-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--header-border);
  transition: box-shadow .2s var(--ease-out), background-color .32s var(--ease-out), border-color .32s var(--ease-out);
}
.nx-header.is-scrolled { box-shadow: var(--shadow-2); }
.nx-header__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.nx-header__logo { height: 26px; display: flex; align-items: center; }
.nx-header__logo svg, .nx-header__logo img { height: 26px; width: auto; }

.nx-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nx-nav a, .nx-nav button.navlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14.5px; font-weight: 500; color: var(--fg-muted);
  padding: 8px 12px; border-radius: var(--r-md); background: none; border: none; cursor: pointer;
  transition: color .12s var(--ease-out), background-color .12s var(--ease-out);
}
.nx-nav a:hover, .nx-nav button.navlink:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); }
.nx-nav a.is-active { color: var(--fg); font-weight: 600; }
.nx-nav .chev { width: 15px; height: 15px; transition: transform .2s var(--ease-out); }

.nx-header__spacer { flex: 1; }
.nx-header__actions { display: flex; align-items: center; gap: 6px; }
/* Header CTA matches the 38px toggle buttons */
.nx-header__cta { height: 38px; padding: 0 16px; font-size: 14px; }

/* Icon toggle buttons */
.nx-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--fg-muted);
  cursor: pointer; transition: all .12s var(--ease-out);
}
.nx-iconbtn:hover { color: var(--fg); border-color: var(--border-strong); }
.nx-iconbtn svg { width: 18px; height: 18px; }

/* Language toggle — single button, shows the language you switch TO (like theme toggle) */
.nx-langtoggle { font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; }

/* Features dropdown */
.nx-dropwrap { position: relative; }
.nx-dropdown {
  position: absolute; top: calc(100% + 10px); left: 0;
  width: min(680px, 86vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); padding: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s var(--ease-out), transform .16s var(--ease-out), visibility .16s;
}
.nx-dropwrap.open .nx-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nx-dropwrap.open .chev { transform: rotate(180deg); }
.nx-dropitem { display: flex; gap: 12px; padding: 12px 12px; border-radius: var(--r-md); transition: background-color .12s var(--ease-out); }
.nx-dropitem:hover { background: var(--surface-inset); }
.nx-dropitem .ic { flex-shrink: 0; width: 38px; height: 38px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--icon-tile-bg); color: var(--nx-green); border: 1px solid var(--icon-tile-border); box-shadow: var(--icon-tile-shadow); }
.nx-dropitem .ic svg { width: 20px; height: 20px; }
.nx-dropitem .nm { display: block; font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 5px; }
.nx-dropitem .ds { display: block; font-size: 13.5px; color: var(--fg-subtle); line-height: 1.4; margin-bottom: 2px; }
.nx-status { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 750; line-height: 1; letter-spacing: .035em; text-transform: uppercase; }
.nx-status--available { color: var(--nx-green); background: color-mix(in srgb, var(--nx-green) 12%, transparent); border: 1px solid color-mix(in srgb, var(--nx-green) 28%, transparent); }
.nx-status--development { color: var(--fg-muted); background: var(--surface-inset); border: 1px solid var(--border-strong); }

/* Mobile nav toggle */
.nx-burger { display: none; }

@media (max-width: 940px){
  .nx-nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px; gap: 2px; margin: 0;
    box-shadow: var(--shadow-3); transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity .18s var(--ease-out), transform .18s var(--ease-out), visibility .18s; }
  .nx-nav.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nx-nav a, .nx-nav button.navlink { font-size: 16px; padding: 12px; }
  .nx-dropdown { position: static; grid-template-columns: 1fr; box-shadow: none; border: none; padding: 4px 0 4px 16px; opacity: 1; visibility: visible; transform: none; display: none; }
  .nx-dropwrap.open .nx-dropdown { display: grid; }
  .nx-burger { display: inline-flex; }
}

/* ---------- Footer ---------- */
.nx-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 64px 0 32px; margin-top: 0; }
.nx-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.nx-footer__logo { height: 24px; margin-bottom: 18px; }
.nx-footer__logo svg, .nx-footer__logo img { height: 24px; width: auto; }
.nx-footer h5 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-subtle); margin: 0 0 14px; }
.nx-footer ul { display: flex; flex-direction: column; gap: 10px; }
.nx-footer a.fl { font-size: 14px; color: var(--fg-muted); transition: color .12s var(--ease-out); width: fit-content; }
.nx-footer a.fl:hover { color: var(--fg); }
.nx-footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--fg-subtle); }
.nx-footer__trust { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nx-footer__trust .ti { display: inline-flex; align-items: center; gap: 7px; }
.nx-footer__trust svg { width: 15px; height: 15px; color: var(--nx-green); }
@media (max-width: 880px){ .nx-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px){ .nx-footer__grid { grid-template-columns: 1fr; } }

/* ---------- Ambient glow orb (reusable depth accent) ---------- */
.nx-glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .25; }

/* ---------- Generic mock panel (UI-mockup chrome, used site-wide) ----------
   Shared chrome (window bar + footer) so each page's stylesheet only needs
   its own inner content classes. */
.mock { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-3); overflow: hidden; }
.mock__bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock__bar .dot { width: 9px; height: 9px; border-radius: 999px; background: var(--border-strong); }
.mock__bar .ttl { margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--fg-subtle); font-family: var(--font-mono); }
.mock__body { padding: 18px; }
.mock__foot { display: flex; align-items: center; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; color: var(--fg-muted); }
.mock__foot .ci { color: var(--nx-green); display: grid; place-items: center; flex-shrink: 0; }
.mock__foot .ci svg { width: 16px; height: 16px; }
.mock__foot .go { margin-left: auto; color: var(--fg-subtle); font-family: var(--font-mono); font-size: 11px; }

/* ---------- Scroll reveal ---------- */
.nx-reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.nx-reveal.in { opacity: 1; transform: none; }
/* Directional variants — used on two-column sections (Shield, Sovereignty) */
.nx-reveal--left  { transform: translate3d(-14px, 0, 0); }
.nx-reveal--right { transform: translate3d(14px, 0, 0); }
.nx-reveal--left.in, .nx-reveal--right.in { transform: none; }
@media (prefers-reduced-motion: reduce){
  .nx-reveal, .nx-reveal--left, .nx-reveal--right { opacity: 1; transform: none; }
}

/* Skip + focus */
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--nx-green); border-radius: 4px; }
.nx-skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: var(--r-md); z-index: 200; border: 1px solid var(--border); }
.nx-skip:focus { left: 8px; }
