/* ============================================================
   Grove · Book Tracker — Global Stylesheet
   Mobile-first, light theme only, no build step
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------- */
:root {
  /* Brand colours */
  --grove-green: #34C759;
  --grove-green-700: #248A3D;

  /* Ink / text */
  --ink: #0B0B0C;
  --body: #3A3A3C;
  --muted: #6E6E73;

  /* Surfaces */
  --line: #E5E5EA;
  --bg: #FFFFFF;
  --bg-alt: #F5F5F7;

  /* Shape */
  --radius: 18px;

  /* Layout */
  --maxw: 1120px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 40px;
  --space-7: 64px;
  --space-8: 96px;
}

/* ----------------------------------------------------------
   2. RESET
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ----------------------------------------------------------
   3. BASE
   ---------------------------------------------------------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
               Arial, sans-serif;
  color: var(--body);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ----------------------------------------------------------
   3a. ACCESSIBILITY
   ---------------------------------------------------------- */
.skip { position: absolute; left: -9999px; top: auto; }
.skip:focus { left: var(--space-5); top: var(--space-3); z-index: 200; background: var(--bg); padding: var(--space-2) var(--space-4); border-radius: var(--radius); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ----------------------------------------------------------
   4. TYPOGRAPHY
   ---------------------------------------------------------- */
h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

p {
  color: var(--body);
}

/* ----------------------------------------------------------
   5. LAYOUT UTILITIES
   ---------------------------------------------------------- */
.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: var(--space-7);
}

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

/* ----------------------------------------------------------
   6. EYEBROW
   ---------------------------------------------------------- */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grove-green-700);
  margin-bottom: var(--space-3);
}

/* ----------------------------------------------------------
   7. BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: 980px; /* pill */
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, transform 0.12s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--grove-green);
  color: #fff;
}

.btn--primary:hover {
  background: var(--grove-green-700);
}

.btn--secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn--secondary:hover {
  background: var(--bg-alt);
  border-color: var(--muted);
}

/* ----------------------------------------------------------
   8. APP STORE BADGE
   ---------------------------------------------------------- */
.appstore-badge {
  display: inline-block;
  line-height: 0;
}

.appstore-badge img {
  height: 60px;
  width: auto;
}

/* ----------------------------------------------------------
   9. NAVIGATION
   ---------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 60px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.nav__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
}

.nav__links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav__links a:hover {
  color: var(--grove-green-700);
}

.nav__cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Keep the Download CTA white — beats `.nav__links a` color in specificity */
.nav__links a.nav__cta { color: #fff; margin-left: var(--space-3); }
.nav__links a.nav__cta:hover { color: #fff; }

/* Mobile toggle — hidden on desktop */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  color: var(--ink);
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Mobile nav: < 800px */
@media (max-width: 800px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: var(--space-3) 0;
    list-style: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .nav__links[data-open] {
    display: flex;
  }

  .nav__links li {
    width: 100%;
  }

  .nav__links a {
    display: block;
    padding: var(--space-3) var(--space-5);
    font-size: 1rem;
  }
}

/* ----------------------------------------------------------
   10. HERO
   ---------------------------------------------------------- */
.hero {
  padding-block: var(--space-8) var(--space-7);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

/* Match the secondary button to the App Store badge height + corner radius */
.hero__actions .btn--secondary {
  min-height: 60px;
  padding-inline: var(--space-6);
  font-size: 1.0625rem;
  border-radius: 13px;
}

.hero__mockup {
  display: flex;
  justify-content: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ----------------------------------------------------------
   11. MOCKUP
   ---------------------------------------------------------- */
.mockup {
  max-width: 320px;
  width: 100%;
  height: auto;
  /* drop-shadow follows the phone's alpha silhouette — no rectangular white card border */
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.16));
}

/* ----------------------------------------------------------
   12. FEATURE ROWS
   ---------------------------------------------------------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}

.feature-row__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  /* text first on mobile for scannability */
  order: 1;
}

.feature-row__media {
  display: flex;
  justify-content: center;
  order: 2;
}

/* Desktop: side-by-side */
@media (min-width: 760px) {
  .feature-row {
    grid-template-columns: 1fr 1fr;
  }

  .feature-row__copy {
    order: unset;
  }

  .feature-row__media {
    order: unset;
  }

  /* Reverse variant: media left, copy right on desktop */
  .feature-row--reverse .feature-row__copy {
    order: 2;
  }

  .feature-row--reverse .feature-row__media {
    order: 1;
  }
}

/* ----------------------------------------------------------
   13. PREMIUM BADGE
   ---------------------------------------------------------- */
.badge--premium {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-3);
  background: var(--grove-green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 980px;
  vertical-align: middle;
}

/* ----------------------------------------------------------
   14. PRICING
   ---------------------------------------------------------- */
.pricing {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .pricing {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.plan-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.plan-card__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.plan-card__price {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.plan-card__price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
}

.plan-card__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.plan-card__features li {
  font-size: 0.9375rem;
  color: var(--body);
  padding-left: var(--space-4);
  position: relative;
}

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

/* Featured card */
.plan-card--featured {
  border: 2px solid var(--grove-green);
  transform: scale(1.02);
  box-shadow: 0 8px 40px rgba(52, 199, 89, 0.15);
}

.plan-card--featured:hover {
  box-shadow: 0 12px 48px rgba(52, 199, 89, 0.2);
}

.plan-card__ribbon {
  position: absolute;
  top: -1px;
  right: var(--space-4);
  background: var(--grove-green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: 0 0 var(--space-2) var(--space-2);
}

/* ----------------------------------------------------------
   15. FAQ
   ---------------------------------------------------------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq__item {
  border-bottom: 1px solid var(--line);
}

.faq__item:first-child {
  border-top: 1px solid var(--line);
}

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  gap: var(--space-4);
  transition: color 0.15s ease;
}

.faq__q:hover {
  color: var(--grove-green-700);
}

/* Chevron icon */
.faq__q::after {
  content: "";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236E6E73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s ease;
}

.faq__item[data-open] .faq__q::after {
  transform: rotate(180deg);
}

.faq__a {
  display: none;
  padding-bottom: var(--space-4);
  color: var(--body);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.faq__item[data-open] .faq__a {
  display: block;
}

/* ----------------------------------------------------------
   16. CTA BANNER
   ---------------------------------------------------------- */
.cta-banner {
  background: linear-gradient(135deg,
    rgba(52, 199, 89, 0.20) 0%,
    rgba(52, 199, 89, 0.14) 100%);
  border-top: 1px solid rgba(52, 199, 89, 0.3);
  border-bottom: 1px solid rgba(52, 199, 89, 0.3);
}

.cta-banner__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
}

.cta-banner__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* ----------------------------------------------------------
   17. FOOTER
   ---------------------------------------------------------- */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding-block: var(--space-6);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__brand-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 1.05rem;
}

.footer__tagline {
  font-size: 0.875rem;
  color: var(--muted);
}

.footer__col-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__links a {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer__links a:hover {
  color: var(--grove-green-700);
}

.footer__copy {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer__bottom {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ----------------------------------------------------------
   18. PLACEHOLDER NOTE
   ---------------------------------------------------------- */
.placeholder-note {
  display: block;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--muted);
  border-radius: 6px;
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: italic;
}

/* ----------------------------------------------------------
   19. LEGAL PAGES
   ---------------------------------------------------------- */
.legal {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--space-5);
  padding-block: var(--space-7);
}

.legal h1 {
  margin-bottom: var(--space-4);
}

.legal h2 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.legal h3 {
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.legal p {
  margin-bottom: var(--space-4);
}

.legal ul,
.legal ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}

.legal li {
  margin-bottom: var(--space-2);
  line-height: 1.65;
}

.legal a {
  color: var(--grove-green-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal a:hover {
  color: var(--grove-green);
}

.legal .last-updated {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: var(--space-5);
}
