:root {
  --bg: #0b0d12;
  --bg-soft: #0f1219;
  --card: #111523;
  --text: #e6e9ef;
  --muted: #a5adcb;
  --brand: #6d8bff;
  --brand-2: #8a5cff;
  --accent: #06d6a0;
  --shadow: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f7f8fb;
  --card: #ffffff;
  --text: #0d1321;
  --muted: #4b5563;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 70% -20%, rgba(141, 92, 255, 0.15), transparent 60%),
              radial-gradient(1000px 700px at -10% 10%, rgba(109, 139, 255, 0.18), transparent 50%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Accessibility and focus */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  background: var(--card);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  z-index: 1000;
}

/* Better focus styles */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(180%) blur(8px); background: rgba(15, 18, 25, 0.6); border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="light"] .site-header { background: rgba(255,255,255,0.7); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand-logo { width: 28px; height: 28px; border-radius: 6px; box-shadow: 0 2px 10px var(--shadow); }
.brand-name { letter-spacing: 0.2px; }
.site-header.is-scrolled { box-shadow: 0 8px 24px rgba(0,0,0,0.35); background: rgba(15, 18, 25, 0.75); }

.nav-toggle { display: none; background: transparent; border: 0; color: var(--text); font-size: 20px; }
.nav-list { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-list li { display: flex; align-items: center; }
.nav-list a { color: var(--muted); text-decoration: none; font-weight: 600; position: relative; padding: 6px 0; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; line-height: 1; display: inline-block; }
.nav-list a:hover { color: var(--text); }
.nav-list a.active { color: var(--text); }
.nav-list a.active::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 100%; height: 2px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 2px; }

.actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { background: transparent; border: 1px solid rgba(255,255,255,0.12); color: var(--text); padding: 8px 10px; border-radius: 10px; cursor: pointer; }
/* Normalize header button sizing so Download matches others */
.site-header .actions .btn { padding: 8px 14px; font-size: 14px; line-height: 1; min-height: 40px; }
.site-header .actions .btn-primary { box-shadow: 0 8px 20px rgba(109,139,255,0.32), inset 0 0 0 1px rgba(255,255,255,0.12); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1px solid transparent; text-decoration: none; font-weight: 700; letter-spacing: 0.2px; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease; }
.btn-primary {
  color: #0b0d12;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  background-image: -webkit-linear-gradient(315deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px rgba(109,139,255,0.35), inset 0 0 0 1px rgba(255,255,255,0.12);
  appearance: none;
  -webkit-appearance: none;
}
.btn-primary:visited { color: #0b0d12; }
.btn-primary:hover { box-shadow: 0 12px 28px rgba(109,139,255,0.4), inset 0 0 0 1px rgba(255,255,255,0.14); }

/* Fancy rainbow download buttons */
.btn-download {
  position: relative;
  overflow: hidden;
  color: #0b0d12;
  isolation: isolate;
}
.btn-download::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: conic-gradient(from 0deg, #ff6ec7, #ffd166, #06d6a0, #6d8bff, #8a5cff, #ff6ec7);
  filter: blur(10px);
  opacity: 0.8;
  transition: transform .6s ease, opacity .3s ease;
  transform: rotate(0deg);
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
}
.btn-download::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.75));
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: -1;
}
.btn-download:hover::before { transform: rotate(120deg); opacity: 1; }
.btn-download:active::before { transform: rotate(200deg); }
.btn-download {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

@media (prefers-reduced-motion: reduce) {
  .btn-download::before { transition: none; }
}

/* Safari fallback: tone down overlay to avoid darkening */
.is-safari .btn-download::after { display: none; }
.is-safari .btn-download { background: linear-gradient(135deg, #ffd166, #06d6a0, #6d8bff, #8a5cff); color: #0b0d12; }
.btn-ghost { color: var(--text); background: transparent; border-color: rgba(255,255,255,0.12); }
.btn-secondary { color: var(--text); background: #1b2030; border-color: rgba(255,255,255,0.08); }
.btn:hover { transform: translateY(-1px); transition: transform .15s ease; }
.btn:active { transform: translateY(0); }

/* Google Sign-In Button */
#loginBtn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
}
#loginBtn svg {
  flex-shrink: 0;
}

/* User Section Improvements */
.user-section {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--brand);
}
.user-name {
  display: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-section .btn {
  padding: 8px 14px;
  font-size: 14px;
}
/* Make Subscribe button more prominent for free users */
.user-section .btn-subscribe {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0b0d12;
  border: none;
  font-weight: 600;
}
.user-section .btn-subscribe:hover {
  box-shadow: 0 4px 12px rgba(109,139,255,0.35);
}

/* Hero */
.hero { padding: 80px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 44px; line-height: 1.08; margin: 0 0 18px; letter-spacing: -0.02em; max-width: 20ch; }
.hero .sub { color: var(--muted); margin: 0 0 24px; font-size: 18px; }
.cta-group { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px 14px; list-style: none; margin: 16px 0 0; padding: 0; color: var(--muted); font-weight: 600; }
.hero-media .mockup { background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); padding: 14px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 12px 40px rgba(0,0,0,0.35); }
.hero-media img { width: 100%; display: block; border-radius: 12px; }

/* Trust */
.trust { padding: 12px 0; }
.trust-inner { text-align: center; color: var(--muted); font-weight: 600; }

/* Features */
.features { padding: 56px 0; }
.features h2 { text-align: center; margin-bottom: 28px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.card { background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 18px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.card-img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.06); }
.card h3 { margin: 6px 0 8px; }
.card p { margin: 0; color: var(--muted); }
.card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.14); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }

/* How */
.how { padding: 56px 0; }
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 18px; }
.step-num { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #0b0d12; font-weight: 800; margin-bottom: 8px; }

/* Use cases */
.use-cases { padding: 56px 0; }

/* CTA */
.cta { padding: 56px 0; }
.cta-inner { background: linear-gradient(135deg, rgba(109,139,255,0.18), rgba(138,92,255,0.16)); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cta .sub { color: var(--muted); margin: 6px 0 0; }
.cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.cta .btn-primary { padding: 12px 18px; }

/* Pricing */
.pricing { padding: 56px 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.price-card { background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 20px; }
.price-card.highlight { outline: 2px solid rgba(109,139,255,0.45); box-shadow: 0 20px 40px rgba(109,139,255,0.25); }
.price-card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,0,0,0.35); }
.price { font-size: 28px; font-weight: 800; margin: 6px 0 12px; }
.price-card ul { margin: 0 0 16px; padding-left: 18px; color: var(--muted); }

/* FAQ */
.faq { padding: 56px 0; }
.faq details { background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--muted); margin: 8px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid rgba(255,255,255,0.08); padding: 24px 0; margin-top: 24px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.footer-brand img { width: 24px; height: 24px; border-radius: 6px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.copyright { grid-column: 1 / -1; text-align: center; color: var(--muted); margin: 0; }

/* Back to top */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
@media (hover:hover) {
  .back-to-top:hover { transform: translateY(-2px); }
}

/* Responsive */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}

/* Compact header a bit earlier to prevent wrapping */
@media (max-width: 1200px) {
  .nav-list { gap: 14px; }
  .nav-list a { font-size: 14px; }
  .actions .btn { padding: 8px 12px; min-height: 36px; }
  .theme-toggle { padding: 6px 8px; }
  .user-name { display: none; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav-list { display: none; position: absolute; top: 64px; right: 16px; background: var(--card); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px; box-shadow: 0 16px 30px rgba(0,0,0,0.25); min-width: 220px; }
  .nav-list.open { display: grid; gap: 10px; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 34px; }
  .user-section { gap: 8px; }
  .user-section .btn { padding: 6px 10px; font-size: 13px; }
  .user-info { padding: 4px 8px; }
  .user-name { font-size: 13px; }
}


