/* ==========================================================================
   The Zebra Guide — design system
   Warm paper ground, deep forest primary, clay accent. Every text pair is
   >= 5.3:1 against its background, checked before the palette was adopted.
   Body face is Atkinson Hyperlegible: drawn for low vision, which is a
   deliberate choice for a chronic-illness audience, not decoration.
   ========================================================================== */

:root {
  --paper:      #F4F1EA;
  --card:       #FBFAF6;
  --ink:        #1C2420;
  --ink-2:      #4A5551;
  --forest:     #1F4A3F;
  --forest-lt:  #2E6A59;
  --clay:       #9E4A2F;
  --amber:      #7A5A14;

  --line:        rgba(28, 36, 32, 0.12);
  --line-strong: rgba(28, 36, 32, 0.22);

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --sh-1: 0 1px 2px rgba(28,36,32,.05), 0 1px 3px rgba(28,36,32,.04);
  --sh-2: 0 4px 10px rgba(28,36,32,.07), 0 2px 4px rgba(28,36,32,.04);
  --sh-3: 0 14px 34px rgba(28,36,32,.11), 0 5px 10px rgba(28,36,32,.06);

  --display: 'Fraunces', Georgia, serif;
  --body:    'Atkinson Hyperlegible', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;

  --wrap: 1120px;
  --measure: 62ch;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 2px;
  border-radius: 3px;
}

[id] { scroll-margin-top: 96px; }

img, svg { max-width: 100%; }

.skip {
  position: absolute; left: 50%; top: 6px;
  transform: translateX(-50%) translateY(-200%);
  z-index: 300;
  background: var(--forest); color: var(--card);
  padding: 12px 22px; border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 700; text-decoration: none;
  transition: transform .18s;
}
.skip:focus { transform: translateX(-50%) translateY(0); }

.sr {
  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: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; }

/* ---------------------------------------------------------------- masthead */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-strong);
}
.masthead-in {
  max-width: var(--wrap); margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 18px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; min-height: 48px; flex-shrink: 0;
}
.brand .mark { width: 36px; height: 36px; flex-shrink: 0; }
.brand .word {
  font-family: var(--display); font-weight: 600; font-size: 1.16rem;
  letter-spacing: -0.025em; line-height: 1.05;
}
.brand .word small {
  display: block; font-family: var(--mono); font-weight: 400;
  font-size: 0.6rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); margin-top: 2px;
}

.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 6px 13px; border-radius: 999px;
  font-size: .9rem; font-weight: 700; color: var(--ink-2);
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(28,36,32,.06); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--forest); color: var(--card); }

.burger {
  display: none; margin-left: auto;
  width: 46px; height: 46px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--card); cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 4px;
}
.burger span { display: block; width: 19px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 900px) {
  .burger { display: flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line-strong);
    flex-direction: column; padding: 10px 18px 18px; gap: 2px;
    box-shadow: var(--sh-2);
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; border-radius: var(--r-sm); }
  .masthead-in { position: relative; }
}

/* ---------------------------------------------------------------- type */
.eyebrow {
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .15em; color: var(--clay);
  display: block; margin-bottom: 12px;
}
.lede { font-size: 1.14rem; line-height: 1.68; color: var(--ink-2); max-width: var(--measure); }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose li { max-width: var(--measure); color: var(--ink-2); }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.16rem; margin-top: 1.8em; font-weight: 600; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose a { color: var(--forest); font-weight: 700; }

/* ---------------------------------------------------------------- bits */
.stripe-rule {
  height: 6px; border-radius: 99px; opacity: .14;
  background: repeating-linear-gradient(90deg, var(--ink) 0 9px, transparent 9px 18px);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font-family: var(--body); font-size: .95rem; font-weight: 700;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .14s, box-shadow .14s, background .14s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--forest); color: var(--card); box-shadow: var(--sh-1); }
.btn-primary:hover { background: #17382F; box-shadow: var(--sh-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--forest); color: var(--forest); }

.card {
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 22px; box-shadow: var(--sh-1);
}

.tag {
  display: inline-block; font-family: var(--mono); font-size: .66rem;
  font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid;
}
.tag-ok      { color: var(--forest); background: rgba(31,74,63,.09);  border-color: rgba(31,74,63,.22); }
.tag-caution { color: var(--clay);   background: rgba(158,74,47,.09); border-color: rgba(158,74,47,.22); }
.tag-info    { color: var(--amber);  background: rgba(122,90,20,.10); border-color: rgba(122,90,20,.24); }

.callout {
  border-left: 4px solid var(--clay);
  background: var(--card); border-radius: 0 var(--r) var(--r) 0;
  padding: 18px 22px; box-shadow: var(--sh-1);
}
.callout.is-safety { border-left-color: var(--clay); }
.callout.is-note   { border-left-color: var(--forest); }
.callout p { max-width: none; }
.callout h3 { font-family: var(--body); font-size: .98rem; font-weight: 700; margin-bottom: 6px; color: var(--ink); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------------------------------------------------------------- hero */
.hero { padding: 68px 0 44px; }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 3.5rem); letter-spacing: -0.035em; max-width: 16ch; }
.hero h1 em { font-style: italic; color: var(--forest); }
.hero .lede { margin-top: 20px; font-size: 1.18rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* ---------------------------------------------------------------- paths */
.path {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 22px 20px;
  text-decoration: none; color: inherit; box-shadow: var(--sh-1);
  border-top: 3px solid var(--forest);
  transition: transform .16s, box-shadow .16s, border-top-color .16s;
}
.path:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-top-color: var(--clay); }
.path .ico { width: 26px; height: 26px; color: var(--forest); }
.path b { font-family: var(--display); font-size: 1.08rem; font-weight: 600; }
.path span { font-size: .9rem; color: var(--ink-2); line-height: 1.55; }

/* ---------------------------------------------------------------- posts */
.post-item {
  display: block; padding: 20px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover h3 { color: var(--forest); }
.post-meta {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2);
}
.post-item h3 { font-size: 1.2rem; margin: 6px 0 5px; transition: color .15s; }
.post-item p { font-size: .94rem; color: var(--ink-2); max-width: var(--measure); }

/* ---------------------------------------------------------------- calculator */
#calc { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.syringe-card svg { width: 100%; height: auto; display: block; margin-top: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-2); font-weight: 500;
}
.field input, .field select {
  font-family: var(--body); font-size: 1rem; min-height: 48px;
  padding: 10px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line-strong); background: var(--card); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--forest); }

.readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px,1fr)); gap: 14px; }
.readout div { background: var(--paper); border-radius: var(--r-sm); padding: 12px 14px; }
.readout dt {
  font-family: var(--mono); font-size: .66rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-2); margin-bottom: 3px;
}
.readout dd { font-family: var(--display); font-size: 1.45rem; font-weight: 600; }


/* ---------------------------------------------------------------- peptides */
.pep-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 26px; }
.chip {
  font-family: var(--body); font-size: .85rem; font-weight: 700;
  min-height: 44px; padding: 9px 16px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: transparent;
  color: var(--ink-2); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--forest); color: var(--card); border-color: var(--forest); }

.pep-card {
  display: flex; flex-direction: column; gap: 7px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 18px 20px;
  text-decoration: none; color: inherit; box-shadow: var(--sh-1);
  transition: transform .15s, box-shadow .15s;
}
.pep-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.pep-card b { font-family: var(--display); font-size: 1.06rem; font-weight: 600; }
.pep-card .cat { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.pep-card p { font-size: .88rem; color: var(--ink-2); line-height: 1.55; }

.spec { width: 100%; border-collapse: collapse; margin-top: 10px; }
.spec th, .spec td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: .93rem; vertical-align: top; }
.spec th { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); font-weight: 500; width: 34%; }

/* ---------------------------------------------------------------- footer */
.foot {
  border-top: 1px solid var(--line-strong); margin-top: 72px;
  padding: 40px 0 64px; font-size: .88rem; color: var(--ink-2);
}
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; }
.foot-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 8px 14px; color: var(--forest); font-weight: 700; text-decoration: none;
}
.foot-nav a:hover { text-decoration: underline; }
.foot p { max-width: 68ch; }
.foot p + p { margin-top: 10px; }

@media (prefers-contrast: more) {
  :root { --ink-2: #333B38; --line: rgba(28,36,32,.3); --line-strong: rgba(28,36,32,.48); }
  .card, .path, .pep-card { border-width: 2px; }
}

@media (max-width: 700px) {
  body { font-size: 16.5px; }
  .hero { padding: 40px 0 30px; }
  .wrap { padding: 0 18px; }
}

/* Without JS the nav can't toggle, so never hide it */
.no-js .nav { display: flex; position: static; flex-direction: row; box-shadow: none; border: 0; padding: 0; }
.no-js .burger { display: none; }

/* ==========================================================================
   Compatibility layer for content carried over from the previous site.
   Ray wrote and sourced all of it; rather than retype 2,000 lines into new
   markup, the old class names are mapped onto the new design tokens.
   ========================================================================== */
.ported section { padding: 0 0 34px; }
.ported .inner, .ported .wide { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.ported .inner { max-width: 860px; }
.ported .ported-h1 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); margin-bottom: 12px; }
.ported h2 { font-size: 1.45rem; margin: 1.6em 0 .5em; }
.ported h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .4em; }
.ported p  { color: var(--ink-2); max-width: var(--measure); margin-bottom: .9em; }
.ported .lede { font-size: 1.1rem; margin-bottom: 1em; }
.ported .eyebrow {
  font-family: var(--mono); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .15em; color: var(--clay); display: block; margin-bottom: 10px;
}
.ported .panel {
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 22px 24px; margin-top: 14px; box-shadow: var(--sh-1);
}
.ported .panel + .panel { margin-top: 12px; }
.ported .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .ported .two-col { grid-template-columns: 1fr; } }
.ported .pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 16px; margin-top: 22px; }
.ported .pillar-card {
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 22px 20px; box-shadow: var(--sh-1);
  display: block; text-decoration: none; color: inherit;
}
.ported .pillar-icon { width: 26px; height: 26px; color: var(--forest); margin-bottom: 10px; }
.ported .tag {
  display: inline-block; font-family: var(--mono); font-size: .66rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase; padding: 4px 10px;
  border-radius: 999px; border: 1px solid; margin-right: 6px; margin-bottom: 8px;
}
.ported .tag-caution { color: var(--clay); background: rgba(158,74,47,.09); border-color: rgba(158,74,47,.22); }
.ported .tag-supportive { color: var(--forest); background: rgba(31,74,63,.09); border-color: rgba(31,74,63,.22); }
.ported .stripe-accent {
  height: 6px; border-radius: 99px; opacity: .14; margin-bottom: 22px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 9px, transparent 9px 18px);
}
.ported .thread-wrap { display: none; }
.ported .doctor-card {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 18px 22px; margin-bottom: 10px; box-shadow: var(--sh-1);
}
.ported .doctor-card .meta { color: var(--ink-2); font-size: .88rem; }
.ported .chart-tool, .ported .dose-table, .ported .chart-controls, .ported .empty-note { display: none; }
.ported a { color: var(--forest); font-weight: 700; }
.ported ul, .ported ol { padding-left: 1.2em; color: var(--ink-2); }
.ported li { margin-bottom: .35em; max-width: var(--measure); }
.ported .btn { margin-top: 10px; }
.ported .disclaimer-strip {
  background: var(--card); border: 1px solid var(--line-strong); border-left: 4px solid var(--clay);
  border-radius: 0 var(--r) var(--r) 0; padding: 16px 20px; margin: 20px 0; font-size: .9rem;
  color: var(--ink-2); max-width: 760px;
}

/* Story page carried over from the previous build */
.story-wrap .story-short p { font-size: 1.06rem; line-height: 1.78; color: var(--ink-2); margin-bottom: 18px; max-width: var(--measure); }
.story-wrap .story-short p:first-of-type::first-letter,
.story-wrap .story-chapter p:first-of-type::first-letter {
  font-family: var(--display); font-size: 3.1rem; font-weight: 600;
  float: left; line-height: .82; margin-right: 10px; color: var(--forest);
}
.story-wrap .story-full { margin-top: 32px; max-width: var(--measure); }
.story-wrap .story-full > summary {
  list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  min-height: 48px; padding: 14px 20px; background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--sh-1);
}
.story-wrap .story-full > summary::-webkit-details-marker { display: none; }
.story-wrap .story-full-label { font-family: var(--display); font-size: 1.05rem; font-weight: 600; }
.story-wrap .story-full-label::after { content: " \2193"; color: var(--forest); }
.story-wrap .story-full[open] .story-full-label::after { content: " \2191"; }
.story-wrap .story-full-meta { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.story-wrap .story-full[open] > summary { margin-bottom: 36px; }
.story-wrap .story-chapter { margin-bottom: 48px; padding-bottom: 44px; border-bottom: 1px solid var(--line); }
.story-wrap .story-chapter:last-child { border-bottom: none; padding-bottom: 0; }
.story-wrap .story-chapter h2 { font-size: 1.35rem; margin-bottom: 14px; max-width: 24ch; }
.story-wrap .story-chapter p { color: var(--ink-2); line-height: 1.8; margin-bottom: 16px; max-width: var(--measure); }
