/* ============================================================
   NEXUSAI DESIGN SYSTEM — Variables, Reset & Utilities
   ============================================================ */

/* ─── COLOR TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99,102,241,.15);
  --secondary: #8b5cf6;
  --accent: #06b6d4;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --gradient-glow: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Border radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --transition: 0.2s var(--ease);
  --transition-slow: 0.4s var(--ease);
}

/* ─── DARK THEME (default) ─────────────────────────────────── */
[data-theme="dark"] {
  --bg-base:    #0a0a0f;
  --bg-surface: #111118;
  --bg-elevated:#16161f;
  --bg-card:    #1a1a26;
  --bg-hover:   #222235;
  --border:     rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.15);

  --text-primary:  #f0f0ff;
  --text-secondary:#a0a0b8;
  --text-muted:    #6060a0;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow:     0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 20px 60px rgba(0,0,0,.6);
  --shadow-glow:0 0 40px rgba(99,102,241,.2);
  --shadow-card:0 0 0 1px rgba(255,255,255,.06), 0 8px 32px rgba(0,0,0,.4);

  color-scheme: dark;
}

/* ─── LIGHT THEME ──────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:    #f8f8fc;
  --bg-surface: #ffffff;
  --bg-elevated:#f0f0f8;
  --bg-card:    #ffffff;
  --bg-hover:   #f0f0f8;
  --border:     rgba(0,0,0,.08);
  --border-strong: rgba(0,0,0,.15);

  --text-primary:  #0f0f1a;
  --text-secondary:#40405a;
  --text-muted:    #8080a0;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.06);
  --shadow:     0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 20px 60px rgba(0,0,0,.12);
  --shadow-glow:0 0 40px rgba(99,102,241,.15);
  --shadow-card:0 0 0 1px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.08);

  color-scheme: light;
}

/* ─── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }

/* ─── TYPOGRAPHY SCALE ─────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 4rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 600; line-height: 1.3; }
h4 { font-size: 1.125rem; font-weight: 600; }
p  { color: var(--text-secondary); line-height: 1.7; }

/* ─── GRADIENT TEXT ────────────────────────────────────────── */
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── LAYOUT UTILITIES ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-wide { max-width: 1400px; }

/* ─── SECTION UTILITIES ────────────────────────────────────── */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .9rem;
  background: var(--primary-light);
  border: 1px solid rgba(99,102,241,.3);
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 600;
  color: #818cf8;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.section-title { color: var(--text-primary); margin-bottom: 1rem; }
.section-subtitle { color: var(--text-secondary); font-size: 1.1rem; }

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  flex-direction: column;
  line-height: 1.2;
}
.btn-subtitle {
  font-size: .7rem;
  font-weight: 400;
  opacity: .7;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,.35);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}
.btn-primary:hover::before { background: rgba(255,255,255,.1); }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,.5);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
}
.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid transparent;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.btn-xl {
  padding: .9rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
  gap: .6rem;
}
.btn-sm {
  padding: .45rem .9rem;
  font-size: .85rem;
  border-radius: var(--radius-sm);
  flex-direction: row;
}
.btn-full { width: 100%; }

/* ─── PULSE GLOW ANIMATION ─────────────────────────────────── */
.pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(99,102,241,.35); }
  50% { box-shadow: 0 6px 40px rgba(99,102,241,.7); }
}

/* ─── HEADER ───────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: .75rem 0;
  transition: all var(--transition);
}
.site-header.scrolled {
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0,0,0,.3);
}
[data-theme="light"] .site-header.scrolled {
  background: rgba(248,248,252,.9);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--gradient-brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}
.main-nav a {
  padding: .45rem .85rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.main-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.main-nav .nav-badge {
  position: relative;
  color: var(--text-primary);
}
.badge {
  position: absolute;
  top: -6px;
  right: -4px;
  background: var(--gradient-brand);
  color: #fff;
  font-size: .55rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── THEME TOGGLE ─────────────────────────────────────────── */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  transition: all var(--transition);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

/* ─── MOBILE MENU ──────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ─── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-slow);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ─── BADGE UTILITIES ──────────────────────────────────────── */
.save-badge {
  background: rgba(16,185,129,.15);
  color: #34d399;
  border: 1px solid rgba(16,185,129,.3);
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: .4rem;
}

/* ─── FORMS ────────────────────────────────────────────────── */
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: .7rem 1rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: .95rem;
  transition: all var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: var(--bg-surface);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236060a0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-group { display: flex; flex-direction: column; gap: .5rem; }
.form-group label { font-size: .9rem; font-weight: 500; color: var(--text-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ─── INPUT WITH ICON ──────────────────────────────────────── */
.input-with-icon { position: relative; }
.input-with-icon > i:first-child {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
}
.input-with-icon .form-input { padding-left: 2.75rem; }

/* ─── CHECKBOX ─────────────────────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .9rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition);
  position: relative;
}
.checkbox-label input:checked ~ .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-label input:checked ~ .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: white;
  font-weight: 700;
}

/* ─── BILLING TOGGLE ───────────────────────────────────────── */
.billing-toggle {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.toggle-label {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.toggle-label.active { color: var(--text-primary); }
.toggle-switch {
  width: 52px;
  height: 28px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
}
.toggle-switch.on { background: var(--primary); border-color: var(--primary); }
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: var(--radius-full);
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.toggle-thumb.on { transform: translateX(24px); }

/* ─── FOOTER ───────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand p {
  margin-top: .75rem;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 240px;
}
.footer-social {
  display: flex;
  gap: .5rem;
  margin-top: 1.25rem;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.footer-social a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}
.footer-col h4 {
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: .6rem; }
.footer-col a {
  font-size: .9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--text-primary); }
.footer-badge {
  background: rgba(16,185,129,.15);
  color: #34d399;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: .4rem;
  text-transform: uppercase;
}
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom p { font-size: .85rem; color: var(--text-muted); }
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { font-size: .85rem; color: var(--text-muted); transition: color var(--transition); }
.footer-bottom-links a:hover { color: var(--text-primary); }

/* ─── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 700px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn .3s var(--ease) forwards;
}
@keyframes modalIn {
  from { transform: scale(.95) translateY(20px); opacity: 0; }
  to   { transform: scale(1)  translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}
.modal-close:hover { background: var(--danger); color: #fff; }
.video-placeholder {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
}
.video-placeholder i { font-size: 4rem; color: var(--primary); }
.video-placeholder p { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }
.video-placeholder span { color: var(--text-muted); font-size: .9rem; }

/* ─── PAGE HERO (inner pages) ──────────────────────────────── */
.page-main { padding-top: 70px; }
.page-hero {
  padding: 5rem 1rem 3rem;
  text-align: center;
  position: relative;
}
.page-headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.page-subheadline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── AOS-LIKE ANIMATIONS ──────────────────────────────────── */
[data-aos] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}
[data-aos][data-aos-delay="50"]  { transition-delay: .05s; }
[data-aos][data-aos-delay="100"] { transition-delay: .1s; }
[data-aos][data-aos-delay="150"] { transition-delay: .15s; }
[data-aos][data-aos-delay="200"] { transition-delay: .2s; }
[data-aos][data-aos-delay="250"] { transition-delay: .25s; }
[data-aos][data-aos-delay="300"] { transition-delay: .3s; }
[data-aos][data-aos-delay="350"] { transition-delay: .35s; }
[data-aos][data-aos-delay="400"] { transition-delay: .4s; }

/* ─── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── SELECTION ────────────────────────────────────────────── */
::selection { background: rgba(99,102,241,.3); color: #fff; }

/* ─── RESPONSIVE HELPERS ───────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
}
@media (max-width: 768px) {
  h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
  h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-actions .btn-ghost { display: none; }
  .btn-xl { padding: .8rem 1.4rem; font-size: 1rem; }
}
