/**
 * MyAI Design System - "Liquid Aurora" Aesthetic
 * A unified, premium design with luminous gradients and sophisticated depth
 */

/* ========================================
   DESIGN TOKENS
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand Colors - Aurora Palette */
  --aurora-indigo: #6366f1;
  --aurora-violet: #8b5cf6;
  --aurora-cyan: #06b6d4;
  --aurora-emerald: #10b981;
  --aurora-amber: #f59e0b;

  /* Primary gradient */
  --gradient-primary: linear-gradient(135deg, var(--aurora-indigo) 0%, var(--aurora-violet) 50%, var(--aurora-cyan) 100%);
  --gradient-accent: linear-gradient(135deg, var(--aurora-emerald) 0%, var(--aurora-cyan) 100%);
  --gradient-warm: linear-gradient(135deg, var(--aurora-amber) 0%, #f97316 100%);

  /* Surface Colors - Deep & Rich */
  --surface-void: #030712;
  --surface-deep: #0a0f1e;
  --surface-base: #111827;
  --surface-elevated: #1f2937;
  --surface-overlay: #374151;
  --surface-light: #f8fafc;
  --surface-light-elevated: #ffffff;

  /* Text Colors */
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-inverse: #111827;
  --text-accent: var(--aurora-cyan);

  /* Light mode text */
  --text-primary-light: #111827;
  --text-secondary-light: #4b5563;
  --text-muted-light: #9ca3af;

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --border-light: #e5e7eb;

  /* Semantic Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Glow Effects */
  --glow-indigo: 0 0 60px rgba(99, 102, 241, 0.4);
  --glow-cyan: 0 0 60px rgba(6, 182, 212, 0.3);
  --glow-emerald: 0 0 60px rgba(16, 185, 129, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.25);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

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

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   BASE STYLES
   ======================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--surface-void);
  min-height: 100vh;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ========================================
   LAYOUT
   ======================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-sm {
  max-width: 800px;
}

.container-lg {
  max-width: 1400px;
}

/* ========================================
   HEADER - Unified Navigation
   ======================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo .tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: var(--space-4);
  border-left: 1px solid var(--border-default);
  display: none;
}

@media (min-width: 640px) {
  .logo .tagline {
    display: block;
  }
}

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

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

/* Nav Button Styles */
.btn-nav-signin,
.btn-nav-signout {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: all var(--transition-base);
}

.btn-nav-signin {
  background: var(--gradient-primary);
  color: white !important;
}

.btn-nav-signin:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-indigo);
}

.btn-nav-signout {
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary) !important;
}

.btn-nav-signout:hover {
  background: var(--surface-overlay);
  color: var(--text-primary) !important;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  position: relative;
  padding: var(--space-24) 0;
  text-align: center;
  overflow: hidden;
  background: var(--surface-deep);
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Aurora gradient mesh */
.hero-background::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  animation: auroraShift 20s ease-in-out infinite;
}

/* Subtle grid pattern */
.hero-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

@keyframes auroraShift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -2%) rotate(1deg); }
  66% { transform: translate(-2%, 2%) rotate(-1deg); }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
  background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title .highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto var(--space-10);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

.cta-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.waitlist-link {
  color: var(--aurora-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.waitlist-link:hover {
  color: var(--aurora-emerald);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-hero {
  padding: var(--space-4) var(--space-10);
  font-size: 1.1rem;
  border-radius: var(--radius-xl);
  background: var(--gradient-accent);
  color: white;
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.3),
    0 8px 30px rgba(16, 185, 129, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(16, 185, 129, 0.4),
    0 16px 50px rgba(16, 185, 129, 0.35),
    var(--glow-emerald);
}

.btn-hero:hover::before {
  opacity: 1;
}

.btn-hero:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--surface-overlay);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-link {
  background: transparent;
  color: var(--aurora-cyan);
  padding: var(--space-2);
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.8rem;
}

/* ========================================
   FEATURE CARDS
   ======================================== */

.features {
  padding: var(--space-24) 0;
  background: var(--surface-base);
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-16);
  letter-spacing: -0.02em;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}

.feature-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-default);
  box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  filter: grayscale(0.2);
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   CTA SECTION
   ======================================== */

.cta-section {
  padding: var(--space-24) 0;
  text-align: center;
  background: var(--surface-deep);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
}

.cta-section .container {
  position: relative;
  z-index: 1;
}

.cta-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.cta-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  background: var(--surface-void);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-section p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--space-2);
}

.footer-section a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-6);
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--aurora-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group small {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   CODE BLOCKS
   ======================================== */

.command-box {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  max-width: 100%;
  overflow-x: auto;
}

.command-box code {
  color: var(--aurora-cyan);
  font-size: 0.9rem;
  white-space: nowrap;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--aurora-indigo);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--aurora-violet);
}

.copy-btn.copied {
  background: var(--aurora-emerald);
}

.code-block {
  position: relative;
  margin: var(--space-4) 0;
}

.code-block pre {
  margin: 0;
  padding: var(--space-4) var(--space-6);
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.code-block code {
  color: var(--text-primary);
  font-size: 0.875rem;
}

.code-block .copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}

/* ========================================
   MODAL
   ======================================== */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-content {
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 480px;
  width: 100%;
  position: relative;
  animation: modalSlideIn 0.3s var(--transition-spring);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.modal-content > p {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.form-message {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  text-align: center;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--error);
  color: var(--error);
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--error);
  color: var(--error);
}

/* ========================================
   STATUS BADGES
   ======================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.status-revoked {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading-state,
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--text-muted);
}

/* ========================================
   UTILITIES
   ======================================== */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

/* Honeypot */
.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Turnstile */
.cf-turnstile {
  margin-bottom: var(--space-5);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .hero {
    padding: var(--space-16) 0;
    min-height: auto;
  }

  .hero-cta {
    flex-direction: column;
  }

  .nav {
    gap: var(--space-4);
  }

  .logo .tagline {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .command-box {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-4);
  }

  .header .container {
    height: 64px;
  }

  .hero {
    padding: var(--space-12) 0;
  }

  .features,
  .cta-section {
    padding: var(--space-16) 0;
  }

  .feature-card {
    padding: var(--space-6);
  }
}
