/* ============================================================================
   QSG // OPERATIONS OS  —  Cinematic 3D Experience
   Glassmorphism HUD · oversize typography · classified-network-OS overlays
   Theme aligned with the QSG landing home (navy / blue / turquoise / cyan)
   ========================================================================== */

:root {
  /* Brand-aligned palette (from tailwind.config.js) + a warm "sun city" accent */
  --navy-deep: #05080f;
  --navy: #0b1220;
  --blue: #2563eb;
  --turq: #14b8a6;
  --cyan: #06b6d4;
  --sun: #f59e0b;
  --sun-warm: #fbbf24;

  --ink: #0f172a;
  --text: #e8f2fb;
  --text-dim: #9fb6cc;
  --muted: #6f869c;

  --glass: rgba(11, 18, 32, 0.42);
  --glass-strong: rgba(8, 14, 26, 0.66);
  --glass-brd: rgba(120, 205, 224, 0.20);
  --glass-brd-hot: rgba(20, 184, 166, 0.55);

  --grad: linear-gradient(135deg, var(--blue) 0%, var(--turq) 100%);
  --grad-hot: linear-gradient(120deg, var(--cyan) 0%, var(--turq) 50%, var(--sun-warm) 120%);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Consolas", monospace;

  --shadow-card: 0 24px 70px rgba(2, 8, 20, 0.55);
  --ease-cine: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy-deep);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

::selection { background: rgba(20, 184, 166, 0.35); color: #fff; }

/* ----------------------------------------------------------------------------
   WebGL canvas — fixed, full screen, behind everything
   -------------------------------------------------------------------------- */
#webgl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
  pointer-events: none;
}

/* subtle scanline + vignette overlay on top of the canvas for the "OS" feel */
#fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.5;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(2, 8, 20, 0.55) 100%),
    repeating-linear-gradient(0deg, rgba(120, 200, 224, 0.035) 0 1px, transparent 1px 3px);
}

/* ----------------------------------------------------------------------------
   BOOT / preloader
   -------------------------------------------------------------------------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(80% 60% at 50% 45%, rgba(20, 184, 166, 0.10), transparent 70%),
    var(--navy-deep);
  transition: opacity 0.8s var(--ease-cine), visibility 0.8s;
}
#boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.boot__inner { width: min(420px, 84vw); text-align: center; }
.boot__logo { width: 92px; height: 92px; margin: 0 auto 26px; filter: drop-shadow(0 0 22px rgba(6, 182, 212, 0.55)); }
.boot__logo .draw {
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: boot-draw 1.6s var(--ease-cine) forwards;
}
@keyframes boot-draw { to { stroke-dashoffset: 0; } }
.boot__node { opacity: 0; animation: boot-node 0.5s ease 1.3s forwards; }
@keyframes boot-node { to { opacity: 1; } }

.boot__title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 0 0 18px;
}
.boot__bar {
  position: relative;
  height: 3px;
  width: 100%;
  background: rgba(120, 200, 224, 0.12);
  border-radius: 99px;
  overflow: hidden;
}
.boot__bar > i {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--grad-hot);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.8);
  transition: width 0.3s ease;
}
.boot__status {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 12px;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------------------
   HUD — fixed chrome (top bar, side nav, ticker)
   -------------------------------------------------------------------------- */
.hud {
  position: fixed;
  z-index: 40;
  pointer-events: none;
}
.hud * { pointer-events: auto; }

/* top bar */
.hud--top {
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 3vw, 38px);
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(20, 184, 166, 0.45)); }
.brand__txt { line-height: 1; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.brand__sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: var(--turq);
  text-transform: uppercase;
  margin-top: 3px;
}

.hud__status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.pill b { color: var(--text); font-weight: 600; }
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--turq);
  box-shadow: 0 0 10px var(--turq);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.pill--hide-sm { }

/* side navigation rail */
.hud--nav {
  top: 50%;
  left: clamp(12px, 2vw, 30px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.nav-dot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-dim);
}
.nav-dot__tick {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(120, 200, 224, 0.4);
  background: transparent;
  transition: all 0.35s var(--ease-cine);
  flex: 0 0 auto;
}
.nav-dot__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.3s var(--ease-cine);
  white-space: nowrap;
  color: var(--text-dim);
}
.nav-dot:hover .nav-dot__label { opacity: 1; transform: translateX(0); }
.nav-dot:hover .nav-dot__tick { border-color: var(--cyan); }
.nav-dot.is-active .nav-dot__tick {
  background: var(--grad-hot);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.85);
  transform: scale(1.25);
}
.nav-dot.is-active .nav-dot__label { opacity: 1; transform: translateX(0); color: var(--text); }

/* bottom ticker */
.hud--ticker {
  bottom: 0; left: 0; right: 0;
  height: 34px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-top: 1px solid var(--glass-brd);
  background: linear-gradient(0deg, rgba(5, 8, 15, 0.78), rgba(5, 8, 15, 0.0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ticker__track {
  display: flex;
  gap: 44px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  will-change: transform;
  animation: ticker 38s linear infinite;
  padding-left: 100%;
}
.ticker__track span b { color: var(--turq); }
.ticker__track span i { color: var(--sun-warm); font-style: normal; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ----------------------------------------------------------------------------
   SCROLL CONTENT — one full-height section per camera stop
   -------------------------------------------------------------------------- */
#scroll { position: relative; z-index: 20; }

.panel {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 7vw, 130px);
  pointer-events: none;
}
.panel[data-side="right"] { justify-content: flex-end; }
.panel[data-side="center"] { justify-content: center; text-align: center; }

/* glass card */
.card {
  position: relative;
  pointer-events: auto;
  width: min(520px, 92vw);
  padding: clamp(22px, 3vw, 38px);
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition: opacity 0.5s var(--ease-cine), transform 0.55s var(--ease-cine);
}
.panel[data-side="center"] .card { width: min(820px, 94vw); }
.panel.is-active .card { opacity: 1; transform: translateY(0) scale(1); }

/* hot accent edge that uses each panel's --accent */
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 22px; bottom: 22px;
  width: 3px;
  border-radius: 99px;
  background: var(--accent, var(--turq));
  box-shadow: 0 0 18px var(--accent, var(--turq));
}
.panel[data-side="center"] .card::before { display: none; }

/* corner ticks → classified-OS frame */
.card__corner {
  position: absolute;
  width: 14px; height: 14px;
  border: 1.5px solid var(--glass-brd-hot);
}
.card__corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.card__corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.card__corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.card__corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.card__tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent, var(--turq));
  margin-bottom: 16px;
}
.card__tag .glyph {
  font-size: 15px;
  filter: drop-shadow(0 0 8px var(--accent, var(--turq)));
}

.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 3.4vw, 3rem);
}
.card__title .grad {
  background: var(--grad-hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* HERO — oversize headline */
.panel--hero .card { position: relative; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; width: min(960px, 96vw); }
.panel--hero .card::before { display: none; }
.panel--hero .card__corner { display: none; }
/* soft readability scrim behind the hero copy (keeps text legible over the 3D) */
.panel--hero .card::after {
  content: "";
  position: absolute;
  inset: -14% -18% -16%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 58% at 50% 46%, rgba(3, 7, 14, 0.78) 0%, rgba(3, 7, 14, 0.5) 44%, rgba(3, 7, 14, 0) 78%);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 6px 0 20px;
  font-size: clamp(2.5rem, 8vw, 7rem);
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.6), 0 10px 60px rgba(6, 182, 212, 0.2);
}
.hero-title .grad {
  background: var(--grad-hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.5));
}
.hero-title .ghost {
  -webkit-text-stroke: 1.4px rgba(159, 182, 204, 0.5);
  color: transparent;
}

.card__lead {
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 22px;
  max-width: 56ch;
}
.panel--hero .card__lead { font-size: clamp(1.05rem, 1.6vw, 1.32rem); color: #dceaf6; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7); }

/* capability bullets */
.card__bullets { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.card__bullets li {
  position: relative;
  padding-left: 26px;
  font-size: 0.96rem;
  line-height: 1.45;
  color: var(--text);
}
.card__bullets li::before {
  content: "";
  position: absolute;
  left: 2px; top: 7px;
  width: 9px; height: 9px;
  border-radius: 2px;
  background: var(--accent, var(--turq));
  box-shadow: 0 0 10px var(--accent, var(--turq));
  transform: rotate(45deg);
}

/* KPI chips + mini data overlays */
.card__kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.kpi {
  flex: 1 1 120px;
  min-width: 116px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-brd);
}
.kpi__val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
}
.kpi__val .u { color: var(--turq); font-size: 1rem; }
.kpi__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 7px;
}
.kpi__bar { margin-top: 9px; height: 3px; border-radius: 99px; background: rgba(120, 200, 224, 0.14); overflow: hidden; }
.kpi__bar > i { display: block; height: 100%; width: 0%; background: var(--grad-hot); transition: width 1s var(--ease-cine); }
.panel.is-active .kpi__bar > i { /* width set per-element inline via data; animated by JS */ }

/* CTA buttons */
.card__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 13px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease-cine), box-shadow 0.25s var(--ease-cine), background 0.25s;
}
.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(20, 184, 166, 0.5); }
.btn--ghost {
  background: var(--glass);
  border-color: var(--glass-brd);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--glass-brd-hot); }
.btn .arrow { transition: transform 0.25s var(--ease-cine); }
.btn:hover .arrow { transform: translateX(4px); }

/* scroll hint */
#scroll-hint {
  position: fixed;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: opacity 0.5s var(--ease-cine);
}
#scroll-hint .mouse {
  width: 22px; height: 34px;
  border: 1.5px solid rgba(120, 200, 224, 0.5);
  border-radius: 12px;
  position: relative;
}
#scroll-hint .mouse::after {
  content: "";
  position: absolute;
  left: 50%; top: 7px;
  width: 3px; height: 6px;
  background: var(--turq);
  border-radius: 3px;
  transform: translateX(-50%);
  animation: scroll-wheel 1.6s var(--ease-cine) infinite;
}
@keyframes scroll-wheel { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 12px); } }
#scroll-hint.is-hidden { opacity: 0; pointer-events: none; }

/* floating mission-statement marquee chip (alive feel) */
.float-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--turq);
}

/* ----------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .hud--nav { display: none; }
  .pill--hide-sm { display: none; }
  .brand__sub { display: none; }
  .panel { padding: 0 18px; }
  .panel[data-side="right"] { justify-content: center; }
  .panel { justify-content: center; }
  .card { width: min(560px, 94vw); }
}

@media (prefers-reduced-motion: reduce) {
  .boot__logo .draw { animation: none; stroke-dashoffset: 0; }
  .boot__node { animation: none; opacity: 1; }
  .ticker__track { animation-duration: 90s; }
  #scroll-hint .mouse::after { animation: none; }
  .pill .dot { animation: none; }
}
