/* ===== Mona Expert — Unified Design System ===== */
/* Day/Night mode, fully responsive, SEO-optimized      */

/* --- CSS Variables (Light Mode Default) --- */
:root {
  /* Colors */
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #a78bfa;
  --primary-glow: rgba(124, 58, 237, 0.3);
  
  --accent: #f59e0b;
  --accent-dark: #d97706;
  
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-code: #1e293b;
  
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #7c3aed;
  
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 30px var(--primary-glow);
  
  --header-bg: rgba(255, 255, 255, 0.92);
  --footer-bg: #0f172a;
  --footer-text: #94a3b8;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  
  --max-width: 1200px;
  --nav-height: 72px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* --- Dark Mode Variables --- */
[data-theme="dark"] {
  --primary: #a78bfa;
  --primary-dark: #7c3aed;
  --primary-light: #c4b5fd;
  --primary-glow: rgba(167, 139, 250, 0.25);
  
  --accent: #fbbf24;
  --accent-dark: #f59e0b;
  
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --bg-card: #1e293b;
  --bg-elevated: #334155;
  --bg-code: #0f172a;
  
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --text-link: #a78bfa;
  
  --border: #334155;
  --border-light: #1e293b;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--primary-glow);
  
  --header-bg: rgba(15, 23, 42, 0.92);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--text-link); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-light); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

::selection { background: var(--primary); color: white; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p { margin-bottom: 1rem; }

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Header / Navigation --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

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

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo:hover { color: var(--primary); }
.nav-logo .logo-icon { width: 36px; height: 36px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 1.1rem; }

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

.nav-links a {
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: var(--transition-fast);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-elevated);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

/* Day/Night Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
  transition: var(--transition-fast);
  margin-left: 12px;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--bg-elevated);
  border-color: var(--primary);
  transform: rotate(15deg);
}

.theme-toggle .icon { transition: transform 0.4s ease, opacity 0.3s ease; }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

/* --- Main Content --- */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

/* --- Footer --- */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 48px 24px 32px;
  margin-top: auto;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand { max-width: 300px; }
.footer-brand h3 { color: white; margin-bottom: 8px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; }

.footer-col h4 { color: white; margin-bottom: 16px; font-size: 0.95rem; }
.footer-col a { display: block; color: var(--footer-text); font-size: 0.9rem; margin-bottom: 10px; }
.footer-col a:hover { color: white; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-glow);
}

.card-gradient {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  border: none;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 24px var(--primary-glow);
  transform: translateY(-2px);
  color: white;
}

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

.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

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

/* --- Status / Badge --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-error { background: rgba(239, 68, 68, 0.1); color: var(--error); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-info { background: rgba(124, 58, 237, 0.1); color: var(--primary); }

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.hero h1 { margin-bottom: 16px; position: relative; }
.hero p { font-size: 1.2rem; color: var(--text-secondary); max-width: 650px; margin: 0 auto 32px; position: relative; }

.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; position: relative; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--primary);
  background: var(--primary-glow, rgba(99,102,241,0.12));
  border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 22px; position: relative;
}
.hero-eyebrow .ico { width: 15px; height: 15px; }
.hero p strong { color: var(--text-primary); font-weight: 650; }

.hero-trust {
  display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
  margin-top: 30px; position: relative;
}
.hero-trust span {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.82rem; color: var(--text-secondary); font-weight: 500;
}
.hero-trust .ico { width: 15px; height: 15px; color: var(--primary); }

/* --- Deep-tech story --- */
.story { margin: 64px 0; }
.story-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.story-head h2 { font-size: 1.9rem; margin-bottom: 10px; }
.story-head p { color: var(--text-secondary); font-size: 1.05rem; }
.story-card {
  position: relative; padding: 28px 24px;
  background: var(--surface, var(--card-bg));
  border: 1px solid var(--border); border-radius: var(--radius, 14px);
  transition: transform .25s ease, border-color .25s ease;
}
.story-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.story-num {
  font-family: var(--font-mono, monospace); font-size: 0.85rem;
  font-weight: 700; color: var(--primary); letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.story-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.story-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

/* --- Features Grid --- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 60px 0;
}

.feature-card {
  text-align: center;
  padding: 40px 24px;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.5rem;
}

.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* --- Section Header --- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 { margin-bottom: 8px; }
.section-header p { color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

/* --- SEO-specific --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease-in-out infinite; }

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* --- Loading Spinner --- */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Toast / Alert --- */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--success); }
.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--error); }
.alert-info { background: rgba(124, 58, 237, 0.1); border: 1px solid rgba(124, 58, 237, 0.2); color: var(--primary); }

/* --- Responsive --- */
@media (max-width: 768px) {
  nav { padding: 0 16px; }
  
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }
  
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 12px 16px; }
  
  .mobile-nav-toggle { display: block; }
  
  main { padding: 24px 16px; }
  
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  
  .card { padding: 24px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

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

/* --- Smooth fade on page load --- */
body { opacity: 0; transition: opacity 0.2s ease; }
body.loaded { opacity: 1; }

/* ── Inline SVG icon system (fast: zero HTTP, currentColor themeable) ── */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: none; stroke-width: 2; }
.ico-lg { width: 1.5em; height: 1.5em; }
.feature-icon .ico { width: 2em; height: 2em; }
.ico-success { color: #16a34a; }
.ico-danger  { color: #dc2626; }
.ico-warn    { color: #d97706; }
.ico-muted   { color: var(--text-secondary); }

/* ── Install section ── */
.install-section { margin: 72px auto; max-width: 900px; }
.install-cmd-wrap { max-width: 720px; margin: 0 auto; border: 1px solid var(--border, rgba(128,128,128,.25)); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.06); }
.install-cmd-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--card-bg, rgba(128,128,128,.08)); font-size: .9em; color: var(--text-secondary); border-bottom: 1px solid var(--border, rgba(128,128,128,.2)); }
.install-cmd-head .copy-btn { margin-left: auto; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 8px; font-size: .85em; cursor: pointer; transition: all .15s; }
.copy-btn:hover { background: var(--accent); color: #fff; }
.copy-btn.copied { background: #16a34a; border-color: #16a34a; color: #fff; }
.install-cmd { margin: 0; padding: 18px 16px; background: var(--code-bg, #0d1117); color: #e6edf3; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; overflow-x: auto; }
.install-cmd code { color: inherit; background: none; }
.install-opt { text-align: center; transition: transform .15s, box-shadow .15s; }
.install-opt:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.1); }
.install-opt .feature-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--accent); }
.btn-outline { border: 1px solid var(--accent); color: var(--accent); background: transparent; }
.btn-outline:hover { background: var(--accent); color: #fff; }
