/* ============================================================
   Nutrition Coach — marketing site
   Token system derived from the product's own mark: leaf green,
   circuit-teal, and the spoon/arrow orange gradient — not a
   generic "wellness site" palette.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
  color-scheme: light;

  --bg:          #F6F4EC;
  --bg-raised:   #FFFFFF;
  --bg-sunken:   #EDEAE0;
  --ink:         #12202C;
  --ink-muted:   #55636D;
  --line:        #DAD5C6;

  --green:       #2F9E56;
  --green-soft:  #E3F1E6;
  --teal:        #1E7FA6;
  --teal-soft:   #DEEFF3;
  --orange:      #E07A2E;
  --orange-soft: #FBE7D4;
  --navy:        #12314A;

  --font-display: 'Space Grotesk', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body:    'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, "SF Mono", Consolas, monospace;

  --space-xs: 0.4rem;
  --space-sm: 0.8rem;
  --space-md: 1.6rem;
  --space-lg: 3.2rem;
  --space-xl: 6.4rem;
  --space-2xl: 10rem;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-card: 0 1px 2px rgba(18,32,44,0.04), 0 8px 24px -12px rgba(18,32,44,0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg:          #0D1620;
    --bg-raised:   #142230;
    --bg-sunken:   #0A121A;
    --ink:         #EDF1F0;
    --ink-muted:   #9FB0B8;
    --line:        #223140;

    --green:       #4FC077;
    --green-soft:  #16301F;
    --teal:        #52B6D8;
    --teal-soft:   #14313B;
    --orange:      #F2985A;
    --orange-soft: #3A2415;
    --navy:        #A9CBE4;

    --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 8px 28px -12px rgba(0,0,0,0.5);
  }
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-md); }
section { position: relative; }

/* ── Focus ─────────────────────────────────────────────────── */
a:focus-visible, button:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Type scale ────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); line-height: 1.05; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.12; }
h3 { font-size: 1.05rem; }
p { max-width: 62ch; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--space-sm);
}
.eyebrow::before { content: "◆"; color: var(--orange); font-size: 0.6rem; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(47,158,86,0.45);
}
.btn-primary:hover { box-shadow: 0 10px 26px -6px rgba(47,158,86,0.55); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-on-dark {
  background: #fff;
  color: var(--navy);
}
.btn-on-dark:hover { box-shadow: 0 10px 26px -8px rgba(0,0,0,0.35); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; }

/* ── Nav ───────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--space-md);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}
/* No backdrop-filter here on purpose: it would make .nav the containing
   block for its position:fixed descendant (#nav-links), collapsing the
   mobile menu panel to the navbar's own height instead of the viewport. */
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.nav-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.nav-brand img { height: 34px; width: auto; }
.nav-links { display: flex; align-items: center; gap: var(--space-lg); }
.nav-links a {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-muted);
  transition: color 150ms ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: var(--space-md); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink);
  transition: transform 200ms ease, opacity 200ms ease;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-lg);
  align-items: center;
}
.hero-copy { position: relative; z-index: 2; }
.hero h1 { margin-bottom: var(--space-md); }
.hero h1 .accent { background: linear-gradient(100deg, var(--green), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 46ch;
  margin-bottom: var(--space-lg);
}
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: var(--space-lg); }
.hero-trust { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.hero-trust-item { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-muted); }
.hero-trust-item strong { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); font-weight: 700; }

.hero-graphic { position: relative; z-index: 1; aspect-ratio: 1/1; max-width: 460px; margin: 0 auto; }
.hero-graphic svg { width: 100%; height: 100%; }
.ledger-path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw 1.8s ease forwards 0.3s;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ledger-path { animation: none; stroke-dashoffset: 0; }
}

/* ── Stat strip ────────────────────────────────────────────── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-lg) auto var(--space-2xl);
  max-width: 1180px;
}
.stat-cell { background: var(--bg-raised); padding: 1.2rem 1.4rem; }
.stat-val { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--green); }
.stat-lbl { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); margin-top: 0.25rem; }

/* ── Section dividers (signature ledger line) ─────────────── */
.divider { width: 100%; height: 40px; overflow: visible; margin: 0 auto; display: block; max-width: 1180px; padding: 0 var(--space-md); }
.divider .ledger-path { stroke-width: 2.5; }

/* ── Sections ──────────────────────────────────────────────── */
.section { padding: var(--space-xl) var(--space-md); }
.section-head { max-width: 640px; margin: 0 auto var(--space-lg); text-align: center; }
.section-head .eyebrow { justify-content: center; }
.section-head p { margin: var(--space-sm) auto 0; color: var(--ink-muted); font-size: 1.05rem; }
.section-inner { max-width: 1180px; margin: 0 auto; }

/* ── Feature grid ──────────────────────────────────────────── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-md); }
.feature-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--green-soft); color: var(--green); margin-bottom: var(--space-sm);
  font-size: 1.2rem;
}
.feature-card h3 { margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.92rem; color: var(--ink-muted); }

/* ── Ledger list (friction section) ───────────────────────── */
.ledger-book {
  border-top: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: var(--shadow-card);
}
.ledger-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-md);
  padding: 1.1rem var(--space-md);
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.ledger-row:nth-child(even) { background: var(--bg-sunken); }
.ledger-row:last-child { border-bottom: none; }
.ledger-term {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--green);
  display: flex; align-items: baseline; gap: 0.5rem;
}
.ledger-term .num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--orange); }
.ledger-desc { font-size: 0.94rem; color: var(--ink-muted); }
@media (max-width: 640px) {
  .ledger-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ── Privacy grid + callout ────────────────────────────────── */
.callout {
  border: 1.5px solid var(--orange);
  background: var(--orange-soft);
  border-radius: var(--radius-md);
  padding: var(--space-md) 1.4rem;
  margin: var(--space-lg) auto 0;
  max-width: 900px;
}
.callout-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.callout p { font-size: 0.95rem; max-width: none; }
.callout p + p { margin-top: 0.6rem; }
.fine-note { font-size: 0.85rem; color: var(--ink-muted); max-width: 900px; margin: var(--space-md) auto 0; text-align: center; }

/* ── CTA band ──────────────────────────────────────────────── */
.cta-band {
  background: linear-gradient(120deg, var(--navy), var(--teal));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  max-width: 1180px;
  margin: var(--space-xl) auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { color: #fff; margin-bottom: var(--space-sm); }
.cta-band p { color: rgba(255,255,255,0.82); margin: 0 auto var(--space-lg); }
.cta-band .hero-ctas { justify-content: center; }
@media (prefers-color-scheme: dark) {
  .cta-band { background: linear-gradient(120deg, #0A1622, var(--teal)); }
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: var(--space-lg) var(--space-md) var(--space-md);
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-lg);
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; }
.footer-brand img { height: 28px; }
.footer-links { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--ink-muted); font-size: 0.88rem; }
.footer-links a:hover { color: var(--ink); }
.footer-bottom {
  max-width: 1180px; margin: var(--space-md) auto 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-muted);
  padding-top: var(--space-md); border-top: 1px solid var(--line);
}

/* ── Scroll reveal ─────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Responsive nav ────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-graphic { max-width: 320px; }
  .nav-links { position: fixed; inset: 64px 0 0 0; background: var(--bg); flex-direction: column; padding: var(--space-lg) var(--space-md); gap: var(--space-md); transform: translateX(100%); transition: transform 220ms ease; }
  .nav-links.is-open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-actions .btn-ghost { display: none; }
}

/* ============================================================
   Tutorials page
   ============================================================ */
.tut-header { text-align: center; padding: var(--space-lg) var(--space-md) var(--space-md); }
.tut-header img { height: 60px; margin: 0 auto 0.6rem; }
.tut-header p { margin: 0 auto; color: var(--ink-muted); }
.chip-row { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; margin: var(--space-md) 0; }
.chip {
  border: 1.5px solid var(--line); background: var(--bg-raised); border-radius: var(--radius-full);
  padding: 0.55rem 1.1rem; cursor: pointer; font-family: var(--font-display); font-size: 0.88rem; font-weight: 600;
  color: var(--ink); transition: all 150ms ease;
}
.chip.active { background: linear-gradient(135deg, var(--green), var(--teal)); border-color: transparent; color: #fff; }
.chip:disabled { opacity: 0.4; cursor: not-allowed; }
.tut-panel-wrap {
  width: 100%; max-width: 860px; margin: 0 auto var(--space-xl);
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: var(--space-md);
}
#pdf-container { display: flex; justify-content: center; overflow: auto; max-height: 72vh; border-radius: var(--radius-sm); }
#pdf-container canvas { max-width: 100%; box-shadow: 0 0 0 1px var(--line); border-radius: 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.pager button {
  border: none; background: var(--ink); color: var(--bg); border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem; font-family: var(--font-display); font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.pager button:disabled { background: var(--line); color: var(--ink-muted); cursor: not-allowed; }
.pager span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-muted); }
#video-panel video { width: 100%; border-radius: var(--radius-sm); display: block; }
#audio-panel { padding: 3rem 1rem; text-align: center; }
#audio-panel audio { width: 100%; }
#audio-panel p { color: var(--ink-muted); font-size: 0.9rem; margin: 1rem auto 0; }
.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--ink-muted); }
.hidden { display: none !important; }
