/* ProducePocket — shared styles.
   Palette tracks the app's own light/dark tokens (src/theme/index.ts). */

:root {
  color-scheme: light dark;

  --bg: #eaf2ec;
  --surface: #f8fbf9;
  --surface-2: #f1f7f3;
  --border: #dce6df;
  --text: #1a2a20;
  --muted: #5f6e64;
  --primary: #1fa463;
  --primary-dark: #17784a;
  --primary-soft: #e4f5ec;
  --on-primary: #ffffff;
  --warning-soft: #fbf1dd;
  --warning-line: #e0a83b;
  --shadow: 0 1px 2px rgba(26, 42, 32, 0.04), 0 8px 24px rgba(26, 42, 32, 0.06);
  --shadow-nav: 0 2px 20px rgba(26, 42, 32, 0.08);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1080px;
  --maxw-text: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121714;
    --surface: #1c2320;
    --surface-2: #19201c;
    --border: #2e3833;
    --text: #eaf3ec;
    --muted: #93a69b;
    --primary: #33c57f;
    --primary-dark: #7fe0aa;
    --primary-soft: #1e3327;
    --on-primary: #0f1611;
    --warning-soft: #3a2f17;
    --warning-line: #f0c168;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-nav: 0 2px 20px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Horizontal padding only, as longhand on purpose: `.wrap` is a class and
   `section` is an element, so a `padding` shorthand here outranks and silently
   zeroes the vertical padding of every `<section class="wrap">`. */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.wrap-text { max-width: var(--maxw-text); }

/* ---------- Floating pill nav ---------- */

.nav-outer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 18px 16px;
  background: transparent;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Pushed out of view while scrolling down; slides back on scroll up. */
.nav-outer.nav-hidden { transform: translateY(-130%); }

.nav-outer.condensed { padding-top: 10px; padding-bottom: 10px; }

/* Content clears the fixed bar. */
body { padding-top: 96px; }

@media (max-width: 720px) {
  body { padding-top: 140px; }
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  pointer-events: auto;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 9px 9px 18px;
  position: relative;
  isolation: isolate;

  /* Liquid glass: a translucent, blurred, slightly over-saturated pane that
     picks up whatever scrolls beneath it, with a bright top edge and a soft
     inner shadow along the bottom so it reads as a raised piece of glass
     rather than a flat panel. */
  background: rgba(248, 251, 249, 0.62);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 1px 1px rgba(26, 42, 32, 0.04),
    0 8px 28px rgba(26, 42, 32, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(26, 42, 32, 0.05);
  transition: background 0.4s ease, box-shadow 0.4s ease,
              border-color 0.4s ease, padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* A specular sheen across the top half, the way light sits on curved glass. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.12) 42%,
    rgba(255, 255, 255, 0) 60%
  );
  pointer-events: none;
  z-index: -1;
}

/* Once scrolled, the glass tightens and gains contrast so it stays legible
   over whatever passes underneath. */
.condensed .nav {
  padding-top: 6px;
  padding-bottom: 6px;
  background: rgba(248, 251, 249, 0.78);
  box-shadow:
    0 1px 1px rgba(26, 42, 32, 0.05),
    0 10px 34px rgba(26, 42, 32, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(26, 42, 32, 0.06);
}

@media (prefers-color-scheme: dark) {
  .nav {
    background: rgba(28, 35, 32, 0.58);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
      0 1px 1px rgba(0, 0, 0, 0.3),
      0 8px 28px rgba(0, 0, 0, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  }

  .nav::before {
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.14) 0%,
      rgba(255, 255, 255, 0.04) 42%,
      rgba(255, 255, 255, 0) 60%
    );
  }

  .condensed .nav {
    background: rgba(28, 35, 32, 0.76);
    box-shadow:
      0 1px 1px rgba(0, 0, 0, 0.35),
      0 10px 34px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  }
}

/* Without backdrop-filter the translucency would just look washed out, so
   fall back to the solid surface colour. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: var(--surface); border-color: var(--border); }
  .condensed .nav { background: var(--surface); }
}

/* Respect a reduced-motion preference: keep the glass, drop the movement. */
@media (prefers-reduced-motion: reduce) {
  .nav-outer, .nav { transition: none; }
  .nav-outer.nav-hidden { transform: none; }
  html { scroll-behavior: auto; }
}

.nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  font-weight: 650;
  font-size: 21px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* Two-tone wordmark: "Produce" in the text colour, "Pocket" in the brand
   green. Used in both the nav and the footer lockup. */
.brand-accent { color: var(--primary); }

.nav .brand img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: block;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* The mark eases down a little once the bar condenses, so the scrolled state
   stays compact without the brand ever looking shrunken. */
.condensed .nav .brand img {
  width: 34px;
  height: 34px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 550;
  padding: 8px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); background: var(--surface-2); }

.nav-links a[aria-current="page"] { color: var(--text); }

.nav-cta {
  background: var(--primary);
  color: var(--on-primary) !important;
  padding: 10px 18px !important;
  font-weight: 650 !important;
}

.nav-cta:hover { background: var(--primary-dark) !important; }

/* Small screens: links wrap under the brand instead of overflowing. */
@media (max-width: 720px) {
  .nav {
    border-radius: var(--radius);
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .nav-links {
    width: 100%;
    margin-left: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
  }
  .nav-links a { padding: 7px 10px; font-size: 14px; }
}

/* ---------- Page head ---------- */

.page-head {
  text-align: center;
  padding: 64px 0 40px;
}

.page-head.tight { padding-bottom: 24px; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
  .badge { color: var(--primary); }
}

h1 {
  font-size: clamp(38px, 7vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  font-weight: 760;
}

.lede {
  font-size: clamp(17px, 2.2vw, 19px);
  color: var(--muted);
  margin: 0 auto;
  max-width: 56ch;
}

h2.section-title {
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 740;
  text-align: center;
  margin: 0 0 14px;
  color: var(--text);
  text-transform: none;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  max-width: 54ch;
  margin: 0 auto 36px;
}

section { padding: 60px 0; }

/* On a phone that same rhythm eats a third of the screen between sections,
   so it tightens up. */
@media (max-width: 720px) {
  section { padding: 38px 0; }
}

/* A note or callout following a block of cards needs its own breathing room
   beyond the section rhythm. */
section > .note { margin-top: 8px; }

h3 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.012em;
  margin: 0 0 8px;
}

p { margin: 0 0 16px; }

a { color: var(--primary-dark); }

@media (prefers-color-scheme: dark) {
  a { color: var(--primary); }
}

/* ---------- Hero ---------- */

.hero { text-align: center; padding: 52px 0 40px; }

.hero img.mark {
  width: 124px;
  height: 124px;
  border-radius: 28px;
  margin-bottom: 26px;
}

.cta {
  display: inline-block;
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  padding: 15px 30px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.cta:hover { background: var(--primary-dark); }

.cta.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.cta.secondary:hover { background: var(--surface-2); }

.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* App Store download button. A plain styled button, not Apple's official
   badge artwork — drop the real badge in from Apple's marketing resources
   if you want the standard lockup. */
.cta.appstore {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 26px;
  text-align: left;
  line-height: 1.2;
}

.cta.appstore .store-sub {
  display: block;
  font-size: 11px;
  font-weight: 550;
  opacity: 0.85;
  letter-spacing: 0.02em;
}

.cta.appstore .store-main {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.rating-line {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 16px;
}

.cta-note {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 14px;
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Numbered steps ---------- */

.steps {
  display: grid;
  gap: 16px;
  counter-reset: step;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 20px;
  align-items: start;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 740;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-color-scheme: dark) {
  .step::before { color: var(--primary); }
}

.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); margin: 0; }

@media (max-width: 560px) {
  .step { grid-template-columns: 1fr; gap: 14px; padding: 22px; }
}

/* ---------- Pricing ---------- */

.plans {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  align-items: start;
}

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
  position: relative;
}

.plan.featured { border-color: var(--primary); border-width: 2px; }

.plan-tag {
  position: absolute;
  top: -11px;
  left: 28px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 740;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
}

.plan h3 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.price .amount {
  font-size: 42px;
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1;
}

.price .per { color: var(--muted); font-size: 16px; }

.plan .blurb {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 22px;
  min-height: 42px;
}

.plan ul { margin: 0; padding: 0; list-style: none; }

.plan li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 11px;
  font-size: 16px;
  color: var(--muted);
}

.plan li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 10px;
  height: 5px;
  border-left: 2.5px solid var(--primary);
  border-bottom: 2.5px solid var(--primary);
  transform: rotate(-45deg);
}

/* ---------- Note / callout ---------- */

.note {
  background: var(--warning-soft);
  border-left: 3px solid var(--warning-line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 16px;
  max-width: var(--maxw-text);
  margin: 0 auto;
}

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

.info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: var(--maxw-text);
  margin: 0 auto;
  box-shadow: var(--shadow);
}

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

/* ---------- FAQ ---------- */

.faq { max-width: var(--maxw-text); margin: 0 auto; }

.faq h2.group {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 36px 0 14px;
  text-align: left;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 17px 20px;
  margin-bottom: 10px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

summary::-webkit-details-marker { display: none; }

.chev {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}

details[open] .chev { transform: rotate(-135deg) translateY(-2px); }

details p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Contact form ---------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  max-width: 620px;
  margin: 0 auto;
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 7px;
}

.field .hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  min-height: 48px;
}

textarea { resize: vertical; min-height: 140px; line-height: 1.6; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: transparent;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: #d64545; }

.error-text {
  display: none;
  color: #d64545;
  font-size: 14px;
  margin-top: 6px;
}

.field.invalid .error-text { display: block; }

@media (prefers-color-scheme: dark) {
  .error-text, .field.invalid input { color: #ff7a7a; }
  .field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #ff7a7a; }
}

.form-card .cta { width: 100%; }

.form-status {
  margin-top: 18px;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

.form-status.success {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.form-status.error {
  background: var(--warning-soft);
  border-left: 3px solid var(--warning-line);
}

@media (prefers-color-scheme: dark) {
  .form-status.success { color: var(--primary); }
}

/* Honeypot: a real person never sees or fills this. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Legal / long-form pages ---------- */

.legal { max-width: var(--maxw-text); padding-bottom: 56px; }

.legal h1 {
  font-size: clamp(32px, 5.5vw, 44px);
  text-align: left;
  margin-bottom: 8px;
}

.legal .updated {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 36px;
}

.legal h2 {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 38px 0 12px;
  text-align: left;
  text-transform: none;
}

.legal ul { padding-left: 22px; margin: 0 0 16px; }
.legal li { margin-bottom: 8px; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 44px 0 56px;
  font-size: 15px;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.4fr 1fr 1fr;
  margin-bottom: 36px;
}

@media (max-width: 640px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

.footer-brand .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  margin-bottom: 10px;
}

.footer-brand .brand img { width: 28px; height: 28px; border-radius: 7px; }

.footer-brand p { font-size: 15px; margin: 0; max-width: 32ch; }

footer h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 12px;
}

footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 9px; }
footer a { text-decoration: none; color: var(--muted); }
footer a:hover { color: var(--text); text-decoration: underline; }

.footer-base {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  font-size: 14px;
}
