/* tallytape.app — the stylesheet of the article pages (everything that is
   not the home page or /foods, which carry their own CSS inline).
   Tokens mirror the DARK side of Tally/Theme/Theme.swift. Green marks a
   daily reference value reached, and a button under the pointer. Red marks
   a ceiling. Nothing else is coloured. */
:root {
  --paper: #000000; --ink: #EDEBE3; --soft: #c9c6bc; --faded: #8B8679; --trace: #2E2C27;
  --met: #34C759; --stamp: #E74A4F;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --prose: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
  --bar: 62px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 18px); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--prose); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
.sheet { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 22px; }
h1, h2, h3 { font-family: var(--mono); font-weight: 600; margin: 0; text-transform: uppercase; }
h1 { font-size: clamp(25px, 6vw, 40px); line-height: 1.2; letter-spacing: 0.05em; text-wrap: balance; max-width: 24ch; }
h2 { font-size: clamp(18px, 4.2vw, 25px); line-height: 1.3; letter-spacing: 0.05em; margin: 0 0 16px; max-width: 30ch; }
h3 { font-size: 13px; line-height: 1.5; letter-spacing: 0.1em; margin-bottom: 6px; }
p { margin: 0 0 16px; max-width: 62ch; }
p:last-child { margin-bottom: 0; }
a { color: var(--ink); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tear { border: none; border-top: 1px dashed var(--trace); margin: 0; }
.g { display: block; fill: currentColor; shape-rendering: crispEdges; flex: none; }
.soft { color: var(--soft); }
.faded { color: var(--faded); }

/* ---- The bar ---- */
.mast { position: sticky; top: 0; z-index: 10; height: var(--bar); background: rgba(0,0,0,0.72); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px dashed var(--trace); }
.mast .sheet { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; margin-right: auto; }
.brand img { display: block; width: 30px; height: 30px; transition: transform 0.4s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.links { display: none; gap: 26px; }
@media (min-width: 800px) { .links { display: flex; } }
.links a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faded); text-decoration: none; padding: 6px 0; background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 1px no-repeat; transition: color 0.2s, background-size 0.3s var(--ease); }
.links a:hover, .links a[aria-current] { color: var(--ink); background-size: 100% 1px; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; transition: background-color 0.18s, border-color 0.18s; }
.btn .g { width: 16.5px; height: 13.5px; }
.btn:hover { background: var(--met); border-color: var(--met); }
.store { display: inline-block; border-radius: 9px; transition: transform 0.35s var(--ease), filter 0.35s; }
.store img { display: block; height: 56px; width: auto; }
.store:hover { transform: translateY(-3px); filter: drop-shadow(0 6px 22px rgba(52,199,89,0.55)); }

/* ---- The page ---- */
.crumbs { padding: 22px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faded); }
.crumbs a { color: var(--faded); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.top { padding: 30px 0 52px; }
.top .lede { font-size: 20px; line-height: 1.5; margin-top: 22px; max-width: 46ch; }
.top .cta { margin-top: 30px; }
.band { padding: 56px 0; }
@media (min-width: 860px) { .band { padding: 76px 0; } }

/* The answer box: the one number the page is about, first. */
.fact { display: grid; gap: 1px; background: var(--trace); border: 1px solid var(--trace); margin-top: 34px; font-family: var(--mono); }
@media (min-width: 720px) { .fact { grid-template-columns: repeat(3, 1fr); } }
.fact div { background: var(--paper); padding: 20px 24px; }
.fact small { display: block; font-size: 11px; color: var(--faded); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 6px; }
.fact b { display: block; font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.fact b i { font-style: normal; font-size: 14px; font-weight: 400; color: var(--faded); margin-left: 5px; }

/* A table that reads like the app's panel: a name, a bar, a number. */
.tbl { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; margin-top: 8px; }
.tbl th { text-align: left; font-weight: 400; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faded); padding: 0 14px 10px 0; border-bottom: 1px dashed var(--trace); }
.tbl td { padding: 11px 14px 11px 0; border-bottom: 1px dashed var(--trace); vertical-align: middle; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .w { width: 26%; min-width: 70px; }
.tbl a { text-decoration: none; background: linear-gradient(var(--faded), var(--faded)) left bottom / 100% 1px no-repeat; transition: color 0.2s; }
.tbl tr:hover td { background: #0b0b0a; }
.tbl .yes { color: var(--ink); }
.tbl .no { color: var(--faded); }
.bar { display: block; height: 7px; border: 1px solid var(--trace); }
.bar > span { display: block; height: 100%; background: var(--ink); }
.bar.met > span { background: var(--met); }
@media (max-width: 560px) { .tbl .hide { display: none; } .tbl { font-size: 12px; } }

/* Two or three short blocks side by side. */
.pairs { display: grid; gap: 30px 56px; margin-top: 30px; }
@media (min-width: 720px) { .pairs { grid-template-columns: 1fr 1fr; } }
.pairs p { max-width: 48ch; color: var(--soft); }
.cards { display: grid; gap: 14px; margin-top: 30px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { border: 1px solid var(--trace); padding: 24px 22px 26px; transition: border-color 0.25s, background-color 0.25s, transform 0.4s var(--ease); }
.card .g { width: 44px; height: 36px; margin-bottom: 24px; }
.card p { font-size: 15px; line-height: 1.55; color: var(--soft); }
@media (hover: hover) { .card:hover { border-color: var(--ink); background: #0d0d0c; transform: translateY(-4px); } }

/* Questions: one line each, opened on demand. */
.qa { margin-top: 26px; border-top: 1px dashed var(--trace); }
.qa details { border-bottom: 1px dashed var(--trace); }
.qa summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; transition: padding-left 0.3s var(--ease); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 { margin: 0; }
.qa summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--trace); font-family: var(--mono); font-size: 16px; line-height: 1; transition: transform 0.3s var(--ease), border-color 0.2s, background-color 0.2s, color 0.2s; }
.qa details[open] summary::after { transform: rotate(45deg); }
@media (hover: hover) { .qa summary:hover { padding-left: 10px; } .qa summary:hover::after { border-color: var(--ink); background: var(--ink); color: var(--paper); } }
.qa details p { padding: 0 50px 22px 0; max-width: 66ch; color: var(--soft); }

.note { font-family: var(--mono); font-size: 11px; line-height: 1.7; letter-spacing: 0.04em; color: var(--faded); margin-top: 18px; max-width: 80ch; }
.note a { color: var(--faded); }

.last { padding: 64px 0 76px; }
.last .sheet { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 26px; }
.last h2 { margin: 0; }

footer { padding: 26px 0 44px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
footer a { color: var(--faded); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--ink); }
footer .src { color: var(--faded); margin-top: 14px; max-width: 76ch; letter-spacing: 0; line-height: 1.7; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .up { animation: up 0.8s var(--ease) both; animation-delay: calc(var(--d, 0) * 110ms); }
  @keyframes up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  .tbl .bar > span { transform-origin: left center; animation: fill 0.9s var(--ease) both; animation-delay: calc(0.3s + var(--n, 0) * 40ms); }
  @keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* ───── Added after the editorial review of 2026-11-21: fewer paragraphs,
   more things to look at. ───── */

/* A band on a slightly lifted ground, so sections do not all read alike. */
.band.alt { background: #0a0a09; border-top: 1px dashed var(--trace); border-bottom: 1px dashed var(--trace); }

/* Hero with a phone beside the words. */
.duo { display: grid; gap: 40px; align-items: center; }
@media (min-width: 860px) { .duo { grid-template-columns: minmax(0, 1fr) 380px; gap: 64px; } }
.shot { position: relative; margin: 0; height: 460px; overflow: hidden; display: grid; justify-items: center; align-items: start; padding-top: 26px;
  -webkit-mask-image: linear-gradient(#000 70%, transparent 99%); mask-image: linear-gradient(#000 70%, transparent 99%); }
@media (min-width: 860px) { .shot { height: 560px; } }
.shot::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, #3a3832 1.1px, transparent 1.6px) center / 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%); mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%); }
.phone { position: relative; z-index: 1; width: min(320px, 82vw); padding: 11px; border-radius: 58px;
  background: linear-gradient(140deg, #6b6862 0%, #2a2926 22%, #171614 55%, #3f3d39 100%);
  box-shadow: inset 0 0 0 1px #7c7972, inset 0 0 0 3px #0b0b0a, 0 0 0 1px #000, 0 0 90px -20px rgba(237,235,227,0.22); transition: transform 0.6s var(--ease); }
.phone img { display: block; width: 100%; height: auto; border-radius: 47px; background: #000; }
.phone::before { content: ""; position: absolute; left: 50%; top: 24px; width: 29%; height: 26px; transform: translateX(-50%); border-radius: 15px; background: #000; box-shadow: inset 0 0 0 1px #1d1c1a; }
@media (hover: hover) { .shot:hover .phone { transform: translateY(-10px); } }

/* Four tiles in a row. */
.fact.four { margin-top: 0; }
@media (min-width: 720px) { .fact.four { grid-template-columns: repeat(4, 1fr); } }
.fact p { font-family: var(--prose); font-size: 13px; line-height: 1.45; color: var(--faded); margin: 8px 0 0; }

/* Nutrient chips: a name and its daily amount. */
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; font-family: var(--mono); }
@media (min-width: 620px) { .chips { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .chips { grid-template-columns: repeat(4, 1fr); } }
.chips > * { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--trace); text-decoration: none; transition: border-color 0.2s, background-color 0.2s; }
.chips b { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.chips span { font-size: 12px; color: var(--faded); }
.chips a:hover { border-color: var(--ink); background: #0d0d0c; }
.chips a b::after { content: " ›"; color: var(--faded); }
.group { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faded); margin: 30px 0 0; }

/* An icon and one line: how you log. */
.ways { display: grid; gap: 14px; margin-top: 30px; }
@media (min-width: 760px) { .ways { grid-template-columns: repeat(3, 1fr); } }
.way { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; border: 1px solid var(--trace); padding: 20px; }
.way .g { width: 44px; height: 36px; }
.way p { font-size: 15px; line-height: 1.5; color: var(--soft); margin: 4px 0 0; }
.say { display: inline-block; margin-top: 22px; padding: 12px 16px; border: 1px dashed var(--faded); font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }

/* A sequence: boxes joined by arrows. Used where order is the point. */
.flow { display: grid; gap: 10px; margin-top: 30px; }
@media (min-width: 760px) { .flow { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; } }
.step { position: relative; border: 1px solid var(--trace); padding: 20px 22px 22px; }
.step .k { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faded); margin-bottom: 10px; }
.step p { font-size: 15px; line-height: 1.5; color: var(--soft); margin: 6px 0 0; }
@media (min-width: 760px) {
  .step + .step { border-left: 0; }
  .step:not(:last-child)::after { content: "›"; position: absolute; right: -11px; top: 50%; z-index: 1; width: 21px; height: 21px; margin-top: -11px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--trace); font-family: var(--mono); font-size: 13px; line-height: 1; color: var(--faded); }
}
.band.alt .step:not(:last-child)::after { background: #0a0a09; }

/* Two paths compared, one over the other. */
.paths { display: grid; gap: 14px; margin-top: 30px; }
.path { display: grid; gap: 0; border: 1px solid var(--trace); }
@media (min-width: 760px) { .path { grid-template-columns: 170px repeat(3, 1fr); } }
.path > * { padding: 16px 18px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; line-height: 1.5; border-top: 1px dashed var(--trace); }
.path > *:first-child { border-top: 0; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; background: #0d0d0c; }
@media (min-width: 760px) { .path > * { border-top: 0; border-left: 1px dashed var(--trace); } .path > *:first-child { border-left: 0; } }
.path .end { color: var(--ink); font-weight: 600; }
.path.ours { border-color: var(--ink); }

/* The verdict: two cards, a list of ticks in each. */
.verdict { display: grid; gap: 14px; margin-top: 34px; }
@media (min-width: 760px) { .verdict { grid-template-columns: 1fr 1fr; } }
.verdict > div { border: 1px solid var(--trace); padding: 24px 24px 26px; }
.verdict > div.ours { border-color: var(--ink); }
.verdict h2 { font-size: 13px; line-height: 1.5; letter-spacing: 0.1em; margin: 0; max-width: none; }
.verdict ul, .ticks { list-style: none; margin: 14px 0 0; padding: 0; }
.verdict li, .ticks li { position: relative; padding: 7px 0 7px 26px; color: var(--soft); font-size: 16px; line-height: 1.45; }
.verdict li::before, .ticks li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 9px; height: 9px; background: var(--ink); }
.ticks.two { display: grid; gap: 0 56px; }
@media (min-width: 720px) { .ticks.two { grid-template-columns: 1fr 1fr; } }

/* Comparison cells: a tick, a dash, or a short value. */
.tbl .yes b, .tbl .mark { font-weight: 600; color: var(--ink); }
.tbl .sub { display: block; font-size: 11px; color: var(--faded); letter-spacing: 0.04em; margin-top: 2px; }
.tbl tr.grp td { padding-top: 26px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faded); border-bottom: 1px solid var(--trace); }
.tbl tr.grp:hover td { background: none; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px solid var(--trace); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faded); vertical-align: 1px; }

/* A scale with marks on it: where a food sits against a reference and a limit. */
.scale { position: relative; height: 172px; margin: 34px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
.scale .track { position: absolute; left: 0; right: 0; top: 70px; height: 9px; border: 1px solid var(--trace); }
.scale .track span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.scale .mk { position: absolute; top: 46px; height: 57px; border-left: 1px dashed var(--faded); }
.scale .mk b { position: absolute; top: -34px; left: -1px; padding-left: 8px; border-left: 1px solid var(--faded); white-space: nowrap; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; line-height: 1.35; }
.scale .mk b small { display: block; font-weight: 400; font-size: 11px; color: var(--faded); text-transform: none; letter-spacing: 0.04em; }
.scale .mk.lim { border-left-color: var(--stamp); }
.scale .mk.lim b { border-left-color: var(--stamp); }
.scale .dot { position: absolute; top: 66px; width: 17px; height: 17px; margin-left: -8px; background: var(--paper); border: 2px solid var(--ink); }
.scale .dot i { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); font-style: normal; white-space: nowrap; color: var(--soft); }
.scale .dot.r i { left: auto; right: -2px; transform: none; }
.scale .dot.low i { top: 46px; }
.scale .dot.low::after { content: ""; position: absolute; left: 50%; top: 15px; height: 28px; border-left: 1px dashed var(--trace); }

/* A small grid of numbers with row and column heads. */
.grid2 { display: grid; grid-template-columns: auto 1fr 1fr; gap: 1px; background: var(--trace); border: 1px solid var(--trace); margin-top: 26px; max-width: 560px; font-family: var(--mono); }
.grid2 > * { background: var(--paper); padding: 14px 18px; font-size: 12px; letter-spacing: 0.08em; }
.grid2 .h { color: var(--faded); text-transform: uppercase; font-size: 11px; letter-spacing: 0.14em; }
.grid2 b { font-size: 20px; letter-spacing: 0.01em; }
.grid2 b i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--faded); margin-left: 4px; }
