/* =====================================================
   ZenGrocery Landing Page – style.css (Calm & Natural)
   ===================================================== */

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

:root {
  /* Colors inspired by the actual app's light theme */
  --bg:          #FAF5F1;
  --surface:     #ffffff;
  --surface-alt: #F8F2EC;
  --border:      rgba(26, 57, 76, 0.08); /* Derived from primary */
  --text:        #1a1b21;
  --text-muted:  #45464f;
  
  --primary:     #1A394C;
  --primary-hover: #132a38;
  --accent:      #515643; /* Secondary color from theme */
  
  --radius:      16px;
  --radius-sm:   8px;
  --nav-h:       72px;
  --transition:  0.25s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: "DM Sans", sans-serif;
  background-color: var(--bg);
  /* Apply paper texture */
  background-image: url("assets/noise/paper_noise.png");
  background-repeat: repeat;
  background-attachment: scroll; /* Move when scrolling */
  background-size: 300px; /* More fine-grained texture */
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background var(--transition), backdrop-filter var(--transition), border-color var(--transition);
}
.nav.scrolled {
  background: rgba(250, 245, 241, 0.85); /* var(--bg) with opacity */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-icon { width: 32px; height: 32px; border-radius: 8px; }
.nav-wordmark {
  font-family: "Prata", serif;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border: none;
  border-radius: 100px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 57, 76, 0.15);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(26, 57, 76, 0.2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(26, 57, 76, 0.04);
}

.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #e0e0e0;
  font-size: 1rem;
  padding: 13px 28px;
  width: 100%;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.btn-google:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 60px) 24px 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 540px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  font-family: "Prata", serif;
  font-size: clamp(2rem, 4vw, 3rem); /* Adjusted closer to app sizes */
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  color: var(--primary);
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero-subtitle {
  font-size: 1.25rem; /* Larger, softer text matching app bodyLarge */
  font-weight: 300;
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 40px;
  line-height: 1.6;
}
.hero-cta { font-size: 1.05rem; padding: 14px 28px; }
.hero-sub-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Hero visual — stacked screenshots ---------- */
.hero-visual {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-screenshot-stack {
  position: relative;
  width: 240px;
  height: 480px;
}

.hero-screenshot {
  position: absolute;
  width: 220px;
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(26,57,76,0.15);
}

.hero-screenshot--back {
  top: 30px;
  left: 0;
  transform: rotate(-4deg) translateX(-10px);
  opacity: 0.8;
  z-index: 0;
}

.hero-screenshot--front {
  top: 0;
  right: 0;
  transform: rotate(2deg);
  z-index: 1;
  box-shadow: 0 32px 80px rgba(26,57,76,0.2);
}

/* ---------- SCREENSHOTS STRIP ---------- */
.screenshots {
  padding: 80px 0 100px;
  overflow: hidden;
}

.screenshots-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.screenshots-inner .section-title {
  margin-bottom: 40px;
}

.screenshots-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 16px 24px 24px;
  margin: 0 -24px;
  scrollbar-width: none;
}

.screenshots-track::-webkit-scrollbar { display: none; }

.screenshot-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.screenshot-item img {
  width: 100%;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(26,57,76,0.12);
  display: block;
}

.screenshot-item figcaption {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

.screenshots-hint {
  display: none;
  justify-content: flex-end;
  padding-top: 12px;
  color: var(--text-muted);
  opacity: 0.5;
}

.screenshots-hint svg {
  width: 20px;
  height: 20px;
  animation: nudge 1.8s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(4px); }
}

/* ---------- Section label ---------- */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ---------- Play badge link ---------- */
.play-badge-link {
  display: inline-block;
  line-height: 0;
  transition: transform var(--transition), opacity var(--transition);
}
.play-badge-link:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}
.play-badge {
  height: 60px;
  width: auto;
  display: block;
}


/* ---------- FEATURES ---------- */
.features {
  padding: 100px 24px;
}
.features-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-title {
  font-family: "Prata", serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem); /* titleLarge matches */
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 60px;
  color: var(--primary);
  text-align: center;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: left;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 20px;
  display: inline-block;
  padding: 12px;
  background: var(--bg);
  border-radius: 14px;
  border: 1px solid var(--border);
}
.feature-card h3 {
  font-size: 1.35rem; /* titleMedium matches */
  font-family: "Prata", serif; /* Applying header font */
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--primary);
}
.feature-card p {
  font-size: 1.1rem; /* bodyMedium matches */
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- CTA BAND ---------- */
.cta-band {
  padding: 100px 24px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cta-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.cta-title {
  font-family: "Prata", serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  color: var(--primary);
}
.cta-inner .btn { margin: 0 auto; font-size: 1.05rem; padding: 14px 32px; }

/* ---------- FOOTER ---------- */
.footer {
  padding: 48px 24px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Prata", serif;
  font-size: 1.05rem;
  color: var(--text);
}
.footer-icon { width: 24px; height: 24px; border-radius: 6px; }
.footer-legal { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 245, 241, 0.85); /* using var(--bg) */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  position: relative;
  box-shadow: 0 24px 60px rgba(26,57,76,0.1);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition);
}
.modal-overlay.visible .modal {
  transform: translateY(0) scale(1);
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--surface-alt);
  border: none;
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { text-align: center; }
.modal-icon img { width: 56px; height: 56px; border-radius: 12px; margin-bottom: 24px; }
.modal-title {
  font-family: "Prata", serif;
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: var(--primary);
}
.modal-subtitle { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 32px; line-height: 1.5; }
.modal-error {
  margin-top: 16px;
  font-size: 0.85rem;
  color: #ba1a1a; /* Error color from material theme */
  min-height: 20px;
}

.modal-loading, .modal-success { text-align: center; padding: 20px 0; }
.modal-loading p, .modal-success p { color: var(--text-muted); margin-top: 20px; font-size: 0.95rem; }
.modal-success h2 { font-family: "Prata", serif; font-size: 1.6rem; margin: 16px 0 8px; color: var(--primary); }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(26,57,76,0.15);
  animation: pop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---------- LEGAL CONTENT ---------- */
.legal-section {
  padding: calc(var(--nav-h) + 60px) 24px 80px;
  max-width: 800px;
  margin: 0 auto;
}
.legal-title {
  font-family: "Prata", serif;
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 12px;
}
.legal-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}
.legal-section h2 {
  font-family: "Prata", serif;
  font-size: 1.5rem;
  color: var(--primary);
  margin-top: 40px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.legal-section h3 {
  font-size: 1.2rem;
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 12px;
}
.legal-section p, .legal-section ul {
  margin-bottom: 16px;
  color: var(--text-muted);
  line-height: 1.8;
}
.legal-section ul {
  padding-left: 24px;
}
.legal-section a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}
.legal-section a:hover {
  color: var(--primary-hover);
}
.footer-links a:hover {
  text-decoration: underline !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: calc(var(--nav-h) + 40px);
    gap: 48px;
  }
  .hero-subtitle { margin: 0 auto 36px; }
  .hero-sub-note { text-align: center; }
  .hero-cta { margin: 0 auto; }
  .hero-screenshot-stack { width: 200px; height: 400px; }
  .hero-screenshot { width: 185px; }
  .screenshots-track { gap: 16px; }
  .screenshot-item { width: 180px; }
  .screenshots-hint { display: flex; }
  .footer-inner { flex-direction: column; text-align: center; gap: 20px; }
}

@media (min-width: 769px) {
  .screenshots-track {
    /* Show 3 full + partial 4th to hint at scrollability */
    padding: 16px 0 24px;
    margin: 0;
  }
  .screenshot-item { width: 260px; }
}
