/* ==========================================================================
   NORTHERN SIGNAL OPS — ns-ops.ca
   Red Signal / White North design system
   5 switchable artistic themes via [data-theme] on <html>
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

:root {
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 3px;
  --container: 1180px;
  --header-h: 72px;
}

/* ==========================================================================
   THEMES
   ========================================================================== */

/* ---- 01 · RED SIGNAL GRID — dark graphite, red signal lines/nodes/radar ---- */
[data-theme="red-signal-grid"] {
  --red: #e8132b;
  --red-bright: #ff2e45;
  --red-soft: rgba(232, 19, 43, .14);
  --bg: #0e1014;
  --ink: #f4f5f7;
  --muted: #9aa3ad;
  --line: rgba(232, 19, 43, .28);
  --hairline: rgba(255, 255, 255, .09);
  --surface: #14171d;
  --surface-2: #191d24;

  --header-bg: rgba(14, 16, 20, .88);
  --header-ink: #f4f5f7;

  --hero-bg: radial-gradient(1100px 600px at 70% 10%, #232a34 0%, #14181f 60%);
  --hero-ink: #f4f5f7;
  --hero-muted: #aab2bb;
  --hero-grid:
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(232,19,43,.16) 79px 80px),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(232,19,43,.16) 79px 80px);

  --paper-bg: #f6f7f8;
  --paper-ink: #14171d;
  --paper-muted: #5a626b;
  --panel-bg: #0b0d10;
  --panel-ink: #f4f5f7;
  --panel-muted: #97a0aa;
  --steel-bg: #15181e;
  --steel-ink: #f4f5f7;
  --steel-muted: #98a1ab;
  --steel-card: #1b1f26;

  --card-bg: #14171d;
  --card-line: rgba(232, 19, 43, .26);
  --btn-ink: #ffffff;
  --canvas-mode: dark;
}

/* ---- 02 · ARCTIC REDLINE — minimal white terrain, red routes & links ---- */
[data-theme="arctic-redline"] {
  --red: #d81230;
  --red-bright: #ee1437;
  --red-soft: rgba(216, 18, 48, .10);
  --bg: #fbfcfd;
  --ink: #15191d;
  --muted: #5e6a73;
  --line: rgba(216, 18, 48, .30);
  --hairline: rgba(21, 25, 29, .10);
  --surface: #ffffff;
  --surface-2: #f1f4f6;

  --header-bg: rgba(251, 252, 253, .9);
  --header-ink: #15191d;

  --hero-bg:
    radial-gradient(900px 500px at 20% 110%, #eef2f4 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
  --hero-ink: #15191d;
  --hero-muted: #5e6a73;
  --hero-grid:
    radial-gradient(circle at 18% 30%, transparent 119px, rgba(21,25,29,.05) 120px, transparent 121px),
    radial-gradient(circle at 18% 30%, transparent 199px, rgba(21,25,29,.05) 200px, transparent 201px),
    radial-gradient(circle at 82% 65%, transparent 149px, rgba(21,25,29,.05) 150px, transparent 151px),
    radial-gradient(circle at 82% 65%, transparent 239px, rgba(21,25,29,.05) 240px, transparent 241px);

  --paper-bg: #ffffff;
  --paper-ink: #15191d;
  --paper-muted: #5e6a73;
  --panel-bg: #10151a;
  --panel-ink: #f3f6f8;
  --panel-muted: #9fb0bb;
  --steel-bg: #f1f4f6;
  --steel-ink: #15191d;
  --steel-muted: #5e6a73;
  --steel-card: #ffffff;

  --card-bg: #ffffff;
  --card-line: rgba(21, 25, 29, .12);
  --btn-ink: #ffffff;
  --canvas-mode: light;
}

/* ---- 03 · TACTICAL WHITEOUT — white/grey UI, sharp red overlays & grids ---- */
[data-theme="tactical-whiteout"] {
  --red: #e01a32;
  --red-bright: #ff2742;
  --red-soft: rgba(224, 26, 50, .12);
  --bg: #eef1f2;
  --ink: #272d33;
  --muted: #636d75;
  --line: rgba(224, 26, 50, .45);
  --hairline: rgba(39, 45, 51, .14);
  --surface: #f7f9fa;
  --surface-2: #e4e8ea;

  --header-bg: rgba(238, 241, 242, .92);
  --header-ink: #272d33;

  --hero-bg: linear-gradient(180deg, #f2f5f6 0%, #e8ecee 100%);
  --hero-ink: #272d33;
  --hero-muted: #5b656d;
  --hero-grid:
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(39,45,51,.07) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(39,45,51,.07) 39px 40px),
    repeating-linear-gradient(0deg, transparent 0 199px, rgba(224,26,50,.18) 199px 200px),
    repeating-linear-gradient(90deg, transparent 0 199px, rgba(224,26,50,.18) 199px 200px);

  --paper-bg: #f7f9fa;
  --paper-ink: #272d33;
  --paper-muted: #636d75;
  --panel-bg: #2b3138;
  --panel-ink: #f2f5f6;
  --panel-muted: #aeb8c0;
  --steel-bg: #e4e8ea;
  --steel-ink: #272d33;
  --steel-muted: #636d75;
  --steel-card: #f7f9fa;

  --card-bg: #f7f9fa;
  --card-line: rgba(39, 45, 51, .16);
  --btn-ink: #ffffff;
  --canvas-mode: light;
}

/* ---- 04 · CANADIAN DEFENCE-TECH MINIMALISM — red/white base, black panels ---- */
[data-theme="defence-minimal"] {
  --red: #cf0e2a;
  --red-bright: #e51233;
  --red-soft: rgba(207, 14, 42, .08);
  --bg: #ffffff;
  --ink: #121212;
  --muted: #61656a;
  --line: rgba(207, 14, 42, .35);
  --hairline: rgba(18, 18, 18, .10);
  --surface: #ffffff;
  --surface-2: #f5f5f5;

  --header-bg: rgba(255, 255, 255, .94);
  --header-ink: #121212;

  --hero-bg: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  --hero-ink: #121212;
  --hero-muted: #61656a;
  --hero-grid: linear-gradient(90deg, var(--red) 0 4px, transparent 4px);

  --paper-bg: #ffffff;
  --paper-ink: #121212;
  --paper-muted: #61656a;
  --panel-bg: #111111;
  --panel-ink: #fafafa;
  --panel-muted: #9b9fa4;
  --steel-bg: #f5f5f5;
  --steel-ink: #121212;
  --steel-muted: #61656a;
  --steel-card: #ffffff;

  --card-bg: #ffffff;
  --card-line: rgba(18, 18, 18, .14);
  --btn-ink: #ffffff;
  --canvas-mode: light;
}

/* ---- 05 · NORTHERN INDUSTRIAL SYSTEMS — metal, frost, field hardware ---- */
[data-theme="northern-industrial"] {
  --red: #ff2e3f;
  --red-bright: #ff5260;
  --red-soft: rgba(255, 46, 63, .14);
  --bg: #15181b;
  --ink: #e9edef;
  --muted: #8d979e;
  --line: rgba(255, 46, 63, .30);
  --hairline: rgba(233, 237, 239, .10);
  --surface: #1b1f23;
  --surface-2: #21262b;

  --header-bg: rgba(21, 24, 27, .9);
  --header-ink: #e9edef;

  --hero-bg:
    linear-gradient(160deg, rgba(255,255,255,.045) 0%, transparent 35%),
    linear-gradient(20deg, rgba(255,255,255,.03) 0%, transparent 30%),
    linear-gradient(180deg, #1a1e22 0%, #121518 100%);
  --hero-ink: #e9edef;
  --hero-muted: #97a1a8;
  --hero-grid:
    repeating-linear-gradient(45deg, transparent 0 28px, rgba(255,255,255,.025) 28px 30px),
    repeating-linear-gradient(-45deg, transparent 0 28px, rgba(255,255,255,.02) 28px 30px);

  --paper-bg: #e8ebec;
  --paper-ink: #181c1f;
  --paper-muted: #4f5a61;
  --panel-bg: #101316;
  --panel-ink: #e9edef;
  --panel-muted: #8d979e;
  --steel-bg: #1d2226;
  --steel-ink: #e9edef;
  --steel-muted: #8d979e;
  --steel-card: #242a2f;

  --card-bg: #1b1f23;
  --card-line: rgba(255, 46, 63, .25);
  --btn-ink: #ffffff;
  --canvas-mode: dark;
}

/* ==========================================================================
   BASE
   ========================================================================== */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

.container { width: min(var(--container), 92vw); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -.015em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }

.kicker {
  font-family: var(--font-label);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--red);
  margin-bottom: .9rem;
}

.section { padding: clamp(4rem, 9vw, 7.5rem) 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: 3rem; }
.section-lede { margin-top: 1rem; color: var(--muted); }

/* secondary (muted) copy is bolded for readability against busy backgrounds */
.hero-sub, .section-lede, .cap-card p, .contact-copy p,
.newsletter > p, .footer-brand p {
  font-weight: 600;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-label);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .85rem 1.7rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red); color: var(--btn-ink); }
.btn-primary:hover { background: var(--red-bright); }
.btn-ghost { border-color: currentColor; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  color: var(--header-ink);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; height: var(--header-h);
}

.brand { display: flex; align-items: center; }
.brand-logo { height: 40px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 1.6rem; margin-left: auto; }
.site-nav a {
  font-family: var(--font-label);
  font-size: .92rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  opacity: .85;
  position: relative;
  padding: .3rem 0;
}
.site-nav a:hover { opacity: 1; color: var(--red); }
.site-nav a.nav-cta {
  background: var(--red); border: 1px solid var(--red); color: var(--btn-ink);
  padding: .45rem 1rem; border-radius: var(--radius); opacity: 1;
}
.site-nav a.nav-cta:hover { background: var(--red-bright); border-color: var(--red-bright); color: var(--btn-ink); }

/* burger lives here; hidden on desktop so the nav sits flush to the right edge */
.header-tools { display: none; align-items: center; gap: .9rem; }

/* Burger (mobile) */
.nav-burger { display: none; flex-direction: column; gap: 5px; padding: .5rem; }
.nav-burger span { width: 22px; height: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: center;
  background: var(--hero-bg);
  color: var(--hero-ink);
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-grid-overlay { position: absolute; inset: 0; background: var(--hero-grid); pointer-events: none; }
[data-theme="defence-minimal"] .hero-grid-overlay { width: 4px; }

.hero-inner { position: relative; z-index: 2; padding: clamp(4rem, 10vh, 7rem) 0 5.5rem; }

.hero-title {
  font-size: clamp(2.4rem, 6.2vw, 4.6rem);
  font-weight: 900;
  max-width: 16ch;
  text-wrap: balance;
}
.hero-sub {
  max-width: 56ch;
  margin-top: 1.4rem;
  font-size: 1.06rem;
  color: var(--hero-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.2rem; }

/* NVIDIA Inception hero badge (official program badge image) */
.inception-badge {
  display: inline-block;
  margin-top: 2.6rem;
  transition: transform .15s ease, box-shadow .2s ease;
}
.inception-badge img {
  display: block;
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
}
.inception-badge:hover { transform: translateY(-2px); }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.6rem;
  margin-top: 3rem;
  font-family: var(--font-label);
  font-size: .78rem; font-weight: 500;
  letter-spacing: .2em;
  color: var(--hero-muted);
}
.hero-meta span { position: relative; padding-left: 14px; }
.hero-meta span::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 6px; height: 6px; transform: translateY(-50%);
  background: var(--red); border-radius: 1px;
}

/* ==========================================================================
   CAPABILITIES
   ========================================================================== */
.section-capabilities { background: var(--bg); }
.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}
.cap-card {
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-top: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem 1.3rem;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cap-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.cap-index {
  position: absolute; top: 1.1rem; right: 1.2rem;
  font-family: var(--font-label); font-size: .78rem; font-weight: 600;
  letter-spacing: .18em; color: var(--muted);
}
.cap-icon { width: 44px; height: 44px; color: var(--red); margin-bottom: 1.1rem; }
.cap-card h3 { margin-bottom: .55rem; }
.cap-card p { font-size: .94rem; color: var(--muted); }

/* ==========================================================================
   CONTACT / NEWSLETTER
   ========================================================================== */
.section-contact {
  background: var(--paper-bg);
  color: var(--paper-ink);
  overflow: hidden;
}
.signal-lines {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    repeating-linear-gradient(115deg, transparent 0 138px, var(--red-soft) 138px 140px);
}
.contact-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.contact-copy p { color: var(--paper-muted); }
/* title → subtext gap, matching the .section-lede spacing used in the other sections */
.contact-copy h2 + p { margin-top: 1rem; }
.contact-email {
  display: inline-block;
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 800;
  color: var(--red);
  border-bottom: 2px solid var(--red);
  padding-bottom: .15rem;
}
.newsletter {
  background: var(--steel-card);
  color: var(--steel-ink);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .12);
}
[data-theme="red-signal-grid"] .newsletter,
[data-theme="northern-industrial"] .newsletter { background: var(--surface); color: var(--ink); }
.newsletter h3 { margin-bottom: .4rem; }
.newsletter > p { font-size: .92rem; color: var(--muted); margin-bottom: 1.2rem; }
.newsletter-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.newsletter-row input {
  flex: 1 1 220px;
  padding: .8rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: inherit;
}
.newsletter-row input:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.newsletter-msg { margin-top: .8rem; font-size: .88rem; color: var(--red); min-height: 1.2em; }
.newsletter-msg.ok { color: inherit; } /* neutral tone for transmitting / success */

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--panel-bg);
  color: var(--panel-ink);
  border-top: 1px solid var(--hairline);
  padding-top: 3.2rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 2.5rem;
  padding-bottom: 2.4rem;
}
.footer-logo { height: 36px; width: auto; }
.footer-brand p { margin-top: .8rem; font-size: .9rem; color: var(--panel-muted); max-width: 38ch; }
.footer-links { display: grid; gap: .55rem; align-content: start; }
.footer-links a { font-size: .9rem; color: var(--panel-muted); }
.footer-links a:hover { color: var(--red); }
.footer-social { display: flex; gap: .6rem; align-items: start; }
.footer-social a {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font-family: var(--font-label); font-size: .8rem; font-weight: 700;
  letter-spacing: .08em;
  color: var(--panel-muted);
}
.footer-social a:hover { border-color: var(--red); color: var(--red); }
.footer-base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem;
  padding: 1.1rem 0 1.4rem;
  border-top: 1px solid var(--hairline);
  font-size: .82rem; color: var(--panel-muted);
}

/* ==========================================================================
   LEGAL / CONTENT PAGES (privacy · accessibility · terms)
   ========================================================================== */
.legal-main { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(4rem, 9vw, 6.5rem); }
.legal-main .container { max-width: 840px; }
.legal-back {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-label); font-size: .82rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.legal-back:hover { color: var(--red); }
.legal-head {
  margin: 1.6rem 0 2.4rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--hairline);
}
.legal-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 900;
  line-height: 1.08; letter-spacing: -.015em;
}
.legal-meta {
  margin-top: 1.1rem;
  display: flex; flex-wrap: wrap; gap: .3rem 1.6rem;
  font-family: var(--font-label); font-size: .82rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.legal-doc { font-size: 1rem; line-height: 1.75; color: color-mix(in srgb, var(--ink) 84%, var(--bg)); }
.legal-doc h2 {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 800; line-height: 1.2;
  margin: 2.4rem 0 .2rem; color: var(--ink);
}
.legal-doc h3 {
  font-family: var(--font-display);
  font-size: 1.04rem; font-weight: 700;
  margin: 1.6rem 0 .1rem; color: var(--ink);
}
.legal-doc p { margin-top: 1rem; }
.legal-doc ul { margin-top: 1rem; padding-left: 1.4rem; list-style: disc; display: grid; gap: .5rem; }
.legal-doc li { padding-left: .2rem; }
.legal-doc a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.legal-doc a:hover { color: var(--red-bright); }
.legal-doc strong { color: var(--ink); font-weight: 700; }
.legal-doc .legal-disclaimer {
  margin-top: 2.6rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--line); border-left: 3px solid var(--red);
  border-radius: var(--radius);
  background: var(--red-soft);
}
.legal-doc .legal-disclaimer p { color: var(--ink); margin-top: 0; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 920px) {
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: flex-start;
    gap: 0;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--hairline);
    padding: .6rem 4vw 1.2rem;
    display: none;
    z-index: 55;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .8rem 0; width: 100%; }
  .site-nav a.nav-cta { margin-top: .6rem; text-align: center; }
  .header-tools { display: flex; }
  .nav-burger { display: flex; }

  .contact-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.8rem; }
}

@media (max-width: 520px) {
  .brand-logo { height: 32px; }
  .hero-meta { gap: 1rem; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
