/* PawPerformance — website styles, shared by /, /privacy, /terms, /support and /404.
 * Tokens mirror constants/theme.ts so the web feels like the app.
 * Pages link this file as main.css?v=N: bump N whenever it changes, because
 * firebase.json lets browsers keep CSS for a day.
 */

/* Fredoka (SIL OFL, assets/fonts/OFL.txt), self-hosted: no third-party font requests. */
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('/assets/fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url('/assets/fonts/fredoka-latin-700-normal.woff2') format('woff2'); }

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --primary: #3A9A60;
  --primary-light: #5DB57F;
  --primary-dark: #2E7D4D;
  --secondary: #F28A3E;
  --gold: #F5B83D;
  --protein: #E8574F;
  --carbs: #F5B83D;
  --fat: #9C6ADE;
  --water: #4DA8DA;

  --bg: #FFF8EF;
  --bg-soft: #FFF1DF;
  --bg-elev: #FFFFFF;
  --text: #2B2118;
  --text-secondary: #6E5A46;
  --text-light: #9A8673;
  --line: #E9D6BD;
  --chunky: 0 4px 0 var(--line);
  --shadow: 0 18px 40px -22px rgba(46, 125, 77, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Fredoka', -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', system-ui, sans-serif;

  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --max-w: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1712;
    --bg-soft: #241D16;
    --bg-elev: #2B231B;
    --text: #FFF3E3;
    --text-secondary: #CDB89F;
    --text-light: #9A8673;
    --line: #463829;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  }
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-sans); font-size: 17px; line-height: 1.55; color: var(--text); background: var(--bg); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1.1; color: var(--text); }
h1 { font-size: clamp(42px, 6.4vw, 72px); letter-spacing: -0.01em; }
h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.01em; }
h3 { font-size: 21px; }
p { margin: 0; color: var(--text-secondary); }
.wrap { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 8vw, 104px); }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; max-width: 56ch; }
.section-title { text-align: center; max-width: 680px; margin: 0 auto clamp(32px, 5vw, 56px); }
.section-title .lead { margin: 14px auto 0; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--primary-dark); background: rgba(58, 154, 96, 0.12); border: 1px solid rgba(58, 154, 96, 0.28);
  padding: 5px 12px; border-radius: 99px; margin-bottom: 16px;
}
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--primary-light); } }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 99px;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; white-space: nowrap;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--primary { color: #fff; background: var(--primary); box-shadow: 0 4px 0 var(--primary-dark); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--primary-dark); }
.btn--ghost { color: var(--text); background: var(--bg-elev); border: 2px solid var(--line); box-shadow: var(--chunky); }
.btn--ghost:hover { transform: translateY(-2px); }

.store-badge {
  position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 11px 24px 11px 18px;
  background: #111; color: #fff; border-radius: 14px; box-shadow: 0 10px 24px -12px rgba(0,0,0,0.5);
}
.store-badge svg { width: 26px; height: 26px; flex-shrink: 0; }
.store-badge .meta { display: flex; flex-direction: column; margin-right: 16px; }
.store-badge .small { font-size: 10.5px; opacity: 0.8; line-height: 1; margin-bottom: 3px; letter-spacing: 0.04em; text-transform: uppercase; }
.store-badge .big { font-size: 18px; font-weight: 700; line-height: 1.1; }
.store-badge[aria-disabled="true"] { cursor: default; }
.store-badge .pill {
  position: absolute; top: -8px; right: -8px; background: var(--gold); color: #2B2118; font-size: 10px; font-weight: 800;
  letter-spacing: 0.06em; padding: 3px 8px; border-radius: 99px; text-transform: uppercase;
}

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 50; padding-block: 12px; transition: background 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { color: var(--text-secondary); font-weight: 600; font-size: 15px; }
.nav__links a:hover { color: var(--primary); }
@media (max-width: 760px) { .nav__links { display: none; } }

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 96px); }
.hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (max-width: 900px) { .hero__grid { grid-template-columns: 1fr; } }
.hero h1 .accent { color: var(--primary); }
.hero .lead { margin-top: 20px; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 30px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; font-size: 14px; font-weight: 600; color: var(--text-light); }
.hero__meta span::before { content: "✓"; color: var(--primary); margin-right: 6px; font-weight: 800; }
.hero__visual { position: relative; display: flex; justify-content: flex-end; padding: 0 2% 12px 0; }
.hero__chester { position: absolute; left: -4%; bottom: -2%; width: 40%; max-width: 210px; filter: drop-shadow(0 16px 22px rgba(43,33,24,0.22)); }
@media (max-width: 900px) {
  .hero__visual { justify-content: center; padding: 0 0 12px 18%; }
  .hero__chester { left: 0; width: 34%; }
}

/* Phone mock: the Today screen, drawn in HTML so it stays sharp */
.phone {
  width: 300px; max-width: 78vw; border-radius: 42px; background: #1F1A15; padding: 10px;
  box-shadow: 0 40px 70px -30px rgba(43,33,24,0.55), 0 0 0 2px rgba(255,255,255,0.06) inset;
}
.phone__screen { border-radius: 33px; background: #FFF8EF; padding: 38px 18px 22px; color: #2B2118; position: relative; overflow: hidden; }
.phone__screen::before { content: ""; position: absolute; top: 10px; left: 50%; width: 86px; height: 22px; margin-left: -43px; background: #1F1A15; border-radius: 99px; }
.today__head { display: flex; justify-content: space-between; align-items: baseline; }
.today__head b { font-family: var(--font-display); font-size: 22px; }
.today__head span { font-size: 12px; font-weight: 700; color: #9A8673; }
.ring {
  --p: 62; width: 150px; aspect-ratio: 1; margin: 18px auto 16px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, #FFF8EF 78%, transparent 79% 100%), conic-gradient(var(--primary) calc(var(--p) * 1%), #EFE2CF 0);
}
.ring div { text-align: center; line-height: 1.1; }
.ring b { display: block; font-family: var(--font-display); font-size: 30px; }
.ring small { font-size: 11.5px; font-weight: 700; color: #9A8673; }
.macros { display: grid; gap: 9px; }
.macro { display: grid; grid-template-columns: 58px 1fr auto; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; }
.macro i { height: 7px; border-radius: 99px; background: #EFE2CF; position: relative; overflow: hidden; }
.macro i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c); border-radius: 99px; }
.macro em { font-style: normal; color: #9A8673; }
.today__tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.tile { background: #fff; border: 2px solid #EFE2CF; border-radius: 14px; padding: 9px 10px; font-size: 11.5px; font-weight: 700; color: #9A8673; }
.tile b { display: block; font-family: var(--font-display); font-size: 17px; color: #2B2118; }
.dots { display: flex; gap: 4px; margin-top: 5px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #EFE2CF; }
.dots i.on { background: var(--c, var(--primary)); }

/* ─── Features: four things it does, each with a small mock ─────────────── */
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--bg-elev); border: 2px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--chunky); padding: 24px; display: flex; flex-direction: column; }
.feature h3 { margin-top: 20px; }
.feature p { margin-top: 8px; font-size: 16px; }
.mock { background: var(--bg); border: 2px solid var(--line); border-radius: 18px; padding: 16px; min-height: 150px; display: grid; align-content: center; gap: 10px; }
.mock__row { display: flex; align-items: center; gap: 12px; }
.mock__row img { width: 46px; height: 46px; }
.mock__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text); line-height: 1.15; }
.mock__sub { font-size: 13px; color: var(--text-light); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span {
  font-size: 12.5px; font-weight: 700; color: var(--text); padding: 4px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 15%, transparent); border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.ways { display: flex; gap: 8px; }
.ways span { flex: 1; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); padding: 7px 4px; border-radius: 10px; background: var(--bg-elev); border: 2px solid var(--line); }
.ways span.on { color: #fff; background: var(--primary); border-color: var(--primary); }
.targets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.targets b { display: block; font-family: var(--font-display); font-size: 19px; color: var(--text); }
.targets span { font-size: 12px; font-weight: 700; color: var(--text-light); }
.targets i { display: block; height: 5px; border-radius: 99px; background: var(--c); margin: 6px auto 0; width: 70%; }
.plan { display: grid; gap: 6px; }
.plan div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 2px; border-bottom: 1.5px dashed var(--line); color: var(--text-secondary); }
.plan div:last-child { border-bottom: 0; }
.plan b { color: var(--text); font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 96px; }
.week i { display: block; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--primary) 30%, transparent); height: var(--h); }
.week i.hit { background: var(--primary); }
.week__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--text-light); }

/* ─── Built properly ─────────────────────────────────────────────────────── */
.proof {
  background: linear-gradient(160deg, #2E7D4D, #24653E); color: #fff; border-radius: clamp(24px, 4vw, 40px);
  padding: clamp(32px, 6vw, 72px); display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: start;
}
@media (max-width: 900px) { .proof { grid-template-columns: 1fr; } }
.proof h2, .proof h3 { color: #fff; }
.proof p { color: rgba(255,255,255,0.82); }
.proof .lead { margin-top: 16px; }
.proof .eyebrow { color: #FFE7A8; background: rgba(255,231,168,0.12); border-color: rgba(255,231,168,0.35); }
.proof ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.proof li { padding-left: 40px; position: relative; }
.proof li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #FFE7A8; color: #24653E; font-weight: 800; font-size: 15px;
}
.proof li h3 { font-size: 20px; }
.proof li p { margin-top: 4px; font-size: 16px; }
.proof__check { margin-top: 18px; font-size: 15px; font-weight: 600; color: #FFE7A8 !important; }
.proof__foot { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,0.18); padding-top: 22px; display: grid; gap: 10px; }
.proof__refs { font-size: 14px; line-height: 1.7; }
.proof__refs span { display: inline-block; margin-right: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #FFE7A8; }
.proof__note { font-size: 13px; color: rgba(255,255,255,0.65) !important; }

/* ─── Chester ────────────────────────────────────────────────────────────── */
.chester { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .chester { grid-template-columns: 1fr; } }
.chester__art { border-radius: var(--radius-xl); overflow: hidden; border: 2px solid var(--line); box-shadow: 0 6px 0 var(--line), var(--shadow); }
.chester__art img { width: 100%; }
.chester p + p { margin-top: 14px; }
.chester .lead { margin-top: 16px; }
.chester__secret { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--secondary) !important; }

/* ─── Pricing ────────────────────────────────────────────────────────────── */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 820px; margin-inline: auto; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
.price { position: relative; background: var(--bg-elev); border: 2px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--chunky); padding: 28px; display: flex; flex-direction: column; }
.price--featured { border-color: var(--primary); box-shadow: 0 4px 0 var(--primary-dark), var(--shadow); }
.price__name { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); }
.price__amount { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; margin-top: 10px; color: var(--text); }
.price__amount small { font-size: 16px; color: var(--text-light); font-weight: 600; }
.price__sub { font-size: 14px; color: var(--text-light); margin-top: 6px; }
.price ul { list-style: none; padding: 0; margin: 20px 0 24px; display: grid; gap: 10px; flex: 1; align-content: start; }
.price li { padding-left: 26px; position: relative; font-size: 15.5px; color: var(--text-secondary); }
.price li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 800; }
.price__badge { position: absolute; top: -13px; right: 20px; background: var(--gold); color: #2B2118; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 12px; border-radius: 99px; }
.price__fine { font-size: 12.5px; color: var(--text-light); margin-top: 12px; text-align: center; }
.billing { display: inline-flex; gap: 4px; padding: 4px; margin-top: 14px; border-radius: 99px; background: var(--bg-soft); border: 2px solid var(--line); align-self: flex-start; }
.billing button { font: inherit; font-size: 14px; font-weight: 700; color: var(--text-secondary); background: none; border: 0; border-radius: 99px; padding: 7px 14px; cursor: pointer; }
.billing button[aria-pressed="true"] { color: #fff; background: var(--primary); }
.billing em { font-style: normal; font-size: 11px; font-weight: 800; margin-left: 4px; padding: 2px 6px; border-radius: 99px; background: var(--gold); color: #2B2118; }
.price--featured .price__amount { font-size: 56px; margin-top: 14px; }
.price--featured[data-plan="yearly"] [data-show="monthly"],
.price--featured[data-plan="monthly"] [data-show="yearly"] { display: none; }

/* ─── FAQ ────────────────────────────────────────────────────────────────── */
.faq { max-width: 760px; margin-inline: auto; display: grid; gap: 10px; }
.faq details { background: var(--bg-elev); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; font-weight: 700; font-size: 16.5px; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--primary); transition: transform 200ms var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin-top: 10px; font-size: 15.5px; }
.faq a { color: var(--primary); text-decoration: underline; }

/* ─── Closing call to action ─────────────────────────────────────────────── */
.cta {
  position: relative; overflow: hidden; text-align: center; border-radius: var(--radius-xl); padding: clamp(36px, 6vw, 64px) var(--gutter);
  background: var(--bg-soft); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--line);
}
.cta p { margin: 14px auto 0; max-width: 46ch; }
.cta .store-badge { margin-top: 26px; }
.cta__chester { position: absolute; right: 2%; bottom: -10px; width: 180px; }
@media (max-width: 800px) { .cta__chester { display: none; } }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
footer { padding-block: 48px 36px; margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--line); }
.foot__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 28px; margin-bottom: 32px; }
@media (max-width: 640px) { .foot__grid { grid-template-columns: 1fr 1fr; } .foot__brand { grid-column: 1 / -1; } }
.foot__brand p { margin-top: 10px; max-width: 34ch; font-size: 14px; }
.foot__col h4 { font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-light); margin-bottom: 12px; }
.foot__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot__col a { color: var(--text-secondary); font-size: 14.5px; }
.foot__col a:hover { color: var(--primary); }
.foot__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text-light); font-size: 13px; }
.foot__legal a { text-decoration: underline; }

/* ─── Doc pages (privacy / terms / support) ──────────────────────────────── */
.doc { max-width: 800px; margin-inline: auto; padding-block: clamp(40px, 6vw, 80px); }
.doc h1 { font-size: clamp(34px, 5vw, 50px); }
.doc .meta { color: var(--text-light); font-size: 13px; margin: 12px 0 32px; }
.doc h2 { font-size: 22px; margin: 36px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.doc h2:first-of-type { border-top: 0; padding-top: 0; }
.doc h3 { font-size: 17px; margin: 20px 0 8px; }
.doc p, .doc li { font-size: 16px; line-height: 1.65; color: var(--text-secondary); }
.doc p { margin-block: 10px; }
.doc ul, .doc ol { margin-block: 10px; padding-left: 1.4em; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--text); }
.doc a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { .doc a { color: var(--primary-light); } }
.doc__back { display: inline-flex; gap: 6px; color: var(--text-secondary); font-weight: 600; font-size: 14px; margin-bottom: 22px; }
.doc__back:hover { color: var(--primary); }
.contact-card { margin-top: 32px; background: var(--bg-elev); border: 2px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--chunky); padding: 26px; }
.contact-card h3 { margin-bottom: 6px; }
.contact-card .btn { margin-top: 16px; }

/* ─── Reveal on scroll ───────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
