/* Article pages and /articles. Tokens and the header/footer mirror landing.css; change them together. */
@font-face {
  font-family: Bricolage;
  src: url("/assets/bricolage-grotesque.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --canvas: #fcf8f3;
  --ink: #020319;
  --muted: #53515e;
  --violet: #4330e2;
  --coral: #fc4f33;
  --mint: #7ccaba;
  --lime: #c5dc3e;
  --burgundy: #65021d;
  --lavender: #e7e0ff;
  --lavender-soft: #f4effb;
  --line: #dedad5;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 88px;
}
html,
body {
  overflow-x: clip;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font:
    16px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
a:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 4px;
}
h1,
h2,
h3 {
  font-family: Bricolage, sans-serif;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
p,
li {
  text-wrap: pretty;
}
svg {
  display: block;
}
.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.apple-icon {
  width: 30px;
  height: 30px;
  fill: currentColor;
  flex: none;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 10;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
}
.skip-link:focus {
  top: 16px;
}
.wrap {
  width: min(1200px, calc(100% - 96px));
  margin-inline: auto;
}
.tile-violet {
  background: var(--violet);
  color: var(--canvas);
}
.tile-coral {
  background: var(--coral);
  color: var(--ink);
}
.tile-lime {
  background: var(--lime);
  color: var(--ink);
}
.tile-mint {
  background: var(--mint);
  color: var(--ink);
}
.tile-burgundy {
  background: var(--burgundy);
  color: var(--canvas);
}
.tile-lavender {
  background: var(--lavender);
  color: var(--ink);
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 100px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font:
    800 27px/1 Bricolage,
    sans-serif;
  letter-spacing: -1px;
  text-decoration: none;
}
.wordmark img {
  border-radius: 11px;
}
.wordmark-dot {
  color: var(--coral);
}
.site-header nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
  margin-right: 40px;
}
.site-header nav a {
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--violet);
}
.button-small {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--canvas);
  font:
    650 14px/1 Bricolage,
    sans-serif;
  text-decoration: none;
  transition: background 0.25s;
}
.button-small:hover {
  background: var(--violet);
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  min-height: 128px;
}
.site-footer .wordmark {
  font-size: 24px;
}
.site-footer > p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.site-footer nav {
  display: flex;
  gap: 24px;
}
.site-footer nav a {
  font-size: 13px;
  text-decoration: none;
}
.site-footer nav a:hover {
  color: var(--violet);
}
.article-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.article-kicker a {
  text-underline-offset: 3px;
}
.article-hero {
  padding-block: 64px;
}
.article-hero-layout,
.index-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 48px;
}
.article-hero h1,
.index-hero h1 {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.article-dek {
  max-width: 620px;
  margin: 22px 0 0;
  font-size: 19px;
  line-height: 1.6;
}
.article-meta {
  margin: 26px 0 0;
  font-size: 14px;
  opacity: 0.85;
}
.article-art {
  width: 260px;
  height: 260px;
  transform: rotate(6deg);
  filter: drop-shadow(0 14px 8px #0203191f);
}
.index-hero {
  padding-block: 56px 72px;
}
.index-hero .article-kicker {
  color: var(--violet);
}
.index-hero .article-dek {
  color: var(--muted);
}
.index-list {
  padding-bottom: 110px;
}
.index-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}
.index-topics a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--violet);
  font: 650 14px/1.4 Bricolage, sans-serif;
  text-decoration: none;
}
.index-topics a:hover {
  border-color: var(--violet);
  background: var(--lavender-soft);
}
.index-topic {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.index-topic + .index-topic {
  margin-top: clamp(48px, 6vw, 72px);
}
.index-topic > h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 0 0 28px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 750;
  line-height: 1.15;
}
.index-topic-count {
  color: var(--muted);
  font: 550 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: normal;
}
.article-body {
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  padding-block: 64px 40px;
  font-size: 18px;
  line-height: 1.75;
}
.article-body > p,
.article-body > ul {
  margin: 0 0 20px;
}
.article-body > h2 {
  margin: 52px 0 16px;
  font-size: 30px;
  font-weight: 750;
  line-height: 1.15;
}
.article-body li {
  margin-bottom: 10px;
  padding-left: 4px;
}
.article-body li::marker {
  color: var(--violet);
}
.article-body a {
  color: var(--violet);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.takeaways {
  margin-bottom: 44px;
  padding: 26px 30px 12px;
  border-radius: 24px;
  background: var(--lavender-soft);
  font-size: 17px;
}
.takeaways h2 {
  margin: 0 0 12px;
  font-size: 20px;
}
.takeaways ul {
  margin: 0;
  padding-left: 22px;
}
.article-toc {
  margin: -16px 0 44px;
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
}
.article-toc summary {
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
}
.article-toc ul {
  margin: 12px 0 0;
  padding-left: 20px;
}
.article-toc li {
  margin-bottom: 6px;
}
.article-toc li:last-child {
  margin-bottom: 0;
}
.article-toc a {
  overflow-wrap: anywhere;
}
.table-wrap {
  margin: 28px 0 32px;
  overflow-x: auto;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.45;
}
.table-wrap th,
.table-wrap td {
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table-wrap thead th {
  border-bottom: 2px solid var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.03em;
}
.table-wrap thead th span {
  font-weight: 400;
  color: var(--muted);
}
.table-wrap tbody th {
  font-family: Bricolage, sans-serif;
  font-weight: 650;
}
.table-wrap tbody th span {
  display: block;
  margin-top: 2px;
  font:
    400 13px/1.4 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--muted);
}
.table-wrap td:last-child {
  white-space: nowrap;
}
.prose-table td:last-child {
  white-space: normal;
}
.table-wrap figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
/* A picture in the body: the wide scene under the first paragraph, or a chart drawn from one of the page's tables. */
.article-figure {
  margin: 32px 0 36px;
}
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--lavender-soft);
}
.article-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.sources {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.sources h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--ink);
}
.sources ol {
  margin: 0;
  padding-left: 20px;
}
.sources li {
  margin-bottom: 8px;
}
.sources a {
  overflow-wrap: anywhere;
}
.disclaimer {
  margin-top: 28px;
  padding: 16px 20px;
  border-radius: 16px;
  background: #f1ece5;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.related {
  padding-block: 56px 110px;
  border-top: 1px solid var(--line);
}
.related > h2 {
  margin: 0 0 32px;
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 750;
  line-height: 1.05;
}
.article-cta {
  background: var(--violet);
  color: var(--canvas);
  overflow: hidden;
}
.article-cta-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  align-items: center;
  gap: 40px;
  padding-block: 64px;
}
.article-cta h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.04;
}
.article-cta p {
  max-width: 480px;
  margin: 18px 0 0;
  font-size: 16px;
  color: #e3ddff;
}
.article-cta img {
  width: 100%;
  height: auto;
  transform: rotate(-9deg);
  filter: drop-shadow(0 16px 0 #21147533);
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 12px 24px 13px 15px;
  border-radius: 14px;
  background: var(--canvas);
  color: var(--ink);
  font:
    700 23px/1.1 Bricolage,
    sans-serif;
  text-decoration: none;
}
.store-badge small {
  display: block;
  font:
    400 11px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
@media (max-width: 1100px) {
  .wrap {
    width: calc(100% - 64px);
  }
  .site-header nav {
    gap: 22px;
    margin-right: 12px;
  }
  .article-art {
    width: 210px;
    height: 210px;
  }
}
@media (max-width: 800px) {
  .wrap {
    width: calc(100% - 48px);
  }
  .site-header {
    height: 88px;
    gap: 12px;
  }
  .site-header nav {
    gap: 18px;
    margin: 0;
  }
  .site-header nav a {
    font-size: 13px;
  }
  .button-small {
    padding: 12px 16px;
    font-size: 13px;
  }
  .article-hero {
    padding-block: 48px;
  }
  .article-art {
    width: 170px;
    height: 170px;
  }
  .article-dek {
    font-size: 17px;
  }
  .site-footer {
    flex-wrap: wrap;
    padding-block: 30px;
  }
  .site-footer > p {
    order: 3;
    width: 100%;
    text-align: center;
  }
}
@media (max-width: 600px) {
  .wrap {
    width: calc(100% - 40px);
  }
  .site-header nav {
    display: none;
  }
  .wordmark {
    font-size: 24px;
  }
  .wordmark img {
    width: 34px;
    height: 34px;
  }
  .article-hero {
    padding-block: 32px 40px;
  }
  .article-hero-layout,
  .index-hero {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .article-art {
    grid-row: 1;
    justify-self: end;
    width: 120px;
    height: 120px;
    margin-bottom: -28px;
  }
  .article-hero h1,
  .index-hero h1 {
    margin-top: 12px;
    font-size: clamp(2.1rem, 9vw, 2.6rem);
  }
  .article-dek {
    margin-top: 16px;
    font-size: 16px;
  }
  .article-meta {
    margin-top: 18px;
    font-size: 13px;
  }
  .index-hero {
    padding-block: 24px 48px;
  }
  .index-list {
    padding-bottom: 72px;
  }
  .article-body {
    padding-top: 40px;
    font-size: 17px;
  }
  .article-body > h2 {
    margin-top: 44px;
    font-size: 25px;
  }
  .takeaways {
    padding: 22px 22px 8px;
    font-size: 16px;
  }
  .table-wrap table {
    font-size: 15px;
  }
  .article-figure {
    margin: 24px 0 28px;
  }
  .article-figure img {
    border-radius: 18px;
  }
  .prose-table thead {
    display: none;
  }
  .prose-table tr,
  .prose-table th,
  .prose-table td {
    display: block;
  }
  .prose-table tbody th {
    padding-top: 18px;
    border-bottom: 0;
  }
  .prose-table td {
    padding-top: 6px;
  }
  .prose-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.03em;
    color: var(--muted);
  }
  .related {
    padding-block: 44px 72px;
  }
  .article-cta-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-block: 52px 36px;
    text-align: center;
  }
  .article-cta p {
    margin-inline: auto;
  }
  .article-cta img {
    width: 200px;
    justify-self: center;
  }
  .site-footer nav {
    gap: 16px;
  }
}

/* Printing an article (the free printable protein tracker relies on this): text and tables only, no site chrome. */
@media print {
  .skip-link,
  .site-header,
  .site-footer,
  .article-cta,
  .related,
  .article-toc,
  .article-art {
    display: none !important;
  }
  body,
  .article-hero {
    background: #fff !important;
    color: #000 !important;
  }
  .article-hero h1,
  .article-dek,
  .article-meta,
  .article-kicker,
  .article-kicker a {
    color: #000 !important;
  }
  .article-body a {
    color: inherit;
    text-decoration: none;
  }
  .table-wrap,
  .article-figure {
    break-inside: avoid;
  }
  .table-wrap th,
  .table-wrap td {
    border: 1px solid #888;
  }
}

/* The original box stays in flow; only the contents and full-width surface compact. */
.site-header {
  --header-height: 100px;
  --stuck-height: 72px;
  position: sticky;
  top: 0;
  z-index: 5;
  pointer-events: none;
}
.site-header::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: var(--header-height);
  z-index: -1;
  background: var(--canvas);
  pointer-events: none;
  transition: height 200ms ease-out, background 200ms ease-out, box-shadow 200ms ease-out;
}
.site-header > * {
  pointer-events: auto;
  translate: 0 0;
  transition: translate 200ms ease-out;
}
.site-header.is-stuck::before {
  height: var(--stuck-height);
  box-shadow: inset 0 -1px var(--line);
}
.site-header.is-stuck > * {
  translate: 0 calc((var(--stuck-height) - var(--header-height)) / 2);
}
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .site-header.is-stuck::before {
    background: rgba(252, 248, 243, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}
@media (max-width: 800px) {
  html { scroll-padding-top: 76px; }
  .site-header { --header-height: 88px; --stuck-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header::before,
  .site-header > * { transition: none; }
}
@media print {
  .site-header { display: none; }
}
