/* ============================================================
   Snack — snack.fit
   Focus design system. Tokens mirror DesignSystem/Tokens/Colors.swift
   (that file wins on any hex conflict). Light-first; dark supported.
   ============================================================ */

/* ---- Fonts (self-hosted, no external requests) ---- */
@font-face {
  font-family: "Spline Sans";
  src: url("fonts/SplineSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spline Sans";
  src: url("fonts/SplineSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spline Sans";
  src: url("fonts/SplineSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ---- */
:root {
  /* Focus semantic tokens — light values */
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface-alt: #E7E9ED;
  --border: #E4E8ED;
  --track: #E4E7EB;
  --ink: #0B0D10;
  --muted: #5C636D;
  --faint: #686E78;
  --accent: #0CA5E9;
  --accent-ink: #087099;   /* accent as text — AA on white */
  --on-accent: #FFFFFF;

  /* Macros / water (fills only) + their readable text variants */
  --protein: #0CA5E9;      --protein-ink: #087099;
  --carbs: #10B981;        --carbs-ink: #047857;
  --fat: #EC4899;          --fat-ink: #BE185D;
  --water: #2E9BD6;        --water-ink: #0E7490;
  --attention-fill: #E8900C;

  /* Brand constants — fixed, never theme-adaptive */
  --brand-blue: #0CA5E9;
  --brand-pink: #EC4899;

  /* Spacing (4pt base) */
  --sp-xxs: 4px;  --sp-xs: 6px;  --sp-sm: 8px;  --sp-md: 12px;
  --sp-lg: 16px;  --sp-xl: 20px; --sp-xxl: 24px; --sp-xxxl: 32px;
  --sp-4xl: 40px; --sp-5xl: 48px; --sp-6xl: 64px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --readable: 700px;
  --screen-h: 24px;

  --font-sans: "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0C0F;
    --surface: #14171C;
    --surface-alt: #15181D;
    --border: #20252D;
    --track: #1B1F25;
    --ink: #F5F7FA;
    --muted: #AEB6C0;
    --faint: #7A818B;
    --accent: #0CA5E9;
    --accent-ink: #38BDF8;
    --on-accent: #04222F;

    --protein: #0CA5E9;    --protein-ink: #38BDF8;
    --carbs: #34D399;      --carbs-ink: #34D399;
    --fat: #F472B6;        --fat-ink: #F472B6;
    --water: #38A8E0;      --water-ink: #38A8E0;
    --attention-fill: #F6B73C;
  }
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; }
p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--ink);
  padding: var(--sp-sm) var(--sp-lg); border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus { left: var(--sp-md); top: var(--sp-md); }

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

/* ---- Shared layout ---- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--screen-h); }
.readable { max-width: var(--readable); margin-left: auto; margin-right: auto; }

.kicker {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: var(--sp-md);
}
.kicker .num { color: var(--accent-ink); }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.site-header .lockup { height: 26px; }
.site-header .lockup svg, .site-header .lockup img { height: 26px; width: auto; }
.header-nav { display: flex; align-items: center; gap: var(--sp-xl); }
.header-nav a {
  color: var(--muted); font-size: 15px; font-weight: 600;
}
.header-nav a:hover { color: var(--ink); text-decoration: none; }
.header-cta {
  font-family: var(--font-mono); font-weight: 500; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--on-accent) !important; background: var(--accent);
  padding: 9px 16px; border-radius: var(--radius-pill);
}
.header-cta:hover { text-decoration: none; opacity: 0.92; }
@media (max-width: 560px) {
  .header-nav a:not(.header-cta) { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-sm);
  font-family: var(--font-sans); font-weight: 600; font-size: 16px;
  padding: 14px 22px; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: opacity .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { opacity: 0.92; }
.btn-primary svg { width: 20px; height: 20px; fill: currentColor; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-ink); }

/* "Coming soon" state — not-yet-live CTAs, non-interactive */
.is-soon { cursor: default; }
.header-cta.is-soon {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink) !important;
}
.appstore-btn.is-soon { opacity: 0.92; }
.btn.is-soon { opacity: 1; }

/* App Store badge-style button */
.appstore-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: 14px;
}
.appstore-btn:hover { text-decoration: none; opacity: 0.9; }
.appstore-btn svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.appstore-btn .as-label { text-align: left; line-height: 1.1; }
.appstore-btn .as-small {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; opacity: 0.85;
}
.appstore-btn .as-big { font-family: var(--font-sans); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }

/* ---- Sections ---- */
section { padding: var(--sp-6xl) 0; }
.section-lead { max-width: 640px; }
.section-lead h2 { font-size: clamp(28px, 4.5vw, 40px); }
.section-lead p { margin-top: var(--sp-lg); color: var(--muted); font-size: 18px; }

/* ---- Hero (split: tagline + live app card) ---- */
.hero { padding: var(--sp-6xl) 0; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-5xl);
  align-items: center;
}
.hero .kicker { color: var(--accent-ink); }
.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px); letter-spacing: -0.03em;
  max-width: 14ch;
}
.hero .subline {
  margin-top: var(--sp-xl);
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(13px, 2vw, 15px); letter-spacing: 0.04em;
  color: var(--muted); text-transform: uppercase;
}
.hero .hero-actions { margin-top: var(--sp-xxxl); display: flex; gap: var(--sp-md); flex-wrap: wrap; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-xxxl); }
  .hero h1 { max-width: 18ch; }
}

/* Live "Today" app card — the product proof in the first screen */
.app-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-xxl) var(--sp-xl) var(--sp-xxl);
  box-shadow: 0 24px 60px -34px rgba(8, 40, 70, 0.28);
}
.app-card .ac-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-xs); }
.app-card .ac-day { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--faint); }
.app-card .ac-live { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--accent-ink); }
.app-card .ac-num { font-weight: 700; font-size: clamp(52px, 8vw, 66px); letter-spacing: -0.03em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.app-card .ac-num .u { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; color: var(--faint); text-transform: uppercase; margin-left: var(--sp-sm); }
.app-card .ac-sub { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); margin-top: var(--sp-xs); }
.app-card .ac-bar { margin: var(--sp-xl) 0 var(--sp-sm); }
.app-card .ac-ledger { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.app-card .ac-macros { margin-top: var(--sp-xxl); display: grid; gap: var(--sp-md); }
.app-card .ac-macro .m-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-xs); }
.app-card .ac-macro .m-name { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.app-card .ac-macro .m-val { font-weight: 700; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.app-card .ac-macro .bar span.-protein { background: var(--protein); }
.app-card .ac-macro .bar span.-carbs { background: var(--carbs); }
.app-card .ac-macro .bar span.-fat { background: var(--fat); }

/* Pillar-1 visual: two days, two targets (the target moving) */
.two-day { display: grid; gap: var(--sp-md); }
.day-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--sp-lg) var(--sp-xl);
  display: grid; gap: var(--sp-sm);
}
.day-card .d-top { display: flex; justify-content: space-between; align-items: baseline; }
.day-card .d-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.day-card .d-target { font-weight: 700; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.day-card .d-target .u { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--faint); text-transform: uppercase; margin-left: 4px; }
.day-card .d-foot { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }

/* ---- Horizontal bar motif (never a ring) ---- */
.bar {
  position: relative; height: 10px; border-radius: var(--radius-pill);
  background: var(--track); overflow: hidden;
}
.bar > span {
  position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-pill);
  background: var(--accent);
}
.bar.-thin { height: 6px; }

/* Ledger demo (deadpan numbers — reinforces pillar 1) */
.demo-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-xxl);
}
.demo-ledger { display: flex; align-items: baseline; gap: var(--sp-lg); flex-wrap: wrap; }
.demo-ledger .cell { display: flex; flex-direction: column; gap: 2px; }
.demo-ledger .val { font-weight: 700; font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.demo-ledger .val.-net { color: var(--accent-ink); }
.demo-ledger .lbl {
  font-family: var(--font-mono); font-weight: 500; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.demo-ledger .op { color: var(--faint); font-weight: 600; font-size: 22px; }
.demo-caption {
  margin-top: var(--sp-lg); font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.04em; color: var(--faint); text-transform: uppercase;
}

/* Four-number demo */
.four-numbers { display: grid; gap: var(--sp-lg); }
.four-numbers .metric { display: grid; gap: var(--sp-sm); }
.four-numbers .metric-top { display: flex; justify-content: space-between; align-items: baseline; }
.four-numbers .metric-name {
  font-family: var(--font-mono); font-weight: 500; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.four-numbers .metric-val { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.four-numbers .bar span.-protein { background: var(--protein); }
.four-numbers .bar span.-carbs { background: var(--carbs); }
.four-numbers .bar span.-fat { background: var(--fat); }

/* Two-column pillar layout */
.pillar-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5xl);
  align-items: center;
}
.pillar-grid.-reverse .pillar-visual { order: -1; }
.pillar-body h2 { font-size: clamp(26px, 4vw, 36px); }
.pillar-body p { margin-top: var(--sp-lg); color: var(--muted); font-size: 18px; }
@media (max-width: 820px) {
  .pillar-grid { grid-template-columns: 1fr; gap: var(--sp-xxxl); }
  .pillar-grid.-reverse .pillar-visual { order: 0; }
}

/* Privacy list */
.privacy-list { display: grid; gap: var(--sp-md); margin-top: var(--sp-lg); }
.privacy-list li {
  display: flex; gap: var(--sp-md); align-items: flex-start;
  padding: var(--sp-lg); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.privacy-list .tick {
  flex: none; width: 22px; height: 22px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-ink); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; margin-top: 1px;
}
.privacy-list .pi-title { font-weight: 600; }
.privacy-list .pi-desc { color: var(--muted); font-size: 15px; }

/* ---- Pricing ---- */
.pricing { text-align: center; }
.pricing h2 { font-size: clamp(28px, 4.5vw, 40px); }
.pricing .pricing-intro { margin: var(--sp-lg) auto 0; max-width: 46ch; color: var(--muted); font-size: 18px; }
.price-card {
  max-width: 460px; margin: var(--sp-4xl) auto 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-4xl) var(--sp-xxl);
}
.price-rows { display: grid; gap: var(--sp-lg); }
.price-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: var(--sp-lg); border-bottom: 1px solid var(--border);
}
.price-row:last-child { border-bottom: none; padding-bottom: 0; }
.price-plan { font-weight: 600; font-size: 17px; }
.price-amount { font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }
.price-amount .per { font-family: var(--font-mono); font-weight: 500; font-size: 12px; color: var(--faint); letter-spacing: 0.06em; }
.price-note {
  margin-top: var(--sp-xl); font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint);
}
.price-card .btn { margin-top: var(--sp-xxl); width: 100%; }

/* ---- FAQ ---- */
.faq-list { margin-top: var(--sp-xxl); display: grid; gap: var(--sp-md); }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: var(--sp-xl);
  font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: var(--sp-md);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent-ink); font-weight: 700; font-size: 20px; }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 var(--sp-xl) var(--sp-xl); color: var(--muted); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-5xl) 0;
  background: var(--surface);
}
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-xxl); flex-wrap: wrap; }
.site-footer .lockup { height: 30px; }
.site-footer .lockup svg, .site-footer .lockup img { height: 30px; width: auto; }
.footer-links { display: flex; gap: var(--sp-xl); flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 15px; font-weight: 600; }
.footer-links a:hover { color: var(--ink); text-decoration: none; }
.footer-bottom {
  margin-top: var(--sp-xxl); padding-top: var(--sp-xl); border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-lg); flex-wrap: wrap;
}
.footer-bottom .copyright { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--faint); }

/* ---- Legal / content pages ---- */
.page-head { padding: var(--sp-5xl) 0 var(--sp-xxl); }
.page-head h1 { font-size: clamp(30px, 5vw, 44px); }
.page-head .subtitle { margin-top: var(--sp-md); color: var(--faint); font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.doc { padding-bottom: var(--sp-6xl); }
.doc h2 { font-size: 22px; margin-top: var(--sp-4xl); margin-bottom: var(--sp-md); }
.doc p, .doc li { color: var(--muted); font-size: 16px; }
.doc p { margin-top: var(--sp-md); }
.doc ul { margin-top: var(--sp-md); display: grid; gap: var(--sp-sm); padding-left: var(--sp-xl); list-style: disc; }
.doc strong { color: var(--ink); }
.contact-card {
  margin-top: var(--sp-4xl); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--sp-xxl);
}
.contact-card h3 { font-size: 18px; }
.contact-card p { margin-top: var(--sp-xs); color: var(--muted); font-size: 15px; }

/* Support cards */
.support-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-lg); margin-bottom: var(--sp-5xl); }
.support-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-xxl); display: grid; gap: var(--sp-md); }
.support-card h3 { font-size: 18px; }
.support-card p { color: var(--muted); font-size: 15px; }
.support-card .btn { justify-self: start; }
@media (max-width: 620px) { .support-grid { grid-template-columns: 1fr; } }

/* 404 */
.notfound { text-align: center; padding: var(--sp-6xl) 0; }
