/* spoil waitlist: the app's "calm" design system (DESIGN.md) on the web.
   Light sage canvas, white cards with one soft shadow, one brand green,
   Plus Jakarta Sans, pill buttons. Mobile first; the column caps at 480px. */

:root {
  --green: #2E7D64;
  --green-dark: #27634F;
  --forest: #1F3A33;
  --green-light: #A7D7C5;
  --mint: #E4F1EA;
  --canvas: #F4F6F2;
  --card: #FFFFFF;
  --ink: #1B2B2A;
  --ink-soft: #6B7C7A;
  --ink-muted: #9BA8A5;
  --line: #E1E7E2;
  --line-soft: #EDF1EE;
  --orange: #E08A3C;
  --orange-light: #FAEBDD;
  --spoiled: #C94F3D;
  --spoiled-light: #F7E2DE;
  --sun: #F2B63A;
  --sun-light: #FFF6DC;
  --pit: #8A5A34;
  --shadow-3: 0 2px 9px rgba(27, 43, 42, 0.06), 0 1px 2px rgba(27, 43, 42, 0.04);
  --shadow-10: 0 6px 30px rgba(27, 43, 42, 0.10), 0 1px 3px rgba(27, 43, 42, 0.05);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--green); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { display: block; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 20px 0;
  max-width: 520px;
  margin: 0 auto;
}
.top-brand { display: block; text-decoration: none; }
.wordmark { width: 108px; height: auto; }
.wm-letter { fill: var(--forest); }
.wm-ring { stroke: var(--green); }
.wm-slice { stroke: var(--orange); }
.wm-leaf { fill: var(--green); transform-origin: 54px 25px; }
.wm-hand { stroke: var(--ink); }
.wm-pit { fill: var(--pit); }
.wm-hands { transform-origin: 50px 52px; }
.top-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-3);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-dark);
}
.top-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(46, 125, 100, 0.18); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
main { max-width: 520px; margin: 0 auto; padding: 0 16px 32px; }
.hero { position: relative; padding-top: 18px; }
.hero-art {
  position: absolute;
  inset: -70px -50vw auto;
  height: 460px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 30%;
  display: block;
  opacity: 0.95;
}
.hero-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(244, 246, 242, 0.35) 0%, rgba(244, 246, 242, 0.05) 30%, rgba(244, 246, 242, 0.55) 62%, var(--canvas) 100%);
}
.hero-copy { padding: 150px 4px 0; }
h1 {
  font-size: clamp(34px, 9.5vw, 42px);
  line-height: 1.08;
  font-weight: 800;
  color: var(--forest);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.lede {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 34ch;
}

/* The freshness shelf: four foods on a glass shelf, each with the app's timer ring. */
.shelf { position: relative; margin-top: 22px; padding: 18px 6px 8px; }
.shelf-glass {
  position: absolute;
  left: 0; right: 0; top: 52%;
  height: 46%;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(228, 241, 234, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-3);
}
.tiles { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; animation: float 5.5s ease-in-out infinite; animation-delay: calc(var(--i) * -1.3s); }
.tile b { font-size: 12px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.ring { position: relative; width: 70px; height: 70px; display: grid; place-items: center; }
.ring > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; stroke: var(--line-soft); }
.ring circle.arc {
  stroke: var(--ring);
  stroke-linecap: round;
  stroke-dasharray: 132;
  stroke-dashoffset: calc(132 - 132 * var(--left));
  animation: sweep 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(0.25s + var(--i) * 0.12s);
}
.ring .food { width: 42px; height: 42px; filter: drop-shadow(0 4px 4px rgba(27, 43, 42, 0.12)); }
.pill { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; font-style: normal; white-space: nowrap; }
.pill-fresh { background: var(--mint); color: var(--green-dark); }
.pill-soon { background: var(--orange-light); color: #9A5A1F; }
.pill-now { background: var(--spoiled-light); color: #8E3529; }
.shelf-note { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-soft); }

@keyframes sweep { from { stroke-dashoffset: 132; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-10);
  padding: 24px 20px;
  margin-top: 18px;
}
.signup h2 { font-size: 24px; line-height: 1.2; font-weight: 800; color: var(--forest); }
.sub { margin-top: 8px; color: var(--ink-soft); font-size: 14.5px; }
.offer { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--sun-light); color: #7A5410; font-size: 13.5px; font-weight: 600; }
.state { animation: rise 0.35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Sign-in providers */
.oauth { margin-top: 18px; }
.google-button { display: flex; justify-content: center; min-height: 44px; }
.google-button > div { width: 100% !important; }
.apple-button { margin-top: 10px; }
.hint { margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; color: var(--ink-muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Fields */
.field { display: block; margin-top: 14px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 0 0 6px 4px; }
input[type="email"], textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 15px 16px;
  font-size: 16px; /* no iOS zoom */
  line-height: 1.3;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 92px; font-size: 15px; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(46, 125, 100, 0.14); }
input::placeholder, textarea::placeholder { color: var(--ink-muted); }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.turnstile { margin-top: 12px; display: flex; justify-content: center; }
.turnstile:empty { margin: 0; }
.turnstile iframe { max-width: 100%; }

/* Buttons: pills, 54px, with a 2px sink on press. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, background-color 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(2px) scale(0.985); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { margin-top: 14px; background: var(--green); color: #fff; box-shadow: 0 6px 18px rgba(46, 125, 100, 0.28); }
.btn-primary:hover { background: var(--green-dark); }
.btn-dark { margin-top: 18px; background: var(--forest); color: #fff; box-shadow: 0 6px 18px rgba(31, 58, 51, 0.25); }
.btn-ghost { margin-top: 8px; background: transparent; color: var(--green-dark); min-height: 46px; }
.btn-ghost:hover { background: var(--mint); }
.btn-danger { margin-top: 16px; background: var(--spoiled); color: #fff; }
.btn-dev { margin-top: 0; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); min-height: 50px; }
.btn-dev:hover { background: var(--line-soft); }

.error { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--spoiled-light); color: #8E3529; font-size: 13.5px; font-weight: 600; }
.privacy { margin-top: 16px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); text-align: center; }
.privacy a { color: var(--green-dark); font-weight: 600; }

/* Thanks */
.check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  display: grid; place-items: center;
  margin-bottom: 14px;
  animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.check svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--mint); border-top-color: var(--green); animation: spin 0.8s linear infinite; margin-bottom: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.questions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.q-intro { font-weight: 600; color: var(--ink); }
.q { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.q legend, .q-label { display: block; padding: 0; margin-bottom: 10px; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.chip input:checked + span { background: var(--forest); border-color: var(--forest); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(46, 125, 100, 0.2); }
.chip:active span { transform: scale(0.97); }
.counter { display: block; margin-top: 6px; text-align: right; font-size: 12px; color: var(--ink-muted); }
.actions { margin-top: 6px; }

/* ── Features ────────────────────────────────────────────────────────────── */
.features { margin-top: 28px; padding: 0 4px; }
.features h2 { font-size: 20px; font-weight: 800; color: var(--forest); }
.features ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.features li { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius-lg); padding: 12px 14px; box-shadow: var(--shadow-3); font-size: 14px; color: var(--ink-soft); }
.features li b { color: var(--ink); font-weight: 700; }
.well { flex: none; width: 42px; height: 42px; border-radius: 14px; background: var(--mint); color: var(--green); display: grid; place-items: center; }
.well svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pantry-row { display: flex; justify-content: center; gap: 18px; margin-top: 22px; }
.pantry-row svg { width: 44px; height: 44px; filter: drop-shadow(0 4px 4px rgba(27, 43, 42, 0.12)); animation: float 6s ease-in-out infinite; }
.pantry-row svg:nth-child(2) { animation-delay: -1.5s; }
.pantry-row svg:nth-child(3) { animation-delay: -3s; }
.pantry-row svg:nth-child(4) { animation-delay: -4.5s; }
.cta-joined { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; min-height: 54px; border-radius: 999px; background: var(--mint); color: var(--green-dark); font-weight: 700; font-size: 16px; }
.cta-joined svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.foot { max-width: 520px; margin: 0 auto; padding: 8px 20px calc(28px + env(safe-area-inset-bottom)); text-align: center; color: var(--ink-soft); font-size: 13px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 10px 0; }
.foot nav a { color: var(--green-dark); font-weight: 600; text-decoration: none; }
.foot nav a:hover { text-decoration: underline; }
.foot .copy { color: var(--ink-muted); font-size: 12px; }

/* ── Legal pages ─────────────────────────────────────────────────────────── */
.legal { max-width: 640px; margin: 0 auto; padding: 8px 20px 48px; }
.legal h1 { font-size: 30px; margin-top: 20px; }
.legal h2 { font-size: 18px; margin-top: 26px; color: var(--forest); }
.legal p, .legal li { margin-top: 8px; color: var(--ink); font-size: 15px; }
.legal ul { padding-left: 20px; }
.legal .muted { color: var(--ink-soft); font-size: 13.5px; }
.legal .box { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--mint); }

/* ── Wider screens ───────────────────────────────────────────────────────── */
@media (min-width: 720px) {
  .hero-art { height: 520px; inset: -80px -50vw auto; }
  .hero-art img { object-position: 60% 35%; }
  .hero-copy { padding-top: 170px; }
  .card { padding: 28px 28px; }
  .wordmark { width: 120px; }
}

/* ── Motion ──────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .wm-hands { animation: tick 60s linear infinite; }
  .wm-leaf { animation: sway 4.5s ease-in-out infinite; }
}
@keyframes tick { to { transform: rotate(360deg); } }
@keyframes sway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-7deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
