/* =============================================
   EditorBox AI — Design System & Global Styles
   ============================================= */

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

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

/* ---- Design Tokens ---- */
:root {
  /* Background */
  --bg-primary: #08080c;
  --bg-secondary: #0c0c14;
  --bg-tertiary: #12121e;
  --bg-elevated: #1a1a2e;
  --bg-card: rgba(18, 18, 30, 0.6);
  --bg-glass: rgba(15, 15, 23, 0.65);
  --bg-glass-hover: rgba(20, 20, 35, 0.75);

  /* Accent – brand gradient */
  --accent-purple: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-cyan: #22d3ee;
  --accent-pink: #ec4899;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
  --accent-gradient-hover: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #67e8f9 100%);
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-glow-lg: rgba(99, 102, 241, 0.15);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --border-accent: rgba(99, 102, 241, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --shadow-glow-lg: 0 0 80px var(--accent-glow-lg);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Spacing */
  --section-padding: 120px 0;
  --container-max: 1200px;
  --container-padding: 0 24px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---- Container ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--container-padding);
}

/* ---- Typography ---- */
.heading-xl {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.heading-lg {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.heading-md {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.heading-sm {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.text-base {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Gradient text */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Section badge ---- */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-accent);
  background: rgba(99, 102, 241, 0.08);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-purple);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.section-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-purple);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* ---- Section titles ---- */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 64px;
}

.section-header .heading-lg {
  margin-bottom: 16px;
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

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

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

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

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 10px 22px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1rem;
}

/* Shimmer effect for primary buttons */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

/* ---- Glass card ---- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  transition: all var(--transition-base);
}

.glass-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-glass-hover);
  box-shadow: var(--shadow-md);
}

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  z-index: 10;
}

.nav-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-logo-text {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-logo-ai {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-cta {
  padding: 10px 24px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-base);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
}

.nav-cta:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

/* Mobile toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 10;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition-base);
}

.nav-mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Footer ---- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 80px 0 32px;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

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

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-logo-text {
  font-weight: 700;
  font-size: 1.125rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
  color: var(--text-muted);
}

.social-link:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.footer-links-group a {
  font-size: 0.875rem;
  color: var(--text-dim);
  transition: color var(--transition-fast);
}

.footer-links-group a:hover {
  color: var(--accent-purple);
}

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

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

/* ---- Scroll reveal animations ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* Scale-in variant */
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ---- Background decorations ---- */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
}

.bg-glow-purple {
  background: rgba(99, 102, 241, 0.12);
}

.bg-glow-violet {
  background: rgba(139, 92, 246, 0.1);
}

.bg-glow-cyan {
  background: rgba(34, 211, 238, 0.08);
}

/* Grid noise overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  :root {
    --section-padding: 80px 0;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 64px 0;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 8, 12, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    z-index: 5;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-links .nav-link {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .nav-cta {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .section-header {
    margin-bottom: 48px;
  }
}

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