/* ToxFree — marketing + legal site. Same palette as the app (src/theme/colors.ts):
   deep green header blocks with cream text, cream ground, clay-brown second accent, muted verdict
   colours. Flat surfaces, hairline borders, no gradients or glows. Dependency-free. */
:root {
  --cream: #f6f2e7;
  --paper: #fffdf8;
  --card: #fffdf8;
  --ink: #2a3228;
  --ink-soft: #5f665b;
  --ink-faint: #676d62;
  --line: #e4dccb;
  --line-strong: #d3c9b4;
  --green: #5b6e57;
  --green-deep: #46563f;
  --sage: #a5b2a0;
  --sage-soft: #dde3d6;
  --on-green: #f6f2e7;
  --on-green-soft: #d9ddd0;
  --clay: #9c6b44;
  --clay-ink: #7e5334;
  --clean: #5b6e57;
  --mixed: #8c682c;
  --avoid: #a04e35;
  --flag-bg: #f3e6dc;
  --flag-ink: #8a4530;
  --radius: 20px;
  --maxw: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
img { max-width: 100%; display: block; }
a { color: var(--green-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: 0; z-index: 30;
  background: rgba(246, 242, 231, 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--ink-soft); font-weight: 500; font-size: 14px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: #1c221b; color: var(--cream); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-sm { min-height: 36px; padding: 8px 16px; font-size: 14px; }
/* App Store button: black pill with the Apple glyph, as Apple's own badge reads */
.appstore { background: #000; color: #fff; padding: 10px 22px 10px 18px; min-height: 56px; border-radius: 14px; }
.appstore:hover { background: #1d1d1f; color: #fff; }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.appstore small { font-size: 11px; font-weight: 500; opacity: .85; }
.appstore b { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.on-green .appstore { background: var(--cream); color: var(--ink); }
.on-green .appstore:hover { background: #fff; color: var(--ink); }
.on-green .btn-ghost { color: var(--on-green); border-color: rgba(246, 242, 231, 0.35); }
.on-green .btn-ghost:hover { background: rgba(246, 242, 231, 0.08); color: var(--on-green); }

/* ---------- Hero ---------- */
.hero { background: var(--green); color: var(--on-green); overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 48px; padding-top: 88px; padding-bottom: 0; }
.hero h1 { font-size: clamp(40px, 6.2vw, 72px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; margin: 0 0 22px; }
.hero .lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--on-green-soft); max-width: 34ch; margin: 0 0 32px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .note { margin-top: 18px; font-size: 14px; color: var(--on-green-soft); }
.hero-copy { padding-bottom: 88px; }

/* Phones: the one signature element. Real app screens in a flat device frame. */
.phones { position: relative; height: 620px; align-self: end; }
.phone {
  position: absolute; width: 290px; aspect-ratio: 598 / 1300; border-radius: 46px;
  background: #1a1c19; padding: 10px; border: 1px solid #0e100d;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 37px; }
.phone.front { left: 50%; transform: translateX(-62%); bottom: -150px; z-index: 2; }
.phone.back { left: 50%; transform: translateX(-2%); bottom: -230px; width: 262px; z-index: 1; opacity: .96; }

/* ---------- Proof strip ---------- */
.proof { background: var(--paper); border-bottom: 1px solid var(--line); }
.proof .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.proof .item { padding: 28px 20px; border-left: 1px solid var(--line); }
.proof .item:first-child { border-left: 0; padding-left: 0; }
.proof .big { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.proof .small { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Sections ---------- */
section { padding: 112px 0; }
.kicker { font-size: 14px; font-weight: 600; color: var(--clay-ink); margin: 0 0 14px; }
.h2 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 18px; max-width: 18ch; }
.sub { font-size: 19px; line-height: 1.55; color: var(--ink-soft); margin: 0; max-width: 56ch; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Hormone card mock: mirrors the in-app card */
.mock {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 22px;
  max-width: 440px; justify-self: center; width: 100%;
}
.mock-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ring {
  width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 5px solid var(--avoid); font-weight: 700; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.mock-head .p { font-weight: 600; font-size: 16px; }
.mock-head .v { font-size: 14px; color: var(--avoid); font-weight: 600; }
.flagcard { background: var(--flag-bg); border-radius: 16px; padding: 16px 18px; margin-top: 18px; }
.flagcard .t { color: var(--flag-ink); font-weight: 700; font-size: 16px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.flagcard ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.flagcard li { font-size: 14px; color: var(--ink); }
.flagcard li b { font-weight: 600; }
.mock-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.mock-row:first-of-type { border-top: 0; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.flag { background: var(--flag-bg); color: var(--flag-ink); }
.tag.ok { background: var(--sage-soft); color: var(--green-deep); }
.checks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: 16px; color: var(--ink-soft); }
.checks li b { color: var(--ink); font-weight: 600; }
.checks svg { margin-top: 3px; color: var(--green); }

/* ---------- Evidence ladder ---------- */
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 56px; }
.rung { background: var(--card); padding: 28px 24px; }
.rung .lvl { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.rung .dot { width: 10px; height: 10px; border-radius: 50%; }
.rung p { margin: 0 0 14px; font-size: 15px; color: var(--ink-soft); }
.rung .ex { font-size: 13px; color: var(--ink-faint); }
.sources { margin-top: 28px; font-size: 14px; color: var(--ink-faint); max-width: 80ch; }

/* ---------- Steps with screenshots ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 64px; }
.steps figure { margin: 0; }
.shot { background: #1a1c19; padding: 8px; border-radius: 36px; max-width: 260px; margin: 0 auto 26px; }
.shot img { border-radius: 29px; width: 100%; height: auto; }
.steps h3 { font-size: 20px; letter-spacing: -0.01em; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* ---------- Reviews ---------- */
.reviews { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 48px; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; margin: 0; }
.review .stars { color: var(--clay); letter-spacing: 3px; font-size: 15px; margin-bottom: 14px; }
.review blockquote { margin: 0 0 16px; font-size: 20px; line-height: 1.45; letter-spacing: -0.01em; }
.review figcaption { font-size: 14px; color: var(--ink-faint); }

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.price { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; position: relative; }
.price.best { border: 2px solid var(--green); padding: 29px; }
.price .tier { font-weight: 600; font-size: 16px; color: var(--ink-soft); }
.price .amt { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.price .per { color: var(--ink-soft); font-size: 14px; }
.price .save { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--green-deep); }
.badge { position: absolute; top: -13px; left: 28px; background: var(--green); color: var(--on-green); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.fine { color: var(--ink-faint); font-size: 13.5px; margin-top: 22px; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin-top: 40px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 18px; padding: 20px 0; min-height: 44px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-faint); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 22px; color: var(--ink-soft); font-size: 16px; max-width: 64ch; }

/* ---------- Founder ---------- */
.founder { display: grid; grid-template-columns: 96px 1fr; gap: 28px; align-items: start; max-width: 760px; }
.avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--sage-soft); color: var(--green-deep); display: grid; place-items: center; font-weight: 700; font-size: 28px; }
.founder h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 10px; }
.founder p { margin: 0 0 12px; color: var(--ink-soft); font-size: 17px; }

/* ---------- Closing band ---------- */
.closing { background: var(--green); color: var(--on-green); text-align: center; }
.closing .h2 { margin: 0 auto 16px; max-width: 16ch; }
.closing p { color: var(--on-green-soft); font-size: 19px; margin: 0 auto 32px; max-width: 46ch; }
.closing .cta-row { display: flex; justify-content: center; }

/* ---------- Footer ---------- */
footer.site { background: var(--cream); border-top: 1px solid var(--line); padding: 40px 0 48px; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot .copy { color: var(--ink-faint); font-size: 14px; }
.foot .links { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.foot .links a { color: var(--ink-soft); font-size: 14px; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot .links a:hover { color: var(--ink); }
.disclaimer { color: var(--ink-faint); font-size: 12.5px; margin-top: 18px; max-width: 760px; }

/* ---------- Legal / doc pages ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 64px 24px 96px; }
.doc h1 { font-size: clamp(34px, 5vw, 46px); letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 8px; }
.doc .updated { color: var(--ink-faint); font-size: 14px; margin-bottom: 10px; }
.doc h2 { font-size: 22px; letter-spacing: -0.01em; margin: 40px 0 10px; }
.doc h3 { font-size: 17px; margin: 24px 0 6px; }
.doc p, .doc li { color: var(--ink-soft); font-size: 16px; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.callout { background: var(--sage-soft); border: 1px solid #c9d1c1; border-radius: 14px; padding: 18px 20px; margin: 22px 0; color: var(--green-deep); }
.callout strong { color: var(--green-deep); }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; color: var(--ink-soft); font-weight: 500; font-size: 14px; text-decoration: none; }

/* Legacy classes still used on inner pages */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.section-head { max-width: 640px; margin: 0 0 40px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; margin: 0 0 12px; }
.section-head p { color: var(--ink-soft); font-size: 17px; margin: 0; }

/* Focus */
a:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 56px; gap: 8px; }
  .hero-copy { padding-bottom: 8px; }
  .hero .lead { max-width: none; }
  .phones { height: 430px; }
  .phone { width: 220px; border-radius: 36px; padding: 8px; }
  .phone img { border-radius: 29px; }
  .phone.back { width: 200px; }
  .phone.front { bottom: -170px; }
  .phone.back { bottom: -230px; }
  .split, .steps, .pricing, .reviews { grid-template-columns: 1fr; }
  .split { gap: 48px; }
  .ladder { grid-template-columns: 1fr 1fr; }
  .proof .container { grid-template-columns: 1fr 1fr; }
  .proof .item { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .proof .item:nth-child(-n+2) { border-top: 0; }
  section { padding: 80px 0; }
  .nav-links { display: none; }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .ladder { grid-template-columns: 1fr; }
  .founder { grid-template-columns: 1fr; }
  .phone.back { display: none; }
  .phone.front { transform: translateX(-50%); }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #171a16; --paper: #1d211c; --card: #222720; --ink: #eef0e8; --ink-soft: #b8bdb0;
    --ink-faint: #9aa093; --line: #313830; --line-strong: #3f473d; --green: #42513f; --green-deep: #c7d3bf;
    --sage-soft: #2c3529; --clay-ink: #d9a77e; --flag-bg: #3a2a22; --flag-ink: #f0b79c;
    --avoid: #d98a6e; --mixed: #d2ad6c; --clean: #a9bba3;
  }
  header.site { background: rgba(23, 26, 22, 0.8); }
  .btn-primary { background: var(--ink); color: #171a16; }
  .btn-primary:hover { background: #fff; color: #171a16; }
  .phone, .shot { background: #0b0c0a; border-color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* Official Apple App Store badge (Apple marketing tools artwork; don't restyle it) */
.store { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
.store img { height: 54px; width: auto; }

/* The screenshots are App Store marketing shots (they include their own device + caption),
   so show them as clean rounded cards rather than wrapping them in a second phone frame. */
.phone { background: transparent; padding: 0; border: 0; border-radius: 30px; overflow: hidden; }
.phone img { border-radius: 30px; }
.phone.front { bottom: -120px; }
.phone.back { bottom: -200px; }
.shot { background: transparent; padding: 0; border-radius: 26px; overflow: hidden; border: 1px solid var(--line); }
.shot img { border-radius: 0; }
@media (prefers-color-scheme: dark) { .phone, .shot { background: transparent; } }

/* ---------- Blog ---------- */
.crumbs { display: flex; gap: 6px; align-items: center; min-height: 44px; margin-bottom: 8px; color: var(--ink-faint); font-size: 14px; }
.crumbs a { color: var(--ink-soft); }
.doc .lede { font-size: 18px; color: var(--ink-soft); margin: 4px 0 24px; }
.article article > p:first-of-type { font-size: 18px; color: var(--ink); }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0 8px; font-size: 15px; font-variant-numeric: tabular-nums; }
.doc th, .doc td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--ink); font-weight: 600; border-bottom-color: var(--line-strong); }
.doc td { color: var(--ink-soft); }
.doc strong { color: var(--ink); }
.cta-box { margin: 40px 0 16px; padding: 20px 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.cta-box p { margin: 0 0 14px; }
.cta-box p:last-child { margin: 0; }
.fine { font-size: 13px !important; color: var(--ink-faint) !important; }
.related { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--line); }
.related h2 { font-size: 18px; }
.post-list { list-style: none; padding: 0 !important; margin: 8px 0 0; display: grid; gap: 14px; }
.post { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 !important; }
.post a { text-decoration: none; color: var(--ink); }
.post a:hover h2, .post a:focus-visible h2 { text-decoration: underline; text-underline-offset: 3px; }
.post h2 { margin: 0 0 6px; font-size: 19px; line-height: 1.3; }
.post p { margin: 0 0 8px; }
@media (max-width: 640px) { .doc table { font-size: 14px; } .doc th, .doc td { padding: 8px 6px; } }
