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

:root {
  --gold: #d4a853;
  --gold-dark: #b8860b;
  --bg: #080c14;
  --bg-card: rgba(15, 20, 35, 0.85);
  --border: rgba(255,255,255,0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --dim: #475569;
}

html { scroll-behavior: smooth; }

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

/* ─── Nav ────────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 40px;
  background: rgba(8,12,20,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
}
.nav.scrolled { background: rgba(8,12,20,0.95); }
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #000;
  box-shadow: 0 4px 16px rgba(212,168,83,0.3);
  flex-shrink: 0;
}
.logo-text { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.nav-links {
  display: flex; align-items: center; gap: 32px;
}
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.btn-signin {
  background: rgba(212,168,83,0.1) !important;
  border: 1px solid rgba(212,168,83,0.3) !important;
  color: var(--gold) !important;
  padding: 8px 18px; border-radius: 8px;
  font-size: 13px !important; font-weight: 600 !important;
  cursor: pointer; transition: all 0.2s !important;
}
.btn-signin:hover { background: rgba(212,168,83,0.2) !important; }

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 40px 80px;
  position: relative;
}
.hero-bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hero-glow {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: -1;
}
.hero-glow-1 {
  top: -20%; left: 30%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(ellipse, rgba(212,168,83,0.08) 0%, transparent 70%);
}
.hero-glow-2 {
  bottom: -30%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.07) 0%, transparent 70%);
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(212,168,83,0.08); border: 1px solid rgba(212,168,83,0.2);
  color: var(--gold); padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
  margin-bottom: 24px;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 900; line-height: 1.1;
  letter-spacing: -1.5px; margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--gold), #f59e0b, var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 17px; color: var(--muted); max-width: 480px;
  line-height: 1.7; margin-bottom: 36px;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; padding: 13px 28px; border-radius: 12px;
  font-size: 15px; font-weight: 700; text-decoration: none;
  box-shadow: 0 4px 24px rgba(212,168,83,0.3);
  transition: all 0.25s; border: none; cursor: pointer;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(212,168,83,0.4); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); padding: 13px 24px; border-radius: 12px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); background: rgba(255,255,255,0.03);
  transition: all 0.25s;
}
.btn-secondary:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }

.hero-stats {
  display: flex; align-items: center; gap: 24px;
}
.stat-value { font-size: 24px; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 12px; color: var(--dim); margin-top: 2px; }
.stat-divider { width: 1px; height: 32px; background: var(--border); }

/* App Preview */
.hero-preview { display: flex; justify-content: center; }
.preview-frame {
  width: 100%; max-width: 520px;
  background: rgba(10,14,26,0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}
.preview-dots {
  display: flex; gap: 6px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.preview-dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.preview-dots span:nth-child(1) { background: #ff5f57; }
.preview-dots span:nth-child(2) { background: #febc2e; }
.preview-dots span:nth-child(3) { background: #28c840; }
.preview-content {
  display: grid; grid-template-columns: 120px 1fr 160px;
  height: 340px;
}
.preview-sidebar {
  padding: 12px 8px;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}
.file-item {
  padding: 5px 8px; border-radius: 6px; font-size: 11px;
  color: var(--dim); cursor: pointer; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-item.active { background: rgba(212,168,83,0.1); color: var(--gold); }

.preview-editor {
  padding: 12px 14px; font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px; line-height: 1.7; overflow: hidden;
  border-right: 1px solid var(--border);
}
.code-line { white-space: nowrap; }
.code-line.indent { padding-left: 14px; }
.kw { color: #c792ea; } .mod { color: #82aaff; } .cls { color: #ffcb6b; }
.fn { color: #82aaff; } .str { color: #c3e88d; } .num { color: #f78c6c; }

.preview-chat {
  padding: 10px 8px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
}
.chat-msg { display: flex; gap: 6px; align-items: flex-start; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; color: #000; flex-shrink: 0;
}
.chat-bubble {
  font-size: 10px; line-height: 1.5; color: var(--muted);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; max-width: 120px;
}
.chat-msg.user .chat-bubble {
  background: rgba(212,168,83,0.08); color: #d4a853; border-color: rgba(212,168,83,0.2);
}
.typing { display: flex; gap: 3px; align-items: center; padding: 8px !important; }
.typing span {
  width: 4px; height: 4px; border-radius: 50%; background: var(--dim);
  animation: blink 1.4s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; }
}

/* ─── Sections ───────────────────────────────────────────────────────────────── */
.features, .pricing, .download {
  padding: 100px 40px;
}
.section-inner {
  max-width: 1200px; margin: 0 auto;
  text-align: center;
}
.section-badge {
  display: inline-block;
  background: rgba(212,168,83,0.08); border: 1px solid rgba(212,168,83,0.2);
  color: var(--gold); padding: 5px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(28px, 4vw, 44px); font-weight: 900;
  letter-spacing: -1px; margin-bottom: 14px;
}
.section-subtitle {
  font-size: 17px; color: var(--muted); max-width: 540px;
  margin: 0 auto 56px;
}

/* Features Grid */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  text-align: left;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 24px;
  transition: all 0.3s;
}
.feature-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-3px); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
}
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Pricing Grid */
.pricing { background: rgba(255,255,255,0.01); }
.pricing-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  text-align: left;
}
.pricing-card {
  position: relative;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 24px 20px;
  display: flex; flex-direction: column;
  transition: all 0.3s;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card-popular {
  border-color: rgba(212,168,83,0.4);
  box-shadow: 0 0 40px rgba(212,168,83,0.1);
}
.popular-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; font-size: 11px; font-weight: 800;
  padding: 3px 14px; border-radius: 20px; white-space: nowrap;
}
.plan-tier { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.plan-price { font-size: 24px; font-weight: 900; color: var(--text); margin-bottom: 4px; }
.plan-tokens { font-size: 13px; font-weight: 700; color: var(--text); }
.plan-period { font-size: 11px; color: var(--dim); margin-bottom: 16px; }
.plan-features {
  list-style: none; flex: 1; margin-bottom: 20px;
}
.plan-features li { font-size: 12px; color: var(--muted); padding: 4px 0; }
.plan-btn {
  display: block; text-align: center; padding: 10px;
  border-radius: 8px; font-size: 13px; font-weight: 700;
  text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.plan-btn-outline {
  background: transparent; border: 1px solid currentColor;
}
.plan-btn-outline:hover { background: rgba(255,255,255,0.05); }
.plan-btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000 !important; border: none;
}
.plan-btn-primary:hover { box-shadow: 0 4px 20px rgba(212,168,83,0.3); transform: translateY(-1px); }

/* Download */
.download-card {
  position: relative; overflow: hidden;
  background: var(--bg-card);
  border: 1.5px solid rgba(212,168,83,0.2);
  border-radius: 24px; padding: 64px;
  box-shadow: 0 0 60px rgba(212,168,83,0.06);
}
.download-glow {
  position: absolute; top: -50%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(212,168,83,0.1) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.download-content { position: relative; z-index: 1; }
.download-card h2 { font-size: 36px; font-weight: 900; margin-bottom: 12px; }
.download-card > div > p { color: var(--muted); margin-bottom: 32px; }
.download-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.download-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text); padding: 14px 24px; border-radius: 12px;
  text-decoration: none; font-weight: 600; font-size: 14px;
  transition: all 0.2s; flex-direction: column; min-width: 140px;
}
.download-btn:hover {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}
.btn-version { font-size: 11px; color: var(--dim); font-weight: 400; }
.download-note { font-size: 12px; color: var(--dim); }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px;
}
.logo-icon-sm {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #000;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--dim); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: #334155; }

/* ─── Auth Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-card {
  background: rgba(12,17,30,0.95);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 36px;
  width: 100%; max-width: 400px;
  position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  transform: scale(0.95); transition: transform 0.25s;
}
.modal-overlay.open .modal-card { transform: scale(1); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--dim);
  font-size: 20px; cursor: pointer; line-height: 1;
}
.modal-logo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.modal-tabs {
  display: flex; background: rgba(255,255,255,0.04);
  border-radius: 10px; padding: 3px; margin-bottom: 20px; gap: 3px;
}
.modal-tab {
  flex: 1; padding: 8px; border-radius: 8px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--dim); transition: all 0.2s;
}
.modal-tab.active { background: rgba(212,168,83,0.15); color: var(--gold); }
.modal-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.3px; }
.modal-input {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 14px; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.modal-input:focus { border-color: rgba(212,168,83,0.4); }
.modal-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  color: #fca5a5; margin-bottom: 12px;
}
.modal-submit {
  width: 100%; background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none; border-radius: 10px; padding: 12px;
  font-size: 14px; font-weight: 700; color: #000; cursor: pointer;
  box-shadow: 0 4px 20px rgba(212,168,83,0.3);
  transition: all 0.2s;
}
.modal-submit:hover { box-shadow: 0 6px 28px rgba(212,168,83,0.4); transform: translateY(-1px); }

/* ─── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding-top: 100px; }
  .hero-preview { display: none; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav { padding: 0 20px; }
  .hero { padding: 100px 20px 60px; }
  .features, .pricing, .download { padding: 60px 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .download-card { padding: 36px 24px; }
  .hero-title { font-size: 32px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
}
