/* ============================================================
   APEX AI — Design System (Single Source of Truth)
   ============================================================
   This file is the canonical design system for apexaiwork.com.
   Change a token here to update it site-wide (on any page that
   does not override it with an inline :root block).

   Load order: link this file FIRST in <head>, before any inline
   <style> block. Pages can override individual tokens in their
   inline :root without touching this file.

   Last updated: 2026-04-05
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Core palette */
  --ivory: #faf9f6;
  --gold: #d4af37;
  --gold-light: #fcf6ba;
  --gold-dark: #b8941f;
  --gold-hover: #e8c547;

  /* Blacks & grays */
  --black: #0a0a0a;
  --dark: #111111;
  --dark2: #1a1a1a;
  --dark3: #141414;

  /* Borders */
  --border: rgba(212,175,55,0.25);
  --border-gold: rgba(212,175,55,0.4);
  --border-dark: #333333;

  /* Text (dark-theme default) */
  --text-primary: #e8e4dc;
  --text-secondary: rgba(255,255,255,0.55);
  --text-muted: rgba(255,255,255,0.35);

  /* Light (for tonal contrast on dark bg) */
  --white: #faf9f6;

  /* Semantic colors */
  --green: #27ae60;
  --red: #e74c3c;
  --yellow: #f39c12;

  /* Gradients & effects */
  --gold-gradient: linear-gradient(135deg,#bf953f,#fcf6ba,#b38728,#fbf5b7,#aa771c);
  --gold-glow: rgba(212,175,55,0.15);
  --card-bg: linear-gradient(145deg,rgba(212,175,55,0.12),rgba(212,175,55,0.04));
  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(212,175,55,0.12);

  /* Spacing scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 128px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-gold: 0 8px 32px rgba(212,175,55,0.25);

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-base: 0.3s ease;
  --t-slow: 0.6s ease;

  /* Layout */
  --max-content: 1200px;
  --max-narrow: 800px;
}

/* ---------- LIGHT-THEME TOKEN OVERRIDE ----------
   Pages with light backgrounds (legal, terms, privacy, success,
   404, unsubscribe, status) add class="light-theme" to <body>
   to flip text tokens for dark text on light bg. */
body.light-theme {
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #888888;
}

/* ---------- BASE RESET (safe defaults) ----------
   These rules are low-specificity so inline page styles win. */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Note: body/h1-h5 rules are left to individual pages to avoid
   fighting with their existing inline overrides. Add new base
   rules here only when you've confirmed no page overrides them. */

/* ---------- UTILITY CLASSES (additive, optional) ----------
   Use these in new pages or when refactoring to reduce duplication.
   Prefix with .apex- to avoid clashing with existing page styles. */

.apex-container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.apex-container-narrow {
  max-width: var(--max-narrow);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.apex-btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-base);
  border: 1px solid transparent;
}

.apex-btn-primary {
  background: var(--gold-gradient);
  color: var(--black);
}

.apex-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.apex-btn-secondary {
  background: transparent;
  color: var(--ivory);
  border-color: var(--border-gold);
}

.apex-btn-secondary:hover {
  background: var(--glass);
  border-color: var(--gold);
}

.apex-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: all var(--t-base);
}

.apex-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.apex-section {
  padding: var(--space-7) var(--space-3);
}

.apex-gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- COMPONENT: NAV (new pages) ----------
   Use on new pages. Existing pages keep their inline nav CSS. */
.apex-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--t-base);
}

.apex-nav-links {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.apex-nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--t-base);
}

.apex-nav-links a:hover,
.apex-nav-links a.active {
  color: var(--gold);
}

.apex-nav-cta {
  background: var(--gold-gradient);
  color: var(--black) !important;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* ---------- COMPONENT: FOOTER ---------- */
.apex-footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-3) var(--space-4);
  color: var(--text-secondary);
}

.apex-footer-grid {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.apex-footer h4 {
  color: var(--gold);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
  font-weight: 600;
}

.apex-footer a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color var(--t-base);
}

.apex-footer a:hover {
  color: var(--gold);
}

.apex-footer-bottom {
  max-width: var(--max-content);
  margin: 0 auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- COMPONENT: STICKY CTA BAR ---------- */
.apex-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-gold);
  padding: var(--space-2) var(--space-3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  transform: translateY(100%);
  transition: transform var(--t-base);
}

.apex-sticky-bar.visible {
  transform: translateY(0);
}

/* ---------- COMPONENT: MODAL (exit-intent, etc.) ---------- */
.apex-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.apex-modal-backdrop.visible {
  display: flex;
}

.apex-modal {
  background: var(--dark);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.apex-modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
  transition: color var(--t-base);
}

.apex-modal-close:hover {
  color: var(--gold);
}

/* ---------- COMPONENT: TRUST BAR ---------- */
.apex-trust-bar {
  background: var(--dark);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) var(--space-3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* ---------- ACCESSIBILITY ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.apex-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
