﻿:root {
  --bg: #06111f;
  --bg2: #0b1728;
  --panel: #111c2d;
  --panel2: #152237;
  --line: #2f4058;
  --line2: #315e78;
  --text: #f8fafc;
  --muted: #bfd0e5;
  --soft: #8da4c2;
  --accent: #38bdf8;
  --accent2: #60a5fa;
  --green: #34d399;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.13), transparent 34%),
    linear-gradient(180deg, #06111f 0%, #071322 48%, #050b14 100%);
  color: var(--text);
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.nav {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.nav-links a:hover {
  color: var(--text);
}

.hero {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 74px 0 84px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: #dff8ff;
  font-size: 13px;
  font-weight: 800;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.9);
}

.hero h1 {
  max-width: 940px;
  margin: 28px 0 0;
  font-size: clamp(46px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.subtitle {
  margin-top: 24px;
  color: var(--accent);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 900;
}

.claim {
  max-width: 850px;
  margin-top: 24px;
  color: #e2e8f0;
  font-size: clamp(18px, 2.1vw, 23px);
}

.statement {
  margin-top: 30px;
  max-width: 900px;
  padding: 20px 24px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 18px;
  background: rgba(14, 116, 144, 0.18);
  font-size: clamp(20px, 2.4vw, 29px);
  font-weight: 900;
}

.note {
  max-width: 900px;
  margin-top: 18px;
  color: var(--soft);
  font-size: 14px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.8);
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: #f8fafc;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.button.secondary {
  background: rgba(15, 23, 42, 0.55);
  color: #dbeafe;
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: none;
}

main {
  width: min(1180px, calc(100vw - 48px));
  margin: 64px auto 90px;
}

section {
  margin-bottom: 62px;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  align-items: start;
  margin-bottom: 26px;
}

h2 {
  margin: 0;
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

p {
  margin: 0 0 15px;
}

.panel,
.card {
  background: rgba(17, 28, 45, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 28px;
}

.card {
  padding: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
}

.flow span {
  padding: 11px 15px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #dbeafe;
  font-weight: 900;
}

.footer {
  padding: 34px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
  color: var(--soft);
  background: #030811;
  font-size: 14px;
}

/* Interactive demo */

.demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 34px 0 22px;
}

.demo-tab {
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.65);
  color: #dbeafe;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 900;
}

.demo-tab.active {
  border-color: rgba(96, 165, 250, 0.9);
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #ffffff;
}

.demo-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  gap: 22px;
  align-items: stretch;
}

.demo-box {
  background: rgba(17, 28, 45, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.demo-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.status-pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill.stable { color: #bbf7d0; }
.status-pill.pressure { color: #fde68a; }
.status-pill.convergence { color: #bfdbfe; }
.status-pill.scw { color: #fbcfe8; }
.status-pill.critical { color: #fecaca; }

.signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 22px 24px;
}

.signal {
  min-height: 102px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 16px;
  background: rgba(8, 13, 24, 0.45);
}

.signal-title {
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 3px;
}

.signal-layer {
  color: #93c5fd;
  font-size: 13px;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  margin-top: 16px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 24px 22px;
}

.metric {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 15px;
  padding: 13px;
  background: rgba(148, 163, 184, 0.08);
}

.metric-label {
  color: #93c5fd;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.07em;
  font-weight: 900;
}

.metric-value {
  font-size: 22px;
  font-weight: 950;
  color: #ffffff;
}

.phase-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 0 24px 24px;
}

.phase {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(8, 13, 24, 0.55);
  color: #bfdbfe;
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.phase.active {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.65);
}

.interpretation {
  padding: 22px 24px;
}

.interpretation-card {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 116, 144, 0.16);
  border-radius: 16px;
  padding: 18px;
  min-height: 132px;
}

.console {
  margin-top: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 18px;
  min-height: 108px;
  background: #050a13;
  color: #dbeafe;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.demo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 24px 24px;
}

.demo-actions button {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 13px 14px;
  font-weight: 900;
  cursor: pointer;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.78);
}

.demo-actions button.primary {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  border-color: rgba(56, 189, 248, 0.75);
}

.small {
  color: var(--soft);
  font-size: 14px;
}

@media (max-width: 980px) {
  .nav,
  .section-head,
  .demo-layout {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-3,
  .grid-4,
  .signal-grid,
  .metric-grid,
  .phase-row {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 52px;
  }
}

/* APS Logic public starfield layer */
body {
  background:
    radial-gradient(circle at 20% 18%, rgba(115,231,255,.10), transparent 26%),
    radial-gradient(circle at 80% 72%, rgba(127,166,255,.10), transparent 32%),
    linear-gradient(180deg,#050914 0%,#07101d 46%,#030711 100%) !important;
}

#apsParticleCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: .72;
  display: block;
}

.site-header,
main,
footer {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  #apsParticleCanvas {
    display: none;
  }
}

/* =========================================================
   APS MOBILE NAV POLISH V1
   Compact horizontal navigation for mobile / tablet.
   Desktop navigation remains unchanged.
   ========================================================= */

@media (max-width: 980px) {

  .nav {
    gap: 14px;
    padding-top: 18px;
    padding-bottom: 14px;
    align-items: stretch;
  }

  .brand {
    align-self: flex-start;
  }

  .nav-links {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 3px 0 8px;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;

    scrollbar-width: none;

    -webkit-mask-image:
      linear-gradient(
        to right,
        transparent 0,
        #000 12px,
        #000 calc(100% - 18px),
        transparent 100%
      );

    mask-image:
      linear-gradient(
        to right,
        transparent 0,
        #000 12px,
        #000 calc(100% - 18px),
        transparent 100%
      );
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;

    padding: 8px 11px;

    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);

    background: rgba(255,255,255,0.025);

    font-size: 12px;
    line-height: 1;
    white-space: nowrap;

    scroll-snap-align: start;

    transition:
      color .2s ease,
      border-color .2s ease,
      background .2s ease;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    color: var(--text);
    border-color: rgba(115,231,255,0.32);
    background: rgba(115,231,255,0.055);
  }
}

@media (max-width: 520px) {

  .nav {
    width: min(1180px, calc(100vw - 28px));
  }

  .brand {
    font-size: 19px;
  }
}

/* APS Logic - Free Program navigation emphasis */
nav a.nav-free-program {
    color: #5fd6ff;
    font-weight: 700;
}

nav a.nav-free-program:hover,
nav a.nav-free-program:focus-visible {
    color: #9be8ff;
    text-shadow: 0 0 10px rgba(95, 214, 255, 0.35);
}
