/* ==========================================================================
   RecallX Official Design System & Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Surface & Canvas Tokens */
  --bg-canvas: #070a12;
  --bg-surface-base: #0d1322;
  --bg-surface-elevated: #151d32;
  --bg-surface-glass: rgba(15, 23, 42, 0.75);
  --bg-surface-glass-card: rgba(21, 29, 50, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --border-active: rgba(16, 185, 129, 0.4);

  /* Brand Accents */
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.35);
  --primary-dark: #059669;
  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.35);
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-highlight: #ffffff;

  /* Elevation & Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
  --shadow-glow-emerald: 0 0 40px -10px rgba(16, 185, 129, 0.3);
  --shadow-glow-indigo: 0 0 40px -10px rgba(99, 102, 241, 0.3);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Layout */
  --max-w-content: 1200px;
  --max-w-prose: 840px;
  --header-height: 76px;
}

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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  position: relative;
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-highlight);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.2rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -0.01em; }
p { color: var(--text-muted); font-size: 1.05rem; }

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Background Atmosphere */
#mesh-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.65;
}

.bg-radial-glow {
  position: absolute;
  width: min(600px, 80vw);
  height: min(600px, 80vw);
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.glow-top-right {
  top: -100px;
  right: 0;
  background: radial-gradient(circle, var(--accent-indigo-glow) 0%, transparent 70%);
}

.glow-center-left {
  top: 40%;
  left: 0;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
}

/* Quiet Reading Mode for Legal & Support Pages */
body.legal-page #mesh-canvas,
body.quiet-mode #mesh-canvas {
  opacity: 0.2;
}

body.legal-page .bg-radial-glow,
body.quiet-mode .bg-radial-glow {
  opacity: 0.25;
  filter: blur(140px);
}

/* Glassmorphism Classes */
.glass-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.glass-card {
  background: var(--bg-surface-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-lg), var(--shadow-glow-indigo);
}

.glass-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-full);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.glass-badge.indigo {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.28);
  color: #818cf8;
}

.glass-badge.cyan {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.28);
  color: #22d3ee;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 0 24px;
}

.prose-container {
  width: 100%;
  max-width: var(--max-w-prose);
  margin: 0 auto;
  padding: 0 24px;
}

.section-spacing {
  padding: 96px 0;
}

.section-title-wrap {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px auto;
}

.section-title-wrap h2 {
  margin-top: 14px;
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.6);
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.btn-indigo {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-indigo:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
  filter: brightness(1.08);
}

/* Header & Nav */
.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--primary-glow);
  background: #0f172a;
  flex-shrink: 0;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.6rem;
  cursor: pointer;
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100vw;
  height: calc(100vh - var(--header-height));
  background: rgba(7, 10, 18, 0.96);
  backdrop-filter: blur(24px);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99;
}

.mobile-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer .nav-link {
  font-size: 1.3rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

/* Hero Section */
.hero-section {
  padding: 56px 0 96px 0;
  position: relative;
  text-align: center;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
}

.hero-title {
  margin: 20px 0 18px 0;
}

.hero-gradient-text {
  background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 70%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  max-width: 640px;
  margin: 0 auto 36px auto;
  color: var(--text-muted);
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Interactive Card Carousel / Visual Mockup */
.hero-mockup-wrap {
  margin-top: 64px;
  position: relative;
  perspective: 1000px;
  width: 100%;
  max-width: 100%;
}

.hero-dashboard-mockup {
  max-width: 980px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg), 0 0 80px -20px var(--primary-glow);
  text-align: left;
}

.mockup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.mockup-dots {
  display: flex;
  gap: 8px;
}

.mockup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.mockup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.mockup-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.mockup-stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 6px 0 2px 0;
}

.mockup-timeline-card {
  grid-column: span 3;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
}

.timeline-intervals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  position: relative;
}

.timeline-intervals::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-indigo) 100%);
  z-index: 0;
}

.timeline-node {
  position: relative;
  z-index: 1;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 0 16px var(--primary-glow);
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.feature-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--primary); }
.icon-indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.feature-card h3 {
  margin-bottom: 12px;
}

/* Split Showcase Sections */
.split-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin: 64px 0;
}

.split-showcase.reverse {
  direction: rtl;
}

.split-showcase.reverse > * {
  direction: ltr;
}

.showcase-text h2 {
  margin: 16px 0 20px 0;
}

.showcase-feature-list {
  list-style: none;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.showcase-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1rem;
  color: var(--text-main);
}

.check-icon {
  width: 20px;
  height: 20px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 860px;
  margin: 0 auto;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pricing-card.popular {
  border-color: var(--primary);
  box-shadow: 0 0 50px -10px var(--primary-glow);
}

.pricing-card-badge {
  position: absolute;
  top: -14px;
  right: 24px;
  background: var(--primary);
  color: #000000;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.pricing-price {
  font-family: 'Outfit', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  color: #ffffff;
  margin: 16px 0 4px 0;
}

.pricing-price span {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* FAQ Accordion */
.faq-wrap {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--bg-surface-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-highlight);
  font-family: 'Outfit', sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.faq-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-answer-inner {
  padding: 0 24px 20px 24px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

/* Legal & Documentation Pages */
.legal-header {
  padding: 60px 0 36px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 40px;
}

.legal-content h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  letter-spacing: -0.015em;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-content h3 {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  margin-top: 24px;
  margin-bottom: 12px;
}

.legal-content p, .legal-content li {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 14px;
}

.legal-content ul, .legal-content ol {
  padding-left: 28px;
  margin-bottom: 20px;
}

.legal-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 28px 0;
}

.legal-box.indigo {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
}

/* Support Portal Card Grid */
.support-hero-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  margin-bottom: 56px;
}

.support-email-highlight {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin: 16px 0 24px 0;
}

.support-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 64px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #04070d;
  border-top: 1px solid var(--border-subtle);
  padding: 72px 0 36px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}

.footer-brand p {
  margin-top: 14px;
  max-width: 320px;
  font-size: 0.95rem;
}

.footer-col-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-link:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .split-showcase, .split-showcase.reverse {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
  
  .mockup-grid {
    grid-template-columns: 1fr;
  }
  
  .mockup-timeline-card {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .section-spacing {
    padding: 64px 0;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .hero-section {
    padding: 40px 0 64px 0;
  }

  .hero-mockup-wrap {
    margin-top: 40px;
  }

  .hero-dashboard-mockup {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
  }

  .mockup-header {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }

  .mockup-stat-card {
    padding: 16px 14px;
  }

  .mockup-stat-val {
    font-size: 1.6rem;
  }

  .mockup-timeline-card {
    padding: 16px 14px;
  }

  .mockup-timeline-card > div:first-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .timeline-intervals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 14px;
  }

  .timeline-intervals::before {
    display: none;
  }

  .timeline-node {
    font-size: 0.8rem;
    padding: 6px 12px;
    box-shadow: 0 0 10px var(--primary-glow);
  }
}

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

  .hero-dashboard-mockup {
    padding: 16px 12px;
  }

  .timeline-node {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .glass-badge {
    font-size: 0.78rem;
    padding: 5px 12px;
  }
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  #mesh-canvas {
    display: none;
  }
}
