/* ─────────────────────────────────────────────────────────────────
   APP0110 Labs — Document page chrome
   Shared by privacy.html, terms.html, engagement.html
   Brand tokens lifted verbatim from index.html (2026-05-22).
   Decorative layers (starfield, nebulas, sun-rays, columns, cursor,
   parallax, oracle, sundial, etc.) intentionally omitted — these
   pages are calm, document-focused.
   ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; }

/* A11y utilities */
.visually-hidden, .sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--orbit-blue, #3b82f6);
  color: var(--stellar-white, #ffffff);
  text-decoration: none;
  border-radius: 4px;
  font-family: var(--display-font);
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; outline: 2px solid var(--accent-cyan, #60a5fa); outline-offset: 2px; }

/* Keyboard focus */
.btn-primary:focus-visible,
.nav-logo:focus-visible,
.theme-toggle:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--orbit-glow, #60a5fa);
  outline-offset: 3px;
  border-radius: 4px;
}
[data-theme="light"] a:focus-visible,
[data-theme="light"] button:focus-visible {
  outline-color: var(--orbit-blue, #1e2a4a);
}

/* ── DARK THEME (Cosmos) ── */
[data-theme="dark"] {
  --deep-space: #020106;
  --void:       #050214;
  --nebula:     #08031a;
  --bg-mesh:
    radial-gradient(ellipse 70% 55% at 82% 38%, rgba(42,24,80,0.10), transparent 62%),
    radial-gradient(ellipse 80% 70% at 50% 92%, rgba(26,12,42,0.14), transparent 65%),
    radial-gradient(ellipse 60% 45% at 30% 70%, rgba(2,1,8,0.82), transparent 60%),
    linear-gradient(180deg, #010008 0%, var(--deep-space) 35%, var(--void) 72%, #050218 100%);
  --orbit-blue: #3b82f6;
  --orbit-glow: #60a5fa;
  --ice-blue: #93c5fd;
  --stellar-white: #e8edf5;
  --silver: #94a3b8;
  --accent-cyan: #22d3ee;
  --earth-blue: #1e40af;
  --accent-rgb: 59, 130, 246;
  --glow-rgb: 96, 165, 250;
  --display-font: 'Orbitron', sans-serif;
  --nav-bg: rgba(6, 10, 19, 0.7);
  --nav-bg-scrolled: rgba(6, 10, 19, 0.92);
  --card-gradient: linear-gradient(145deg, rgba(13, 21, 40, 0.96), rgba(6, 10, 19, 0.98));
  --doc-body-color: #b8c2d4;          /* softer than --stellar-white for long reading */
  --doc-link-color: var(--orbit-glow);
  --doc-link-hover: var(--ice-blue);
  --doc-rule: rgba(96, 165, 250, 0.18);
  --doc-callout-bg: rgba(13, 21, 40, 0.55);
  --doc-callout-border: rgba(96, 165, 250, 0.22);
}

/* ── LIGHT THEME (Apollo) ── */
[data-theme="light"] {
  --deep-space: #faf3e2;
  --void: #f3e6c4;
  --nebula: #ecd9a3;
  --bg-mesh:
    radial-gradient(ellipse 90% 60% at 50% 18%, rgba(245,200,124,0.55), transparent 60%),
    radial-gradient(ellipse 70% 50% at 18% 80%, rgba(184,134,44,0.18), transparent 60%),
    radial-gradient(ellipse 70% 50% at 82% 75%, rgba(200,127,27,0.12), transparent 60%),
    linear-gradient(180deg, var(--deep-space) 0%, var(--void) 70%, var(--deep-space) 100%);
  --orbit-blue: #1e2a4a;
  --orbit-glow: #c9a961;
  --ice-blue: #d4b878;
  --stellar-white: #1a1f2e;
  --silver: #6b7280;
  --accent-cyan: #b8923b;
  --earth-blue: #2d3a5f;
  --accent-rgb: 30, 42, 74;
  --glow-rgb: 201, 169, 97;
  --display-font: 'Cinzel', serif;
  --nav-bg: rgba(251, 247, 238, 0.75);
  --nav-bg-scrolled: rgba(251, 247, 238, 0.95);
  --card-gradient: linear-gradient(145deg, #fffaf0, #f7f0df);
  --doc-body-color: #3b4252;
  --doc-link-color: #b8923b;
  --doc-link-hover: #8a6a26;
  --doc-rule: rgba(184, 146, 59, 0.30);
  --doc-callout-bg: rgba(255, 250, 240, 0.6);
  --doc-callout-border: rgba(184, 146, 59, 0.35);
}

/* ── Design tokens (theme-agnostic) ── */
:root {
  --fs-h1: clamp(1.85rem, 3.4vw, 2.25rem);
  --fs-h2: clamp(1.3rem, 2.2vw, 1.5rem);
  --fs-h3: 1.15rem;
  --fs-body: 1.0625rem;
  --fs-small: 0.85rem;
  --ls-eyebrow: 0.22em;
  --lh-body: 1.7;
  --lh-heading: 1.25;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --section-px: clamp(1.25rem, 3vw, 2rem);
}

html {
  background: var(--deep-space);
  transition: background-color 0.4s ease;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: 'Exo 2', sans-serif;
  color: var(--doc-body-color);
  background: var(--deep-space);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  background-size: cover;
  overflow-x: hidden;
  line-height: var(--lh-body);
  font-size: var(--fs-body);
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Painterly mesh drift — lifted verbatim from index.html */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 0;
  background: var(--bg-mesh);
  opacity: 1;
  animation: meshDrift 80s ease-in-out infinite alternate;
}
@keyframes meshDrift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1);     }
  50%  { transform: translate3d(-2%, 1%, 0) rotate(2deg) scale(1.04); }
  100% { transform: translate3d(2%, -1%, 0) rotate(-2deg) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
}

/* ── NAV (simplified — logo + theme toggle only) ── */
nav.doc-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.10);
  transition: background-color 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
}
nav.doc-nav.scrolled {
  background: var(--nav-bg-scrolled);
  border-bottom-color: rgba(var(--accent-rgb), 0.20);
}
.doc-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: padding 0.4s ease;
}
nav.doc-nav.scrolled .doc-nav-inner { padding: 0.75rem 2rem; }

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--orbit-glow);
}
.nav-logo img {
  width: 48px;
  height: auto;
  border-radius: 6px;
  display: block;
  clip-path: inset(0 3px 3px 0);
  transition: filter 0.4s ease, opacity 0.2s ease;
}
[data-theme="light"] .nav-logo img { filter: drop-shadow(0 2px 6px rgba(201, 169, 97, 0.18)); }
[data-theme="dark"] .nav-logo img  { filter: drop-shadow(0 0 8px rgba(96, 160, 224, 0.16)); }
.nav-logo-name {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--orbit-glow);
}
@media (max-width: 540px) {
  .nav-logo-name { display: none; }
}

/* Theme toggle — lifted from index.html */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  color: var(--orbit-glow);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}
.theme-toggle:hover {
  border-color: var(--orbit-blue);
  background: rgba(var(--accent-rgb), 0.10);
  transform: rotate(15deg);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[data-theme="dark"]  .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.theme-toggle.pulsing { transform: scale(0.94) rotate(15deg); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle.pulsing { transform: none; }
  .theme-toggle:hover { transform: none; }
}

/* Theme wipe overlay (cross-fade) */
.theme-wipe {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: var(--deep-space);
  clip-path: circle(0 at var(--wx, 50%) var(--wy, 50%));
  opacity: 0;
}
.theme-wipe.active {
  opacity: 1;
  animation: wipe-expand 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes wipe-expand {
  from { clip-path: circle(0 at var(--wx, 50%) var(--wy, 50%)); }
  to   { clip-path: circle(150% at var(--wx, 50%) var(--wy, 50%)); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-wipe.active { animation: none !important; opacity: 0 !important; }
}

/* Logo cross-fade utility — matches index.html behavior */
#logoNav, #logoFooter {
  transition: opacity 0.2s ease;
}
.logo-fading { opacity: 0 !important; }

/* ── DOCUMENT MAIN ── */
main.doc-main {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  /* Top padding accounts for fixed nav (~84px) plus breathing room */
  padding: clamp(7rem, 11vw, 9rem) var(--section-px) clamp(4rem, 7vw, 6rem);
}

.doc-container {
  max-width: 720px;
  margin: 0 auto;
}

/* Eyebrow above page title */
.doc-eyebrow {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--orbit-glow);
  opacity: 0.85;
  margin-bottom: 1rem;
}

/* Page title (h1) */
.doc-container h1 {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  color: var(--stellar-white);
  margin-bottom: 0.75rem;
}

/* "Last updated" line */
.doc-meta {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: 0.85;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--doc-rule);
}
.doc-meta strong {
  font-weight: 600;
  color: var(--orbit-glow);
}

/* Section headings */
.doc-container h2 {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: -0.005em;
  color: var(--stellar-white);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
}
.doc-container h2:first-of-type { margin-top: 2rem; }

.doc-container h3 {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  color: var(--stellar-white);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.95;
}

/* Body paragraphs */
.doc-container p {
  margin-bottom: 1.15rem;
  color: var(--doc-body-color);
}
.doc-container p:last-child { margin-bottom: 0; }

/* Lists */
.doc-container ul,
.doc-container ol {
  margin: 0 0 1.5rem 1.5rem;
  padding: 0;
}
.doc-container li {
  margin-bottom: 0.6rem;
  color: var(--doc-body-color);
}
.doc-container li::marker {
  color: var(--orbit-glow);
}
.doc-container ul ul,
.doc-container ol ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Strong emphasis */
.doc-container strong {
  color: var(--stellar-white);
  font-weight: 600;
}
[data-theme="light"] .doc-container strong { color: #1a1f2e; }

/* Links */
.doc-container a {
  color: var(--doc-link-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.doc-container a:hover {
  color: var(--doc-link-hover);
  text-decoration-thickness: 2px;
}

/* Horizontal rule between major sections (optional, used on engagement) */
.doc-container hr {
  border: 0;
  height: 1px;
  background: var(--doc-rule);
  margin: 2.5rem 0;
}

/* Callout boxes (used on engagement.html for stages / pricing) */
.doc-callout {
  background: var(--doc-callout-bg);
  border: 1px solid var(--doc-callout-border);
  border-left: 3px solid var(--orbit-glow);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.doc-callout p:last-child { margin-bottom: 0; }
.doc-callout-label {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orbit-glow);
  margin-bottom: 0.6rem;
}

/* Stage indicator (engagement.html) */
.doc-stage-tag {
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orbit-glow);
  background: rgba(var(--accent-rgb), 0.10);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 0.5rem;
}

/* CTA link (engagement page bottom) */
.doc-cta-row {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--doc-rule);
}

/* ── FOOTER (lifted from index.html, document variant) ── */
footer.doc-footer {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem 2rem;
  border-top: 1px solid rgba(var(--accent-rgb), 0.12);
  background: var(--deep-space);
  transition: background-color 0.4s ease, border-color 0.4s ease;
  flex-shrink: 0;
}
[data-theme="light"] footer.doc-footer {
  border-top-color: rgba(201, 169, 97, 0.28);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.footer-brand-col { display: flex; flex-direction: column; gap: 1rem; }
.footer-brand-row { display: flex; align-items: center; gap: 0.75rem; }
.footer-brand-row img {
  width: 48px;
  height: auto;
  border-radius: 6px;
  display: block;
  vertical-align: middle;
  clip-path: inset(0 3px 3px 0);
  filter: drop-shadow(0 4px 14px rgba(var(--accent-rgb), 0.18));
}
[data-theme="dark"] .footer-brand-row img {
  filter: drop-shadow(0 0 10px rgba(96, 160, 224, 0.14));
}
.footer-brand-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 2.5px;
  color: var(--orbit-glow);
  text-transform: uppercase;
}
.footer-blurb {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.88rem;
  color: var(--silver);
  line-height: 1.65;
  max-width: 280px;
}
[data-theme="light"] .footer-blurb { color: rgba(60, 65, 80, 0.78); }

.footer-col h4 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orbit-glow);
  margin-bottom: 1.1rem;
  opacity: 0.92;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0;
  margin: 0;
}
.footer-col a {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.6px;
  color: var(--silver);
  text-decoration: none;
  transition: color 0.25s ease, transform 0.25s ease;
  display: inline-block;
}
.footer-col a:hover { color: var(--orbit-glow); transform: translateX(2px); }
[data-theme="light"] .footer-col a { color: rgba(60, 65, 80, 0.82); }
[data-theme="light"] .footer-col a:hover { color: var(--orbit-glow); }

.footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(var(--accent-rgb), 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.82rem;
  color: var(--silver);
  letter-spacing: 1px;
  opacity: 0.75;
}
.footer-tagline {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.55);
  letter-spacing: 3.5px;
  text-transform: uppercase;
  transition: color 0.4s ease;
}
[data-theme="light"] .footer-tagline { color: rgba(107, 114, 128, 0.7); }

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .doc-nav-inner { padding: 1rem 1.25rem; }
  nav.doc-nav.scrolled .doc-nav-inner { padding: 0.6rem 1.25rem; }
}

/* Theme transitions enabled only after first paint to prevent FOUC */
body.theme-ready,
body.theme-ready a,
body.theme-ready p,
body.theme-ready h1,
body.theme-ready h2,
body.theme-ready h3,
body.theme-ready .doc-meta,
body.theme-ready .footer-col a,
body.theme-ready .footer-blurb,
body.theme-ready .footer-tagline,
body.theme-ready .footer-copy {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}
