/* FreshBy Product Website — Modern, fresh aesthetic */

:root {
  --green-900: #1a3c34;
  --green-700: #2d5a4a;
  --green-600: #3d7a5f;
  --green-500: #4a9d6e;
  --green-400: #6bb88a;
  --green-200: #c5e6d1;
  --green-100: #e8f5ec;
  --green-50: #f2f9f4;
  --cream: #fafbf8;
  --white: #ffffff;
  --text: #1a2e26;
  --text-muted: #5a7269;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(26, 60, 52, 0.08);
  --shadow-lg: 0 12px 48px rgba(26, 60, 52, 0.12);
  --footer-bg: #1a3c34;
  --footer-text: #c5e6d1;
}

/* Dark theme */
[data-theme="dark"] {
  --green-900: #c5e6d1;
  --green-700: #6bb88a;
  --green-600: #7bc99a;
  --green-500: #4a9d6e;
  --green-400: #3d7a5f;
  --green-200: #2d4a3d;
  --green-100: #243830;
  --green-50: #1e322a;
  --cream: #141a18;
  --white: #1c2420;
  --text: #e8f0ec;
  --text-muted: #8fa89e;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.35);
  --footer-bg: #0f1614;
  --footer-text: #8fa89e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* Header: logo (left), nav + theme toggle (top right) */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--green-900);
  font-weight: 700;
}

.logo-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

.logo-text {
  font-family: "Fraunces", serif;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.25rem 0;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

.nav-link-current {
  color: var(--green-700);
}

/* Dark mode toggle */
.theme-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--green-50);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--green-100);
  color: var(--green-700);
}

.theme-icon {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.theme-icon svg {
  display: block;
}

.theme-icon-sun {
  opacity: 1;
}

.theme-icon-moon {
  opacity: 0;
}

[data-theme="dark"] .theme-icon-sun {
  opacity: 0;
}

[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  color: var(--green-400);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
}

.nav-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.nav-icon svg {
  display: block;
  vertical-align: middle;
}

/* QR placeholder (used in hero row) */
.app-store-cta {
  flex-shrink: 0;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--green-100);
  min-width: 240px;
  min-height: 280px;
  justify-content: center;
}

.qr-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qr-slot {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
}

.qr-code-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.store-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.app-store-badge {
  display: block;
  text-decoration: none;
  line-height: 0;
}

.app-store-badge img {
  display: block;
  width: 160px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
}

.app-store-badge:hover img,
.app-store-badge:focus img {
  opacity: 0.9;
}

.app-store-badge:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
  border-radius: 8px;
}

.play-store-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  line-height: 0;
}

.play-store-badge img {
  display: block;
  width: 160px;
  height: auto;
  max-height: 54px;
  object-fit: contain;
}

.play-store-badge--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.play-store-coming-soon {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Hero: "A smarter way..." content (left) + QR code (right) on same row */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2.5rem;
  padding: 3rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-content {
  max-width: 640px;
  min-width: 0;
}

.hero-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--green-900);
  margin: 0 0 1rem;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text);
  margin: 0;
  word-wrap: break-word;
}

/* How it works */
.how-it-works {
  padding: 4rem 2rem 5rem;
  background: var(--white);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -4px 24px rgba(26, 60, 52, 0.06);
}

.section-title {
  font-family: "Fraunces", serif;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--green-900);
  text-align: center;
  margin: 0 0 2.5rem;
  letter-spacing: -0.02em;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
}

.step-number {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-100);
  color: var(--green-700);
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 1.2rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-content {
  min-width: 0;
}

.step-title {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--green-900);
  margin: 0 0 0.4rem;
}

.step-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* CTA */
.cta {
  padding: 3rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.cta-box {
  text-align: center;
  padding: 2rem 2.5rem;
  background: linear-gradient(135deg, var(--green-100) 0%, var(--green-50) 100%);
  border-radius: var(--radius);
  border: 1px solid var(--green-200);
}

.cta-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--green-900);
  margin: 0 0 1rem;
}

.cta-app-store-badge {
  display: inline-block;
  margin-top: 0.25rem;
}

/* Help and Support */
.help-support {
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.help-support .section-title {
  margin-bottom: 1rem;
}

.help-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 480px;
  margin-inline: auto;
}

.help-email-link {
  color: var(--green-700);
  text-decoration: none;
  font-weight: 500;
}

.help-email-link:hover {
  text-decoration: underline;
}

.help-email-link:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Footer */
.footer {
  padding: 1.5rem 2rem;
  text-align: center;
  background: var(--footer-bg);
  color: var(--footer-text);
}

.footer-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Privacy Policy page (deeplink) */
.policy-page {
  padding: 2rem;
  max-width: 720px;
  margin: 0 auto 4rem;
}

.policy-content {
  background: var(--white);
  padding: 2rem 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--green-100);
}

.policy-title {
  font-family: "Fraunces", serif;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--green-900);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.policy-updated {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.policy-content p {
  margin: 0 0 1rem;
  color: var(--text);
  line-height: 1.6;
}

.policy-content p:last-child {
  margin-bottom: 0;
}

.policy-content ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.policy-content li {
  margin-bottom: 0.35rem;
  color: var(--text);
  line-height: 1.5;
}

/* Responsive — tablet and below */
@media (max-width: 900px) {
  .logo-icon {
    width: 56px;
    height: 56px;
  }

  .logo-text {
    font-size: 1.65rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 1.5rem 3.5rem;
  }

  .hero-content {
    text-align: center;
  }

  .app-store-cta {
    justify-self: center;
  }

  .store-badges {
    justify-content: center;
  }
}

/* Responsive — mobile */
@media (max-width: 700px) {
  .header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "logo toggle"
      "nav nav";
    padding: 1rem 1rem;
    gap: 0.5rem 0.75rem;
    align-items: center;
  }

  .logo {
    grid-area: logo;
    justify-self: start;
  }

  .header-right {
    display: contents;
  }

  .header-right .theme-toggle {
    grid-area: toggle;
    justify-self: end;
  }

  .header-right .nav {
    grid-area: nav;
    justify-self: end;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
  }

  .nav a {
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .logo-icon {
    width: 48px;
    height: 48px;
  }

  .logo-text {
    font-size: 1.4rem;
  }

  .qr-placeholder {
    min-width: 0;
    width: 100%;
    max-width: 260px;
    min-height: auto;
    padding: 1rem 1rem;
  }

  .qr-slot {
    width: 160px;
    height: 160px;
  }

  .hero {
    padding: 2rem 1rem 3rem;
  }

  .hero-title {
    font-size: clamp(1.65rem, 5vw, 2rem);
  }

  .how-it-works {
    padding: 2.5rem 1rem 3.5rem;
    border-radius: 20px 20px 0 0;
  }

  .section-title {
    font-size: clamp(1.4rem, 4vw, 1.75rem);
    margin-bottom: 1.5rem;
  }

  .steps {
    gap: 1.5rem;
  }

  .step {
    gap: 1rem;
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .step-title {
    font-size: 1.05rem;
  }

  .step-text {
    font-size: 0.9rem;
  }

  .cta {
    padding: 2rem 1rem 3rem;
  }

  .cta-box {
    padding: 1.5rem 1.25rem;
  }

  .cta-text {
    font-size: 1rem;
  }

  .help-support {
    padding: 2rem 1rem;
  }

  .help-text {
    font-size: 0.95rem;
    padding: 0 0.5rem;
  }

  .footer {
    padding: 1.25rem 1rem;
  }

  .footer-text {
    font-size: 0.85rem;
  }

  .app-store-badge img,
  .play-store-badge img {
    width: 140px;
    max-height: 47px;
  }
}

/* Responsive — extra small phones */
@media (max-width: 480px) {
  .header {
    padding: 0.75rem 0.75rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
  }

  .logo-text {
    font-size: 1.25rem;
  }

  .nav a {
    font-size: 0.8rem;
  }

  .nav .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
  }

  .hero {
    padding: 1.5rem 0.75rem 2.5rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .qr-placeholder {
    padding: 0.75rem;
    max-width: 240px;
  }

  .qr-slot {
    width: 140px;
    height: 140px;
  }

  .store-badges {
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .app-store-badge img,
  .play-store-badge img {
    width: 120px;
    max-height: 40px;
  }

  .how-it-works {
    padding: 2rem 0.75rem 3rem;
    border-radius: 16px 16px 0 0;
  }

  .step {
    grid-template-columns: 36px 1fr;
  }

  .cta-box {
    padding: 1.25rem 1rem;
  }

  .policy-page {
    padding: 1.25rem 0.75rem 3rem;
  }

  .policy-content {
    padding: 1.5rem 1.25rem;
  }

  .policy-title {
    font-size: 1.35rem;
  }
}
