/* NutriPixel marketing site.
   Signature element: the scan frame (the logo's corner brackets) locking onto food.
   It appears in the hero and around the tester sign-up; everything else stays quiet. */

:root {
  --ink: #0f3d24;        /* leaf ink: text and deep bands */
  --canopy: #137a43;     /* primary green */
  --canopy-600: #0e6337;
  --lime: #9bd63a;       /* logo highlight */
  --lime-soft: #e3f4c7;
  --saffron: #ff9a2e;    /* the app's saffron accent: tester CTAs only */
  --saffron-600: #e57d0c;
  --sprout: #f2f7ee;     /* page background */
  --chalk: #ffffff;
  --muted: #4d6b58;
  --line: #d5e3cf;
  --danger: #b3261e;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Onest", "Segoe UI", system-ui, sans-serif;

  /* Modular scale, ratio 1.25 on an 18px body */
  --step--1: 0.889rem;
  --step-0: 1.125rem;
  --step-1: 1.406rem;
  --step-2: 1.758rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.75rem);
  --step-4: clamp(2.6rem, 1.6rem + 3.8vw, 4.6rem);

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--sprout);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--canopy); text-underline-offset: 3px; }
a:hover { color: var(--canopy-600); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); font-weight: 750; }
h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--chalk); padding: 8px 14px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 2px solid transparent;
  font: 650 1rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-tester { background: var(--saffron); color: #2b1600; }
.btn-tester:hover { background: var(--saffron-600); color: #1d0e00; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--sprout); }
.btn-green { background: var(--canopy); color: var(--chalk); }
.btn-green:hover { background: var(--canopy-600); color: var(--chalk); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--sprout) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 800 1.3rem/1 var(--font-display); letter-spacing: -0.02em; }
.brand img { width: 34px; height: auto; }
.nav-links { display: flex; gap: 26px; margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 550; font-size: 1rem; }
.nav-links a:hover { color: var(--canopy); }
.nav .btn { min-height: 44px; padding: 0 20px; font-size: .95rem; }
@media (max-width: 860px) { .nav-links { display: none; } .nav .btn { margin-left: auto; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(36px, 6vw, 80px) 0 clamp(56px, 8vw, 110px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.035em; line-height: .98; }
.hero h1 span { display: block; }
.hero h1 span + span { color: var(--canopy); }
.hero-lede { margin-top: 26px; font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); color: var(--muted); max-width: 34ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-note { margin-top: 22px; font-size: var(--step--1); color: var(--muted); display: flex; gap: 10px; align-items: center; }
.hero-note .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 4px color-mix(in srgb, var(--saffron) 25%, transparent); flex: none; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* The scan stage */
.scan { position: relative; margin: 0; }
.scan-photo { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 632 / 500; background: #6b4a2e; box-shadow: 0 30px 60px -30px rgba(15, 61, 36, .55); }
.scan-photo img { width: 100%; height: 100%; object-fit: cover; }
.scan-photo::after { /* scan sweep */
  content: ""; position: absolute; left: 0; right: 0; height: 36%; top: -36%;
  background: linear-gradient(180deg, transparent, rgba(155, 214, 58, .38) 85%, rgba(226, 255, 170, .9));
  mix-blend-mode: screen; animation: sweep 1.4s .3s cubic-bezier(.5, 0, .3, 1) forwards;
}
@keyframes sweep { to { top: 100%; } }

.tag {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px; border-radius: 999px; background: var(--chalk); color: var(--ink);
  font-size: .82rem; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(6px) scale(.96);
  animation: tag-in .35s cubic-bezier(.2, .8, .2, 1.2) forwards;
}
.tag::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--canopy); flex: none; }
.tag b { font-weight: 750; color: var(--canopy); }
.tag-1 { left: 30%; top: 12%; animation-delay: 1.35s; }
.tag-2 { right: 3%; top: 38%; animation-delay: 1.55s; }
.tag-3 { left: 4%; top: 49%; animation-delay: 1.75s; }
.tag-4 { left: 30%; top: 63%; animation-delay: 1.95s; }
@keyframes tag-in { to { opacity: 1; transform: none; } }

.result {
  position: absolute; right: -14px; bottom: -34px; width: min(290px, 78%);
  background: var(--ink); color: var(--sprout); border-radius: 20px; padding: 18px 20px 20px;
  box-shadow: 0 24px 40px -20px rgba(15, 61, 36, .7);
  opacity: 0; transform: translateY(12px); animation: tag-in .45s 2.35s cubic-bezier(.2, .8, .2, 1) forwards;
}
.result-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.result-label { font-size: .85rem; color: #b9d3bf; }
.result-kcal { font: 800 2rem/1 var(--font-display); letter-spacing: -0.02em; }
.result-kcal small { font-size: .95rem; font-weight: 600; margin-left: 4px; color: #b9d3bf; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.macro { font-size: .78rem; color: #b9d3bf; }
.macro strong { display: block; color: var(--sprout); font-size: .95rem; }
.macro i { display: block; height: 5px; border-radius: 3px; margin-top: 6px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.macro i::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--c); border-radius: inherit; }
@media (max-width: 560px) {
  /* On phones the card sits under the photo instead of covering the food. */
  .result { position: relative; right: auto; bottom: auto; width: auto; margin: -22px 10px 0 10px; }
  .tag { font-size: .74rem; }
  .tag-2 { top: 34%; }
}

/* Corner brackets, shared by the hero stage and the tester form */
.corners { position: absolute; inset: -12px; pointer-events: none; }
.corners i { position: absolute; width: 38px; height: 38px; border: 5px solid var(--canopy); }
.corners i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.corners i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 16px; }
.corners i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 16px; }
.corners i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.scan .corners { animation: lock .5s 1.1s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes lock { from { inset: -34px; opacity: 0; } to { inset: -12px; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head p { margin-top: 16px; color: var(--muted); font-size: 1.15rem; }

/* How it works: a real sequence, so it is numbered */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 22px; }
.steps li::before { content: counter(step); display: block; font: 800 3.4rem/1 var(--font-display); color: var(--canopy); margin-bottom: 14px; letter-spacing: -0.04em; }
.steps p { margin-top: 10px; color: var(--muted); }
.steps q { color: var(--ink); font-style: italic; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* Features: mixed-size tiles, each shows the thing rather than an icon */
.features { background: var(--chalk); border-radius: clamp(28px, 4vw, 48px); margin: 0 clamp(8px, 2vw, 24px); }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.tile { background: var(--sprout); border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 32px); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tile p { color: var(--muted); font-size: 1.02rem; }
.tile-ring { grid-column: span 3; grid-row: span 2; background: var(--ink); color: var(--sprout); }
.tile-ring p { color: #b9d3bf; }
.tile-type { grid-column: span 3; }
.tile-streak { grid-column: span 3; background: var(--lime-soft); }
.tile-progress { grid-column: span 2; }
.tile-water { grid-column: span 2; }
.tile-private { grid-column: span 2; background: var(--lime-soft); }
.tile-recipes { grid-column: span 3; }
.tile-remind { grid-column: span 3; }
@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento .tile { grid-column: span 1; grid-row: auto; }
  .bento .tile-ring, .bento .tile-type { grid-column: span 2; }
}
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .bento .tile, .bento .tile-ring, .bento .tile-type { grid-column: auto; } }

.ring-visual { display: flex; align-items: center; gap: 28px; margin-top: auto; padding-top: 18px; flex-wrap: wrap; }
.ring-visual svg { width: 170px; height: 170px; flex: none; }
.ring-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: .95rem; }
.ring-legend li { display: flex; align-items: center; gap: 10px; }
.ring-legend span { width: 12px; height: 12px; border-radius: 4px; flex: none; }

.typed { background: var(--chalk); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; font-size: .98rem; }
.typed-input { color: var(--ink); font-weight: 550; }
.typed-input::after { content: ""; display: inline-block; width: 2px; height: 1.1em; background: var(--canopy); vertical-align: -3px; margin-left: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.typed-out { list-style: none; padding: 10px 0 0; margin: 10px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 4px; font-size: .92rem; color: var(--muted); }
.typed-out li { display: flex; justify-content: space-between; gap: 12px; }
.typed-out b { color: var(--ink); font-weight: 650; }

.streak-row { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.streak-num { font: 800 3.6rem/1 var(--font-display); letter-spacing: -0.04em; color: var(--ink); }
.streak-num small { font-size: 1rem; font-weight: 650; letter-spacing: 0; margin-left: 6px; color: var(--muted); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.badges li { background: var(--chalk); border-radius: 999px; padding: 6px 12px 6px 8px; font-size: .88rem; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.badges li.locked { opacity: .5; }

.spark { width: 100%; height: 70px; margin-top: auto; }
.glasses { display: flex; gap: 6px; margin-top: auto; }
.glasses i { width: 22px; height: 30px; border: 2px solid var(--canopy); border-top: 0; border-radius: 0 0 6px 6px; position: relative; overflow: hidden; }
.glasses i.full::after { content: ""; position: absolute; inset: 35% 0 0; background: #5fb0e0; }

/* ---------- Plans ---------- */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 920px; }
.plan { border-radius: var(--radius-lg); padding: clamp(26px, 3.5vw, 40px); background: var(--chalk); border: 1px solid var(--line); display: flex; flex-direction: column; }
.plan-pro { background: var(--canopy); color: var(--chalk); border-color: var(--canopy); position: relative; overflow: hidden; }
.plan-pro::after { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -90px; background: url("../img/logo-128.png") center / 70% no-repeat; opacity: .12; transform: rotate(-12deg); }
.plan h3 { font-size: var(--step-2); }
.plan-price { margin-top: 8px; font-size: 1rem; color: var(--muted); }
.plan-pro .plan-price { color: #cfe8d6; }
.plan ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.plan li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.plan li svg { margin-top: 4px; }
.plan li.no { color: var(--muted); }
.plan-foot { margin-top: auto; padding-top: 28px; font-size: .95rem; color: var(--muted); }
.plan-pro .plan-foot { color: #cfe8d6; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }

/* ---------- Closed testing ---------- */
.testers { background: var(--ink); color: var(--sprout); }
.testers h2 { color: var(--chalk); }
.testers .section-head p { color: #b9d3bf; }
.testers-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(36px, 6vw, 80px); align-items: start; }
.perks { list-style: none; padding: 0; margin: 0 0 36px; display: grid; gap: 22px; }
.perks li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; }
.perk-mark { width: 52px; height: 52px; border-radius: 16px; background: rgba(155, 214, 58, .14); display: grid; place-items: center; color: var(--lime); font: 800 1.05rem/1 var(--font-display); }
.perks strong { display: block; color: var(--chalk); font-size: 1.12rem; font-family: var(--font-display); font-weight: 700; }
.perks span { color: #b9d3bf; font-size: 1rem; }
.join-steps { counter-reset: j; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.join-steps li { counter-increment: j; display: grid; grid-template-columns: 30px 1fr; gap: 12px; color: #cfe8d6; font-size: 1rem; }
.join-steps li::before { content: counter(j); width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--lime); color: var(--lime); display: grid; place-items: center; font-weight: 750; font-size: .85rem; }
.join-title { font: 700 1.1rem/1.3 var(--font-display); color: var(--chalk); margin-bottom: 14px; }

.form-shell { position: relative; }
.form-shell .corners i { border-color: var(--lime); }
.form-card { background: var(--chalk); color: var(--ink); border-radius: 22px; padding: clamp(24px, 3.5vw, 40px); }
.form-card h3 { font-size: var(--step-2); }
.form-card > p { margin-top: 8px; color: var(--muted); font-size: 1rem; }
.field { display: grid; gap: 6px; margin-top: 18px; }
.field label, .field legend { font-weight: 650; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--sprout);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 13px 14px; min-height: 50px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--canopy); box-shadow: 0 0 0 3px rgba(19, 122, 67, .18); background: var(--chalk); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; margin-top: 20px; font-size: .92rem; color: var(--muted); align-items: start; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--canopy); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-card .btn { width: 100%; margin-top: 24px; }
.form-error { margin-top: 14px; color: var(--danger); font-weight: 600; font-size: .95rem; min-height: 1.4em; }
.form-done { display: none; }
.form-card.done form { display: none; }
.form-card.done .form-done { display: block; }
.done-steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; counter-reset: d; }
.done-steps li { counter-increment: d; background: var(--sprout); border-radius: var(--radius-md); padding: 16px 18px; display: grid; gap: 10px; }
.done-steps li > span::before { content: "Step " counter(d) ": "; font-weight: 750; color: var(--canopy); }
.done-steps .btn { width: auto; margin-top: 0; min-height: 44px; justify-self: start; }
@media (max-width: 900px) { .testers-grid { grid-template-columns: 1fr; } }

/* choice chips (feedback) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: .95rem; background: var(--sprout); }
.chips input:checked + span { background: var(--canopy); border-color: var(--canopy); color: var(--chalk); }
.chips input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: 2px; }
.stars { direction: rtl; display: inline-flex; gap: 4px; border: 0; padding: 0; margin: 0; }
.stars input { position: absolute; opacity: 0; }
.stars label { font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--saffron); }
.stars input:focus-visible + label { outline: 3px solid var(--saffron); border-radius: 4px; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
.faq details { border-top: 1.5px solid var(--line); }
.faq details:last-child { border-bottom: 1.5px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 22px 44px 22px 0; position: relative; font: 700 1.2rem/1.35 var(--font-display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; border-right: 3px solid var(--canopy); border-bottom: 3px solid var(--canopy); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 68ch; }

/* ---------- Footer ---------- */
.site-footer { padding: 56px 0 44px; border-top: 1px solid var(--line); font-size: .95rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: flex-start; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 28px; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--ink); text-decoration: none; font-weight: 550; }
.footer-links a:hover { color: var(--canopy); }
.site-footer .brand { font-size: 1.1rem; }
.site-footer p { margin-top: 10px; max-width: 42ch; }

/* ---------- Simple pages (feedback, privacy, admin) ---------- */
.page { padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 8vw, 100px); }
.page h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.03em; }
.page-lede { margin-top: 14px; color: var(--muted); max-width: 60ch; font-size: 1.12rem; }
.page .form-card { max-width: 680px; margin-top: 36px; border: 1px solid var(--line); }
.prose { max-width: 70ch; margin-top: 28px; }
.prose h2 { font-size: var(--step-1); margin: 36px 0 10px; }
.prose p, .prose li { color: #294a37; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 1.2em; }
