/* =========================================================
   Nutrition Rx — shared styles
   Design tokens pulled from brand graphics:
   - cream paper + deep forest green
   - sage pill accents, slab + transitional serif type
   ========================================================= */

:root {
  /* Surfaces */
  --cream: #e6e2d4;
  --cream-warm: #ddd6c4;
  --cream-light: #efeadc;
  --green-deep: #2e3b2a;
  --green-darker: #1f2a1d;
  --green-mid: #5b7350;
  --green-sage: #a8c89a;
  --green-sage-soft: #c2d6b6;

  /* Ink */
  --ink: #2a2522;
  --ink-soft: #6b665a;
  --ink-on-green: #e6e2d4;
  --ink-on-green-soft: #a8b29c;

  /* Macros */
  --macro-cal: #c8553d;
  --macro-protein: #d8893a;
  --macro-carbs: #a8a83a;
  --macro-fat: #5b7350;

  /* Type */
  --font-display: "DM Serif Display", "Source Serif Pro", Georgia, serif;
  --font-slab: "Zilla Slab", Georgia, serif;
  --font-italic: "Zilla Slab", Georgia, serif;

  /* Layout */
  --page-pad: clamp(20px, 5vw, 56px);
  --max: 1240px;
  --radius-pill: 999px;
  --radius-card: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-slab);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.theme-green {
  background: var(--green-deep);
  color: var(--ink-on-green);
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
}

.eyebrow {
  font-family: var(--font-slab);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-mid);
}
.theme-green .eyebrow { color: var(--green-sage); }

.italic-lede {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}
.theme-green .italic-lede { color: var(--ink-on-green-soft); }

.rule {
  width: 56px;
  height: 2px;
  background: var(--green-mid);
  border: 0;
  margin: 28px auto;
}
.theme-green .rule { background: var(--green-sage); }

/* ---------- Pills / Buttons ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--green-sage);
  color: var(--green-darker);
  font-family: var(--font-slab);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: var(--radius-pill);
  background: var(--green-mid);
  color: var(--cream);
  font-family: var(--font-slab);
  font-weight: 600;
  font-size: 18px;
  border: 0;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn-primary:hover { background: #4d6244; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: 1.5px solid currentColor;
  font-family: var(--font-slab);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  background: transparent;
}

/* ---------- Top bar / Hamburger ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad);
  z-index: 50;
  pointer-events: none;
  transition: background .28s ease, box-shadow .28s ease, backdrop-filter .28s ease, height .28s ease;
}
.topbar > * { pointer-events: auto; }

.topbar.scrolled {
  background: rgba(230, 226, 212, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(42, 37, 34, 0.10), 0 6px 20px -14px rgba(42, 37, 34, 0.5);
}
.theme-green .topbar.scrolled {
  background: rgba(46, 59, 42, 0.9);
  box-shadow: 0 1px 0 rgba(230, 226, 212, 0.12), 0 6px 20px -14px rgba(0, 0, 0, 0.6);
}

.brand {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--green-mid);
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.brand__logo {
  height: 32px;
  width: auto;
  display: block;
}
.theme-green .brand { color: var(--green-sage); }
.brand small {
  font-family: var(--font-slab);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin-left: 0;
  letter-spacing: 0;
  white-space: nowrap;
}
.menu__brand-logo { height: 30px; width: auto; display: block; }
.theme-green .brand small { color: var(--ink-on-green-soft); }

.hamburger {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green-mid);
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.theme-green .hamburger { background: var(--green-sage); color: var(--green-darker); }
.hamburger:hover { transform: scale(1.04); }
.hamburger svg { width: 22px; height: 22px; }

/* ---------- Menu overlay ---------- */
.menu {
  position: fixed;
  inset: 0;
  background: var(--green-deep);
  color: var(--cream);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity .35s ease, transform .35s ease;
  display: grid;
  grid-template-rows: 72px 1fr auto;
  padding: 0 var(--page-pad);
}
.menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.menu__brand {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--green-sage);
}
.menu__close {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green-sage);
  color: var(--green-darker);
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu__close svg { width: 22px; height: 22px; }

.menu__nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(20px, 4vh, 36px);
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}
.menu__link {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 88px);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--cream);
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(230, 226, 212, 0.18);
  transition: color .2s ease, padding-left .2s ease;
}
.menu__link:hover {
  color: var(--green-sage);
  padding-left: 8px;
}
.menu__link .num {
  font-family: var(--font-slab);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--ink-on-green-soft);
  font-style: italic;
}
.menu__link .arrow {
  font-family: var(--font-slab);
  font-size: 20px;
  color: var(--ink-on-green-soft);
  transition: transform .2s ease;
}
.menu__link:hover .arrow { transform: translateX(8px); color: var(--green-sage); }

.menu__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid rgba(230, 226, 212, 0.18);
  font-family: var(--font-slab);
  font-size: 13px;
  color: var(--ink-on-green-soft);
  letter-spacing: 0.04em;
}
.menu__foot a:hover { color: var(--green-sage); }

body.menu-open { overflow: hidden; }

/* ---------- Page sections ---------- */
.section {
  padding: clamp(80px, 12vw, 140px) var(--page-pad);
  max-width: var(--max);
  margin: 0 auto;
}
.section--narrow { max-width: 820px; }
.section--green {
  background: var(--green-deep);
  color: var(--ink-on-green);
  max-width: none;
}
.section--green-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.center { text-align: center; }

/* ---------- Image placeholder ---------- */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(0,0,0,0.04) 0 8px,
      transparent 8px 16px),
    var(--cream-warm);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding: 16px;
  min-height: 200px;
}
.theme-green .ph {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.04) 0 8px,
      transparent 8px 16px),
    rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  color: var(--ink-on-green-soft);
}
.ph--circle { border-radius: 999px; aspect-ratio: 1; }
.ph--phone {
  aspect-ratio: 9 / 19.5;
  border-radius: 36px;
  min-height: 0;
}

/* ---------- Footer ---------- */
.foot {
  padding: 36px var(--page-pad) 28px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.theme-green .foot {
  border-color: rgba(255,255,255,0.12);
  color: var(--ink-on-green-soft);
}
.foot a:hover { color: var(--green-mid); }
.theme-green .foot a:hover { color: var(--green-sage); }
.foot__links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- Utility ---------- */
.stack > * + * { margin-top: var(--gap, 16px); }
.grid { display: grid; gap: 24px; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .topbar { height: 64px; }
  .hamburger, .menu__close { width: 44px; height: 44px; }
  .menu { grid-template-rows: 64px 1fr auto; }
  .menu__link { grid-template-columns: 40px 1fr auto; gap: 14px; }
  .menu__link .num { font-size: 12px; }
}

.foot__note { flex-basis: 100%; order: -1; margin: 0; padding-bottom: 16px; border-bottom: 1px solid rgba(0,0,0,0.08); font-size: 12px; line-height: 1.55; font-style: italic; color: var(--ink-soft); max-width: 78ch; }
.theme-green .foot__note { border-color: rgba(255,255,255,0.12); color: var(--ink-on-green-soft); }
