/* =============================================================================
   Glucose Decoded, shared stylesheet.
   Plain CSS, no build step. Edit and reload.

   Layers
   1. @font-face
   2. Tokens (CSS custom properties for light + dark)
   3. Base reset and typography
   4. Layout primitives (container, grid)
   5. Components (button, card, pill, callout, table-like comparison)
   6. Header, footer, hero, prose article
   7. Newsletter, form, comments
   8. Utilities + responsive
   ============================================================================= */

/* ---------- 1. Fonts (self-hosted, no CDN) ---------- */
@font-face {
  font-family: 'Plus Jakarta Sans Variable';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans-latin-wght.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/fraunces-latin-wght.woff2') format('woff2');
}

/* ---------- 2. Design tokens ---------- */
:root {
  --cream-50:  #fdfaf3;
  --cream-100: #faf4e7;
  --cream-200: #ede0c4;
  --cream-300: #d8c194;
  --cream-400: #b8945e;
  --cream-500: #8c6c3d;
  --cream-600: #5a4320;
  --cream-700: #3a2c17;
  --cream-800: #241c10;
  --cream-900: #15100a;
  --cream-950: #0c0805;

  --sage-50:  #f1f6ec;
  --sage-100: #e0ebd2;
  --sage-200: #c3d8a6;
  --sage-300: #a0c073;
  --sage-400: #84a850;
  --sage-500: #6a8d3a;
  --sage-600: #52702b;
  --sage-700: #3f5723;
  --sage-800: #34481f;
  --sage-900: #2c3c1c;

  --peach-50:  #fff5ec;
  --peach-100: #ffe7d0;
  --peach-200: #ffcaa1;
  --peach-300: #ffa867;
  --peach-400: #fb863c;
  --peach-500: #f06c1f;
  --peach-600: #d05314;
  --peach-700: #a93f12;

  /* Semantic */
  --bg:        var(--cream-50);
  --bg-elev:   var(--cream-100);
  --fg:        var(--cream-900);
  --fg-muted:  var(--cream-700);
  --border:    var(--cream-300);
  --border-soft: var(--cream-200);
  --link:      var(--sage-700);
  --link-hover: var(--peach-700);

  /* Shadows (warm-brown tint, not cold gray) */
  --shadow-soft: 0 1px 2px rgba(72,50,24,.03), 0 4px 12px rgba(72,50,24,.04);
  --shadow-card: 0 1px 2px rgba(72,50,24,.04), 0 8px 24px rgba(72,50,24,.06);
  --shadow-cardLg: 0 2px 4px rgba(72,50,24,.05), 0 18px 40px rgba(72,50,24,.08);

  --ease-soft: cubic-bezier(.22,.61,.36,1);

  color-scheme: light;
}

:root.dark {
  --bg:        var(--cream-950);
  --bg-elev:   var(--cream-900);
  --fg:        var(--cream-100);
  --fg-muted:  var(--cream-300);
  --border:    var(--cream-700);
  --border-soft: var(--cream-800);
  --link:      var(--sage-300);
  --link-hover: var(--peach-300);
  color-scheme: dark;
}

/* ---------- 3. Base reset + typography ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Plus Jakarta Sans Variable', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem; /* 17px */
  font-weight: 450;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss03';
  font-synthesis: none;
  transition: background-color .25s var(--ease-soft), color .25s var(--ease-soft);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--link-hover); }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: 'Fraunces Variable', ui-serif, Georgia, 'Times New Roman', serif;
  letter-spacing: -.015em;
  line-height: 1.15;
  color: var(--cream-950);
  margin: 0 0 .5em;
  font-weight: 500;
}
:root.dark h1, :root.dark h2, :root.dark h3, :root.dark h4 { color: var(--cream-50); }
h1 { font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem); margin-top: 2em; }
h3 { font-size: clamp(1.25rem, 1.4vw + 1rem, 1.5rem); margin-top: 1.75em; font-weight: 600; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }

::selection { background: rgba(132,168,80,.25); color: var(--fg); }
:focus-visible { outline: 2px solid var(--sage-600); outline-offset: 3px; border-radius: 6px; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; width: auto; height: auto;
  background: #fff; color: var(--cream-900); padding: .5rem .75rem;
  border-radius: .75rem; box-shadow: var(--shadow-card); z-index: 999;
}

/* ---------- 4. Layout primitives ---------- */
.container-wide  { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.container-prose { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 640px) {
  .container-wide, .container-prose { padding: 0 1.5rem; }
}

.eyebrow {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sage-700);
}
:root.dark .eyebrow { color: var(--sage-300); }

.lede {
  font-size: 1.1875rem;
  line-height: 1.65;
  color: var(--cream-900);
}
:root.dark .lede { color: var(--cream-200); }
@media (min-width: 768px) {
  .lede { font-size: 1.3125rem; }
}

.pill {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .25rem .75rem; border-radius: 9999px;
  background: var(--cream-100); color: var(--cream-900);
  font-size: .75rem; font-weight: 600;
}
:root.dark .pill { background: var(--cream-800); color: var(--cream-100); }
.pill .pill-dot { width: .375rem; height: .375rem; border-radius: 9999px; background: var(--sage-500); }

.hand-underline {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'><path d='M3 9 C 40 2, 80 13, 120 6 S 180 11, 197 5' fill='none' stroke='%23f06c1f' stroke-width='3' stroke-linecap='round'/></svg>");
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% .6em;
  padding-bottom: .15em;
}

/* ---------- 5. Components ---------- */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 9999px;
  font-size: .9375rem; font-weight: 600; text-decoration: none;
  min-height: 48px; border: 2px solid transparent;
  transition: background-color .2s var(--ease-soft), border-color .2s var(--ease-soft), transform .2s var(--ease-soft);
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--sage-600); color: var(--cream-50); box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--sage-700); color: var(--cream-50); }
.btn-warm { background: var(--peach-500); color: #fff; box-shadow: var(--shadow-card); }
.btn-warm:hover { background: var(--peach-600); color: #fff; }
.btn-ghost {
  background: var(--cream-50); color: var(--cream-900);
  border: 2px solid var(--border);
}
.btn-ghost:hover { background: var(--cream-100); border-color: var(--cream-400); color: var(--cream-900); }
:root.dark .btn-ghost { background: var(--cream-900); color: var(--cream-50); border-color: var(--cream-700); }
:root.dark .btn-ghost:hover { background: var(--cream-800); color: var(--cream-50); }

/* Cards */
.card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 1.625rem;
  box-shadow: var(--shadow-card);
}
:root.dark .card { background: var(--cream-900); border-color: var(--cream-700); }

.card-pad   { padding: 1.5rem; }
.card-pad-lg{ padding: 1.75rem; }
@media (min-width: 768px) { .card-pad-lg { padding: 2.25rem; } }

/* Stat row inside hero mock */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; text-align: center; border-top: 1px solid var(--border-soft); padding-top: 1rem; margin-top: 1.25rem; }
.stat-row .stat-num { font-family: 'Fraunces Variable', serif; font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--cream-950); }
:root.dark .stat-row .stat-num { color: var(--cream-50); }
.stat-row .stat-label { font-size: .6875rem; color: var(--fg-muted); }

/* Callout */
.callout {
  border: 2px solid var(--border);
  background: var(--cream-100);
  border-radius: 1.125rem;
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
  color: var(--cream-900);
}
.callout-warm { border-color: var(--peach-300); background: var(--peach-50); }
.callout-info { border-color: var(--sage-300); background: var(--sage-50); }
:root.dark .callout { background: var(--cream-900); border-color: var(--cream-700); color: var(--cream-100); }
.callout .callout-label {
  display: inline-flex; align-items: center; gap: .375rem;
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em;
  margin-bottom: .25rem;
}

/* Comparison (educational, NOT product/price) */
.compare {
  width: 100%; border-collapse: collapse; border: 2px solid var(--border);
  border-radius: 1.125rem; overflow: hidden; background: #fff;
  font-variant-numeric: tabular-nums;
}
:root.dark .compare { background: var(--cream-900); border-color: var(--cream-700); }
.compare th, .compare td { padding: 1rem 1.25rem; text-align: left; vertical-align: top; }
.compare thead { background: var(--cream-100); }
:root.dark .compare thead { background: var(--cream-800); }
.compare tbody tr + tr th, .compare tbody tr + tr td { border-top: 1px solid var(--border-soft); }
.compare .good { color: var(--sage-700); font-weight: 600; }
.compare .warn { color: var(--peach-700); font-weight: 600; }
:root.dark .compare .good { color: var(--sage-300); }
:root.dark .compare .warn { color: var(--peach-300); }

/* Table of contents */
.toc {
  border: 2px solid var(--border);
  background: var(--cream-50);
  border-radius: 1.125rem;
  padding: 1.25rem;
  margin: 2rem 0;
}
:root.dark .toc { background: var(--cream-900); border-color: var(--cream-700); }
.toc-title { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; color: var(--sage-700); margin-bottom: .75rem; }
:root.dark .toc-title { color: var(--sage-300); }
.toc ol {
  display: grid; grid-template-columns: 1fr; gap: .5rem; margin: 0; padding: 0; list-style: none;
}
@media (min-width: 640px) { .toc ol { grid-template-columns: 1fr 1fr; } }
.toc li { display: flex; align-items: flex-start; gap: .5rem; font-size: .9375rem; }
.toc .toc-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; border-radius: 9999px;
  background: var(--peach-100); color: var(--peach-700);
  font-size: .6875rem; font-weight: 600; flex: none; margin-top: .15em;
}
:root.dark .toc .toc-num { background: rgba(255,168,103,.15); color: var(--peach-300); }
.toc a { text-decoration: underline; text-decoration-color: var(--cream-300); }
.toc a:hover { text-decoration-color: var(--peach-400); color: var(--peach-700); }

/* References block */
.references {
  border-top: 1px solid var(--border-soft);
  padding-top: 1.5rem;
  margin-top: 2.25rem;
}
.references h2 { margin-top: 0; }
.references ol { padding-left: 1.25rem; }
.references li { margin: .5rem 0; font-size: .9375rem; color: var(--fg-muted); }
.references a { word-break: break-word; }

/* Author byline */
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  font-size: .9375rem; color: var(--fg-muted);
  padding: .75rem 0;
}
.byline .avatar {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 9999px;
  background: var(--sage-100); color: var(--sage-700);
}
:root.dark .byline .avatar { background: rgba(132,168,80,.18); color: var(--sage-300); }
.byline a { color: var(--cream-900); font-weight: 600; }
:root.dark .byline a { color: var(--cream-50); }

/* Newsletter */
.newsletter {
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 1.625rem;
  padding: 1.75rem;
  margin: 2.25rem 0 1rem;
  box-shadow: var(--shadow-card);
}
:root.dark .newsletter { background: var(--cream-900); border-color: var(--cream-500); }
@media (min-width: 768px) {
  .newsletter { padding: 2.5rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.75rem; align-items: center; }
}
.newsletter h2 { margin: .25rem 0 .5rem; font-size: clamp(1.5rem, 2vw + 1rem, 2rem); }
.newsletter p { color: var(--fg-muted); margin: 0; }
.newsletter form { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.25rem; }
@media (min-width: 768px) {
  .newsletter form { margin-top: 0; }
}
.newsletter input[type="email"],
.newsletter input[type="text"] {
  height: 3rem; padding: 0 1.25rem; border-radius: 9999px;
  border: 2px solid var(--border); background: var(--cream-50);
  font-size: .9375rem; color: var(--cream-900);
}
.newsletter input[type="email"]:focus,
.newsletter input[type="text"]:focus {
  outline: none; border-color: var(--sage-500); box-shadow: 0 0 0 4px rgba(132,168,80,.18);
}
:root.dark .newsletter input[type="email"],
:root.dark .newsletter input[type="text"] {
  background: var(--cream-950); color: var(--cream-50); border-color: var(--cream-500);
}
:root.dark .newsletter input[type="email"]:hover,
:root.dark .newsletter input[type="text"]:hover {
  border-color: var(--cream-400);
}
.newsletter .setup-note { font-size: .75rem; color: var(--fg-muted); margin-top: .5rem; }

/* Inline status message after the newsletter form is submitted. */
.newsletter-status {
  margin: .5rem 0 0;
  padding: .65rem 1rem;
  border-radius: 1.125rem;
  font-size: .9375rem; font-weight: 600;
  background: var(--cream-100);
  color: var(--cream-900);
  border: 2px solid var(--cream-300);
}
.newsletter-status.is-success {
  background: var(--sage-50);
  color: var(--sage-800);
  border-color: var(--sage-400);
}
.newsletter-status.is-error {
  background: var(--peach-50);
  color: var(--peach-800);
  border-color: var(--peach-300);
}
:root.dark .newsletter-status {
  background: var(--cream-800); color: var(--cream-100); border-color: var(--cream-500);
}
:root.dark .newsletter-status.is-success {
  background: rgba(132,168,80,.15); color: var(--sage-200); border-color: var(--sage-500);
}
:root.dark .newsletter-status.is-error {
  background: rgba(240,108,31,.18); color: var(--peach-200); border-color: var(--peach-500);
}

/* Contact form */
.form-field { margin-bottom: 1.25rem; }
.form-field label { display: block; font-size: .9375rem; font-weight: 600; margin-bottom: .375rem; color: var(--cream-900); }
:root.dark .form-field label { color: var(--cream-50); }
.form-field input, .form-field textarea {
  width: 100%; padding: .75rem 1rem; border-radius: 1.125rem;
  border: 2px solid var(--border); background: var(--cream-50);
  font-size: 1rem; color: var(--cream-900);
}
.form-field textarea { min-height: 9rem; resize: vertical; }
.form-field input:focus, .form-field textarea:focus {
  outline: none; border-color: var(--sage-500); box-shadow: 0 0 0 4px rgba(132,168,80,.18);
}
:root.dark .form-field input, :root.dark .form-field textarea {
  background: var(--cream-950); color: var(--cream-50); border-color: var(--cream-500);
}
:root.dark .form-field input:hover, :root.dark .form-field textarea:hover {
  border-color: var(--cream-400);
}
.hp { display: none !important; }

/* Comments embed wrapper */
.comments {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-soft);
}
.comments-title { font-size: 1.25rem; margin: 0 0 1rem; }
.comments .placeholder {
  border: 2px dashed var(--border); border-radius: 1.125rem; padding: 1.25rem;
  background: var(--cream-50); color: var(--fg-muted); font-size: .9375rem;
}
:root.dark .comments .placeholder { background: var(--cream-900); }

/* ---------- 6. Header / nav / footer ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(253, 250, 243, .9);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 2px solid var(--border);
}
:root.dark .site-header { background: rgba(12,8,5,.88); border-bottom-color: var(--cream-700); }
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 6rem; gap: 2rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .75rem;
  text-decoration: none; color: inherit;
}
.brand .mark {
  display: grid; place-items: center;
  width: 3rem; height: 3rem; border-radius: 1.125rem;
  background: var(--peach-500); color: #fff;
  font-family: 'Fraunces Variable', serif; font-size: 1.5rem; font-weight: 600;
  box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease-soft);
}
.brand:hover .mark { transform: rotate(-4deg) scale(1.05); }
.brand .wordmark {
  font-family: 'Fraunces Variable', serif; font-size: 1.75rem; font-weight: 500;
  letter-spacing: -.015em; color: var(--cream-900);
}
:root.dark .brand .wordmark { color: var(--cream-50); }

.site-nav ul {
  display: none; align-items: center; gap: 3rem;
  margin: 0; padding: 0; list-style: none;
  font-size: 1.1875rem; font-weight: 600; letter-spacing: -.01em;
}
@media (min-width: 768px) { .site-nav ul { display: flex; } }
.site-nav a { color: var(--cream-950); text-decoration: none; transition: color .2s var(--ease-soft); }
:root.dark .site-nav a { color: var(--cream-50); }
.site-nav a:hover { color: var(--peach-700); }
:root.dark .site-nav a:hover { color: var(--peach-300); }
.site-nav a.active {
  text-decoration: underline; text-decoration-color: var(--peach-500); text-underline-offset: 8px; text-decoration-thickness: 3px;
}

.site-header .actions { display: flex; align-items: center; gap: .75rem; }
.theme-toggle {
  width: 2.5rem; height: 2.5rem; display: inline-grid; place-items: center;
  background: #fff; color: var(--cream-800);
  border: 2px solid var(--cream-300); border-radius: 9999px;
  transition: background .2s var(--ease-soft), border-color .2s var(--ease-soft), color .2s var(--ease-soft);
}
.theme-toggle:hover { background: var(--cream-100); border-color: var(--cream-400); color: var(--cream-950); }
/* Dark mode: button must contrast against the nearly-black header.
   Use cream-800 background (lighter than body), cream-500 border, cream-50 icon. */
:root.dark .theme-toggle {
  background: var(--cream-800);
  color: var(--cream-50);
  border-color: var(--cream-500);
}
:root.dark .theme-toggle:hover {
  background: var(--cream-700);
  border-color: var(--cream-400);
  color: #fff;
}
.theme-toggle .icon-sun { display: none; }
:root.dark .theme-toggle .icon-sun { display: block; }
:root.dark .theme-toggle .icon-moon { display: none; }

/* Mobile nav strip */
.site-nav-mobile {
  border-top: 2px solid var(--border);
  background: rgba(253, 250, 243, .95);
}
@media (min-width: 768px) { .site-nav-mobile { display: none; } }
:root.dark .site-nav-mobile { background: rgba(12,8,5,.95); border-top-color: var(--cream-700); }
.site-nav-mobile ul {
  display: flex; justify-content: space-between; align-items: center;
  list-style: none; margin: 0; padding: 0;
  height: 4rem; font-size: 1.0625rem; font-weight: 600;
}
.site-nav-mobile a { color: var(--cream-950); text-decoration: none; }
:root.dark .site-nav-mobile a { color: var(--cream-50); }

/* Footer */
.site-footer {
  margin-top: 2.5rem;
  background: var(--cream-100);
  border-top: 2px solid var(--border);
}
:root.dark .site-footer { background: var(--cream-950); border-top-color: var(--cream-700); }
.site-footer .row {
  display: grid; gap: 2.5rem; padding: 2.5rem 0;
}
@media (min-width: 768px) { .site-footer .row { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 {
  font-family: 'Plus Jakarta Sans Variable', sans-serif; font-size: .75rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--fg-muted); margin: 0 0 .75rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .5rem 0; font-size: .9375rem; }
.site-footer a { color: var(--cream-900); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
:root.dark .site-footer a { color: var(--cream-100); }
.site-footer .blurb { max-width: 32rem; font-size: .9375rem; color: var(--fg-muted); }
.site-footer .legal {
  border-top: 1px solid var(--border-soft);
}
.site-footer .legal .row2 {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: space-between;
  padding: 1.25rem 0; font-size: .75rem; color: var(--fg-muted);
}

/* ---------- 7. Hero (home) ---------- */

.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 80% at 20% 0%, rgba(255,202,161,.45), transparent 65%),
    radial-gradient(50% 70% at 90% 10%, rgba(160,192,115,.22), transparent 65%);
}
:root.dark .hero::before {
  background:
    radial-gradient(60% 80% at 20% 0%, rgba(240,108,31,.10), transparent 65%),
    radial-gradient(50% 70% at 90% 10%, rgba(132,168,80,.10), transparent 65%);
}
.hero .blob {
  position: absolute; pointer-events: none; z-index: -1;
  border-radius: 9999px; filter: blur(64px);
}
.hero .blob-1 { left: -8rem; top: 2.5rem; width: 18rem; height: 18rem; background: rgba(255,202,161,.4); }
.hero .blob-2 { right: -6rem; top: 10rem; width: 20rem; height: 20rem; background: rgba(160,192,115,.4); }
:root.dark .hero .blob-1 { background: rgba(208,83,20,.15); }
:root.dark .hero .blob-2 { background: rgba(82,112,43,.15); }
.hero .wrap {
  display: grid; gap: 3.5rem;
  padding: 2.5rem 0 3rem;
}
@media (min-width: 768px) {
  .hero .wrap { grid-template-columns: 1.15fr 1fr; gap: 4rem; padding: 4rem 0 4.5rem; align-items: center; }
}
.hero h1 { margin-top: 1.5rem; }
.hero .lede { margin-top: 1.5rem; max-width: 32rem; }
.hero .actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: .75rem; }
/* Hero trust signals as soft outlined pills with colored icon badges. */
.hero .trust {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex; flex-wrap: wrap; gap: .9rem 1rem;
}
@media (min-width: 480px) {
  .hero .trust { flex-wrap: nowrap; }
}
.hero .trust li {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8125rem; font-weight: 600;
  color: var(--fg-muted);
  white-space: nowrap;
}
:root.dark .hero .trust li { color: var(--cream-200); }
.hero .trust .ti {
  display: inline-grid; place-items: center;
  width: 1.125rem; height: 1.125rem;
  border-radius: 9999px;
  color: #fff;
  flex: none;
}
.hero .trust .ti svg { width: .6875rem; height: .6875rem; }
.hero .trust .ti-sage  { background: var(--sage-600); }
.hero .trust .ti-peach { background: var(--peach-500); }
.hero .trust .ti-cream { background: var(--cream-700); }
:root.dark .hero .trust .ti-cream { background: var(--cream-400); color: var(--cream-950); }

/* Hero -> value-grid divider: long fading line with a small accent dot */
.hero-divider {
  max-width: 72rem;
  margin: 2.5rem auto 3rem;
  padding: 0 1.25rem;
  display: flex; align-items: center; justify-content: center;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .hero-divider { margin: 3.5rem auto 4rem; }
}
.hero-divider::before,
.hero-divider::after {
  content: "";
  flex: 1 1 auto;
  max-width: 26rem;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--cream-500) 18%, var(--cream-500) 82%, transparent);
}
:root.dark .hero-divider::before,
:root.dark .hero-divider::after {
  background: linear-gradient(to right, transparent, var(--cream-500) 18%, var(--cream-500) 82%, transparent);
}
.hero-divider-dot {
  width: .5rem; height: .5rem;
  border-radius: 9999px;
  background: var(--peach-500);
  flex: none;
  box-shadow: 0 0 0 5px rgba(232, 138, 95, .18);
}

/* Hero dashboard mock card */
.hero .mock-wrap { position: relative; margin-left: auto; max-width: 22rem; }
.hero .mini-card {
  display: none; position: absolute; left: -1.5rem; top: 2.5rem; width: 11rem;
  transform: rotate(-6deg);
  background: #fff; border: 2px solid var(--border); border-radius: 1.125rem;
  padding: 1rem; box-shadow: var(--shadow-card);
}
@media (min-width: 640px) { .hero .mini-card { display: block; } }
:root.dark .hero .mini-card { background: var(--cream-900); border-color: var(--cream-400); border-width: 3px; }
.hero .mini-card .label { font-size: .625rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-muted); }
.hero .mini-card .row { display: flex; align-items: baseline; gap: .375rem; margin-top: .25rem; }
.hero .mini-card .row .v { font-family: 'Fraunces Variable', serif; font-size: 1.5rem; font-weight: 600; color: var(--cream-950); }
:root.dark .hero .mini-card .row .v { color: var(--cream-50); }
.hero .mini-card .row .u { font-size: .6875rem; color: var(--fg-muted); }
.hero .mini-card .bars { display: flex; align-items: flex-end; gap: .25rem; height: 1.75rem; margin-top: .75rem; }
.hero .mini-card .bar { flex: 1; border-radius: 2px; background: var(--sage-300); }
.hero .mini-card .bar.s1 { height: 40%; background: var(--sage-200); }
.hero .mini-card .bar.s2 { height: 70%; }
.hero .mini-card .bar.s3 { height: 55%; }
.hero .mini-card .bar.s4 { height: 85%; background: var(--sage-500); }
.hero .mini-card .bar.s5 { height: 40%; background: var(--sage-200); }
.hero .mini-card .bar.s6 { height: 70%; background: var(--sage-400); }
.hero .mini-card .bar.s7 { height: 85%; background: var(--sage-500); }

.hero .dash-card {
  position: relative;
  margin-left: auto; max-width: 22rem;
  transform: rotate(1.5deg);
  background: #fff; border: 2px solid var(--border); border-radius: 2rem;
  padding: 1.5rem; box-shadow: var(--shadow-cardLg);
}
:root.dark .hero .dash-card { background: var(--cream-900); border-color: var(--cream-400); border-width: 3px; }
.hero .dash-head { display: flex; align-items: center; justify-content: space-between; }
.hero .dash-head .badge {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--sage-100); color: var(--sage-800);
  padding: .125rem .5rem; border-radius: 9999px;
  font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
}
:root.dark .hero .dash-head .badge { background: rgba(132,168,80,.18); color: var(--sage-200); }
.hero .dash-head .badge::before { content: ""; width: .375rem; height: .375rem; border-radius: 9999px; background: var(--sage-500); }
.hero .dash-head .title { display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 600; color: var(--cream-950); }
:root.dark .hero .dash-head .title { color: var(--cream-50); }
.hero .dash-head .title-mark {
  width: 1.75rem; height: 1.75rem; border-radius: 9999px; background: var(--sage-100); color: var(--sage-700);
  display: inline-grid; place-items: center;
}
:root.dark .hero .dash-head .title-mark { background: rgba(132,168,80,.18); color: var(--sage-300); }

.hero .dash-num {
  display: flex; align-items: baseline; gap: .5rem; margin-top: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.hero .dash-num .big {
  font-family: 'Fraunces Variable', serif; font-size: 3.75rem; font-weight: 500; line-height: 1;
  color: var(--cream-950); letter-spacing: -.02em;
}
:root.dark .hero .dash-num .big { color: var(--cream-50); }
.hero .dash-num .unit { font-size: .875rem; color: var(--fg-muted); }
.hero .dash-note { margin-top: .25rem; font-size: .75rem; color: var(--fg-muted); }

.hero .dash-chart { position: relative; height: 8rem; margin: 1.25rem 0 0; }
.hero .dash-chart svg { width: 100%; height: 100%; }

.tip-pill {
  display: none; position: absolute; right: .5rem; bottom: -1.25rem;
  align-items: center; gap: .5rem;
  background: #fff; border: 2px solid var(--border); border-radius: 9999px;
  padding: .5rem .75rem; box-shadow: var(--shadow-card);
}
@media (min-width: 640px) { .tip-pill { display: inline-flex; } }
:root.dark .tip-pill { background: var(--cream-900); border-color: var(--cream-700); }
.tip-pill .star {
  width: 1.25rem; height: 1.25rem; display: inline-grid; place-items: center;
  background: var(--peach-500); color: #fff; border-radius: 9999px;
}
.tip-pill .text { font-size: .75rem; font-weight: 600; color: var(--cream-900); }
:root.dark .tip-pill .text { color: var(--cream-100); }

/* ---------- Home: value prop tiles + "Where to start" grid ---------- */

.value-grid {
  display: grid; gap: 1rem; padding: 0 0 3.5rem;
}
@media (min-width: 768px) { .value-grid { grid-template-columns: repeat(3, 1fr); } }
.value-tile { padding: 1.5rem; transition: transform .25s var(--ease-soft), box-shadow .25s var(--ease-soft); }
.value-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-cardLg); }
.value-tile .emoji { font-size: 1.5rem; line-height: 1; }
.value-tile h3 { font-size: 1.25rem; margin: .75rem 0 .25rem; }
.value-tile p { color: var(--fg-muted); font-size: 1rem; margin: 0; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}
:root.dark .section-head { border-bottom-color: var(--cream-800); }
.section-head h2 {
  margin: .5rem 0 0;
  font-size: clamp(1.625rem, 1.2vw + 1.2rem, 2.125rem);
  letter-spacing: -.015em;
}
.section-head .more {
  font-size: .8125rem; font-weight: 600;
  color: var(--peach-700); text-decoration: none;
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .5rem .875rem;
  border-radius: 9999px;
  background: var(--peach-50);
  transition: background-color .2s var(--ease-soft), transform .2s var(--ease-soft);
}
:root.dark .section-head .more { color: var(--peach-300); background: rgba(240,108,31,.10); }
.section-head .more:hover { background: var(--peach-100); transform: translateX(2px); }
:root.dark .section-head .more:hover { background: rgba(240,108,31,.18); }

.post-grid {
  display: grid; gap: 1.5rem; padding-bottom: 3rem;
}
@media (min-width: 768px) {
  .post-grid { grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
}

.post-card {
  position: relative;
  padding: 1.875rem;
  border-radius: 1.5rem;
  overflow: hidden;
  transition: transform .3s var(--ease-soft), box-shadow .3s var(--ease-soft), border-color .3s var(--ease-soft);
  text-decoration: none; color: inherit; display: block;
}
.post-card::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--sage-400), var(--peach-400));
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease-soft);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-cardLg);
  border-color: var(--sage-300);
}
:root.dark .post-card:hover { border-color: var(--sage-600); }
.post-card:hover::before { transform: scaleX(1); }

.post-card .post-meta {
  display: flex; align-items: center; gap: .625rem;
  font-size: .75rem; color: var(--fg-muted);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 500;
}
.post-card .post-meta > span:not(.post-cat)::before {
  content: "•"; margin-right: .625rem; color: var(--border);
}
.post-card .post-cat {
  background: var(--sage-100); color: var(--sage-800);
  padding: .25rem .625rem; border-radius: 9999px; font-weight: 600;
  font-size: .6875rem; letter-spacing: .1em;
}
:root.dark .post-card .post-cat { background: rgba(132,168,80,.18); color: var(--sage-200); }
.post-card h3 {
  margin: 1rem 0 .625rem;
  font-size: 1.5rem; letter-spacing: -.015em; line-height: 1.25;
  transition: color .2s var(--ease-soft);
}
.post-card:hover h3 { color: var(--sage-700); }
:root.dark .post-card:hover h3 { color: var(--sage-300); }

.post-card.featured {
  background: linear-gradient(140deg, var(--cream-50) 0%, var(--sage-50) 100%);
  border-color: var(--sage-200);
}
:root.dark .post-card.featured {
  background: linear-gradient(140deg, var(--cream-900) 0%, rgba(132,168,80,.10) 100%);
  border-color: var(--sage-700);
}
.post-card.featured::before { transform: scaleX(1); height: 4px; }
.post-card.featured h3 { font-size: 1.75rem; }
@media (min-width: 768px) {
  .post-card.featured { grid-column: 1 / -1; padding: 2.25rem 2.5rem; }
  .post-card.featured h3 { font-size: 2rem; max-width: 34rem; }
  .post-card.featured p { font-size: 1.0625rem; max-width: 44rem; -webkit-line-clamp: 2; }
}
@media (min-width: 1024px) {
  .post-card.featured { padding: 2.5rem 2.75rem; }
  .post-card.featured h3 { font-size: 2.25rem; }
}

.post-card p { color: var(--fg-muted); margin: 0; font-size: 1rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .read-more {
  margin-top: 1.5rem;
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; color: var(--peach-700); font-size: .875rem;
}
.post-card .read-more svg {
  transition: transform .25s var(--ease-soft);
}
.post-card:hover .read-more svg { transform: translateX(4px); }
:root.dark .post-card .read-more { color: var(--peach-300); }

/* ---------- Articles index: filter chips + unified grid ---------- */

.article-list { padding-bottom: 2.5rem; }

.filter-row {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 0 0 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}
:root.dark .filter-row { border-bottom-color: var(--cream-800); }
.chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .9rem;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--cream-900);
  border-radius: 9999px;
  font-size: .8125rem; font-weight: 600;
  cursor: pointer;
  transition: background .15s var(--ease-soft), border-color .15s var(--ease-soft), color .15s var(--ease-soft);
}
.chip .count {
  font-size: .6875rem; font-weight: 600;
  color: var(--fg-muted);
  background: var(--cream-100); padding: .05rem .4rem;
  border-radius: 9999px;
}
.chip:hover { border-color: var(--cream-400); }
.chip.is-active {
  background: var(--cream-950); color: var(--cream-50);
  border-color: var(--cream-950);
}
.chip.is-active .count { background: rgba(255,255,255,.18); color: var(--cream-100); }
:root.dark .chip {
  background: var(--cream-900); color: var(--cream-100);
  border-color: var(--cream-700);
}
:root.dark .chip:hover { border-color: var(--cream-500); }
:root.dark .chip .count { background: var(--cream-800); color: var(--cream-300); }
:root.dark .chip.is-active {
  background: var(--cream-50); color: var(--cream-950);
  border-color: var(--cream-50);
}
:root.dark .chip.is-active .count { background: rgba(0,0,0,.12); color: var(--cream-900); }

.article-grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .article-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem; } }
@media (min-width: 1024px) { .article-grid { grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; } }

.article-tile {
  position: relative;
  display: flex; flex-direction: column;
  padding: 1.5rem;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 1.375rem;
  text-decoration: none; color: inherit;
  transition: transform .25s var(--ease-soft), border-color .25s var(--ease-soft), box-shadow .25s var(--ease-soft);
}
.article-tile:hover {
  transform: translateY(-2px);
  border-color: var(--cream-400);
  box-shadow: var(--shadow-card);
}
:root.dark .article-tile { background: var(--cream-900); border-color: var(--cream-700); }
:root.dark .article-tile:hover { border-color: var(--cream-500); }

.article-tile .tile-meta {
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: var(--fg-muted);
  margin-bottom: 1rem;
}
.article-tile .tile-cat {
  font-weight: 700; color: var(--sage-700);
  text-transform: uppercase; letter-spacing: .1em;
  font-size: .6875rem;
}
:root.dark .article-tile .tile-cat { color: var(--sage-300); }
.article-tile .tile-meta .tile-dot {
  width: 3px; height: 3px; border-radius: 9999px; background: var(--cream-400);
}
.article-tile .tile-title {
  font-family: 'Fraunces Variable', serif;
  font-size: 1.375rem; font-weight: 500; line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0 0 .625rem;
  color: var(--cream-950);
}
:root.dark .article-tile .tile-title { color: var(--cream-50); }
.article-tile .tile-dek {
  color: var(--fg-muted); font-size: .9375rem; line-height: 1.55;
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  flex-grow: 1;
}
.article-tile .tile-more {
  margin-top: 1.25rem;
  display: inline-flex; align-items: center; gap: .375rem;
  font-size: .8125rem; font-weight: 600;
  color: var(--peach-700);
}
:root.dark .article-tile .tile-more { color: var(--peach-300); }
.article-tile:hover .tile-more svg { transform: translateX(2px); }
.article-tile .tile-more svg { transition: transform .2s var(--ease-soft); }

/* Featured tile (spans 2 columns on desktop, slightly richer) */
.article-tile.is-featured {
  padding: 2rem;
  background: linear-gradient(135deg, var(--cream-50) 0%, #fff 60%);
  border-color: var(--cream-300);
}
:root.dark .article-tile.is-featured {
  background: linear-gradient(135deg, var(--cream-900) 0%, var(--cream-950) 80%);
  border-color: var(--cream-600);
}
@media (min-width: 1024px) {
  .article-tile.is-featured {
    grid-column: span 2;
    padding: 2.5rem;
  }
}
.article-tile.is-featured .tile-title { font-size: 1.875rem; }
@media (min-width: 1024px) {
  .article-tile.is-featured .tile-title { font-size: 2.25rem; }
  .article-tile.is-featured .tile-dek { font-size: 1.0625rem; }
}
.featured-flag {
  position: absolute; top: 1.25rem; right: 1.25rem;
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--peach-500); color: #fff;
  font-size: .625rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: .3rem .65rem;
  border-radius: 9999px;
}
.featured-flag svg { width: .75rem; height: .75rem; }

.empty-state {
  grid-column: 1 / -1;
  padding: 2.5rem;
  text-align: center;
  color: var(--fg-muted);
  border: 2px dashed var(--border);
  border-radius: 1.25rem;
  background: var(--cream-50);
}
:root.dark .empty-state { background: var(--cream-900); border-color: var(--cream-700); }

/* ---------- Tools (calculator / converter UI) ---------- */

.tool-section { padding: 1rem 0 1.5rem; }

.tool-card {
  background: #fff;
  border: 2px solid var(--cream-300);
  border-radius: 1.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
:root.dark .tool-card { background: var(--cream-900); border-color: var(--cream-700); }
@media (min-width: 640px) { .tool-card { padding: 2rem; } }

/* Tabs (segmented control look) */
.tool-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .375rem;
  padding: .375rem;
  background: var(--cream-100);
  border-radius: 9999px;
  margin-bottom: 1.5rem;
}
:root.dark .tool-tabs { background: var(--cream-800); }
.tool-tab {
  appearance: none; -webkit-appearance: none;
  border: 0; background: transparent;
  padding: .65rem 1rem;
  border-radius: 9999px;
  font-family: inherit; font-size: .875rem; font-weight: 600;
  color: var(--cream-800);
  cursor: pointer;
  transition: background .2s var(--ease-soft), color .2s var(--ease-soft), box-shadow .2s var(--ease-soft);
}
.tool-tab:hover { color: var(--cream-950); }
:root.dark .tool-tab { color: var(--cream-200); }
:root.dark .tool-tab:hover { color: var(--cream-50); }
.tool-tab.is-active {
  background: #fff; color: var(--cream-950);
  box-shadow: var(--shadow-soft);
}
:root.dark .tool-tab.is-active { background: var(--cream-700); color: var(--cream-50); }

.tool-panel { display: none; }
.tool-panel.is-active { display: block; }

/* Tool field label + value display */
.tool-label {
  display: block;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sage-700);
  margin-bottom: .75rem;
}
:root.dark .tool-label { color: var(--sage-300); }

/* A1C slider row */
.slider-row {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.slider-row input[type="range"] {
  flex: 1; height: 40px;
  appearance: none; -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.slider-row .out-block {
  display: inline-flex; align-items: baseline; gap: .25rem;
  background: var(--cream-100);
  padding: .5rem .85rem;
  border-radius: 9999px;
  min-width: 5.5rem; justify-content: center;
  font-variant-numeric: tabular-nums;
}
:root.dark .slider-row .out-block { background: var(--cream-800); }
.slider-row .out-block output {
  font-family: 'Fraunces Variable', serif;
  font-size: 1.5rem; font-weight: 600;
  color: var(--cream-950);
  line-height: 1;
}
:root.dark .slider-row .out-block output { color: var(--cream-50); }
.slider-row .out-block .u { font-size: .8125rem; color: var(--fg-muted); }

/* Range input track (cross-browser) */
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 9999px; background: var(--cream-200);
}
.slider-row input[type="range"]::-moz-range-track {
  height: 8px; border-radius: 9999px; background: var(--cream-200);
}
:root.dark .slider-row input[type="range"]::-webkit-slider-runnable-track { background: var(--cream-700); }
:root.dark .slider-row input[type="range"]::-moz-range-track { background: var(--cream-700); }

.slider-row input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 9999px;
  background: var(--sage-600);
  border: 3px solid #fff;
  box-shadow: var(--shadow-card);
  margin-top: -7px;
  cursor: pointer;
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 9999px;
  background: var(--sage-600);
  border: 3px solid #fff;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
:root.dark .slider-row input[type="range"]::-webkit-slider-thumb { border-color: var(--cream-900); }
:root.dark .slider-row input[type="range"]::-moz-range-thumb { border-color: var(--cream-900); }
.slider-row input[type="range"]:focus-visible { outline: none; }
.slider-row input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(132,168,80,.25);
}
.slider-row input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(132,168,80,.25);
}

/* Unit-converter input + select row */
.conv-row {
  display: grid; grid-template-columns: 1fr; gap: .75rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 480px) { .conv-row { grid-template-columns: 1fr auto; align-items: stretch; } }
.conv-row input[type="number"],
.conv-row select {
  height: 56px;
  padding: 0 1rem;
  font-family: inherit; font-size: 1.125rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--cream-950);
  background: var(--cream-50);
  border: 2px solid var(--cream-300);
  border-radius: 1.125rem;
  appearance: none; -webkit-appearance: none;
}
.conv-row input[type="number"]:focus,
.conv-row select:focus {
  outline: none; border-color: var(--sage-500);
  box-shadow: 0 0 0 4px rgba(132,168,80,.18);
}
:root.dark .conv-row input[type="number"],
:root.dark .conv-row select {
  background: var(--cream-950); color: var(--cream-50);
  border-color: var(--cream-700);
}
.conv-row select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233a2c17' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
:root.dark .conv-row select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23faf4e7' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
}

/* Two equal-weight result cards */
.results-grid {
  display: grid; grid-template-columns: 1fr; gap: .875rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) { .results-grid { grid-template-columns: 1fr 1fr; gap: 1rem; } }
.result-card {
  background: linear-gradient(135deg, var(--cream-50), #fff 70%);
  border: 2px solid var(--cream-300);
  border-radius: 1.25rem;
  padding: 1.25rem;
}
:root.dark .result-card {
  background: linear-gradient(135deg, var(--cream-900), var(--cream-950));
  border-color: var(--cream-700);
}
.result-card .r-label {
  font-size: .6875rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sage-700);
}
:root.dark .result-card .r-label { color: var(--sage-300); }
.result-card .r-value {
  margin-top: .5rem;
  font-family: 'Fraunces Variable', serif;
  font-size: 2.25rem; font-weight: 500;
  letter-spacing: -.02em; line-height: 1.05;
  color: var(--cream-950);
  font-variant-numeric: tabular-nums;
}
.result-card .r-value .u {
  font-size: 1rem; font-weight: 500; color: var(--fg-muted); margin-left: .25rem;
}
:root.dark .result-card .r-value { color: var(--cream-50); }
.result-card .r-note {
  margin-top: .75rem;
  font-size: .8125rem; line-height: 1.5;
  color: var(--fg-muted);
}

/* Reference range band (tone changes with A1C value, no alarming red) */
.ref-band {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1rem 1.25rem;
  border-radius: 1.125rem;
  border: 2px solid;
  background: var(--cream-100);
  border-color: var(--cream-300);
  color: var(--cream-900);
  margin-bottom: 1.25rem;
}
.ref-band strong { font-weight: 700; }
.ref-band span { font-size: .875rem; color: var(--fg-muted); }
:root.dark .ref-band { background: var(--cream-800); color: var(--cream-100); border-color: var(--cream-700); }
:root.dark .ref-band span { color: var(--cream-300); }

.ref-band[data-tone="normal"] {
  background: var(--sage-50);
  border-color: var(--sage-300);
  color: var(--sage-800);
}
:root.dark .ref-band[data-tone="normal"] {
  background: rgba(132,168,80,.10);
  border-color: rgba(132,168,80,.4);
  color: var(--sage-200);
}
.ref-band[data-tone="pre"] {
  background: var(--peach-50);
  border-color: var(--peach-300);
  color: var(--peach-800);
}
:root.dark .ref-band[data-tone="pre"] {
  background: rgba(240,108,31,.10);
  border-color: rgba(240,108,31,.4);
  color: var(--peach-200);
}
.ref-band[data-tone="dia"] {
  background: var(--peach-100);
  border-color: var(--peach-400);
  color: var(--peach-800);
}
:root.dark .ref-band[data-tone="dia"] {
  background: rgba(240,108,31,.18);
  border-color: rgba(240,108,31,.55);
  color: var(--peach-100);
}
.ref-band[data-tone="normal"] span,
.ref-band[data-tone="pre"] span,
.ref-band[data-tone="dia"] span { color: inherit; opacity: .85; }

.tool-formula {
  margin: 0;
  font-size: .8125rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Article prose ---------- */

.article {
  padding: 2rem 0 2rem;
}
.article .crumbs {
  font-size: .75rem; color: var(--fg-muted); margin-bottom: .75rem;
}
.article .crumbs a { color: inherit; text-decoration: none; }
.article .crumbs a:hover { text-decoration: underline; color: var(--peach-700); }

.article h1 { margin-top: .5rem; font-size: clamp(2.25rem, 4vw + 1rem, 3.25rem); letter-spacing: -.02em; line-height: 1.1; }
.article .lede { margin-top: 1.25rem; }

/* Two-column hero row at the top of each article. Text left, illustration right. */
.article-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 2.5rem 0 3rem;
}
.article-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(45% 70% at 15% 0%, rgba(255,202,161,.30), transparent 65%),
    radial-gradient(40% 60% at 92% 5%, rgba(160,192,115,.18), transparent 65%);
}
:root.dark .article-hero::before {
  background:
    radial-gradient(45% 70% at 15% 0%, rgba(240,108,31,.08), transparent 65%),
    radial-gradient(40% 60% at 92% 5%, rgba(132,168,80,.08), transparent 65%);
}
.article-hero-grid {
  display: grid; gap: 2.5rem; align-items: center;
}
@media (min-width: 960px) {
  .article-hero-grid { grid-template-columns: 1.25fr 1fr; gap: 4rem; }
}
.article-hero-text h1 { margin-top: .75rem; }
.article-hero-text .lede { margin-top: 1.25rem; max-width: 36rem; }
.article-hero-text .byline { margin-top: 1.5rem; }

/* Hero illustration card on the right. Reuses dashboard mock language. */
.article-hero-image {
  display: flex; justify-content: center;
}
.hero-illustration {
  position: relative;
  width: 100%; max-width: 22rem;
  margin-left: auto;
  transform: rotate(1.5deg);
  background: #fff; border: 2px solid var(--border); border-radius: 2rem;
  padding: 1.5rem; box-shadow: var(--shadow-cardLg);
}
:root.dark .hero-illustration { background: var(--cream-900); border-color: var(--cream-400); border-width: 3px; }
.hero-illustration .head {
  display: flex; align-items: center; justify-content: space-between;
}
.hero-illustration .head .title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em;
  color: var(--cream-700);
}
:root.dark .hero-illustration .head .title { color: var(--cream-300); }
.hero-illustration .head .badge {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--sage-100); color: var(--sage-800);
  padding: .125rem .5rem; border-radius: 9999px;
  font-size: .625rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
}
:root.dark .hero-illustration .head .badge { background: rgba(132,168,80,.18); color: var(--sage-200); }
.hero-illustration .head .badge::before { content: ""; width: .3125rem; height: .3125rem; border-radius: 9999px; background: var(--sage-500); }

.hero-illustration .stat {
  display: flex; align-items: baseline; gap: .375rem; margin-top: .75rem;
  font-variant-numeric: tabular-nums;
}
.hero-illustration .stat .big {
  font-family: 'Fraunces Variable', serif; font-size: 2.5rem; font-weight: 500; line-height: 1;
  color: var(--cream-950); letter-spacing: -.02em;
}
:root.dark .hero-illustration .stat .big { color: var(--cream-50); }
.hero-illustration .stat .unit { font-size: .75rem; color: var(--fg-muted); }

.hero-illustration .chart { height: 5.5rem; margin-top: 1rem; }
.hero-illustration .chart svg { width: 100%; height: 100%; }

.hero-illustration .annotations {
  margin-top: 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  font-size: .6875rem;
}
.hero-illustration .annotations .a {
  display: flex; align-items: center; gap: .375rem;
  padding: .375rem .5rem; border-radius: .5rem;
  background: var(--cream-100); color: var(--cream-900);
}
:root.dark .hero-illustration .annotations .a { background: var(--cream-800); color: var(--cream-100); }
.hero-illustration .annotations .a .dot { width: .375rem; height: .375rem; border-radius: 9999px; background: var(--sage-500); }
.hero-illustration .annotations .a.warn .dot { background: var(--peach-500); }

.prose { font-size: 1.1875rem; line-height: 1.75; max-width: 64ch; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25em; }
.prose h2 { font-size: clamp(1.5rem, 1.8vw + 1rem, 1.875rem); margin: 2.4em 0 .7em; }
.prose h3 { font-size: 1.4rem; margin: 2em 0 .5em; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin: .35em 0; }
.prose strong { font-weight: 600; color: var(--cream-950); }
:root.dark .prose strong { color: var(--cream-50); }
.prose a { color: var(--link); }
.prose a:hover { color: var(--link-hover); }
.prose blockquote {
  border-left: 4px solid var(--peach-400);
  padding-left: 1rem; color: var(--cream-900);
  font-style: italic; margin: 1.5em 0;
}
:root.dark .prose blockquote { color: var(--cream-100); }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9375em;
  background: var(--cream-100); padding: .1em .35em; border-radius: .375em;
}
:root.dark .prose code { background: var(--cream-800); }

/* Responsive YouTube embed */
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 1.125rem; overflow: hidden;
  border: 2px solid var(--border);
  background: var(--cream-100);
  margin: 1.5rem 0;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-embed .video-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--fg-muted); text-align: center; padding: 2rem;
}
:root.dark .video-embed { background: var(--cream-900); border-color: var(--cream-700); }

/* Related reads */
.related {
  margin-top: 2.5rem; padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
}
.related h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.related-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
.related-card {
  background: #fff; border: 2px solid var(--border); border-radius: 1.125rem;
  padding: 1.25rem; text-decoration: none; color: inherit;
  transition: transform .25s var(--ease-soft), border-color .25s var(--ease-soft), box-shadow .25s var(--ease-soft);
  display: block;
}
:root.dark .related-card { background: var(--cream-900); border-color: var(--cream-700); }
:root.dark .related-card:hover { border-color: var(--cream-600); }
.related-card:hover { transform: translateY(-2px); border-color: var(--cream-400); box-shadow: var(--shadow-card); }
.related-card .eyebrow { font-size: .6875rem; }
.related-card h3 { margin: .25rem 0 .5rem; font-size: 1.0625rem; line-height: 1.3; }
.related-card .read-more { margin-top: .5rem; display: inline-flex; align-items: center; gap: .375rem; font-size: .875rem; font-weight: 600; color: var(--peach-700); }
:root.dark .related-card .read-more { color: var(--peach-300); }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}
.nums { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: .75rem; }
