:root {
  --purple: #a855f7;
  --pink: #ec4899;
  --ink: #1a1a2e;
  --body: #555555;
  --border: #e5e7eb;
  --bg-wash: #faf7ff;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  background-image: linear-gradient(135deg, rgba(168, 85, 247, 0.16) 0%, rgba(236, 72, 153, 0.16) 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: 100% 100%;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

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

.gradient-text {
  background: linear-gradient(90deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3);
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

.navbar img.logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.navbar .wordmark {
  width: auto;
  height: 24px;
}

.navbar .spacer {
  flex: 1;
}

/* ── Sections ─────────────────────────────────────────── */
section {
  padding: 28px 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 32px;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 28px 0 24px;
}

.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  width: fit-content;
}

.hero h1 {
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -1px;
  margin: 16px 0 12px;
}

.hero p.lede {
  font-size: 1.05rem;
  color: var(--body);
  line-height: 1.65;
  margin: 0 0 24px;
  max-width: 560px;
}

@media (min-width: 800px) {
  .hero-grid {
    flex-direction: row;
    align-items: center;
  }
  .hero-copy {
    flex: 1;
  }
  /* Matches MarketingCarousel.dart's own sizing math: the widget caps its
     own column width at 560px, then sizes the visible slide to
     viewportFraction (0.96) of that minus 8px of horizontal padding —
     i.e. itemWidth = min(columnWidth, 560) * 0.96 - 8 = 529.6px at the cap. */
  .marketing-carousel {
    flex: 1;
    width: calc(96% - 8px);
    max-width: 529.6px;
    margin: 0 auto;
  }
}

/* ── Marketing carousel (hero + mobile) ──────────────────────
   On mobile, flush to the container edge — full width, same as the hero
   copy above it and the .card sections below, so nothing looks inset. */
.marketing-carousel {
  width: 100%;
  margin: 0 auto;
}

.marketing-carousel .carousel-track {
  position: relative;
  aspect-ratio: 1080 / 1350;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(168, 85, 247, 0.2);
}

.marketing-carousel .carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.marketing-carousel .carousel-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.marketing-carousel .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Dot navigation (shared by marketing + testimonial carousels) ── */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
}

.carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(120, 120, 120, 0.4);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.carousel-dots .dot.is-active {
  width: 22px;
  background: var(--purple);
}

/* ── Testimonials ─────────────────────────────────────── */
.testimonial-spotlight {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 28px 20px;
}

.testimonial-spotlight h2 {
  margin-bottom: 20px;
}

.testimonial-track {
  position: relative;
  height: 250px;
  max-width: 480px;
  margin: 0 auto;
}

.testimonial-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.testimonial-slide.is-active {
  opacity: 1;
}

.testimonial-slide .quote-mark {
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 0.7;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.testimonial-slide .quote {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin: 4px 0 20px;
}

.avatar-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
}

.avatar-ring .avatar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  border: 2px solid #fff;
}

.avatar-ring .avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial-slide .handle {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--body);
}

/* ── Cards (login / auto-reply / how-it-works) ───────────── */
.card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(26, 26, 46, 0.1), 0 8px 12px rgba(26, 26, 46, 0.05);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.card-title.center {
  text-align: center;
}

.card-title.with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 0.92rem;
  color: var(--body);
  margin: 0 0 20px;
}

.card-subtitle.center {
  text-align: center;
}

.login-section .container {
  padding-top: 0;
}

.login-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .login-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-instagram {
  width: 100%;
  max-width: 300px;
  justify-content: center;
  color: #fff;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3);
  padding: 15px 26px;
  font-size: 16px;
}

.ig-icon {
  display: inline-flex;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.fine-print {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--body);
  text-align: center;
}

.fine-print a {
  color: var(--purple);
  text-decoration: underline;
}

/* ── Auto-reply demo card ────────────────────────────────── */
.comment {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
}

.comment.is-reply {
  margin-left: 24px;
}

.comment-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.comment-avatar.solid {
  background: var(--pink);
}

.comment-avatar.gradient {
  background: linear-gradient(90deg, var(--purple), var(--pink));
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-meta .user {
  font-weight: 700;
  font-size: 0.85rem;
}

.comment-meta .tag {
  color: var(--purple);
  font-weight: 500;
  font-size: 0.78rem;
}

.comment-meta .time {
  color: #9ca3af;
  font-size: 0.78rem;
}

.comment .message {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--ink);
}

/* ── How it works ─────────────────────────────────────── */
.how-it-works-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 800px) {
  .how-it-works-grid {
    flex-direction: row;
    align-items: stretch;
  }
  .how-it-works-grid .steps {
    flex: 1;
  }
  .how-it-works-grid .reel-carousel {
    flex: 1;
  }
  .how-it-works-grid .reel-row {
    flex: 1;
    min-height: 0;
  }
  .how-it-works-grid .reel-frame {
    width: auto;
    height: 100%;
  }
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  display: flex;
  gap: 16px;
}

.step .num {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.step p {
  margin: 0;
  color: var(--body);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ── Reel carousel ────────────────────────────────────── */
.reel-carousel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.12);
  border-radius: 18px;
  padding: 20px 14px 14px;
}

.reel-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.reel-nav {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.15);
  background: #fff;
  color: var(--purple);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.reel-frame {
  position: relative;
  width: 180px;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reel-slide {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.reel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.reel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.45));
}

.reel-slide .pill {
  position: absolute;
  top: 9px;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.reel-slide .pill-reel {
  left: 9px;
}

.reel-slide .pill-duration {
  right: 9px;
}

.reel-slide .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.reel-slide .caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.reel-counter {
  flex: none;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--body);
}

/* ── About / SEO content section ─────────────────────── */
.about-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.about-item h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.about-item p {
  margin: 0;
  color: var(--body);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ── Stats row (about section) ───────────────────────── */
.stats-row {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

@media (min-width: 800px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--body);
  max-width: 220px;
}

/* ── Features section ─────────────────────────────────── */
.features-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature-item {
  padding: 16px;
  border-radius: 16px;
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.12);
}

.feature-icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.feature-item h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.feature-item p {
  margin: 0;
  color: var(--body);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* ── Footer ───────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  text-align: center;
  color: var(--body);
  font-size: 0.85rem;
}

footer a {
  text-decoration: underline;
  color: var(--purple);
}

footer .footer-links {
  margin-bottom: 8px;
}

/* ── Entrance reveal animations ──────────────────────────
   Mirrors the FadeTransition/SlideTransition entrance play on each
   LoginPage card in the Flutter app. Triggered by IntersectionObserver
   in carousel.js as each block scrolls into view. */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

[data-reveal-item] {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal-item].is-visible {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal-item] {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
