/* ZMacros website. White with a black accent, green only where it means
   something, matching the app's default look. No build step. */
:root {
  --bg: #ffffff;
  --surface: #f5f5f4;
  --text: #0a0a0a;
  --muted: #57534e;
  --line: #e7e5e4;
  --accent: #0a0a0a;
  --on-accent: #ffffff;
  --green: #15803d;
  --protein: #2563eb;
  --carbs: #d97706;
  --fat: #db2777;
  --radius: 18px;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #171717;
    --text: #fafafa;
    --muted: #a8a29e;
    --line: #262626;
    --accent: #fafafa;
    --on-accent: #0a0a0a;
    --green: #4ade80;
    --protein: #60a5fa;
    --carbs: #fbbf24;
    --fat: #f472b6;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
header { border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; text-decoration: none; }
.nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: none; color: var(--muted); font-size: 15px; }
.nav ul a:hover { color: var(--text); }
@media (max-width: 640px) { .nav ul { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-decoration: none; border: 1px solid var(--accent);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line); }

/* Hero */
.hero { padding-top: 88px; padding-bottom: 72px; display: grid; gap: 48px; grid-template-columns: 1.1fr 0.9fr; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 56px; } }
.hero h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 20px; }
.hero p { font-size: 19px; color: var(--muted); margin: 0 0 32px; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.note, .hero .note { font-size: 13px; color: var(--muted); margin: 16px 0 0; }

/* The phone mock-up, drawn in CSS so it matches the app rather than a stock image. */
.phone {
  justify-self: center; width: min(320px, 100%);
  border: 1px solid var(--line); border-radius: 40px; padding: 22px;
  background: var(--bg); box-shadow: 0 24px 60px rgba(0,0,0,0.08);
}
.phone .date { font-size: 13px; color: var(--muted); }
.phone .today { font-size: 26px; font-weight: 800; margin: 2px 0 18px; }
.ring-card { background: var(--surface); border-radius: var(--radius); padding: 20px; text-align: center; }
.ring { width: 160px; height: 160px; margin: 0 auto; }
.ring .num { font-size: 30px; font-weight: 800; }
.ring .lbl { font-size: 12px; fill: var(--muted); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; text-align: left; }
.macro .name { font-size: 11px; color: var(--muted); }
.macro .val { font-size: 15px; font-weight: 700; }
.bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 3px; }
.log { margin-top: 16px; width: 100%; }

/* Sections */
section { padding: 72px 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 18px; max-width: 40em; margin: 0 0 40px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; }
.card h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { counter-increment: step; }
.step::before {
  content: counter(step); display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14px; margin-bottom: 12px;
}

/* Pricing */
.price { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 0; }
.price small { font-size: 15px; font-weight: 600; color: var(--muted); }
.yearly { color: var(--muted); font-size: 14px; margin: 2px 0 16px; }
.card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.card ul li { margin: 4px 0; }
.card.featured { background: var(--accent); color: var(--on-accent); }
.card.featured p, .card.featured ul, .card.featured .yearly, .card.featured .price small { color: var(--on-accent); opacity: 0.8; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 18px 0; }
summary { cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--muted); }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin: 10px 0 0; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
footer .row { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

/* Legal pages */
.doc { max-width: 720px; padding: 56px 20px 80px; margin: 0 auto; }
.doc h1 { font-size: 36px; letter-spacing: -0.03em; margin: 0 0 8px; }
.pending { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; color: var(--muted); }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---- v2: header actions, mobile menu, animation, reviews, legal ---- */
header { position: sticky; top: 0; z-index: 10; background: var(--bg); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 999px; width: 40px; height: 40px; padding: 0; justify-content: center; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.mobile-menu { display: none; border-top: 1px solid var(--line); padding: 8px 20px 16px; }
.mobile-menu a { display: block; padding: 12px 0; text-decoration: none; font-weight: 600; }
.mobile-menu.open { display: block; }
@media (max-width: 640px) { .menu-btn { display: inline-flex; align-items: center; } }
.burger, .burger::before, .burger::after { display: block; width: 16px; height: 2px; border-radius: 1px; background: currentColor; transition: transform .2s ease, background .2s ease; }
.burger { position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -5px; }
.burger::after { top: 5px; }
.menu-btn[aria-expanded="true"] .burger { background: transparent; }
.menu-btn[aria-expanded="true"] .burger::before { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .burger::after { transform: translateY(-5px) rotate(-45deg); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }

/* Hero phone: the app "loads in" - screen boots, ring fills, bars grow, entries arrive. */
.phone { position: relative; overflow: hidden; }
.boot { position: absolute; inset: 0; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 28px; letter-spacing: -0.02em; border-radius: 40px; z-index: 2; }
.entries { list-style: none; margin: 14px 0 0; padding: 0; }
.entries li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.entries li span:last-child { color: var(--muted); }
.ring .arc { stroke-dashoffset: 427; }

@media (prefers-reduced-motion: no-preference) {
  .anim .phone { animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
  .anim .boot { animation: bootout .5s ease 1s forwards; }
  .anim .ring .arc { animation: fill 1.4s cubic-bezier(.2,.8,.2,1) 1.4s forwards; }
  .anim .bar span { transform-origin: left; transform: scaleX(0); animation: grow 1s cubic-bezier(.2,.8,.2,1) 1.8s forwards; }
  .anim .entries li { opacity: 0; animation: slidein .5s ease forwards; }
  .anim .entries li:nth-child(1) { animation-delay: 2.4s; }
  .anim .entries li:nth-child(2) { animation-delay: 2.6s; }
  .anim .entries li:nth-child(3) { animation-delay: 2.8s; }
  .anim .hero h1, .anim .hero .lead, .anim .hero .actions, .anim .hero .note { animation: rise .7s ease both; }
  .anim .hero .lead { animation-delay: .1s; }
  .anim .hero .actions { animation-delay: .2s; }
  .anim .hero .note { animation-delay: .3s; }
  .anim .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
  .anim .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .boot { display: none; } .ring .arc { stroke-dashoffset: 150; } }
.no-js .boot { display: none; }
.no-js .ring .arc { stroke-dashoffset: 150; }
.no-js .reveal { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes bootout { to { opacity: 0; visibility: hidden; } }
@keyframes fill { to { stroke-dashoffset: 150; } }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes slidein { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

/* Facts strip */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.fact .big { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.fact p { margin: 0; color: var(--muted); font-size: 15px; }

/* Reviews - rendered from reviews.json, real reviews only */
.reviews { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.review blockquote { margin: 0 0 14px; font-size: 16px; }
.review .who { font-weight: 700; font-size: 14px; }
.review .src { color: var(--muted); font-size: 13px; }
.stars { color: var(--text); letter-spacing: 2px; margin-bottom: 10px; }
.empty-reviews { color: var(--muted); }

/* Sticky mobile call to action */
.sticky-cta { display: none; }
@media (max-width: 640px) {
  .sticky-cta { display: block; position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 9;
    opacity: 0; transform: translateY(24px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
  .sticky-cta.show { opacity: 1; transform: none; pointer-events: auto; }
  .sticky-cta .btn { width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
  .no-js .sticky-cta { display: none; }
}

/* Legal documents */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { text-decoration: none; }
.draft-banner { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--text); border-radius: 12px; padding: 16px 20px; margin: 0 0 32px; }
.legal h2 { font-size: 22px; margin: 36px 0 8px; letter-spacing: -0.01em; }
.legal h3 { font-size: 18px; margin: 24px 0 6px; }
.legal p, .legal li { color: var(--text); }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.legal .ph { background: var(--surface); border: 1px dashed var(--muted); border-radius: 4px; padding: 0 4px; font-size: .92em; }
.legal a { overflow-wrap: anywhere; }
.center { text-align: center; }

/* ---- v3: the phone layout. One column, tighter rhythm, smaller type,
   feature cards as a swipeable row instead of nine stacked blocks. ---- */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav { height: 56px; }
  .nav-right { gap: 8px; }
  .btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
  .menu-btn { width: 36px; height: 36px; }
  .mobile-menu { padding: 4px 16px 12px; }
  .mobile-menu a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .mobile-menu a:last-child { border-bottom: 0; }

  .hero { padding-top: 32px; padding-bottom: 48px; gap: 36px; text-align: center; }
  .hero h1 { font-size: 36px; margin-bottom: 14px; }
  .hero p { font-size: 16px; margin: 0 auto 24px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .actions .btn { padding: 0 12px; }
  .hero .note { margin-top: 12px; }
  .phone { width: min(290px, 100%); padding: 18px; border-radius: 34px; text-align: left; }
  .boot { border-radius: 34px; }
  .phone .today { font-size: 22px; margin-bottom: 14px; }
  .ring-card { padding: 16px; }
  .ring { width: 136px; height: 136px; }
  .entries li { font-size: 13px; padding: 9px 0; }

  section { padding: 48px 0; }
  section h2 { font-size: 26px; }
  .lede { font-size: 16px; margin-bottom: 24px; }
  .card { padding: 20px; }
  .card h3 { font-size: 17px; }

  .facts { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
  .fact .big { font-size: 26px; }
  .fact p { font-size: 14px; line-height: 1.45; }

  .grid.scroller {
    display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 82%;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
    margin: 0 -16px; padding: 0 16px 8px; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .grid.scroller::-webkit-scrollbar { display: none; }
  .grid.scroller .card { scroll-snap-align: start; }

  .steps { gap: 12px; }
  .step { display: grid; grid-template-columns: 32px 1fr; column-gap: 14px; }
  .step::before { grid-row: span 2; margin: 0; }
  .step h3, .step p { grid-column: 2; }

  summary { font-size: 16px; }
  details { padding: 16px 0; }

  footer { padding: 32px 0 calc(88px + env(safe-area-inset-bottom)); }
  footer .row { flex-direction: column; gap: 12px; }
  footer nav { gap: 16px; }

  .doc { padding: 32px 16px 64px; }
  .doc h1 { font-size: 28px; }

  .anim .reveal { transform: translateY(16px); }
}
@media (max-width: 360px) {
  .hero h1 { font-size: 32px; }
  .actions { grid-template-columns: 1fr; }
}
