/* The Coffee Swap, v5 ("soft"): modern wellness look. Warm white, soft
   charcoal, sage panels, rounded cards with hairline borders, pill buttons.
   No dark blocks, no texture. No third-party requests. */

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #fbf9f5;
  --white: #ffffff;
  --line: #ebe6de;
  --ink: #2d312e;
  --ink-2: #4a504b;
  --ink-3: #646a65;
  --sage: #4a6651;
  --sage-btn: #3e5a46;
  --sage-btn-hover: #344d3b;
  --sage-50: #edf2ea;
  --sage-100: #e6eee3;
  --oat-50: #f4eee6;
  --sky-50: #eaf2f6;
  --chip: #f0ece6;
  --accent: #9e522a;
  --chart-gray: #8a8f96;
  --star: #d08a3a;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: 20px;
  --radius: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17.5px; line-height: 1.68;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
::selection { background: var(--sage-100); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1.05em; text-wrap: pretty; }
strong { font-weight: 600; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--ink); color: var(--white); padding: 8px 12px; z-index: 50; border-radius: 8px; }
.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; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: 660px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Masthead ---------- */
.masthead { background: var(--bg); border-bottom: 1px solid var(--line); }
.masthead-top { display: flex; justify-content: center; padding: 18px 0 10px; }
.brand { text-decoration: none; display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { width: 24px; height: 24px; flex: none; }
.brand-name { font: 600 21px/1 var(--font); letter-spacing: -0.02em; color: var(--ink); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 12px; font: 500 14px/1 var(--font); }
.nav::-webkit-scrollbar { display: none; }
.nav > :first-child { margin-left: auto; }
.nav > :last-child { margin-right: auto; }
.nav a { color: var(--ink-3); text-decoration: none; white-space: nowrap; padding: 8px 10px; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--chip); }
.nav a[aria-current="page"] { color: var(--sage); background: var(--sage-50); font-weight: 600; }

/* ---------- Article header ---------- */
.article { padding-top: 28px; padding-bottom: 8px; }
.kicker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.kicker {
  display: inline-block; font: 600 12.5px/1 var(--font); color: var(--sage);
  background: var(--sage-50); padding: 7px 12px; border-radius: 999px;
}
.sponsor { display: inline-block; font: 500 12.5px/1 var(--font); color: #5f6560; background: var(--chip); padding: 7px 12px; border-radius: 999px; }
h1, h2, h3 { font-family: var(--font); font-weight: 600; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.05rem, 8.4vw, 3.15rem); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 14px; }
.dek { font-size: 1.14rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 22px; }
.byline {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 0;
  min-height: 40px; padding-left: 50px; margin-bottom: 24px; font: 400 14px/1.4 var(--font); color: var(--ink-3);
}
.byline .author { flex-basis: 100%; }
.byline .author + .dot { display: none; }
.byline .author::before {
  content: attr(data-initials); position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sage-50); color: var(--sage); font: 600 13px/1 var(--font);
}
.byline strong { color: var(--ink); font-weight: 600; }
.byline .dot { opacity: 0.5; }

.article > h2 { font-size: 1.58rem; line-height: 1.2; letter-spacing: -0.018em; margin: 1.9em 0 0.55em; }
h3 { font-size: 1.22rem; line-height: 1.3; letter-spacing: -0.01em; margin: 1.5em 0 0.4em; }

/* ---------- Figures ---------- */
figure { margin: 28px 0; }
figure img { width: 100%; border-radius: var(--radius); background: var(--oat-50); }
figcaption { font: 400 13.5px/1.45 var(--font); color: var(--ink-3); margin-top: 10px; }
.hero-fig { margin: 0 0 28px; }
.hero-fig img { border-radius: 24px; }

/* ---------- Panels ---------- */
.callout { background: var(--sage-50); border-radius: 24px; padding: 22px 22px 10px; margin: 28px 0; }
.callout-title { font: 600 15px/1.3 var(--font); color: var(--sage); margin: 0 0 14px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding-left: 34px; margin: 0 0 12px; line-height: 1.5; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.12em; width: 22px; height: 22px; border-radius: 50%;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%234a6651' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.checks.plain li { padding-left: 22px; }
.checks.plain li::before { width: 7px; height: 7px; top: 0.7em; left: 6px; background: var(--sage); }
.note-box { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px 6px; margin: 28px 0; }

/* ---------- Pull quote ---------- */
.pullquote { margin: 32px 0; padding: 26px 24px 22px; background: var(--oat-50); border-radius: 24px; }
.pullquote p { font: 500 1.28rem/1.42 var(--font); letter-spacing: -0.012em; color: var(--ink); margin: 0 0 12px; text-wrap: balance; }
.pullquote cite { font: 500 13.5px/1.3 var(--font); font-style: normal; color: var(--ink-3); }

/* ---------- Dose graphic ---------- */
.dose { background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: 22px 18px 18px; margin: 28px 0; }
.dose-title { font: 600 15px/1.3 var(--font); color: var(--ink); margin: 0 0 16px; }
.dose-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.piece {
  width: 38px; height: 34px; margin: 0 auto 8px; border-radius: 48% 48% 44% 44% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 28%, #f2c793 0 14%, #d6914f 44%, #a35d2a 100%);
  box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(60, 30, 10, 0.1);
}
.dose-mg { font: 600 13px/1.2 var(--font); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dose-scale { height: 4px; border-radius: 2px; margin: 14px 4px 16px; background: linear-gradient(90deg, #f1dcc7, #c98a52); }
.dose-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font: 400 13.5px/1.4 var(--font); color: var(--ink-2); }
.dose-legend b { display: block; font-weight: 600; color: var(--ink); margin-bottom: 2px; }

/* ---------- Charts ---------- */
.chart { background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: 22px 20px 16px; margin: 28px 0; }
.chart-title { font: 600 15px/1.3 var(--font); color: var(--ink); margin: 0 0 2px; }
.chart-sub { font: 400 14px/1.4 var(--font); color: var(--ink-3); margin: 0 0 16px; }
.bars { list-style: none; margin: 0; padding: 0; }
.bar-row { margin: 0 0 14px; }
.bar-label { display: block; font: 500 14px/1.3 var(--font); color: var(--ink-2); margin-bottom: 6px; }
.bar-row.is-hero .bar-label { color: var(--ink); font-weight: 600; }
.bar-line { display: flex; align-items: center; gap: 8px; }
.bar {
  display: block; height: 14px; width: calc(var(--v) / 320 * 76%); min-width: 6px;
  background: var(--chart-gray); border-radius: 0 4px 4px 0; transition: filter 0.15s ease;
}
.bar-row.is-hero .bar { background: var(--accent); }
.bar-row:hover .bar { filter: brightness(1.08); }
.bar-value { font: 600 14px/1 var(--font); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-note { font: 400 12.5px/1.5 var(--font); color: var(--ink-3); margin: 12px 0 0; }
.curve svg { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.curve .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; font: 500 13.5px/1.3 var(--font); color: var(--ink-2); }
.curve .key { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 7px; position: relative; top: -2px; }
.curve .key-big { background: var(--chart-gray); }
.curve .key-small { background: var(--accent); }
.curve .line-big { stroke: var(--chart-gray); }
.curve .line-small { stroke: var(--accent); }
.curve .area-small { fill: var(--accent); fill-opacity: 0.08; }
.curve .axis { stroke: var(--line); }
.curve .baseline { stroke: #dcd5ca; }
.curve text { font-family: var(--font); fill: var(--ink-3); }

/* ---------- CTA ---------- */
.cta { text-align: center; margin: 30px 0; }
.btn {
  display: block; width: 100%; max-width: 420px; margin: 0 auto;
  background: var(--sage-btn); color: var(--white); text-decoration: none;
  font: 600 16.5px/1.2 var(--font); letter-spacing: 0.005em;
  padding: 17px 26px; border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn::after { content: "\2192"; display: inline-block; margin-left: 0.5em; transition: transform 0.2s ease; }
.btn:hover { background: var(--sage-btn-hover); }
.btn:hover::after { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--sage-100); outline-offset: 2px; }
.cta-sub { font: 400 13px/1.45 var(--font); color: var(--ink-3); margin: 10px 0 0; }

/* ---------- Product card ---------- */
.product-card { display: grid; gap: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 28px; padding: 12px 12px 22px; margin: 32px 0; }
.product-card img { border-radius: 20px; }
.product-card > div { padding: 0 10px; }
.product-card h3 { margin: 4px 0 6px; font-size: 1.5rem; letter-spacing: -0.02em; }
.product-card .rating { font: 500 14px/1.3 var(--font); color: var(--ink-2); margin: 0 0 14px; }
.stars { color: var(--star); letter-spacing: 1.5px; }
.product-card ul { list-style: none; margin: 0 0 20px; padding: 0; font: 400 15.5px/1.5 var(--font); color: var(--ink-2); }
.product-card li { position: relative; padding-left: 26px; margin: 0 0 8px; }
.product-card li::before {
  content: ""; position: absolute; left: 0; top: 0.18em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--sage-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8' fill='none' stroke='%234a6651' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.product-card .btn { max-width: none; }

/* ---------- Reviews ---------- */
.reviews { display: grid; gap: 12px; margin: 18px 0 8px; }
.review { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px 16px; }
.review .stars { font-size: 15px; display: block; margin-bottom: 8px; }
.review p { font-size: 1rem; line-height: 1.55; margin: 0 0 10px; }
.review .who { display: block; font: 500 13px/1.4 var(--font); color: var(--ink-3); }
.review-note { font: 400 13px/1.45 var(--font); color: var(--ink-3); margin: 10px 0 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; margin: 18px 0; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 0 18px; }
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  font: 600 16px/1.4 var(--font); padding: 17px 40px 17px 0; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sage-50); color: var(--sage); font: 500 18px/1 var(--font);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { font-size: 0.98rem; margin: 0 0 18px; color: var(--ink-2); }

/* ---------- Final CTA ---------- */
.final { background: var(--sage-50); border-radius: 28px; padding: 34px 22px 28px; margin: 40px 0 12px; text-align: center; }
.final h2 { font-size: 1.7rem; line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 10px; }
.final p { color: var(--ink-2); margin: 0 0 22px; }
.final .cta-sub { margin-top: 12px; }

/* ---------- Sources ---------- */
.sources { margin: 34px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font: 400 13px/1.5 var(--font); color: var(--ink-3); }
.sources p { margin: 0 0 8px; font-weight: 600; color: var(--ink-2); }
.sources ol { margin: 0; padding-left: 18px; }
.sources li { margin: 0 0 4px; }
.sources a { color: var(--ink-3); }

/* ---------- Related + cards ---------- */
.related { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.related-title, .section-label { font: 600 15px/1.3 var(--font); color: var(--ink); margin: 0 0 16px; }
.cards { display: grid; gap: 22px; }
.card { text-decoration: none; display: block; }
.card img { border-radius: 20px; margin-bottom: 12px; background: var(--oat-50); }
.card .kicker { margin-bottom: 10px; }
.card h3 { margin: 0 0 6px; font-size: 1.24rem; line-height: 1.25; letter-spacing: -0.015em; }
.card p { font-size: 0.98rem; line-height: 1.5; color: var(--ink-2); margin: 0; }
.card:hover h3, .feature:hover h2 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }

/* ---------- Home ---------- */
.home-intro { padding: 26px 0 6px; text-align: center; }
.home-intro .tagline { font-size: 1.08rem; line-height: 1.5; color: var(--ink-2); margin: 0 auto; max-width: 520px; }
.feature { display: grid; gap: 16px; padding: 20px 0 28px; border-bottom: 1px solid var(--line); text-decoration: none; }
.feature img { border-radius: 24px; }
.feature .kicker { margin-bottom: 4px; }
.feature h2 { font-size: clamp(1.75rem, 6.6vw, 2.5rem); line-height: 1.12; letter-spacing: -0.022em; margin: 8px 0 8px; }
.feature p { color: var(--ink-2); line-height: 1.55; margin: 0 0 14px; }
.feature .readmore { font: 600 15px/1 var(--font); color: var(--sage); }
.feature .readmore::after { content: " \2192"; }
.section-label { margin: 28px 0 16px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--white); border-top: 1px solid var(--line); margin-top: 48px; padding: 30px 0 120px; font: 400 13px/1.6 var(--font); color: var(--ink-3); }
.site-footer p { margin: 0 0 10px; }
.site-footer .foot-brand { font: 600 18px/1 var(--font); letter-spacing: -0.02em; color: var(--ink); margin-bottom: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0; }
.site-footer nav a { color: var(--ink-2); }
.fda { font-size: 12px; }

/* ---------- Sticky CTA ---------- */
.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(1.2) blur(14px); backdrop-filter: saturate(1.2) blur(14px);
  border-top: 1px solid var(--line);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  transform: translateY(110%); visibility: hidden;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}
.sticky.show { transform: none; visibility: visible; transition: transform 0.3s ease, visibility 0s; }
.sticky-inner { max-width: 660px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.sticky-copy { flex: 1; min-width: 0; font: 400 13px/1.3 var(--font); color: var(--ink-3); }
.sticky-copy b { display: block; font: 600 15px/1.25 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky .btn { width: auto; flex: none; padding: 12px 18px; font-size: 14.5px; margin: 0; }
.sticky .btn::after { content: none; }

@media (prefers-reduced-motion: reduce) {
  .sticky, .btn, .btn::after, .bar { transition: none; }
}

@media (min-width: 720px) {
  body { font-size: 18.5px; }
  :root { --gutter: 28px; }
  .masthead-top { padding-top: 24px; }
  .brand-name { font-size: 23px; }
  .nav { gap: 6px; font-size: 14.5px; }
  .article { padding-top: 44px; }
  .dek { font-size: 1.22rem; }
  .hero-fig { margin: 4px -40px 34px; }
  .reviews { grid-template-columns: 1fr 1fr; }
  .product-card { grid-template-columns: 250px 1fr; align-items: center; padding: 14px; }
  .product-card > div { padding: 0 14px 0 6px; }
  .feature { grid-template-columns: 1.25fr 1fr; align-items: center; gap: 34px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 28px; }
  .final { padding: 44px 40px 36px; }
}
