/* Susta marketing site — self-contained, zero external requests, zero JS.
   Modern CSS: custom props, fluid clamp() type, :has(), color-mix(),
   scroll-driven reveal animations, light/dark. Brand-matched to the app. */

/* ---------- fonts (self-hosted, same-origin) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/Inter-400Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/Inter-600SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/Inter-700Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/Inter-800ExtraBold.woff2") format("woff2");
}
/* Fraunces (headings) — a warm, soft old-style serif under the SIL Open Font
   Licence (free for web, self-hosting, and app embedding). SemiBold instance. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/Fraunces-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/Fraunces-SemiBold.woff2") format("woff2");
}

/* ---------- tokens ---------- */
:root {
  /* Brand palette — Deep Nourish, Leafstone, Harvest Gold, Soft Paper, Night Ink */
  --forest: #0f1f19; /* Deep Nourish — primary brand */
  --forest-deep: #0a1710;
  --forest-soft: #eceeea; /* soft tint on paper */
  --leaf: #5f7666; /* Leafstone — muted secondary green */
  --mint: #d1a15a; /* accent slot now Harvest Gold (no teal) */
  --gold: #d1a15a; /* Harvest Gold */
  --gold-deep: #b8873f;
  --buy: #4f7a5f;
  --limit: #bd8a3c;
  --avoid: #b1493a;

  --cta-bg: #0f1f19; /* primary button — gold in dark mode */
  --cta-fg: #ffffff;
  --cta-hover: #21402f; /* lifts lighter (warmer green), never toward black */

  --paper: #f7f6f2; /* Soft Paper */
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --ink: #0b1320; /* Night Ink — headings/body */
  --muted: #4b5a51;
  --faint: #7b877e;
  --faint-solid: #7b877e;
  --line: #e6e3da;
  --line-strong: #d7d3c7;

  --shadow-1:
    0 1px 2px rgba(15, 31, 25, 0.05), 0 4px 16px rgba(15, 31, 25, 0.05);
  --shadow-2:
    0 6px 28px rgba(15, 31, 25, 0.09), 0 2px 8px rgba(15, 31, 25, 0.05);
  --shadow-3: 0 20px 56px rgba(15, 31, 25, 0.16);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --maxw: 1120px;

  --font:
    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --font-head: "Fraunces", "Georgia", "Times New Roman", serif;
}

/* Dark palette preserved but disabled — Susta is a light, Soft-Paper brand, so
   the logo and identity always read. To re-enable a manual dark mode later,
   add class="dark" to <html> (and ship a reversed logo). */
:root.dark {
  --forest: #8aa593; /* light leafstone for text/links on dark */
  --forest-deep: #6e8a78;
  --forest-soft: #17231d;
  --leaf: #8aa593;
  --mint: #d9ab63;
  --gold: #d9ab63;
  --gold-deep: #c2934a;
  --buy: #6ea981;
  --limit: #d9a94f;
  --avoid: #dc7a68;

  --cta-bg: #d1a15a; /* gold CTAs in dark mode */
  --cta-fg: #0f1f19;
  --cta-hover: #dcae66; /* lighter gold on hover */

  --paper: #0c1712; /* deep nourish-black */
  --surface: #12201a;
  --surface-2: #17241d;
  --ink: #f2f1ea; /* soft paper text */
  --muted: #aab8ae;
  --faint: #7c8a80;
  --faint-solid: #7c8a80;
  --line: #223029;
  --line-strong: #2d3d34;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 6px 30px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  background: var(--forest);
  color: #fff;
  font-weight: 700;
  padding: 0.7em 1.1em;
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus {
  transform: none;
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}
section {
  padding-block: clamp(56px, 9vw, 120px);
}
.eyebrow {
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--forest);
}
h1,
h2,
h3 {
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
}
h3 {
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}
p {
  text-wrap: pretty;
}
.lead {
  font-size: clamp(1.05rem, 1.8vw, 1.32rem);
  color: var(--muted);
  max-width: 44ch;
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--cta-bg);
  --fg: var(--cta-fg);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 1.4em;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  box-shadow: var(--shadow-1);
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  background: var(--cta-hover);
}
.btn:active {
  transform: translateY(0);
}
.btn.ghost {
  --bg: transparent;
  --fg: var(--ink);
  border-color: var(--line-strong);
  box-shadow: none;
}
.btn.ghost:hover {
  background: color-mix(in oklab, var(--forest-soft) 60%, transparent);
  border-color: var(--forest);
  color: var(--forest);
}
.btn.arrow::after {
  content: "→";
  transition: transform 0.2s ease;
}
.btn.arrow:hover::after {
  transform: translateX(3px);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header:has(~ main) {
  border-color: var(--line);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.brand .logo {
  height: 50px;
  width: auto;
}
.site-footer .brand .logo {
  height: 52px;
}
.nav-links {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}
.nav-links a:not(.btn):hover {
  color: var(--forest);
}
.nav-cta {
  margin-left: 0.4rem;
}

/* mobile nav via checkbox hack (no JS) */
.nav-toggle,
.nav-toggle-label {
  display: none;
}
@media (max-width: 820px) {
  .nav-links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem clamp(20px, 5vw, 40px) 1.2rem;
    box-shadow: var(--shadow-2);
    transform: translateY(-140%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0;
  }
  .nav-links a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-links .btn {
    margin-top: 0.8rem;
    justify-content: center;
  }
  .nav-toggle:checked ~ .nav-links {
    transform: translateY(0);
  }
  .nav-toggle-label {
    display: grid;
    margin-left: auto;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
  }
  .nav-toggle-label span {
    width: 24px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: 0.3s;
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(48px, 8vw, 96px) clamp(56px, 9vw, 110px);
  overflow: hidden;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  margin-block: 0.5rem 1.1rem;
}
.hero h1 .accent {
  color: var(--gold);
}
.hero .lead {
  max-width: 40ch;
  margin-bottom: 2rem;
}
.hero-cta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.hero-trust {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hero-trust span::before {
  content: "✓";
  color: var(--buy);
  font-weight: 800;
}

/* hero mockup — a real verdict card, drawn in CSS */
.mock {
  position: relative;
  justify-self: center;
  width: min(370px, 100%);
}
.mock-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.mock-banner {
  background: color-mix(in oklab, var(--buy) 15%, var(--surface));
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mock-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--buy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.mock-verdict {
  font-weight: 800;
  color: var(--buy);
  font-size: 1.1rem;
}
.mock-food {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.mock-body {
  padding: 18px;
}
.mock-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.mock-line {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  font-size: 0.92rem;
}
.mock-line b {
  color: var(--forest);
  font-weight: 800;
}
.mock-lesson {
  margin-top: 14px;
  background: var(--forest-soft);
  color: var(--forest);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  font-size: 0.86rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mock-lesson::after {
  content: "→";
  margin-left: auto;
}
.mock-evi {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mock-grade {
  background: color-mix(in oklab, var(--gold) 20%, transparent);
  color: var(--gold-deep);
  font-weight: 800;
  font-size: 0.76rem;
  padding: 4px 9px;
  border-radius: 7px;
}
.mock-conf {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--faint-solid);
}
.mock-float {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 10px 13px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mock-float.a {
  top: -18px;
  left: -26px;
  color: var(--avoid);
}
.mock-float.b {
  bottom: 24px;
  right: -30px;
  color: var(--limit);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.dot.avoid {
  background: var(--avoid);
}
.dot.limit {
  background: var(--limit);
}
@media (max-width: 480px) {
  .mock-float {
    display: none;
  }
}

/* ---------- generic section header ---------- */
.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 5vw, 3.4rem);
}
.section-head p {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0.8rem;
}
.center {
  text-align: center;
  margin-inline: auto;
}

/* ---------- feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-1);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in oklab, var(--forest) 40%, var(--line));
}
.card .ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--forest-soft);
  color: var(--forest);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}
.card .ico svg {
  width: 24px;
  height: 24px;
}
.card h3 {
  margin-bottom: 0.4rem;
}
.card p {
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- honesty / moat band ---------- */
.band {
  background: var(--forest);
  color: #eef1ea;
  border-radius: var(--r-xl);
  padding: clamp(2.2rem, 5vw, 4rem);
  position: relative;
  overflow: hidden;
}
.band .eyebrow {
  color: var(--gold);
}
.band h2 {
  color: #fff;
  max-width: 20ch;
  margin-block: 0.7rem 1rem;
}
.band p {
  color: #cfe8dc;
  max-width: 52ch;
  font-size: 1.08rem;
}
.band-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  margin-top: 2.4rem;
}
.band-grid .pill {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-md);
  padding: 1.2rem 1.3rem;
  backdrop-filter: blur(4px);
}
.band-grid .pill b {
  display: block;
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}
.band-grid .pill span {
  color: #bfe0d1;
  font-size: 0.92rem;
}

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  counter-reset: step;
}
.step {
  position: relative;
  padding-top: 1rem;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--forest);
  color: #fff;
  font-weight: 800;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-1);
}
.step h3 {
  margin-bottom: 0.35rem;
}
.step p {
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- final CTA ---------- */
.cta-final {
  text-align: center;
}
.cta-final .box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(2.4rem, 6vw, 4.4rem);
  box-shadow: var(--shadow-2);
}
.cta-final h2 {
  max-width: 18ch;
  margin-inline: auto;
}
.cta-final p {
  color: var(--muted);
  max-width: 46ch;
  margin: 1rem auto 2rem;
  font-size: 1.1rem;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem 2.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-weight: 600;
}
.footer-links a:hover {
  color: var(--forest);
}
.footer-legal {
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  font-size: 0.82rem;
  color: var(--faint-solid);
  max-width: 70ch;
  line-height: 1.65;
}

/* ---------- legal (privacy / terms) pages ---------- */
.legal {
  padding-block: clamp(2.4rem, 6vw, 4rem) clamp(3rem, 8vw, 6rem);
}
.legal-head {
  max-width: 46rem;
  margin-bottom: 2.5rem;
}
.legal-head h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-block: 0.6rem 0.8rem;
}
.legal-head .updated {
  color: var(--faint-solid);
  font-size: 0.9rem;
  font-weight: 600;
}
.legal-body {
  max-width: 46rem;
}
.legal-body h2 {
  font-size: 1.4rem;
  margin-top: 2.6rem;
  margin-bottom: 0.8rem;
  scroll-margin-top: 90px;
}
.legal-body h3 {
  font-size: 1.08rem;
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
}
.legal-body p,
.legal-body li {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}
.legal-body ul {
  padding-left: 1.2rem;
  margin: 0.6rem 0 1rem;
}
.legal-body li {
  margin-bottom: 0.5rem;
}
.legal-body strong {
  color: var(--ink);
}
.legal-body a {
  color: var(--forest);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.callout {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  border-radius: var(--r-sm);
  padding: 1.1rem 1.3rem;
  margin: 1.6rem 0;
}
.callout p {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 1.3rem 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-1);
}
.toc b {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--forest);
  margin-bottom: 0.7rem;
}
.toc ol {
  columns: 2;
  gap: 2rem;
  padding-left: 1.1rem;
  font-size: 0.92rem;
}
.toc a {
  color: var(--muted);
}
.toc a:hover {
  color: var(--forest);
}
@media (max-width: 560px) {
  .toc ol {
    columns: 1;
  }
}

/* ---------- scroll-driven reveal (no JS) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 22%;
    }
  }
}
@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
