/* ==========================================================================
   Macronaut — shared stylesheet
   Brand: playful astronaut-meets-macros
   Primary violet #6B4DF2 - protein coral #F2547A - carbs amber #FAAB33 - fat teal #2EC79E
   ========================================================================== */

/* ---- Fonts (self-contained, Google Fonts via @import; degrades gracefully) ---- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ---- Design tokens ---- */
:root {
  /* Brand */
  --violet: #6B4DF2;
  --violet-600: #5a3fe0;
  --violet-700: #4a32c4;
  --violet-100: #ece8ff;
  --protein: #F2547A;
  --carbs: #FAAB33;
  --fat: #2EC79E;

  /* Neutrals — light */
  --bg: #fbfaff;
  --surface: #ffffff;
  --surface-2: #f4f2fc;
  --ink: #16121f;
  --ink-2: #4a4458;
  --ink-3: #6f6982;
  --line: #e7e3f4;
  --line-2: #d9d4ec;

  /* Effects */
  --radius: 18px;
  --radius-lg: 28px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(22, 18, 31, .06), 0 2px 8px rgba(22, 18, 31, .04);
  --shadow: 0 4px 12px rgba(22, 18, 31, .08), 0 18px 40px -12px rgba(107, 77, 242, .18);
  --shadow-lg: 0 12px 28px rgba(22, 18, 31, .10), 0 40px 80px -24px rgba(107, 77, 242, .28);

  --maxw: 1120px;
  --pad: clamp(1.25rem, 5vw, 3rem);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0a18;
    --surface: #16122a;
    --surface-2: #1d1838;
    --ink: #f3f0ff;
    --ink-2: #c4bedb;
    --ink-3: #948cb3;
    --line: #2a2447;
    --line-2: #38315c;
    --violet-100: #221b48;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px rgba(0, 0, 0, .3);
    --shadow: 0 4px 12px rgba(0, 0, 0, .4), 0 18px 40px -12px rgba(107, 77, 242, .35);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, .5), 0 40px 80px -24px rgba(107, 77, 242, .45);
  }
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); }
p { margin: 0 0 1rem; color: var(--ink-2); }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Layout helpers ---- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--violet);
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--violet); border-radius: 2px; }
.lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-2); max-width: 46ch; }
.center { text-align: center; }
.center .lede { margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: .5rem; z-index: 100;
  background: var(--violet); color: #fff; padding: .6rem 1rem; border-radius: 8px;
}
.skip-link:focus { left: .5rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: .85rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 8px 24px -6px rgba(107, 77, 242, .55); }
.btn-primary:hover { background: var(--violet-600); box-shadow: 0 12px 30px -6px rgba(107, 77, 242, .65); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }
.btn .apple { width: 20px; height: 20px; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: var(--violet); text-decoration: none; }
.nav-cta { display: inline-flex; }
@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(242, 84, 122, .18), transparent 55%),
    radial-gradient(100% 80% at 10% 0%, rgba(46, 199, 158, .16), transparent 50%),
    linear-gradient(165deg, var(--violet) 0%, var(--violet-700) 60%, #2a1d6b 100%);
  color: #fff;
}
.hero::after {
  /* subtle star field */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 55% 45%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 12% 80%, rgba(255,255,255,.45), transparent);
}
.hero .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center; padding-block: clamp(3.5rem, 8vw, 6rem);
}
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; text-align: center; } }

.hero h1 { color: #fff; }
.hero h1 .accent {
  background: linear-gradient(100deg, #fff 0%, #ffe6f0 40%, #ffd9a8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-pitch {
  font-size: clamp(1.1rem, 2.3vw, 1.35rem); color: rgba(255,255,255,.92);
  max-width: 48ch; margin-bottom: 1.75rem; line-height: 1.55;
}
@media (max-width: 880px) { .hero-pitch { margin-inline: auto; } }
.hero-badge {
  display: inline-flex; align-items: center; gap: .55rem;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-weight: 600; font-size: .85rem; padding: .4rem .9rem;
  border-radius: 999px; margin-bottom: 1.5rem; backdrop-filter: blur(6px);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fat); box-shadow: 0 0 0 4px rgba(46,199,158,.3); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }
@media (max-width: 880px) { .hero-actions { justify-content: center; } }
.hero .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; border-color: #fff; }
.hero-note { margin-top: 1rem; font-size: .9rem; color: rgba(255,255,255,.75); }

.hero-art { display: flex; justify-content: center; align-items: center; }
.hero-art svg { width: min(420px, 100%); height: auto; filter: drop-shadow(0 30px 60px rgba(0,0,0,.35)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.float { animation: float 6s ease-in-out infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.spin-slow { animation: spin-slow 28s linear infinite; transform-origin: center; }

/* ---- Trust strip ---- */
.trust { background: var(--surface); border-bottom: 1px solid var(--line); }
.trust-row {
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; justify-content: center;
  padding-block: 1.4rem; color: var(--ink-3); font-weight: 600; font-size: .92rem;
}
.trust-row span { display: inline-flex; align-items: center; gap: .5rem; }
.trust-row .ic { color: var(--violet); }

/* ---- Feature sections ---- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.feature + .feature { margin-top: clamp(3rem, 7vw, 5.5rem); }
.feature.reverse .feature-text { order: 2; }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; }
  .feature.reverse .feature-text { order: 0; }
}
.feature-text h2 { margin-bottom: .65rem; }
.feature-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .65rem; }
.feature-list li { display: flex; gap: .65rem; align-items: flex-start; color: var(--ink-2); font-weight: 500; }
.feature-list .check {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: .8rem; margin-top: .15rem;
}
.tag-protein { background: var(--protein); }
.tag-carbs { background: var(--carbs); }
.tag-fat { background: var(--fat); }
.tag-violet { background: var(--violet); }

/* ---- Screenshot placeholder ---- */
.shot {
  position: relative; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  aspect-ratio: 9 / 16; max-width: 320px; width: 100%; margin-inline: auto;
  display: grid; place-items: center; overflow: hidden;
}
.shot.wide { aspect-ratio: 4 / 3; max-width: 520px; }
.shot::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(80% 40% at 50% 0%, rgba(107,77,242,.12), transparent 60%);
}
.shot-inner { position: relative; text-align: center; padding: 1.5rem; }
.shot-inner .ph-icon { width: 56px; height: 56px; margin: 0 auto .75rem; color: var(--violet); opacity: .85; }
.shot-inner .ph-label { font-weight: 700; color: var(--ink-2); font-size: .95rem; }
.shot-inner .ph-sub { font-size: .82rem; color: var(--ink-3); }
.shot .notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 96px; height: 22px; border-radius: 999px; background: var(--line-2); opacity: .6; }

/* ---- Macro ring stat row ---- */
.macro-stats { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.macro-pill {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem .95rem; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow-sm);
}
.macro-pill .swatch { width: 12px; height: 12px; border-radius: 50%; }

/* ---- Pricing ---- */
.pricing-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2.5rem;
  align-items: stretch;
}
@media (max-width: 760px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow); position: relative; display: flex; flex-direction: column;
}
.plan.featured {
  border-color: var(--violet);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--violet) 7%, var(--surface)), var(--surface));
  box-shadow: var(--shadow-lg);
}
.plan-flag {
  position: absolute; top: -13px; right: 1.75rem;
  background: var(--violet); color: #fff; font-weight: 700; font-size: .72rem;
  letter-spacing: .08em; text-transform: uppercase; padding: .35rem .85rem; border-radius: 999px;
}
.plan h3 { font-family: var(--font-body); font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .25rem; }
.plan .price { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 2.8rem); font-weight: 600; color: var(--ink); line-height: 1; margin-bottom: .25rem; }
.plan .price small { font-family: var(--font-body); font-size: .95rem; font-weight: 600; color: var(--ink-3); }
.plan .plan-sub { color: var(--ink-3); font-size: .92rem; margin-bottom: 1.25rem; }
.plan ul { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .7rem; flex: 1; }
.plan li { display: flex; gap: .6rem; align-items: flex-start; color: var(--ink-2); font-weight: 500; font-size: .98rem; }
.plan li .check { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .72rem; margin-top: .2rem; }
.plan .btn { width: 100%; }

/* ---- Generic content cards (support FAQ etc.) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; margin-bottom: 1rem; }
.card h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.card p { font-size: .95rem; margin: 0; }

/* ---- CTA band ---- */
.cta-band {
  margin: 0 auto; max-width: var(--maxw);
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-700) 70%, #2a1d6b 100%);
  color: #fff; text-align: center; padding: clamp(2.5rem, 7vw, 4.5rem) var(--pad);
}
.cta-band::after {
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 25% 30%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 75% 60%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 60% 25%, rgba(255,255,255,.5), transparent);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 50ch; margin-inline: auto; }
.cta-band .btn-primary { background: #fff; color: var(--violet); }
.cta-band .btn-primary:hover { background: #fff; color: var(--violet-700); }

/* ---- Legal / document pages ---- */
.doc { max-width: 760px; margin-inline: auto; }
.doc-header { padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; }
.doc-header .eff { color: var(--ink-3); font-size: .95rem; font-weight: 600; }
.doc h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.doc h2:first-of-type { border-top: none; padding-top: 0; }
.doc h3 { font-size: 1.2rem; margin-top: 1.75rem; }
.doc p, .doc li { color: var(--ink-2); }
.doc ul, .doc ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.doc li { margin-bottom: .5rem; }
.doc .toc {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin-bottom: 2rem;
}
.doc .toc h2 { border: none; padding: 0; margin: 0 0 .75rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-body); font-weight: 800; color: var(--ink-3); }
.doc .toc ol { margin: 0; columns: 2; column-gap: 2rem; }
.doc .toc li { margin-bottom: .35rem; }
@media (max-width: 560px) { .doc .toc ol { columns: 1; } }
.callout {
  background: color-mix(in srgb, var(--carbs) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--carbs) 40%, var(--line));
  border-left: 4px solid var(--carbs);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.callout p { margin: 0; color: var(--ink); font-weight: 500; }
.placeholder {
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  border-radius: 5px; padding: .05em .4em; font-weight: 700; color: var(--violet);
  font-family: var(--font-body);
}
@media (prefers-color-scheme: dark) { .placeholder { color: #b9a8ff; } }

/* ---- FAQ accordion ---- */
.faq { max-width: 820px; margin-inline: auto; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.4rem; margin-bottom: .85rem; box-shadow: var(--shadow-sm);
}
.faq details[open] { border-color: var(--line-2); }
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 1.05rem; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--font-body); font-weight: 700; font-size: 1.4rem;
  color: var(--violet); transition: transform .2s ease; line-height: 1;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .85rem 0 .25rem; }
.faq details p:last-child { margin-bottom: 0; }

/* ---- Steps (how-to) ---- */
.steps { counter-reset: step; display: grid; gap: 1rem; margin-top: 2rem; max-width: 820px; margin-inline: auto; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; box-shadow: var(--shadow-sm);
}
.step .num {
  counter-increment: step; width: 38px; height: 38px; border-radius: 50%;
  background: var(--violet); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
}
.step .num::before { content: counter(step); }
.step h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 800; margin-bottom: .2rem; }
.step p { margin: 0; font-size: .95rem; }

/* ---- Footer ---- */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 8vw, 6rem); padding-block: 3rem 2rem;
}
.footer-top { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.footer-brand { max-width: 320px; }
.footer-brand .brand { margin-bottom: .75rem; }
.footer-brand p { font-size: .9rem; color: var(--ink-3); margin: 0; }
.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-body); font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .9rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.footer-col a { color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.footer-col a:hover { color: var(--violet); text-decoration: none; }
.footer-legal {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center;
}
.footer-legal .attribution { max-width: 70ch; line-height: 1.6; }
.footer-legal a { color: var(--ink-2); font-weight: 600; }

/* ---- Reveal on load (staggered) ---- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); animation: reveal .7s cubic-bezier(.2,.7,.2,1) forwards; }
  @keyframes reveal { to { opacity: 1; transform: none; } }
  .d1 { animation-delay: .05s; } .d2 { animation-delay: .15s; }
  .d3 { animation-delay: .25s; } .d4 { animation-delay: .35s; } .d5 { animation-delay: .45s; }
}
