/* foodsense website: light and dark follow the browser (prefers-color-scheme). Colors come from the app's design
   tokens (indigo accent, violet severity ramp). System fonts only: no requests to any other site. */

:root {
  color-scheme: light dark;
  --bg: #F6F5FB;
  --bg-alt: #ECEAF7;
  --surface: #FFFFFF;
  --surface-2: #F2F1F9;
  --text: #1C1C1E;
  --text-2: #55555F;
  --line: rgba(28, 28, 50, 0.10);
  --accent: #5A4BCA;
  --accent-strong: #33278A;
  --accent-soft: #E7E3FF;
  --on-accent: #FFFFFF;
  --sev-1: #BCABF1; --sev-2: #9F85E5; --sev-3: #7C58CA; --sev-4: #613EA6; --sev-5: #482880;
  --glow-1: rgba(100, 85, 209, 0.28);
  --glow-2: rgba(207, 198, 255, 0.55);
  --shadow: 0 1px 2px rgba(30, 20, 80, 0.06), 0 12px 32px rgba(30, 20, 80, 0.10);
  --phone-shadow: 0 30px 60px rgba(40, 25, 110, 0.22), 0 8px 20px rgba(40, 25, 110, 0.12);
  --radius: 22px;
  --wrap: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0E12;
    --bg-alt: #15141C;
    --surface: #1C1B23;
    --surface-2: #24232D;
    --text: #F2F2F7;
    --text-2: #A8A8B3;
    --line: rgba(255, 255, 255, 0.09);
    --accent: #B4AAFF;
    --accent-strong: #D7D0FF;
    --accent-soft: #272148;
    --on-accent: #171042;
    --sev-1: #6246A0; --sev-2: #7C58CA; --sev-3: #9D80E7; --sev-4: #B9A6F3; --sev-5: #D7CCFE;
    --glow-1: rgba(100, 85, 209, 0.35);
    --glow-2: rgba(72, 40, 128, 0.45);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
    --phone-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left)); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 10px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 500; padding: 6px 12px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* Type */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 0.5em; }
h1 { font-size: clamp(40px, 6.4vw, 72px); font-weight: 800; }
h2 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 750; }
h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--text-2); max-width: 36em; }
.muted { color: var(--text-2); }
.gradient-text {
  background: linear-gradient(100deg, #6455D1 0%, #8E6FE0 45%, #33278A 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-color-scheme: dark) {
  .gradient-text { background-image: linear-gradient(100deg, #CFC6FF 0%, #B4AAFF 45%, #8E7BFF 100%); }
}

/* Buttons */
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 650; font-size: 16px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.button.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 24px var(--glow-1); }
.button.primary:hover { color: var(--on-accent); transform: translateY(-1px); }
.button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.button.secondary:hover { color: var(--text); transform: translateY(-1px); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 14px; font-weight: 600;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }

/* Hero */
.hero { position: relative; padding-block: clamp(48px, 8vw, 96px) clamp(40px, 6vw, 80px); isolation: isolate; }
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); pointer-events: none;
}
.hero::before { width: 560px; height: 560px; right: -120px; top: -80px; background: var(--glow-1); }
.hero::after { width: 460px; height: 460px; left: -160px; bottom: -120px; background: var(--glow-2); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero .pill { margin-bottom: 22px; }
.hero-note { font-size: 14px; color: var(--text-2); margin-top: 16px; }

.phones { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 520px; }
.phone {
  margin: 0; width: min(270px, 44vw); border-radius: 40px; padding: 9px;
  background: linear-gradient(160deg, #2B2A33, #0B0B0F);
  box-shadow: var(--phone-shadow);
}
.phone img { border-radius: 32px; width: 100%; aspect-ratio: 1206 / 2622; object-fit: cover; background: var(--surface-2); }
.phones .phone:nth-child(1) { transform: rotate(-5deg) translate(28px, 14px); z-index: 1; }
.phones .phone:nth-child(2) { transform: rotate(4deg) translate(-28px, -24px); z-index: 2; }

/* Floating insight card in the hero */
.float-card {
  position: absolute; z-index: 3; left: 50%; bottom: -14px; transform: translateX(-62%);
  width: min(320px, 86vw); background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow);
}
.float-card .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.float-card strong { font-size: 16px; }
.float-card p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.meter { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; font-weight: 650; color: var(--accent); }
.meter i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.meter i.off { background: transparent; border: 1.5px solid var(--accent); }

/* Sections */
section { scroll-margin-top: 72px; }
.section { padding-block: clamp(64px, 9vw, 120px); }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lede { margin-inline: auto; }

/* Problem / promise strip */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.stat .big { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 8px; }
.stat p { margin: 0; color: var(--text-2); font-size: 16px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px 26px; box-shadow: var(--shadow); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 18px;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 18px;
}
.step p { color: var(--text-2); margin: 0; font-size: 16px; }

/* Feature rows */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.feature + .feature { margin-top: clamp(72px, 10vw, 128px); }
.feature.flip .feature-media { order: -1; }
.feature-media { display: flex; justify-content: center; gap: 20px; position: relative; isolation: isolate; }
.feature-media::before {
  content: ""; position: absolute; inset: 10% 8%; z-index: -1; border-radius: 40%;
  background: radial-gradient(closest-side, var(--glow-1), transparent); filter: blur(30px);
}
.feature-media .phone { width: min(260px, 42vw); }
.feature-media .phone.small { width: min(220px, 36vw); margin-top: 48px; }
/* A PDF page from the Insights report: always white paper, like the PDF itself. */
.paper { margin: 0; width: min(300px, 46vw); align-self: center; }
.paper img { width: 100%; aspect-ratio: 1275 / 1650; border-radius: 6px; background: #FFFFFF; box-shadow: var(--phone-shadow); }
.paper.back { width: min(250px, 38vw); margin-top: 56px; transform: rotate(3deg); }
.guide-step .shots .paper { width: min(260px, 42vw); }
.feature ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.feature li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--text-2); }
.feature li::before {
  content: ""; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%235A4BCA' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
@media (prefers-color-scheme: dark) {
  .feature li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23B4AAFF' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
.feature li strong { color: var(--text); font-weight: 650; }

/* Example pattern card (HTML, not a screenshot) */
.example {
  margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow);
}
.example .title { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-weight: 700; margin-bottom: 10px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; align-items: center; font-size: 14px; color: var(--text-2); }
.dots { display: flex; flex-wrap: wrap; gap: 4px; }
.dots span { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.dots span.on { background: var(--sev-4); border-color: transparent; }
.example small { display: block; margin-top: 12px; color: var(--text-2); font-size: 13px; }

/* Severity ramp chip row */
.ramp { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.ramp span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-weight: 700; font-size: 15px; }
/* The severity squares always run light to dark, 1 to 5, as the app shows them in light mode: the app's dark mode
   reverses its ramp for contrast, which reads as backwards on a page beside light-mode screenshots. */
.ramp span:nth-child(1) { background: #BCABF1; color: #1C1C1E; }
.ramp span:nth-child(2) { background: #9F85E5; color: #1C1C1E; }
.ramp span:nth-child(3) { background: #7C58CA; color: #FFFFFF; }
.ramp span:nth-child(4) { background: #613EA6; color: #FFFFFF; }
.ramp span:nth-child(5) { background: #482880; color: #FFFFFF; }
/* Card grid */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card p { color: var(--text-2); margin: 0; font-size: 16px; }
.icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent);
}
.icon svg { width: 24px; height: 24px; }

/* Gallery */
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(240px, 62vw); gap: 22px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 4px 28px; margin-inline: -4px;
  scrollbar-width: thin;
}
.gallery figure { margin: 0; scroll-snap-align: start; }
.gallery .phone { width: 100%; }
.gallery figcaption { text-align: center; margin-top: 14px; font-size: 15px; font-weight: 600; }
.gallery figcaption span { display: block; font-weight: 400; color: var(--text-2); font-size: 14px; }

/* Privacy band */
.privacy {
  background: linear-gradient(150deg, #6455D1 0%, #4A3DB0 50%, #33278A 100%);
  color: #FFFFFF; border-radius: 32px; padding: clamp(32px, 6vw, 64px); position: relative; overflow: hidden;
}
.privacy::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -200px; border-radius: 50%;
  border: 26px solid rgba(255, 255, 255, 0.12);
}
.privacy h2, .privacy h3 { color: #FFFFFF; }
.privacy .eyebrow { color: #CFC6FF; }
.privacy .lede { color: rgba(255, 255, 255, 0.86); }
.privacy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 40px; margin-top: 32px; position: relative; z-index: 1; }
.privacy-grid div { border-top: 1px solid rgba(255, 255, 255, 0.22); padding-top: 16px; }
.privacy-grid p { color: rgba(255, 255, 255, 0.82); margin: 0; font-size: 16px; }
.privacy-grid h3 { font-size: 18px; margin-bottom: 6px; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 22px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 650; padding: 16px 30px 16px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 2px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { color: var(--text-2); margin: 0 0 16px; }

/* Closing CTA */
.closing { text-align: center; }
.closing img.app-icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 24px; box-shadow: 0 16px 40px var(--glow-1); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 36px 48px; font-size: 14px; color: var(--text-2); }
.foot .wrap { display: grid; gap: 14px; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot nav a { color: var(--text-2); }
.disclaimer { max-width: 60em; }

/* Guide and support pages */
.page-hero { padding-block: clamp(48px, 7vw, 88px) 24px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.toc a { text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 15px; font-weight: 550; }
.toc a:hover { border-color: var(--accent); color: var(--accent); }
.guide-step { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding-block: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.guide-step:first-of-type { border-top: 0; }
.guide-step .shots { display: flex; gap: 16px; justify-content: center; }
.guide-step .shots .phone { width: min(230px, 40vw); }
.guide-step ol, .guide-step ul { padding-left: 1.2em; color: var(--text-2); }
.guide-step li { margin-bottom: 8px; }
.guide-step li strong { color: var(--text); }
.tip { background: var(--accent-soft); color: var(--text); border-radius: 14px; padding: 14px 18px; font-size: 15px; margin-top: 18px; }
.tip strong { color: var(--accent-strong); }
.support-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 8px; }
.mail { font-size: clamp(20px, 3vw, 28px); font-weight: 700; word-break: break-all; }

/* Reveal on scroll (only when JS runs and motion is allowed) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .button { transition: none; }
}

/* Responsive */
@media (max-width: 920px) {
  .hero-grid, .feature, .guide-step { grid-template-columns: 1fr; }
  .feature.flip .feature-media { order: 0; }
  .feature-media { order: 2; }
  .hero-grid > div:first-child { text-align: left; }
  .phones { min-height: 0; margin-top: 16px; padding-bottom: 60px; }
  .stats, .steps, .cards { grid-template-columns: 1fr; }
  .privacy-grid, .support-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav a { padding: 6px 9px; font-size: 14px; }
  .phones .phone:nth-child(1) { transform: rotate(-5deg) translate(16px, 10px); }
  .phones .phone:nth-child(2) { transform: rotate(4deg) translate(-16px, -16px); }
  .float-card { transform: translateX(-50%); }
  .feature-media .phone.small, .feature-media .paper.back { display: none; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
}

/* Grid children may shrink below their content's width (keeps phones and the gallery inside narrow screens). */
.hero-grid > *, .feature > *, .guide-step > *, .stats > *, .steps > *, .cards > *, .support-grid > * { min-width: 0; }
@media (max-width: 920px) {
  .hero-grid, .feature, .guide-step, .stats, .steps, .cards, .privacy-grid, .support-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding-bottom: clamp(56px, 8vw, 96px); }
.legal h2 { font-size: clamp(22px, 2.6vw, 28px); margin-top: 2em; }
.legal h3 { font-size: 18px; margin-top: 1.5em; }
.legal p, .legal li { color: var(--text-2); }
.legal strong { color: var(--text); }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }
.legal .caps { font-size: 15px; letter-spacing: 0.01em; }
.draft {
  display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 32px; padding: 16px 18px; border-radius: 16px;
  background: var(--accent-soft); color: var(--text); font-size: 15px; line-height: 1.5;
}
.draft strong { color: var(--accent-strong); }
.ph { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 6px; padding: 0 6px; font-style: normal; white-space: nowrap; }
.legal-list { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; }
.legal-list a { text-decoration: none; color: var(--text); }
.legal-list a:hover h3 { color: var(--accent); }
@media (max-width: 920px) { .legal-list { grid-template-columns: minmax(0, 1fr); } }
.legal-hero .wrap > * { max-width: 760px; margin-inline: auto; }
.legal-hero .wrap > .legal-list { max-width: none; }
.legal-hero .eyebrow { display: flex; }
