:root {
  color-scheme: light;
  --ink: #171a15;
  --muted: #64695f;
  --paper: #f5f7f2;
  --surface: #ffffff;
  --green: #54d20e;
  --line: rgba(23, 26, 21, 0.14);
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; text-underline-offset: 3px; }

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 44px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { font-size: 21px; font-weight: 700; text-decoration: none; }
.back { color: var(--muted); font-size: 14px; }

main { padding: 72px 0 100px; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  align-items: end;
  gap: clamp(48px, 8vw, 120px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(52px, 8vw, 94px);
  font-weight: 400;
  line-height: 0.94;
}

h1 span { color: var(--green); }

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.audit {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 64px 0 0;
  border-block: 1px solid var(--line);
}

.audit div { padding: 24px 0; }
.audit div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.audit strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 400; }
.audit span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }

.method { padding: 72px 0; }
.method h2, .catalog h2, .source-note h2 { margin: 0; font-size: 24px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 24px; }
.method p, .source-note p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.method strong { color: var(--ink); }

.catalog { border-top: 1px solid var(--ink); padding-top: 28px; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.catalog-heading output { color: var(--muted); font-size: 14px; }

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.3fr);
  gap: 12px;
  margin: 30px 0 18px;
}

.controls label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.controls input, .controls select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
}
.controls input:focus, .controls select:focus { outline: 2px solid var(--green); outline-offset: 1px; }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { padding: 13px 10px; color: var(--muted); font-size: 11px; text-align: right; text-transform: uppercase; white-space: nowrap; }
th:first-child, th:nth-child(2) { text-align: left; }
td { padding: 20px 10px; border-top: 1px solid var(--line); font-size: 14px; text-align: right; vertical-align: top; white-space: nowrap; }
td:first-child, td:nth-child(2) { text-align: left; }
.food-cell { min-width: 320px; white-space: normal; }
.food-name { display: block; margin-bottom: 5px; font-size: 16px; font-weight: 700; }
.source-description { display: block; max-width: 480px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.source-link { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; }
.serving { min-width: 150px; white-space: normal; }
.serving span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.number::after { content: " g"; color: var(--muted); font-size: 11px; }
.loading, .empty { padding: 42px 10px; color: var(--muted); text-align: center; }
.empty { margin: 0; border-top: 1px solid var(--line); }

.source-note { max-width: 680px; margin-top: 84px; }
.source-note p { margin: 14px 0 18px; }
.source-note a { font-size: 14px; font-weight: 700; }

footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
footer span:last-child { display: flex; gap: 18px; }

@media (max-width: 760px) {
  main { padding-top: 48px; }
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .audit { grid-template-columns: 1fr; margin-top: 44px; }
  .audit div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .method-grid { grid-template-columns: 1fr; gap: 18px; }
  .controls { grid-template-columns: 1fr; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { display: grid; grid-template-columns: repeat(5, 1fr); padding: 22px 0; border-top: 1px solid var(--line); }
  td { padding: 7px 6px; border: 0; text-align: left; white-space: normal; }
  td::before { display: block; margin-bottom: 3px; color: var(--muted); content: attr(data-label); font-size: 10px; text-transform: uppercase; }
  td:first-child, td:nth-child(2) { grid-column: 1 / -1; padding-block: 4px 12px; }
  td:nth-child(2) { padding-bottom: 16px; }
  .food-cell, .serving { min-width: 0; }
  .loading { grid-column: 1 / -1; }
}

@media (max-width: 440px) {
  .site-header, main, footer { width: min(100% - 32px, 1180px); }
  tr { grid-template-columns: repeat(3, 1fr); }
  td:nth-last-child(-n + 2) { grid-column: span 1; }
  footer { flex-direction: column; gap: 12px; }
}
