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

:root {
  --accent:       #6c63ff;
  --accent-dark:  #4b44cc;
  --accent-light: #e8e6ff;
  --bg:           #0f0f1a;
  --bg-alt:       #15152a;
  --bg-card:      #1c1c35;
  --text:         #e8e8f0;
  --text-muted:   #9595b0;
  --border:       #2a2a50;
  --code-bg:      #0d0d1f;
  --radius:       12px;
  --shadow:       0 4px 32px rgba(108, 99, 255, 0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.center { text-align: center; }

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-cta {
  background: linear-gradient(135deg, #1a1838 0%, #0f0f1a 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-intro {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
  text-align: center;
  letter-spacing: -0.02em;
}

h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; }

p { color: var(--text-muted); }

code {
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  color: #a78bfa;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-top: 0.75rem;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  color: #c4b5fd;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

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

.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 26, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: box-shadow 0.3s;
}

.nav-scrolled {
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none !important;
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: none !important;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none !important;
}

/* ── Hamburger toggle (mobile) ───────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #13103a 0%, #0f0f1a 60%);
  border-bottom: 1px solid var(--border);
  padding-bottom: 3rem;
}

.hero-body {
  max-width: 700px;
  margin: 4rem auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-body h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: #fff;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-sub strong { color: var(--text); }

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-screenshot {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-screenshot img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ─── Feature grid ────────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

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

/* ─── Screenshots ────────────────────────────────────────────────────────── */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 2rem;
}

.screenshot-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

/* Mobile (portrait) screenshots sit narrower – up to 2 per row */
.screenshot-card--mobile {
  max-width: 320px;
  justify-self: center;
}

.screenshot-card img {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-card figcaption {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ─── Steps (how it works) ───────────────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 720px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-body h3 { color: var(--text); }

/* ─── Install steps ──────────────────────────────────────────────────────── */
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.install-step h3 {
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.url-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.url-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}

.url-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 160px;
}

.url-row code {
  background: none;
  border: none;
  padding: 0;
  color: #a78bfa;
}

.alt-install-title {
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

/* ─── Tech stack ─────────────────────────────────────────────────────────── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.tech-label {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.tech-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tech-card li {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.tech-card li::before {
  content: "▸ ";
  color: var(--accent);
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
}

.footer p { font-size: 0.9rem; margin-bottom: 0.4rem; }
.footer-sub { color: var(--text-muted); font-size: 0.85rem !important; }

/* ─── Star button ────────────────────────────────────────────────────────── */
.btn-star {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  font-weight: 700;
}

.nav-star {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
}

.btn-star:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.35);
}

.btn-star .star-icon {
  transition: transform 0.3s;
}

.btn-star:hover .star-icon {
  transform: scale(1.25) rotate(18deg);
}

.btn-star .star-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.1em 0.5em;
  margin-left: 0.15em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1.2;
}

/* ─── Scroll-triggered animations ────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

[data-animate] {
  opacity: 0;
}

[data-animate].is-visible.anim-fade {
  animation: fadeIn 0.7s ease forwards;
}

[data-animate].is-visible.anim-fade-up {
  animation: fadeUp 0.6s ease forwards;
}

/* stagger cards inside grids */
.feature-grid [data-animate].is-visible:nth-child(1) { animation-delay: 0s; }
.feature-grid [data-animate].is-visible:nth-child(2) { animation-delay: 0.08s; }
.feature-grid [data-animate].is-visible:nth-child(3) { animation-delay: 0.16s; }
.feature-grid [data-animate].is-visible:nth-child(4) { animation-delay: 0.24s; }
.feature-grid [data-animate].is-visible:nth-child(5) { animation-delay: 0.32s; }
.feature-grid [data-animate].is-visible:nth-child(6) { animation-delay: 0.40s; }
.feature-grid [data-animate].is-visible:nth-child(7) { animation-delay: 0.48s; }
.feature-grid [data-animate].is-visible:nth-child(8) { animation-delay: 0.56s; }
.feature-grid [data-animate].is-visible:nth-child(9) { animation-delay: 0.64s; }

.steps [data-animate].is-visible:nth-child(1) { animation-delay: 0s; }
.steps [data-animate].is-visible:nth-child(2) { animation-delay: 0.12s; }
.steps [data-animate].is-visible:nth-child(3) { animation-delay: 0.24s; }
.steps [data-animate].is-visible:nth-child(4) { animation-delay: 0.36s; }

.install-steps [data-animate].is-visible:nth-child(1) { animation-delay: 0s; }
.install-steps [data-animate].is-visible:nth-child(2) { animation-delay: 0.12s; }
.install-steps [data-animate].is-visible:nth-child(3) { animation-delay: 0.24s; }

/* Hero entrance animations */
.hero-body {
  animation: fadeUp 0.8s ease 0.1s both;
}

.hero-screenshot {
  animation: fadeUp 0.8s ease 0.3s both;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: var(--bg-alt);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 4.5rem 2rem 2rem;
    gap: 1.25rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 105;
  }

  .nav-links.open {
    transform: translateX(0);
  }
}

@media (max-width: 600px) {
  .screenshot-grid { grid-template-columns: 1fr; }
  .step { flex-direction: column; gap: 0.75rem; }
  .url-row { flex-direction: column; gap: 0.25rem; }
  .url-label { min-width: unset; }
}

/* Reduced-motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-animate] { opacity: 1; }
}
