:root {
  --orange: #F59E0B;
  --orange-dark: #EA8B00;
  --orange-soft: #FFF3E0;
  --green: #4CAF50;
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  --bg: #FFFBF5;
  --bg-alt: #FFF7ED;
  --card: #FFFFFF;
  --border-soft: #F1E5D6;
  --shadow-soft: 0 12px 40px rgba(31, 41, 55, 0.06);
  --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(180deg, var(--bg), var(--bg-alt));
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.section {
  padding: 72px 0;
}

.accent {
  color: var(--orange);
}

.lede {
  font-size: 18px;
  color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 24px;
  font-size: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--orange-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dark);
  border: 1.5px solid var(--border-soft);
}

.btn-ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.btn-lg {
  padding: 15px 30px;
  font-size: 16px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: rgba(255, 251, 245, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.logo {
  font-weight: 800;
  font-size: 22px;
  color: var(--orange);
  letter-spacing: -0.02em;
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 48px;
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero .lede {
  margin-bottom: 32px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  min-height: 360px;
}

.flashcard {
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  width: 220px;
}

.flashcard img {
  border-radius: 14px;
}

/* Front/back flashcard pair: the back card peeks out from behind the front
   card and swings fully into view on hover instead of staying hidden. */
.flashcard-stack {
  position: relative;
  width: 220px;
}

.flashcard-stack .flashcard-back {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  transform: rotate(9deg) translate(8px, 10px);
}

.flashcard-stack .flashcard-front {
  position: relative;
  z-index: 2;
  transform: rotate(-6deg);
}

/* Hover only on devices that truly hover; touch devices toggle .is-open on
   tap instead (see script.js), since a tapped :hover sticks until the user
   taps elsewhere and the stack could never be closed. */
@media (hover: hover) {
  .flashcard-stack:hover .flashcard-back {
    transform: rotate(11deg) translate(168px, 20px);
  }

  .flashcard-stack:hover .flashcard-front {
    transform: rotate(-8deg) translateY(-8px);
  }
}

.flashcard-stack.is-open .flashcard-back {
  transform: rotate(11deg) translate(168px, 20px);
}

.flashcard-stack.is-open .flashcard-front {
  transform: rotate(-8deg) translateY(-8px);
}

.phone-frame {
  width: 190px;
  border-radius: 28px;
  padding: 5px;
  background: #111;
  box-shadow: var(--shadow-lift);
  animation: float 6s ease-in-out infinite;
  overflow: hidden;
}

.phone-frame img {
  border-radius: 24px;
}

.phone-frame-lg {
  width: 280px;
  padding: 7px;
  border-radius: 38px;
  margin: 0 auto;
}

.phone-frame-lg img {
  border-radius: 33px;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* ---------- App preview ---------- */
.app-preview-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: center;
}

.app-preview-copy h2 {
  font-size: 36px;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  color: var(--text-muted);
}

.checklist li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 700;
}

/* ---------- Features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.feature-icon {
  font-size: 28px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange-soft);
  border-radius: 16px;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
}

/* ---------- Section heading ---------- */
.section-heading {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}

.section-heading h2 {
  font-size: 36px;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Product showcase (carousel: 3 visible, auto-sweeps, draggable) ---------- */
.product-carousel {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.product-carousel::-webkit-scrollbar {
  display: none;
}

.product-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* ---------- Dotted scroll indicator ---------- */
.product-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.product-dot {
  appearance: none;
  border: none;
  padding: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border-soft);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.product-dot:hover {
  background: #E9D5B8;
}

.product-dot.is-active {
  width: 24px;
  background: var(--orange);
}

.product-grid {
  display: flex;
  gap: 24px;
  scroll-snap-type: x proximity;
}

.product-card {
  flex: 0 0 calc((100% - 48px) / 3);
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

/* Auto margins center the cards when they don't fill the row (e.g. a single
   pack) while still letting an overflowing row scroll from its first card,
   which justify-content: center would clip. */
.product-card:first-child {
  margin-left: auto;
}

.product-card:last-child {
  margin-right: auto;
}

.product-card.is-best-value {
  border-color: var(--orange);
}

.product-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #FFE0B2, var(--orange-soft));
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-media .placeholder-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.product-ribbon {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.product-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-badge {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.product-badge.subscription {
  background: #EDE9FE;
  color: #6D28D9;
}

.product-body h3 {
  margin: 0;
  font-size: 19px;
}

.product-description {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
  flex: 1;
}

.product-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--orange);
  margin: 4px 0 0;
}

.product-availability {
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
  margin-top: 4px;
}

.product-status {
  text-align: center;
  color: var(--text-muted);
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}

/* ---------- Final CTA ---------- */
.final-cta {
  text-align: center;
}

.final-cta h2 {
  font-size: 36px;
  margin: 0 0 16px;
  font-weight: 700;
}

.final-cta .lede {
  margin: 0 auto 24px;
}

.store-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 32px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  color: var(--text-muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--orange-dark);
  text-decoration: underline;
}

/* ---------- Legal pages (Privacy Policy, Account Deletion) ---------- */
.legal-header {
  padding: 48px 0 8px;
}

.legal-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--orange-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
}

.legal-header h1 {
  font-size: 32px;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 32px;
}

.legal-container {
  max-width: 760px;
}

.legal-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 20px;
}

.legal-card h2 {
  font-size: 18px;
  margin: 0 0 10px;
}

.legal-card p,
.legal-card li {
  color: var(--text-muted);
  font-size: 15px;
}

.legal-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.legal-card a {
  color: var(--orange-dark);
}

.legal-callout {
  background: var(--orange-soft);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  font-size: 14.5px;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.legal-form label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 14px 0 6px;
}

.legal-form input,
.legal-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-dark);
  background: var(--bg);
}

.legal-form textarea {
  min-height: 100px;
  resize: vertical;
}

.legal-form-status {
  margin-top: 14px;
  font-size: 14px;
}

.legal-form-status.is-success { color: var(--green); }
.legal-form-status.is-error { color: #DC2626; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid,
  .app-preview-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero .lede {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    margin-top: 16px;
  }

  .checklist {
    text-align: left;
    display: inline-block;
  }

  .product-card {
    flex-basis: calc((100% - 24px) / 2);
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 34px;
  }

  .section-heading h2,
  .app-preview-copy h2,
  .final-cta h2 {
    font-size: 28px;
  }

  .hero-visual {
    flex-direction: column;
  }

  .product-card {
    flex-basis: 82%;
  }
}
