/* ========== RESET & VARIABLES ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #07080f;
  --surface: #0e1017;
  --surface2: #161820;
  --border: #1e2030;
  --border2: #252840;
  --text: #e8eaf6;
  --muted: #9ca3b8;
  --muted2: #6b7080;
  --indigo: #818cf8;
  --indigo2: #6366f1;
  --pink: #f472b6;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Cabinet Grotesk', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ========== NAV ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  transition: all 0.3s;
  padding: 0 1rem;
}
.nav.scrolled {
  background: rgba(7,8,15,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 70px; padding: 0 1rem;
}
.nav-logo {
  font-family: 'Clash Display', sans-serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 0.5rem;
  letter-spacing: -0.02em;
}
.logo-mark {
  color: var(--indigo);
  font-size: 1.1rem;
  filter: drop-shadow(0 0 8px rgba(99,102,241,0.6));
}
.nav-links {
  display: flex; gap: 2rem;
}
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 0.8rem; align-items: center; }

/* HAMBURGER MENU */
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 0.5rem; background: none; border: none;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px; transition: all 0.3s;
}
.nav-mobile {
  display: none; position: fixed;
  top: 70px; left: 0; right: 0;
  background: rgba(7,8,15,0.98); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem; z-index: 999;
  flex-direction: column; gap: 0.8rem;
  animation: fadeIn 0.2s ease;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  color: var(--text); text-decoration: none;
  font-size: 1rem; font-weight: 600; padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.nav-mobile .btn { margin-top: 0.5rem; justify-content: center; }
@media (max-width: 768px) { .nav-hamburger { display: flex; } }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.65rem 1.4rem; border-radius: 8px;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--indigo2), #8b5cf6);
  color: white;
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 30px rgba(99,102,241,0.5);
}
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-outline {
  background: transparent;
  color: var(--indigo);
  border: 1px solid rgba(99,102,241,0.4);
}
.btn-outline:hover { background: rgba(99,102,241,0.08); }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.82rem; border-radius: 6px; }
.btn-full { width: 100%; }

/* ========== SECTION HEADERS ========== */
.section-header { text-align: center; max-width: 600px; margin: 0 auto; }
.section-tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 700;
  color: var(--indigo); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-title {
  font-family: 'Clash Display', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 1rem; line-height: 1.1;
}
.section-sub { color: var(--muted); font-size: 1rem; line-height: 1.7; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text);
  font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.95rem;
  padding: 0.8rem 1rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--indigo2);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted2); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-error {
  font-size: 0.78rem; color: var(--red); margin-top: 0.4rem; display: none;
}
.form-error.show { display: block; }

/* ========== FOOTER ========== */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 4rem 2rem 2rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem; margin-bottom: 3rem;
}
.footer-tagline { font-size: 0.85rem; color: var(--muted); line-height: 1.7; }
.footer-col {}
.footer-col-title {
  font-size: 0.75rem; font-weight: 700; color: var(--text);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem;
}
.footer-col a {
  display: block; color: var(--muted); text-decoration: none;
  font-size: 0.88rem; margin-bottom: 0.6rem; transition: color 0.2s;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 2rem; border-top: 1px solid var(--border);
  font-size: 0.78rem; color: var(--muted2);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ========== LOADING ========== */
.dots {
  display: flex; gap: 5px; align-items: center;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--indigo); animation: dotBounce 1.2s infinite;
}
.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ========== TOAST ========== */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 1rem 1.5rem;
  font-size: 0.88rem; color: var(--text);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s;
  display: flex; align-items: center; gap: 0.8rem;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(52,211,153,0.4); }
.toast.error { border-color: rgba(248,113,113,0.4); }

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {

  /* NAV */
  .nav-links { display: none; }
  .nav-inner { padding: 0 1rem; }
  .nav-logo { font-size: 1.1rem; }
  .nav-actions .btn-ghost { display: none; }
  .btn-primary { padding: 0.55rem 1rem; font-size: 0.82rem; }

  /* HERO */
  .hero { padding: 7rem 1.2rem 4rem; }
  .hero-h1 { font-size: clamp(2.8rem, 12vw, 4rem); }
  .hero-sub { font-size: 0.95rem; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .hero-ctas .btn { width: 100%; max-width: 320px; justify-content: center; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat-num { font-size: 1.6rem; }

  /* SECTIONS */
  section { padding: 4rem 1.2rem; }
  .section-title { font-size: clamp(1.8rem, 7vw, 2.5rem); }
  .section-sub { font-size: 0.88rem; }

  /* FEATURES GRID */
  .features-grid { grid-template-columns: 1fr; gap: 1px; }
  .feature-card { padding: 1.8rem 1.2rem; }

  /* STEPS */
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .steps::before { display: none; }
  .step { display: flex; align-items: flex-start; gap: 1rem; text-align: left; }
  .step-num { margin: 0; flex-shrink: 0; width: 44px; height: 44px; }

  /* CATEGORIES */
  .cats-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .cat-pill { padding: 0.9rem 0.8rem; gap: 0.6rem; }
  .cat-emoji { font-size: 1.2rem; }
  .cat-name { font-size: 0.78rem; }
  .cat-count { font-size: 0.65rem; }

  /* TESTIMONIALS */
  .testi-grid { grid-template-columns: 1fr; }

  /* CTA BANNER */
  .cta-banner { padding: 4rem 1.2rem; }
  .cta-banner h2 { font-size: 1.8rem; }
  .cta-banner .btn { width: 100%; max-width: 320px; }

  /* FOOTER */
  .footer { padding: 3rem 1.2rem 2rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  /* HOW SECTION */
  .how { padding: 4rem 1.2rem; }

  /* PRICING */
  .plans-grid { grid-template-columns: 1fr; padding: 0 1.2rem 4rem; }
  .plan-card { padding: 2rem 1.5rem; }
  .billing-toggle { flex-wrap: wrap; justify-content: center; }

  /* FAQ */
  .faq { padding: 3rem 1.2rem 4rem; }
  .faq h2 { font-size: 1.6rem; }

  /* BLOG */
  .blog-hero { padding: 8rem 1.2rem 3rem; }
  .blog-grid { grid-template-columns: 1fr; padding: 2rem 1.2rem 4rem; }

  /* CONTACT */
  .contact-section { padding: 8rem 1.2rem 4rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .contact-info h1 { font-size: 2rem; }
  .contact-form { padding: 1.5rem; }

  /* APP */
  .app-topbar { padding: 0.8rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .app-topbar-title { font-size: 0.95rem; }
  .usage-bar-wrap .btn { display: none; }
  .view { padding: 1.2rem; }
  .cats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .cat-card { padding: 0.9rem 0.7rem; }
  .cat-card-emoji { font-size: 1.4rem; }
  .cat-card-name { font-size: 0.75rem; }
  .detail-form { padding: 1.2rem; }
  .result-box { border-radius: 12px; }
  .result-top { padding: 0.8rem 1rem; }
  .result-body { padding: 1rem; }
  .result-actions { padding: 0.8rem 1rem; flex-wrap: wrap; }
  .dash-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .dash-card { padding: 1.2rem; }
  .dash-card-num { font-size: 1.8rem; }
  .apikey-bar { padding: 0.8rem; gap: 0.6rem; font-size: 0.75rem; }
  .apikey-bar input { min-width: 150px; font-size: 0.75rem; }
  .gen-steps { gap: 0.5rem; }
  .gen-step { font-size: 0.72rem; }
  .gen-step-divider { max-width: 20px; }
  .tone-grid { gap: 0.4rem; }
  .tone-chip { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
  .hist-full-item { flex-wrap: wrap; gap: 0.5rem; padding: 1rem; }
  .auth-card { padding: 1.8rem 1.2rem; }

  /* BUTTONS MOBILE */
  .btn-lg { padding: 0.8rem 1.5rem; font-size: 0.95rem; }
  .btn-full { width: 100%; }
}

@media (max-width: 400px) {
  .hero-h1 { font-size: 2.5rem; }
  .cats-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
