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

:root {
  --blue:        #1a56db;
  --blue-dark:   #1040b0;
  --blue-light:  #e8f0fe;
  --navy:        #0d1b3e;
  --slate:       #374151;
  --muted:       #6b7280;
  --border:      #e5e7eb;
  --bg:          #f9fafb;
  --white:       #ffffff;
  --green:       #059669;
  --radius:      10px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--slate);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius);
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-outline:hover { background: var(--blue-light); }

.btn-outline-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.5);
}
.btn-outline-light:hover { background: rgba(255,255,255,.12); border-color: var(--white); }

.btn-white {
  background: var(--white);
  color: var(--blue);
  border-color: var(--white);
}
.btn-white:hover { background: var(--blue-light); }

.btn-lg  { padding: 13px 28px; font-size: 1rem; }
.btn-sm  { padding: 7px 14px;  font-size: 0.82rem; }

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.logo-light { color: var(--white); }

.logo-icon {
  color: var(--blue);
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
  margin-left: auto;
}
.nav-links a {
  color: var(--slate);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--blue); }

.nav-cta { margin-left: 8px; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 80px;
  background: linear-gradient(145deg, #f0f4ff 0%, #ffffff 60%);
}

.hero-bg-shape {
  position: absolute;
  top: -120px;
  right: -180px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,86,219,.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-badge {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 580px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 52px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
}
.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ── Section Shared ───────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.section-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Tools Grid ───────────────────────────────────────────── */
.tools {
  padding: 96px 0;
  background: var(--bg);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
}
.tool-card.available:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.tool-card.placeholder {
  border-style: dashed;
  background: transparent;
}

.tool-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.tool-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}
.tool-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.tool-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
}
.badge-soon {
  background: #fef3c7;
  color: #92400e;
}
.badge-live {
  background: #d1fae5;
  color: #065f46;
}

/* ── Features ─────────────────────────────────────────────── */
.features {
  padding: 96px 0;
  background: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px 32px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.feature-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}
.feature-item p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── CTA Banner ───────────────────────────────────────────── */
.cta-banner {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 80px 0;
}

.cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.cta-inner h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--white);
}
.cta-inner p {
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  margin-bottom: 8px;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  padding: 72px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 56px;
}

.footer-brand p {
  color: rgba(255,255,255,.55);
  font-size: 0.88rem;
  margin-top: 12px;
  max-width: 260px;
  line-height: 1.6;
}

.footer-links h4,
.footer-contact h4 {
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--white); }

.footer-contact p {
  color: rgba(255,255,255,.55);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
}
.footer-bottom span {
  color: rgba(255,255,255,.35);
  font-size: 0.8rem;
}

/* ── Auth Nav ─────────────────────────────────────────────── */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 14px 5px 10px;
  font-size: 0.82rem;
}
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.user-email {
  font-weight: 600; color: var(--slate);
  max-width: 160px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.signout-btn {
  background: none; border: none; color: var(--muted);
  font-size: 0.8rem; cursor: pointer; padding: 0; font-family: inherit;
}
.signout-btn:hover { color: var(--slate); }
.tool-signin-link {
  font-size: 0.82rem; font-weight: 700; color: var(--blue);
  text-decoration: none; padding: 5px 12px;
  border: 1.5px solid var(--blue); border-radius: 7px;
}
.tool-signin-link:hover { background: rgba(59,130,246,.06); }

/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-cycle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  transition: color .12s, box-shadow .12s;
}
.theme-cycle-btn:hover {
  color: var(--slate);
  box-shadow: var(--shadow);
}

/* ── Dark Mode ─────────────────────────────────────────────── */
[data-theme="dark"] {
  color-scheme: dark;
  --blue:       #60a5fa;
  --blue-dark:  #3b82f6;
  --blue-light: #1e3a5f;
  --navy:       #f1f5f9;
  --slate:      #e2e8f0;
  --muted:      #94a3b8;
  --border:     #334155;
  --bg:         #0f172a;
  --white:      #1e293b;
  --green:      #34d399;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.6);
}

[data-theme="dark"] body { background: var(--bg); }

[data-theme="dark"] .nav { background: rgba(15,23,42,.95); }

[data-theme="dark"] .hero {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 60%);
}

[data-theme="dark"] .badge-soon { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .badge-live { background: #022c22; color: #6ee7b7; }

/* CTA banner: keep blue but ensure text stays white */
[data-theme="dark"] .cta-inner h2 { color: #ffffff; }

/* Footer stays dark; fix heading colors that used --white */
[data-theme="dark"] .footer { background: #020817; }
[data-theme="dark"] .footer-links h4,
[data-theme="dark"] .footer-contact h4 { color: rgba(255,255,255,.85); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 72px 0 60px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 16px; }
}

@media (max-width: 520px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .btn-lg { width: 100%; }
}
