/* Nutribyte website. The app's own fonts (Fredoka, Nunito; SIL Open Font
   License) and colours. */

@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("fonts/nunito-regular.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 600; font-display: swap; src: url("fonts/nunito-semibold.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("fonts/nunito-bold.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("fonts/nunito-extrabold.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url("fonts/fredoka-medium.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("fonts/fredoka-semibold.woff2") format("woff2"); }

:root {
  --paper: #fbf8f3;
  --paper-2: #f5eee3;
  --card: #ffffff;
  --cream: #fff2e2;
  --ink: #2b2118;
  --ink-2: #5a4a3b;
  --ink-3: #8a7866;
  --line: #eadfcf;
  --orange: #f06c08;
  --orange-2: #f28c28;
  --orange-ink: #b45309;
  --leaf: #3fa34d;
  --leaf-edge: #2d7d39;
  --leaf-soft: #e6f3e3;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(43, 33, 24, 0.04), 0 8px 24px -12px rgba(43, 33, 24, 0.18);
  --display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --text: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--orange-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange); }

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

h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--ink); line-height: 1.12; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }

p { margin: 0 0 1em; }

.container { width: min(100% - 48px, 1120px); margin-inline: auto; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 50;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; color: #fff; }

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

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 248, 243, 0.9);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(234, 223, 207, 0.7);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.375rem/1 var(--display); }
.brand:hover { color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 11px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }

/* ── Buttons and store links ──────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font: 700 1rem/1 var(--text); text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-primary { background: var(--leaf); color: #fff; box-shadow: 0 4px 0 var(--leaf-edge); }
.btn-primary:hover { color: #fff; background: #46ad55; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--leaf-edge); }
.btn-quiet { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-quiet:hover { color: var(--ink); box-shadow: inset 0 0 0 1px #d8c9b4; }

.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 18px 8px 14px; border-radius: 14px;
  background: var(--ink); color: #fff; text-decoration: none;
}
.store:hover { color: #fff; background: #3a2d22; }
.store svg { width: 24px; height: 24px; flex: none; }
.store small { display: block; font-size: 0.7rem; line-height: 1.1; opacity: 0.8; }
.store strong { display: block; font: 600 1.05rem/1.15 var(--display); }

.soon { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; }
.soon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange-2); box-shadow: 0 0 0 4px rgba(242, 140, 40, 0.18); }

/* ── Landing page ─────────────────────────────────────────────────────── */

.hero { padding: 64px 0 88px; overflow: hidden; }
.hero .container { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); align-items: center; gap: 48px; }
.hero h1 { font-size: clamp(2.6rem, 5.2vw, 4rem); line-height: 1.04; }
.hero h1 span { color: var(--orange); }
.lead { margin: 22px 0 32px; max-width: 34ch; color: var(--ink-2); font-size: 1.22rem; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.hero-note { margin: 28px 0 0; color: var(--ink-3); font-size: 0.95rem; }

.tag { display: inline-block; margin-bottom: 18px; padding: 6px 12px; border-radius: 999px; background: var(--cream); color: var(--orange-ink); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.01em; }

.hero-art { position: relative; height: 600px; }
.hero-art::before { content: ""; position: absolute; inset: 48px 0 auto 6%; aspect-ratio: 1; width: 88%; border-radius: 50%; background: var(--cream); }
.hero-art .phone { position: absolute; }
.hero-art .phone.back { left: 2%; top: 64px; width: 238px; transform: rotate(-4deg); }
.hero-art .phone.front { right: 4%; top: 0; width: 268px; }
.hero-art .pup { position: absolute; left: -4%; bottom: 20px; width: 118px; filter: drop-shadow(0 10px 14px rgba(60, 38, 16, 0.2)); }

.phone {
  padding: 9px; border-radius: 42px;
  background: #1f1913;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 28px 48px -22px rgba(64, 40, 16, 0.5), 0 6px 14px -6px rgba(64, 40, 16, 0.25);
}
.phone img { width: 100%; height: auto; aspect-ratio: 856 / 1852; border-radius: 33px; background: #f2f2f7; }

.section { padding: 96px 0; }
.section.tint { background: var(--paper-2); }
.section-head { max-width: 40rem; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.kicker { margin: 0 0 12px; color: var(--orange-ink); font-weight: 800; font-size: 0.9rem; letter-spacing: 0.02em; }
.section h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); }
.section-head p { margin: 16px 0 0; color: var(--ink-2); font-size: 1.12rem; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 72px; }
.split.flip > :first-child { order: 2; }
.split h2 { margin-bottom: 18px; }
.split > div > p { color: var(--ink-2); font-size: 1.1rem; }
.media { display: flex; justify-content: center; }
.media .phone { width: min(300px, 80%); }

.checks { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 34px; color: var(--ink-2); }
.checks li strong { color: var(--ink); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--leaf-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232d7d39' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.foods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.food { padding: 18px 10px 14px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); text-align: center; }
.food img { width: 64px; height: 64px; margin: 0 auto 10px; }
.food span { display: block; font-weight: 700; font-size: 0.95rem; }
.food small { display: block; color: var(--ink-3); font-size: 0.82rem; }

.trackers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; margin-top: 28px; }
.tracker h3 { font: 800 1.02rem/1.3 var(--text); margin-bottom: 4px; }
.tracker p { margin: 0; color: var(--ink-2); font-size: 0.98rem; }

.rules { display: grid; gap: 14px; margin-top: 28px; }
.rule { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 18px 20px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.rule b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--cream); color: var(--orange-ink); font: 600 1.15rem/1 var(--display); }
.rule p { margin: 0; color: var(--ink-2); }
.rule p strong { color: var(--ink); }

.companion { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.companion-art { position: relative; padding: 32px; border-radius: 32px; background: var(--card); box-shadow: var(--shadow); }
.companion-art .pup { width: 180px; margin: 0 auto 20px; }
.stickers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stickers figure { margin: 0; text-align: center; }
.stickers img { width: 64px; height: 64px; margin: 0 auto 6px; }
.stickers figcaption { color: var(--ink-3); font-size: 0.8rem; font-weight: 700; line-height: 1.3; }

.privacy-band { padding: 88px 0; background: var(--ink); color: #f6efe5; }
.privacy-band h2 { color: #fff; font-size: clamp(1.9rem, 3.2vw, 2.5rem); }
.privacy-band .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 56px; align-items: start; }
.privacy-band p.intro { margin-top: 16px; color: #d9cbb8; font-size: 1.08rem; }
.privacy-band a { color: #ffd2a3; }
.points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
.points h3 { color: #fff; font: 800 1.02rem/1.3 var(--text); margin-bottom: 6px; }
.points p { margin: 0; color: #d9cbb8; font-size: 0.98rem; }

.cta { padding: 96px 0; text-align: center; }
.cta h2 { font-size: clamp(2rem, 3.6vw, 2.75rem); }
.cta p { margin: 14px auto 30px; max-width: 34rem; color: var(--ink-2); font-size: 1.12rem; }
.cta .stores, .cta .hero-actions { justify-content: center; }

/* ── Document pages (privacy, terms, deletion, support) ───────────────── */

.doc-hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.doc-hero h1 { font-size: clamp(2.3rem, 4.4vw, 3.2rem); }
.doc-hero p { margin: 16px 0 0; max-width: 44rem; color: var(--ink-2); font-size: 1.14rem; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 22px; color: var(--ink-3); font-size: 0.92rem; font-weight: 600; }

.doc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 64px; padding: 48px 0 96px; }
.toc { position: sticky; top: 96px; align-self: start; font-size: 0.92rem; }
.toc p { margin: 0 0 10px; color: var(--ink-3); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { background: var(--paper-2); color: var(--ink); }

.prose { max-width: 46rem; font-size: 1.02rem; }
.prose > h2 { margin: 56px 0 14px; font-size: 1.55rem; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { margin: 30px 0 8px; font: 800 1.08rem/1.35 var(--text); }
.prose p, .prose li { color: #3d3026; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.prose li { margin: 0 0 0.45em; padding-left: 0.2em; }
.prose li::marker { color: var(--ink-3); }
.prose strong { color: var(--ink); }

.summary { margin: 0 0 8px; padding: 26px 28px; border-radius: var(--radius); background: var(--cream); }
.summary h2 { margin: 0 0 12px !important; font-size: 1.2rem !important; }
.summary ul { margin: 0; }
.summary li { color: var(--ink-2); }

.note { margin: 22px 0; padding: 16px 20px; border-left: 4px solid var(--orange-2); border-radius: 0 14px 14px 0; background: var(--card); box-shadow: var(--shadow); color: var(--ink-2); }
.note strong { color: var(--ink); }

.table { margin: 18px 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.table table { width: 100%; border-collapse: collapse; font-size: 0.94rem; line-height: 1.5; }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { background: var(--paper-2); color: var(--ink); font-weight: 800; font-size: 0.86rem; }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { color: var(--ink); font-weight: 700; min-width: 9rem; }
.table td { color: #3d3026; }

.contact-card { margin-top: 40px; padding: 26px 28px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.contact-card h2 { margin: 0 0 8px !important; font-size: 1.25rem !important; }
.contact-card p { margin: 0; color: var(--ink-2); }

/* Deletion page */
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 8px 0 12px; }
.option { padding: 26px 26px 22px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.option h2 { margin: 0 0 4px !important; font-size: 1.3rem !important; }
.option > p { color: var(--ink-3); font-weight: 600; font-size: 0.95rem; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; margin: 18px 0 0 !important; }
.steps li { counter-increment: step; position: relative; padding-left: 42px !important; margin-bottom: 14px !important; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--cream); color: var(--orange-ink); font: 600 0.95rem/1 var(--display); }

.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 20px 0 28px; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 34px 16px 0 0; margin: 0 !important; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 9px; width: 18px; height: 18px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 5px var(--orange-2); }
.timeline li::after { content: ""; position: absolute; left: 24px; right: 8px; top: 17px; height: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline b { display: block; color: var(--ink); font-weight: 800; }
.timeline span { display: block; color: var(--ink-2); font-size: 0.95rem; }

/* Support page */
.help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.help-card { padding: 24px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.help-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.help-card p { margin: 0 0 14px; color: var(--ink-2); font-size: 0.98rem; }
.help-card p:last-child { margin-bottom: 0; }

.faq { padding: 64px 0 96px; }
.faq .container { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 64px; }
.faq-group + .faq-group { margin-top: 44px; }
.faq-group h2 { margin-bottom: 12px; font-size: 1.45rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { position: relative; list-style: none; cursor: pointer; padding: 18px 44px 18px 0; color: var(--ink); font-weight: 700; font-size: 1.04rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details > div { padding: 0 0 18px; color: var(--ink-2); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ── Invite (/r/{code}) ───────────────────────────────────────────────── */

.invite { padding: 56px 0 72px; text-align: center; }
.invite .container { max-width: 40rem; }
.invite-pup { width: 120px; margin: 0 auto 18px; }
.invite h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); }
.invite .lead { margin: 18px auto 28px; max-width: 32rem; }
.invite-code { display: grid; justify-items: center; gap: 10px; margin: 0 auto 32px; padding: 22px; max-width: 22rem; border: 2px dashed var(--orange-2); border-radius: var(--radius); background: var(--cream); }
.invite-code span { font: 800 0.8rem/1 var(--text); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.invite-code strong { font: 600 2.4rem/1 var(--display); letter-spacing: 0.08em; color: var(--orange-ink); word-break: break-all; }
.invite-steps { margin: 0 auto 32px; text-align: left; }
.invite .hero-actions { display: flex; justify-content: center; }

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

.site-footer { padding: 56px 0 40px; background: var(--paper-2); border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-grid p { max-width: 26rem; margin: 14px 0 0; }
.footer-grid h2 { margin: 4px 0 12px; font: 800 0.8rem/1 var(--text); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.88rem; }

/* ── Small screens ────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero .container, .split, .companion, .privacy-band .grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .split.flip > :first-child { order: 0; }
  .hero { padding-top: 40px; }
  .hero-art { height: 520px; max-width: 460px; width: 100%; margin-inline: auto; }
  .doc, .faq .container { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .help { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .container { width: min(100% - 32px, 1120px); }
  .site-header .container { min-height: 60px; }
  .brand { font-size: 1.2rem; }
  .brand img { width: 32px; height: 32px; }
  .nav a { padding: 8px 9px; font-size: 0.9rem; }
  .nav .wide { display: none; }
  .lead { font-size: 1.1rem; }
  .hero-art { height: 440px; }
  .hero-art .phone.back { width: 190px; top: 54px; }
  .hero-art .phone.front { width: 212px; }
  .hero-art .pup { width: 92px; left: -2%; bottom: 12px; }
  .section, .cta { padding: 72px 0; }
  .foods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trackers, .points, .options, .timeline { grid-template-columns: minmax(0, 1fr); }
  .timeline li { padding: 0 0 18px 32px; }
  .timeline li::before { top: 3px; }
  .timeline li::after { left: 8px; right: auto; top: 26px; bottom: 0; width: 2px; height: auto; }
  .stickers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table td:first-child { min-width: 7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .toc, .skip { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .doc { display: block; padding: 0; }
  .doc-hero { padding: 0 0 12pt; }
  .summary, .note, .table, .option, .contact-card { box-shadow: none; border: 1px solid #ddd; }
  a { color: inherit; }
}
