/* =========================================
   1. CSS VARIABLES & THEMES
   ========================================= */
:root, [data-theme="theme1"] {
  --bg-body: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #1a2234;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --accent: #d4af37;
  --accent-hover: #f3ce4a;
  --accent-text: #0b0f19;
  --accent-bg: rgba(212, 175, 55, 0.1);
  --border: #2d3748;
  --nav-bg: rgba(11, 15, 25, 0.85);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

[data-theme="theme2"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-text: #ffffff;
  --accent-bg: rgba(37, 99, 235, 0.05);
  --border: #e2e8f0;
  --nav-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

[data-theme="theme3"] {
  --bg-body: #faf5ff;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --text-main: #2e1065;
  --text-muted: #6b21a8;
  --accent: #9333ea;
  --accent-hover: #7e22ce;
  --accent-text: #ffffff;
  --accent-bg: rgba(147, 51, 234, 0.05);
  --border: #e9d5ff;
  --nav-bg: rgba(250, 245, 255, 0.9);
  --shadow: 0 10px 15px -3px rgba(147, 51, 234, 0.1);
}

[data-theme="theme4"] {
  --bg-body: #ffffff;
  --bg-surface: #f8fafc;
  --bg-card: #f1f5f9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent: #0f172a;
  --accent-hover: #334155;
  --accent-text: #ffffff;
  --accent-bg: rgba(15, 23, 42, 0.05);
  --border: #cbd5e1;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* =========================================
   2. BASE & TYPOGRAPHY
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.bg-surface { background-color: var(--bg-surface); }
.text-accent { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; color: var(--text-main); }
h1 { font-size: 3.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p { color: var(--text-muted); margin-bottom: 1rem; }
a { color: inherit; text-decoration: none; }

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  .section { padding: 3rem 0; }
}

/* =========================================
   3. BUTTONS & BADGES
   ========================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600;
  transition: all 0.2s ease; cursor: pointer; border: none; font-size: 0.95rem;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-secondary { background: transparent; border: 2px solid var(--border); color: var(--text-main); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

.hero-badge {
  display: inline-block; padding: 0.5rem 1rem; background: var(--accent-bg);
  color: var(--accent); border-radius: 50px; font-size: 0.875rem; font-weight: 600; margin-bottom: 1.5rem;
}

/* =========================================
   4. NAVIGATION
   ========================================= */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); transition: background-color 0.3s ease;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.logo { font-size: 1.5rem; font-weight: 800; text-decoration: none; color: var(--text-main); }
.logo span { color: var(--accent); }
.nav-links { display: none; align-items: center; gap: 2rem; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 1rem; }

@media (min-width: 1024px) {
  .nav-links { display: flex; }
  .mobile-menu-btn { display: none; }
}

.mobile-menu-btn { background: none; border: none; color: var(--text-main); cursor: pointer; padding: 0.5rem; display: block; }
.mobile-menu {
  display: none; position: absolute; top: 72px; left: 0; width: 100%;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem; flex-direction: column; gap: 1rem;
}
.mobile-menu.active { display: flex; }
.mobile-menu a { text-decoration: none; color: var(--text-main); font-weight: 500; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }

/* Theme Selector */
.theme-selector { position: relative; }
.theme-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-main);
  padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; font-weight: 500;
}
.theme-menu {
  position: absolute; top: 100%; right: 0; margin-top: 0.5rem;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); display: none; min-width: 160px; z-index: 110; overflow: hidden;
}
.theme-menu.active { display: block; }
.theme-menu button {
  width: 100%; text-align: left; padding: 0.75rem 1rem; background: none;
  border: none; color: var(--text-main); cursor: pointer; font-size: 0.9rem;
}
.theme-menu button:hover { background: var(--bg-card); color: var(--accent); }

.theme-select {
  width: 100%; padding: 0.75rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-main); font-size: 1rem; margin-top: 0.5rem;
}

/* =========================================
   5. HERO & VISUALS
   ========================================= */
.hero { padding: 120px 0 80px; position: relative; overflow: hidden; }
.hero-container { display: grid; grid-template-columns: 1fr; gap: 4rem; align-items: center; }
.hero-subtitle { font-size: 1.25rem; max-width: 600px; margin-bottom: 2rem; }
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-visual { position: relative; height: 400px; display: flex; align-items: center; justify-content: center; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; z-index: 1; }
.blob-1 { width: 300px; height: 300px; background: var(--accent); top: 10%; left: 10%; animation: blob 7s infinite; }
.blob-2 { width: 250px; height: 250px; background: var(--accent-hover); bottom: 10%; right: 10%; animation: blob 7s infinite 2s; }

.floating-cards { position: relative; z-index: 2; width: 100%; height: 100%; }
.float-card {
  position: absolute; background: var(--bg-card); border: 1px solid var(--border);
  padding: 1rem 1.5rem; border-radius: 12px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 1rem; animation: float 6s ease-in-out infinite;
}
.float-card .icon { font-size: 1.5rem; }
.float-card strong { display: block; font-size: 0.9rem; color: var(--text-main); }
.float-card span { font-size: 0.8rem; color: var(--text-muted); }
.card-1 { top: 15%; left: 5%; animation-delay: 0s; }
.card-2 { top: 45%; right: 0%; animation-delay: 2s; }
.card-3 { bottom: 10%; left: 15%; animation-delay: 4s; }

.contact-hero { text-align: center; padding: 140px 0 60px; }
.contact-hero h1 { margin-bottom: 1rem; }

@media (min-width: 1024px) {
  .hero-container { grid-template-columns: 1fr 1fr; }
}

@keyframes blob {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0px, 0px) scale(1); }
}
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

/* =========================================
   6. GRIDS & CARDS
   ========================================= */
.section-header { text-align: center; max-width: 800px; margin: 0 auto 4rem auto; }
.section-header p { font-size: 1.1rem; }

.services-grid, .why-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.stats-grid, .dm-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.ecosystem-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.process-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }

@media (min-width: 768px) {
  .services-grid, .why-grid, .dm-grid, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ecosystem-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .services-grid, .why-grid { grid-template-columns: repeat(3, 1fr); }
  .dm-grid, .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .process-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1280px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
}

.card, .dm-card, .why-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 2rem; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover, .dm-card:hover, .why-card:hover {
  transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--accent);
}
.card-icon, .dm-icon, .why-icon { font-size: 2.5rem; margin-bottom: 1.5rem; display: block; }

.platform-badge {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem; text-align: center; font-weight: 700; font-size: 1.1rem;
  transition: all 0.3s ease; color: var(--text-main);
}
.platform-badge:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.05); }

.stat-card { text-align: center; padding: 2rem; }
.stat-card h3 { font-size: 3rem; color: var(--accent); margin-bottom: 0.5rem; }

.dm-section { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.process-step { text-align: center; position: relative; }
.step-num {
  width: 48px; height: 48px; background: var(--accent-bg); color: var(--accent);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.25rem; margin: 0 auto 1rem auto; border: 2px solid var(--accent);
}

/* =========================================
   7. CTA & FOOTER
   ========================================= */
.cta-section { background: var(--bg-surface); }
.cta-container { text-align: center; max-width: 800px; margin: 0 auto; }
.cta-container h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.cta-container p { font-size: 1.1rem; margin-bottom: 2rem; }

.footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding-top: 4rem; }
.footer-container { display: grid; grid-template-columns: 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { max-width: 300px; margin-top: 1rem; }
.footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.footer-col h4 { color: var(--text-main); margin-bottom: 1rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col a, .footer-col p { display: block; color: var(--text-muted); margin-bottom: 0.5rem; font-size: 0.95rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom { border-top: 1px solid var(--border); padding: 1.5rem 0; text-align: center; }
.footer-bottom p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

@media (min-width: 768px) {
  .footer-container { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-links { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================
   8. CONTACT PAGE
   ========================================= */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 4rem; }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1fr; } }

.info-cards { display: flex; flex-direction: column; gap: 1.5rem; }
.info-card { display: flex; gap: 1.5rem; align-items: flex-start; }
.info-icon { font-size: 1.5rem; background: var(--accent-bg); width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.info-card h3 { margin-bottom: 0.25rem; font-size: 1.1rem; }
.info-card p { margin: 0; font-size: 0.95rem; }

.contact-form {
  background: var(--bg-card); padding: 2.5rem; border-radius: 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; color: var(--text-main); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-body); color: var(--text-main); font-size: 1rem; font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}