/*
 * Macronaut website — tokens mirror the app's src/theme.ts exactly.
 * Keep them in sync: the site and the app should never disagree on a colour.
 */

:root {
  --bg: #09090b;
  --surface: #141417;
  --surface-high: #1c1c21;
  --surface-higher: #26262c;
  --border: #26262c;
  --border-light: #33333a;

  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-faint: #52525b;

  --primary: #22d3ee;
  --primary-bright: #67e8f9;
  --on-primary: #083344;

  --protein: #fbbf24;
  --carbs: #4ade80;
  --fat: #a78bfa;
  --water: #38bdf8;
  --danger: #f87171;

  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --glow: 0 3px 10px color-mix(in srgb, var(--primary) 35%, transparent);
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  color: var(--text);
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-bright); }
::selection { background: var(--primary); color: var(--on-primary); }

/* Keyboard users must be able to see where they are. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 800;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ── Header ────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.nav-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-full);
}
.nav-link:hover { color: var(--text); background: var(--surface-high); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-high); }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--glow);
}
.btn-primary:hover { background: var(--primary-bright); color: var(--on-primary); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
}
.btn-secondary:hover { border-color: var(--border-light); color: var(--text); }

.btn-nav { margin-left: 8px; font-size: 13px; padding: 10px 18px; }

/* ── Layout ────────────────────────────────────────────────────────────── */

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 48px 20px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 64px 20px 72px; }
.wrap-mid { max-width: 960px; margin: 0 auto; padding: 64px 20px 72px; }
.wrap-data { max-width: 820px; margin: 0 auto; padding: 64px 20px 72px; }

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

h1 { font-size: 40px; font-weight: 900; letter-spacing: -1.2px; margin: 12px 0 0; }
h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin: 40px 0 0; }
h3 { font-size: 17px; font-weight: 700; margin: 20px 0 0; }

.lede { font-size: 17px; line-height: 1.6; color: var(--text-secondary); margin: 16px 0 0; }
.body-text { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin: 12px 0 0; }
.small-note { font-size: 13px; line-height: 1.7; color: var(--text-muted); margin-top: 24px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.grid-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-lg { padding: 24px; }
.card-accent {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 27%, transparent);
}
.card-danger {
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 27%, transparent);
}

.card-title { font-size: 17px; font-weight: 700; margin-top: 10px; }
.card-text { font-size: 14px; line-height: 1.55; color: var(--text-secondary); margin: 8px 0 0; }

.card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.card-label-primary { color: var(--primary); }
.card-label-carbs { color: var(--carbs); }
.card-label-fat { color: var(--fat); }
.card-label-danger { color: var(--danger); }

.card ul, .body-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}
.body-list-lg { font-size: 16px; padding-left: 20px; }

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 64px 20px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 56px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 27%, transparent);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--radius-full);
}

.hero h1 {
  font-size: 44px;
  line-height: 1.06;
  letter-spacing: -1.4px;
  margin: 20px 0 0;
}
.hero-accent { color: var(--primary); }

.hero p {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 20px 0 0;
  max-width: 46ch;
  text-wrap: pretty;
}

/* ── Waitlist form ─────────────────────────────────────────────────────── */

.waitlist { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; max-width: 440px; }
.waitlist-row { display: flex; gap: 8px; flex-wrap: wrap; }

.waitlist input {
  flex: 1 1 200px;
  background: var(--surface-high);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 18px;
  outline: none;
  font-family: inherit;
}
.waitlist input:focus { border-color: var(--primary); }
.waitlist input::placeholder { color: var(--text-faint); }

.waitlist-note { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.waitlist-note.is-error { color: var(--danger); }
.waitlist-note.is-success { color: var(--carbs); }

/* ── Store badges ──────────────────────────────────────────────────────── */

.store-row { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }

.store-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 18px;
  opacity: 0.55;
  cursor: not-allowed;
}
.store-badge-glyph { font-size: 20px; font-weight: 900; color: var(--text-secondary); }
.store-badge-soon {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.store-badge-name { font-size: 14px; font-weight: 800; color: var(--text-secondary); }

/* ── Phone mockup ──────────────────────────────────────────────────────── */

.phone-wrap { display: flex; justify-content: center; animation: riseIn 400ms ease-out both; }

.phone {
  width: 340px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 44px;
  padding: 10px;
  box-shadow: 0 0 90px color-mix(in srgb, var(--primary) 12%, transparent);
}
.phone-screen { background: var(--bg); border-radius: 36px; overflow: hidden; padding: 14px 16px 18px; }

.phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.phone-greeting { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.phone-greeting-sub { color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.phone-greeting-date { color: var(--text); font-size: 19px; font-weight: 800; margin-top: 2px; }

.streak-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  background: color-mix(in srgb, var(--protein) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--protein) 25%, transparent);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  color: var(--protein);
  font-size: 12px;
  font-weight: 700;
}

.ring-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 18px; }
.ring-box { position: relative; width: 244px; height: 244px; margin: 0 auto; max-width: 100%; }
.ring-svg { position: absolute; inset: 0; width: 100%; height: auto; }

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-eyebrow {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.ring-eaten { color: var(--text); font-size: 17px; font-weight: 800; margin-top: -1px; }
.ring-rule { height: 1px; width: 34px; background: var(--border); margin: 5px 0; }
.ring-big { color: var(--primary); font-size: 34px; font-weight: 900; letter-spacing: -1px; }
.ring-big-label { color: var(--text-muted); font-size: 10px; margin-top: -3px; }
.ring-goal { color: var(--text-secondary); font-size: 13px; font-weight: 800; margin-top: 5px; }
.ring-goal-label { color: var(--text-muted); font-size: 10px; font-weight: 600; }

.legend {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 9px; height: 9px; border-radius: 5px; flex-shrink: 0; }
.legend-name { color: var(--text-secondary); font-size: 12px; font-weight: 700; min-width: 58px; }
.legend-nums { font-size: 12px; }
.legend-nums strong { color: var(--text); font-weight: 800; }
.legend-nums span { color: var(--text-faint); }
.legend-left { color: var(--text-muted); font-size: 11px; margin-left: auto; }

.water-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.water-label { color: var(--text-secondary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.water-amount { color: var(--text); font-size: 20px; font-weight: 800; margin-top: 4px; }
.water-amount span { color: var(--text-muted); font-size: 13px; font-weight: 400; }
.water-btns { margin-left: auto; display: flex; gap: 8px; }
.water-btn {
  width: 38px; height: 38px; border-radius: 19px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  background: var(--surface-high); border: 1px solid var(--border); color: var(--text-secondary);
}
.water-btn-add { background: var(--water); border-color: var(--water); color: var(--on-primary); font-weight: 800; }

/* ── Pricing ───────────────────────────────────────────────────────────── */

.pricing-teaser {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  align-items: center;
}
.price-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.price-card {
  background: var(--surface-high);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 150px;
  flex: 1;
}
.price-card-accent {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 27%, transparent);
}
.price-period { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); }
.price-period-accent { color: var(--primary); }
.price-value { font-size: 30px; font-weight: 900; letter-spacing: -1px; margin-top: 6px; }
.price-sub { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.price-big { font-size: 34px; font-weight: 900; letter-spacing: -1px; margin-top: 8px; }
.price-big-accent { color: var(--primary); }

.tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  background: var(--primary);
  color: var(--on-primary);
  padding: 4px 9px;
  border-radius: var(--radius-full);
}

/* ── Tables (legal pages) ──────────────────────────────────────────────── */

.data-table { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-top: 16px; }
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--surface-high);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 14px;
}
.data-table td {
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
  padding: 12px 14px;
  vertical-align: top;
}
.data-table td:first-child { color: var(--text); font-weight: 600; }

/* ── Data / delete page ────────────────────────────────────────────────── */

.step-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.step { display: flex; gap: 12px; align-items: baseline; }
.step-num { font-size: 11px; font-weight: 700; color: var(--danger); min-width: 18px; }
.step-text { font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
.step-text strong { color: var(--text); font-weight: 700; }

.retention-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.retention-row div:first-child { color: var(--text); font-weight: 600; }
.retention-row div:last-child { color: var(--text-secondary); }

/* ── FAQ ───────────────────────────────────────────────────────────────── */

.faq-list { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.faq-q { font-size: 17px; font-weight: 700; }
.faq-a { font-size: 15px; line-height: 1.6; color: var(--text-secondary); margin: 8px 0 0; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--border); margin-top: 24px; }
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 40px 20px 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand span { font-size: 15px; font-weight: 800; }
.footer-tagline { font-size: 13px; line-height: 1.65; color: var(--text-muted); margin: 12px 0 0; max-width: 34ch; }

.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.footer-link { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.footer-link:hover { color: var(--text); }

.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Motion ────────────────────────────────────────────────────────────── */

@keyframes ringCal { from { stroke-dashoffset: 735; } to { stroke-dashoffset: 270; } }
@keyframes ringPro { from { stroke-dashoffset: 647; } to { stroke-dashoffset: 61; } }
@keyframes ringCar { from { stroke-dashoffset: 559; } to { stroke-dashoffset: 172; } }
@keyframes ringFat { from { stroke-dashoffset: 471; } to { stroke-dashoffset: 124; } }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.ring-cal { animation: ringCal 700ms ease-out both 200ms; }
.ring-pro { animation: ringPro 700ms ease-out both 300ms; }
.ring-car { animation: ringCar 700ms ease-out both 400ms; }
.ring-fat { animation: ringFat 700ms ease-out both 500ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 560px) {
  h1 { font-size: 32px; letter-spacing: -0.9px; }
  .hero h1 { font-size: 36px; }
  .hero { padding-top: 40px; gap: 36px; }
  .pricing-teaser { padding: 22px; }
  .site-nav { gap: 2px; }
  .nav-link { padding: 8px 9px; }
}
