/* Advanced Nutrition Network
   Design note: this is reference material read on a phone in a grocery aisle.
   The signature element is the ratio number itself, set large, in a technical
   face, because that number is the entire product. Everything else stays quiet.
   Type pairing: Space Grotesk (data/display) with Source Serif 4 (body):
   instrument-panel precision against editorial warmth. */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap');

:root {
  --ink: #14231f;
  --paper: #fbfaf7;
  --rule: #ddd9d0;
  --muted: #5d6b66;
  --potassium: #17694a;
  --sodium: #a8432c;
  --amber: #9a6b12;
  --max: 46rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

main { max-width: var(--max); margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* ---------- header / footer ---------- */
header.site {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
  align-items: baseline; justify-content: space-between;
  max-width: var(--max); margin: 0 auto;
}
.brand {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700; letter-spacing: -.02em;
  font-size: 1rem; text-decoration: none; color: var(--ink);
}
header.site nav { display: flex; gap: 1rem; }
header.site nav a {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .8125rem; color: var(--muted); text-decoration: none;
}
header.site nav a:hover, .brand:hover { color: var(--potassium); }

footer.site {
  max-width: var(--max); margin: 0 auto;
  border-top: 1px solid var(--rule);
  padding: 1.5rem 1.25rem 3rem;
  font-size: .8125rem; color: var(--muted);
}
footer.site a { color: var(--muted); }
.disc { margin: 0 0 .75rem; }

/* ---------- type ---------- */
h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.75rem, 5.5vw, 2.5rem);
  line-height: 1.1; letter-spacing: -.025em;
  font-weight: 700; margin: .25rem 0 1rem;
}
h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.125rem; letter-spacing: -.01em;
  margin: 2.25rem 0 .5rem;
}
.lede { font-size: 1.125rem; color: var(--muted); margin-top: 0; }
.crumb {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 0;
}
.crumb a { color: var(--muted); }
a { color: var(--potassium); }

/* ---------- the signature: the ratio ---------- */
.hero {
  border-left: 3px solid var(--potassium);
  padding: 1rem 0 1rem 1.125rem;
  margin: 1.5rem 0 2rem;
}
.ratio { display: flex; flex-direction: column; }
.ratio .num {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2.75rem, 13vw, 4.5rem);
  line-height: .95; letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.ratio .lab {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .75rem; text-transform: uppercase;
  letter-spacing: .13em; color: var(--muted); margin-top: .5rem;
}
.rating {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 500; font-size: .9375rem; margin: .75rem 0 0;
}

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9375rem; }
th, td { text-align: left; padding: .5rem .5rem .5rem 0; border-bottom: 1px solid var(--rule); }
th {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 500;
}
th small { text-transform: none; letter-spacing: 0; font-weight: 400; }
td { font-variant-numeric: tabular-nums; }
.r { text-align: right; }

.db { font-size: .875rem; }
.db td:first-child { font-weight: 600; }
.db a { text-decoration: none; }
.db a:hover { text-decoration: underline; }

/* ---------- controls ---------- */
.controls { display: flex; gap: .5rem; margin: 1.5rem 0 .5rem; flex-wrap: wrap; }
.controls input, .controls select {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .9375rem; padding: .55rem .7rem;
  border: 1px solid var(--rule); border-radius: 2px;
  background: #fff; color: var(--ink); flex: 1 1 12rem;
}
.controls input:focus, .controls select:focus {
  outline: 2px solid var(--potassium); outline-offset: 1px; border-color: transparent;
}
.count {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .8125rem; color: var(--muted);
}

/* ---------- misc ---------- */
.note, .swap {
  border-left: 2px solid var(--rule);
  padding-left: .875rem; color: var(--muted); font-size: .9375rem;
}
.gf { font-size: .9375rem; color: var(--muted); }

a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--potassium); outline-offset: 2px;
}

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

@media (max-width: 30rem) {
  .db th:nth-child(2), .db td:nth-child(2) { display: none; }  /* hide category on small screens */
  main { padding: 1rem 1rem 3rem; }
}

/* ---------- homepage doors ---------- */
.doors { display: grid; gap: .75rem; margin: 2rem 0; }
.door {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); border-left: 3px solid var(--potassium);
  padding: 1rem 1.125rem; background: #fff;
}
.door:hover { border-left-color: var(--sodium); }
.door .k {
  display: block; font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -.015em; margin-bottom: .25rem;
}
.door .d { display: block; font-size: .9375rem; color: var(--muted); line-height: 1.5; }

/* ---------- lists ---------- */
.spokes, .buyorder { padding-left: 1.15rem; }
.spokes li, .buyorder li { margin-bottom: .5rem; }
.spokes { list-style: none; padding-left: 0; }
.spokes li { border-bottom: 1px solid var(--rule); padding: .55rem 0; margin: 0; }
.buyorder li::marker { font-family: 'Space Grotesk', system-ui, sans-serif; color: var(--muted); }

/* ---------- affiliate ---------- */
.aff {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .8125rem; color: var(--muted);
  border-left: 2px solid var(--rule); padding: .4rem 0 .4rem .875rem; margin: 1.25rem 0;
}
a.buy {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 500; text-decoration: none;
  border-bottom: 2px solid var(--potassium);
}
a.buy:hover { background: var(--potassium); color: #fff; border-bottom-color: var(--potassium); }
a.buy::after { content: " \2197"; font-size: .85em; }

@media print {
  header.site nav, .aff, footer.site { display: none; }
  body { font-size: 10.5pt; }
  main { max-width: none; padding: 0; }
  a { text-decoration: none; color: #000; }
  a.buy::after { content: ""; }
}

/* pending items, visible so they cannot be forgotten */
.todo {
  background: #fff6e5; border-left: 3px solid var(--amber);
  padding: .6rem .875rem; font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .875rem; color: #7a5400;
}
.buyrow { margin: 1.5rem 0; font-size: 1.0625rem; }

/* ---------- figures ---------- */
figure { margin: 1.75rem 0; }
figure img { width: 100%; height: auto; display: block; }
figcaption {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: .8125rem; color: var(--muted);
  margin-top: .6rem; padding-left: .875rem; border-left: 2px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: .5rem; }
.brand img { display: block; }
