/* ============================================================
   MYRO — base.css
   Design tokens, reset, typography
   Palette pulled from the myro+ bottle: bone / sand / espresso / gold
   + a single clinical green for data, actives and lab readouts
   ============================================================ */

:root {
  /* surfaces */
  --bone:        #EFE9DE;   /* page background */
  --bone-2:      #E7DFD1;   /* alt panel */
  --sand:        #DBD0BD;   /* warm card */
  --clay:        #C9BBA2;
  --paper:       #F5F1E8;   /* lightest */
  --espresso:    #211E18;   /* near-black text */
  --ink:         #2D2922;
  --ink-soft:    #6A6256;
  --ink-faint:   #9A9081;
  --line:        rgba(33,30,24,.14);
  --line-soft:   rgba(33,30,24,.08);

  /* accents */
  --gold:        #B2924E;   /* the myro+ badge gold */
  --gold-2:      #C9A964;
  --gold-soft:   #E9DCBE;
  --broccoli:    #6F7F4E;   /* sprout green, used sparingly */
  --broccoli-dk: #43502F;
  --lab:         #4E7A5A;   /* clinical green — data lines, actives, readouts */
  --lab-2:       #7FB08C;
  --lab-soft:    rgba(78,122,90,.12);
  --beet:        #9E2B3A;

  /* type */
  --display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --brand: "Clash Display", "Helvetica Neue", sans-serif;
  --grotesk: "General Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  /* scale */
  --maxw: 1320px;
  --gutter: clamp(20px, 5vw, 72px);
  --radius: 14px;
  --radius-lg: 26px;

  /* motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);

  --nav-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
  overflow-x: clip;
}

body {
  font-family: var(--grotesk);
  background: var(--bone);
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
::selection { background: var(--gold-soft); color: var(--espresso); }

/* ---------- Line breaking ----------
   No orphans anywhere: every run of copy balances its lines so a
   paragraph reads as even lines rather than a stranded last word.
   Browsers cap balancing on very long blocks, so `pretty` catches
   those and still refuses to leave a short final line. */
h1, h2, h3, h4, h5, h6,
p, li, dd, dt, blockquote, figcaption, summary, label,
.lead, .eyebrow, .cap, .note, .buyrow__note {
  text-wrap: balance;
}
.faq__a, .faq__a p, .legal p, .longform p { text-wrap: pretty; }

/* ---------- Type scale ---------- */
.eyebrow {
  text-wrap: balance;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
}

h1, h2, h3 {
  text-wrap: balance;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.012em;
  color: var(--espresso);
}
h2 em, h1 em { font-style: italic; color: var(--gold); font-family: var(--display); }

.display-xl {
  font-size: clamp(3rem, 12vw, 9.5rem);
  line-height: 0.94;
  letter-spacing: -0.022em;
  font-weight: 400;
}
.display-l { font-size: clamp(2.4rem, 6.5vw, 5.4rem); }
.display-m { font-size: clamp(1.9rem, 4.5vw, 3.6rem); }
.display-s { font-size: clamp(1.5rem, 3vw, 2.2rem); }

.lead {
  text-wrap: balance;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--ink-soft);
  line-height: 1.5;
  letter-spacing: -0.015em;
  max-width: 46ch;
}
.lead b { color: var(--espresso); font-weight: 500; }

/* utility */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 11vw, 160px); position: relative; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.gold { color: var(--gold); }
.lab-c { color: var(--lab); }
.grow-line { display:block; height:1px; background:var(--line); width:100%; }

/* section header pattern — eyebrow + figure number + title */
.shead { display:flex; justify-content:space-between; align-items:flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 64px); }
.shead > div:first-child { max-width: 620px; }
.shead h2 { margin-top: 14px; }
.shead .lead { max-width: 40ch; }

/* figure label — "FIG. 03 · Lactate curve" */
.fig {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ink-faint); display: inline-block;
}
.fig::before { content: none; }
.fig.light { color: rgba(239,233,222,.6); }

/* a faint drafting grid for scientific panels */
.gridbg {
  background-image:
    linear-gradient(rgba(33,30,24,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33,30,24,.05) 1px, transparent 1px);
  background-size: 48px 48px;
}
.gridbg--dark {
  background-image:
    linear-gradient(rgba(239,233,222,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239,233,222,.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* data readout row (label — value) */
.readout { border-top: 1px solid var(--line); }
.readout .row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
}
.readout .row span:first-child { color: var(--ink-soft); text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; }
.readout .row span:last-child { color: var(--espresso); text-align: right; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  /* show everything immediately — no scroll-triggered reveals */
  .reveal, .step, .blurband .statement .w, .molecule__annot span, .xray__tag,
  .chart .line, .chart .zone, .chart .pt, .chart .callout, .soil__mask { opacity: 1 !important; transform: none !important; filter: none !important; stroke-dashoffset: 0 !important; }
  .soil__mask { display: none; }
}
