/* Fix My Diet. One stylesheet, no framework. */

@font-face {
  font-family: 'Bricolage';
  src: url('../fonts/bricolage-grotesque.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/dm-sans.woff2') format('woff2-variations');
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --bg: #f5f1e8;
  --surface: #fffdf8;
  --surface-2: #ede7da;
  --ink: #17160f;
  --ink-2: #55524a;
  --ink-3: #6f6b62;
  --line: rgb(23 22 15 / 0.12);
  --line-strong: rgb(23 22 15 / 0.22);
  --accent: #f0532b;
  --accent-soft: #fde2d8;
  --good: #1d7a45;
  --good-soft: #dcefe1;
  --mid: #a86400;
  --mid-soft: #f7e7c9;
  --bad: #c73a1a;
  --bad-soft: #f9ddd5;
  --track: #e6dfd0;

  --font-display: 'Bricolage', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgb(23 22 15 / 0.04), 0 12px 32px -18px rgb(23 22 15 / 0.35);
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #12110d;
    --surface: #1b1a15;
    --surface-2: #25241e;
    --ink: #f3efe4;
    --ink-2: #bdb8aa;
    --ink-3: #9a9588;
    --line: rgb(243 239 228 / 0.12);
    --line-strong: rgb(243 239 228 / 0.24);
    --accent: #ff6a42;
    --accent-soft: #3a1d14;
    --good: #5fcb8a;
    --good-soft: #15291d;
    --mid: #f0b44c;
    --mid-soft: #33270f;
    --bad: #ff7c5c;
    --bad-soft: #3a1b13;
    --track: #2c2a23;
    --shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 16px 40px -20px rgb(0 0 0 / 0.8);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #12110d;
  --surface: #1b1a15;
  --surface-2: #25241e;
  --ink: #f3efe4;
  --ink-2: #bdb8aa;
  --ink-3: #9a9588;
  --line: rgb(243 239 228 / 0.12);
  --line-strong: rgb(243 239 228 / 0.24);
  --accent: #ff6a42;
  --accent-soft: #3a1d14;
  --good: #5fcb8a;
  --good-soft: #15291d;
  --mid: #f0b44c;
  --mid-soft: #33270f;
  --bad: #ff7c5c;
  --bad-soft: #3a1b13;
  --track: #2c2a23;
  --shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 16px 40px -20px rgb(0 0 0 / 0.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  text-transform: lowercase;
}
/* Citations keep their real casing. */
.paper, .sources-list li, .wins a { text-transform: none; }
main { flex: 1; outline: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.02; letter-spacing: -0.025em; margin: 0; font-weight: 750; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[tabindex='-1']:focus { outline: none; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px; z-index: 50; }
.skip:focus { left: 12px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  max-width: var(--max); width: 100%; margin: 0 auto;
}
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.04em;
  text-decoration: none; display: inline-flex; align-items: center; gap: 1px;
}
.wordmark span { color: var(--accent); }
.wordmark i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-left: 3px; transform: translateY(-7px); }
.topnav { display: flex; gap: 22px; font-size: 15px; font-weight: 500; }
.topnav a { text-decoration: none; color: var(--ink-2); }
.topnav a:hover { color: var(--ink); }
.is-quiz .topnav { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; cursor: pointer; text-decoration: none;
  font-weight: 650; font-size: 17px; line-height: 1;
  padding: 18px 26px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  transition: transform .15s ease, background-color .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn[disabled] { opacity: .35; cursor: not-allowed; transform: none; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-accent { background: var(--accent); color: #1a0a04; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-sm { padding: 12px 18px; font-size: 15px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-grid; place-items: center; background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.icon-btn:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ---------- landing ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(24px, 6vw, 72px) var(--gutter) clamp(40px, 7vw, 88px);
  display: grid; gap: clamp(36px, 5vw, 64px); align-items: center;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2); margin-bottom: 18px; display: inline-flex; gap: 8px; align-items: center; }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.hero h1 { font-size: clamp(48px, 8.2vw, 104px); }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); max-width: 30ch; margin-top: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 34px; }
.hero-cta .note { font-size: 14px; color: var(--ink-3); }

.preview { position: relative; display: grid; gap: 14px; }
.preview-label { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.preview .fix { transform: rotate(-1.2deg); }
.preview .fix + .fix { transform: rotate(1deg) translateX(18px); }
.preview .grade-mini {
  position: absolute; top: -18px; right: -6px; z-index: 2;
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: var(--mid-soft); color: var(--mid);
  font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 1;
  box-shadow: var(--shadow); transform: rotate(8deg);
}

.band { border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 88px) 0; }
.band h2 { font-size: clamp(32px, 4.4vw, 52px); max-width: 16ch; }
.band .intro { color: var(--ink-2); max-width: 52ch; margin-top: 14px; font-size: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; padding: 0; list-style: none; }
.steps li { background: var(--surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.steps b { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: var(--accent); display: block; line-height: 1; margin-bottom: 18px; }
.steps h3 { font-size: 22px; margin-bottom: 8px; }
.steps p { color: var(--ink-2); font-size: 16px; }

.sources-list { margin-top: 28px; }
.sources-list summary { cursor: pointer; font-weight: 650; display: inline-flex; gap: 8px; align-items: center; padding: 12px 18px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line-strong); list-style: none; }
.sources-list summary::-webkit-details-marker { display: none; }
.sources-list summary::after { content: '+'; font-size: 20px; line-height: 1; }
.sources-list[open] summary::after { content: '\2212'; }
.sources-list ol { margin: 24px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
.sources-list li { font-size: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sources-list li a { text-decoration: none; }
.sources-list li a:hover span { text-decoration: underline; }
.sources-list small { display: block; color: var(--ink-3); margin-top: 4px; font-size: 13px; }

/* ---------- quiz ---------- */
.quiz { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 140px; }
.quiz-head { display: flex; align-items: center; gap: 14px; padding: 6px 0 26px; }
.progress { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.progress span { height: 6px; border-radius: 99px; background: var(--track); transition: background-color .3s ease; }
.progress span.done { background: var(--ink); }
.progress span.now { background: var(--accent); }
.step-count { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-3); min-width: 38px; text-align: right; }

.q-title { font-size: clamp(34px, 5.4vw, 60px); max-width: 18ch; }
.q-sub { color: var(--ink-2); font-size: 18px; margin-top: 12px; max-width: 52ch; }
.q-section + .q-section { margin-top: 48px; }
.q-section h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 18px; }
.q-body { margin-top: 32px; }

.goals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.goal {
  text-align: left; cursor: pointer; border: 0; padding: 18px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1.5px transparent;
  display: grid; gap: 4px; align-content: start; min-height: 132px;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.goal:hover { transform: translateY(-2px); }
.goal .e { font-size: 28px; margin-bottom: 10px; }
.goal b { font-size: 17px; font-weight: 650; line-height: 1.2; }
.goal small { color: var(--ink-3); font-size: 14px; }
.goal[aria-checked='true'] { background: var(--ink); color: var(--bg); }
.goal[aria-checked='true'] small { color: inherit; opacity: .7; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  cursor: pointer; border: 0; padding: 12px 18px; border-radius: 999px; font-weight: 550; font-size: 16px;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip[aria-pressed='true']::before { content: '\2713'; margin-right: 8px; }

.foods { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; align-items: start; }
.food {
  position: relative; border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); overflow: hidden;
  transition: background-color .18s ease, color .18s ease, transform .15s ease;
}
.food-toggle {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left;
  padding: 18px 16px; min-height: 76px;
}
.food .e { font-size: 30px; line-height: 1; width: 36px; text-align: center; }
.food .name { font-weight: 600; font-size: 16px; line-height: 1.25; display: block; }
.food .serving { font-size: 13px; color: var(--ink-3); display: block; margin-top: 2px; }
.food .tick {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--line-strong); font-size: 14px; font-weight: 700;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.food:hover:not(.on) { transform: translateY(-2px); }
.food.on { background: var(--ink); color: var(--bg); }
.food.on .serving { color: inherit; opacity: .65; }
.food.on .tick { background: var(--accent); color: #1a0a04; box-shadow: none; }
.food.on .tick::before { content: '\2713'; }
.food.pop { animation: pop .28s ease; }
@keyframes pop { 50% { transform: scale(1.03); } }

.freq {
  display: none; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px 14px 12px;
}
.food.on .freq { display: flex; }
.freq button {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; font-size: 20px; line-height: 1;
  background: color-mix(in srgb, currentColor 16%, transparent); color: inherit; display: grid; place-items: center;
}
.freq button:hover { background: var(--accent); color: #1a0a04; }
.freq output { font-weight: 650; font-size: 15px; font-variant-numeric: tabular-nums; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.dock-inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dock-stats { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dock-stats b { color: var(--ink); }
.dock-actions { display: flex; gap: 10px; }

/* ---------- results ---------- */
.results { max-width: 820px; margin: 0 auto; padding: 8px var(--gutter) 80px; }
.verdict { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.grade {
  width: clamp(112px, 16vw, 148px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; align-content: center; gap: 2px;
  font-family: var(--font-display); font-weight: 800; line-height: 1;
}
.grade b { font-size: clamp(64px, 9vw, 88px); }
.grade small { font-family: var(--font-body); font-size: 13px; font-weight: 600; }
.grade.g-A, .grade.g-B { background: var(--good-soft); color: var(--good); }
.grade.g-C { background: var(--mid-soft); color: var(--mid); }
.grade.g-D, .grade.g-F { background: var(--bad-soft); color: var(--bad); }
.verdict h1 { font-size: clamp(30px, 4.6vw, 48px); }
.verdict .meta { color: var(--ink-2); margin-top: 12px; }
.verdict .meta b { color: var(--ink); }
.jump {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 14px; border-radius: 999px;
  background: var(--good-soft); color: var(--good); font-weight: 650; font-size: 15px;
}

.signals { display: grid; gap: 14px; margin-top: 36px; padding: 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.signal { display: grid; grid-template-columns: 124px 1fr; gap: 12px; align-items: baseline; }
.signal > span { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: 15px; font-weight: 600; padding: 6px 12px; border-radius: 999px; display: inline-flex; gap: 8px; align-items: center; }
.pill small { font-weight: 500; font-variant-numeric: tabular-nums; opacity: .8; font-size: 13px; }
.pill.low { background: var(--mid-soft); color: var(--ink); }
.pill.low::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mid); }
.pill.over { background: var(--bad-soft); color: var(--ink); }
.pill.over::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }

.section-title { font-size: clamp(26px, 3.4vw, 36px); margin: 56px 0 20px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title small { font-family: var(--font-body); font-size: 15px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }

.fix-list { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; counter-reset: fix; }
.fix {
  position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 22px 20px; display: grid; grid-template-columns: 56px 1fr; gap: 4px 18px;
}
.fix-list .fix { counter-increment: fix; }
.fix .e { font-size: 40px; line-height: 1; grid-row: span 2; padding-top: 4px; }
.fix-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.tag.add { background: var(--good-soft); color: var(--good); }
.tag.swap, .tag.cut { background: var(--accent-soft); color: var(--bad); }
.tag.for-goal { background: var(--surface-2); color: var(--ink-2); }
.fix-list .fix-top::after { content: counter(fix, decimal-leading-zero); margin-left: auto; font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--ink-3); }
.fix h3 { font-size: clamp(24px, 3vw, 30px); margin-top: 8px; }
.fix .how { font-weight: 550; margin-top: 6px; }
.fix .body { grid-column: 2; }
.fix .closes { font-size: 14px; color: var(--ink-3); margin-top: 10px; }
.fix .closes b { color: var(--ink-2); font-weight: 600; }
.fix .why { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); color: var(--ink-2); font-size: 16px; }
.fix .why strong { color: var(--ink); font-family: var(--font-display); font-weight: 750; font-size: 18px; margin-right: 6px; }
.paper {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; text-decoration: none;
  font-size: 14px; font-weight: 600; color: var(--ink);
  padding: 8px 12px 8px 10px; border-radius: 10px; background: var(--surface-2);
  transition: background-color .15s ease;
}
.paper:hover { background: var(--accent-soft); }
.paper .doc { width: 18px; height: 18px; flex: none; }
.paper small { font-weight: 500; color: var(--ink-3); font-size: 13px; }

.wins { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.wins li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--good-soft); }
.wins li::before { content: '\2713'; width: 24px; height: 24px; border-radius: 50%; background: var(--good); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 800; margin-top: 1px; }
.wins a { font-size: 14px; color: var(--ink-2); }

.map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; background: var(--surface); padding: 26px; border-radius: var(--radius); box-shadow: var(--shadow); }
.map h3 { font-size: 18px; margin-bottom: 14px; }
.meter { display: grid; gap: 6px; padding: 9px 0; }
.meter-row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.meter-row span:first-child { font-weight: 550; }
.meter-row .val { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.meter-row .val b { color: var(--ink); font-weight: 650; }
.bar { position: relative; height: 10px; border-radius: 99px; background: var(--track); }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%); border-radius: 99px; background: var(--good); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.bar.mid i { background: var(--mid); }
.bar.low i { background: var(--bad); }
.bar.over i { background: var(--bad); }
.bar .goal-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; left: var(--g, 100%); background: var(--ink); border-radius: 2px; }
.status { font-size: 13px; font-weight: 700; margin-left: 8px; }
.status.good { color: var(--good); }
.status.mid { color: var(--mid); }
.status.low, .status.over { color: var(--bad); }
.hero-solo { display: block; padding-bottom: clamp(56px, 9vw, 120px); }
.hero-solo h1 { max-width: 14ch; }
.hero-solo h1 { font-size: clamp(46px, 7.4vw, 92px); letter-spacing: -0.035em; }
.hero-solo .lede { max-width: 38ch; }
.band#sources { padding: 28px 0 40px; }
.roasts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.roasts li { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 2.2vw, 22px); color: var(--bad); line-height: 1.25; }
.week { margin-top: 48px; }
.week summary { cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 750; font-size: clamp(22px, 3vw, 28px); display: flex; align-items: center; gap: 10px; }
.week summary::-webkit-details-marker { display: none; }
.week summary::after { content: '+'; font-size: 24px; color: var(--ink-3); }
.week[open] summary::after { content: '\2212'; }
.week .map { margin-top: 18px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 48px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 40;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { text-align: center; padding: 60px 0; }
.empty p { color: var(--ink-2); margin: 12px 0 24px; }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--max); width: 100%; margin: 0 auto; padding: 32px var(--gutter) 40px;
  border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); display: grid; gap: 6px;
}
.is-quiz .site-footer { display: none; }

/* ---------- motion ---------- */
.rise { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
/* Opacity only: a transform here would trap the fixed dock inside #app. */
.view-in { animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; } }

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

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .goals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .preview { max-width: 460px; }
  .steps { grid-template-columns: 1fr; }
  .sources-list ol { grid-template-columns: 1fr; }
  .map { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .topnav { gap: 16px; font-size: 14px; }
  .goals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal { min-height: 0; padding: 16px; }
  .foods { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .food-toggle { grid-template-columns: 1fr auto; grid-template-rows: auto auto; padding: 14px 12px; gap: 8px; }
  .food .e { grid-column: 1; text-align: left; width: auto; font-size: 28px; }
  .food .tick { grid-column: 2; grid-row: 1; align-self: start; }
  .food .label { grid-column: 1 / -1; }
  .freq { padding: 0 8px 12px; }
  .freq button { width: 32px; height: 32px; }
  .freq output { font-size: 14px; }
  .verdict { grid-template-columns: 1fr; gap: 18px; }
  .signal { grid-template-columns: 1fr; gap: 8px; }
  .fix { grid-template-columns: 1fr; padding: 20px 18px; }
  .fix .e { grid-row: auto; font-size: 34px; }
  .fix .body { grid-column: 1; }
  .dock-stats span.long { display: none; }
  .btn { padding: 16px 22px; }
  .preview .fix + .fix { transform: rotate(1deg) translateX(8px); }
  .preview .grade-mini { right: 0; }
}
