/* ================================================================
   Order BPC-157 — Dark Botanical aesthetic
   Palette: warm near-black #0F0F0F ground, warm off-white #E8E4DF,
   aged-gold #D4A574, bruised-mauve #C19BA8, dusty-sage #8A9583,
   terracotta #C4856A
   Typography: Cormorant Garamond (headings) + IBM Plex Sans (body)
   ================================================================ */

:root {
  --primary:           #D4A574;
  --primary-50:        #2A2620;
  --primary-900:       #A07C4E;
  --secondary:         #C19BA8;
  --accent:            #C4856A;
  --rose:              #E8B4B8;
  --sage:              #8A9583;
  --neutral-50:        #1A1916;
  --neutral-200:       #2E2C28;
  --neutral-500:       #9A9590;
  --neutral-900:       #0A0A09;
  --bg:                #0F0F0F;
  --surface:           #171614;
  --surface-elevated:  #201E1B;
  --text:              #E8E4DF;
  --text-muted:        #9A9590;
  --rule:              #2E2C28;
  --rule-accent:       #D4A574;
  --success:           #8A9583;
  --warning:           #D4A574;
  --danger:            #C4856A;

  --font-heading: 'Cormorant Garamond', 'Cormorant', Garamond, Georgia, 'Times New Roman', serif;
  --font-body:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --h1: clamp(2.5rem, 5vw, 3.75rem);
  --h2: clamp(1.875rem, 3.5vw, 2.625rem);
  --h3: 1.375rem;
  --lede: 1.25rem;
  --body: 1.0625rem;
  --small: 0.875rem;
  --micro: 0.8125rem;

  --max-width: 70rem;
  --container-px: clamp(1.25rem, 4vw, 2.5rem);
  --radius-card: 0.25rem;
  --radius-btn: 0.125rem;

  --transition: 350ms ease-out;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.7;
  min-height: 100vh;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text);
  line-height: 1.12;
  letter-spacing: 0.005em;
}
h1 { font-size: var(--h1); letter-spacing: 0.01em; }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
p { max-width: 62ch; }
p + p { margin-top: 1.125rem; }
strong { font-weight: 600; color: var(--text); }
em { font-style: italic; }
sup { font-size: 0.72em; line-height: 0; position: relative; top: -0.4em; }

/* ---- Container ---- */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--rule-accent);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.125rem;
  gap: 1.5rem;
}
.site-brand {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.site-brand:hover { color: var(--primary); transition: color var(--transition); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: center;
}
.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  padding-block: 0.25rem;
  border-bottom: 1.5px solid transparent;
  transition: border-color var(--transition);
  display: inline-block;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--primary);
}
.site-nav a[aria-current="page"] { border-bottom-width: 1.5px; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background-color: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--surface);
    border-bottom: 1px solid var(--rule);
    padding: 1rem var(--container-px);
    z-index: 99;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 10vw, 7rem);
  background-color: var(--bg);
}
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -15%;
  width: 50%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(193,155,168,0.08) 0%, transparent 65%);
  pointer-events: none;
  filter: blur(60px);
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 40%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(138,149,131,0.06) 0%, transparent 65%);
  pointer-events: none;
  filter: blur(70px);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  max-width: 56ch;
}
.hero-with-image {
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: 100%;
  gap: 3rem;
}
.hero-content { max-width: 56ch; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: var(--lede);
  color: var(--primary);
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 1px;
  height: 4rem;
  background-color: var(--primary);
  flex-shrink: 0;
}
.hero-headline {
  font-size: var(--h1);
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin-bottom: 1.25rem;
}
.hero-subheadline {
  font-size: var(--lede);
  line-height: 1.5;
  color: var(--text);
  max-width: 56ch;
}
.cta-row {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.hero-figure {
  position: relative;
}
.hero-figure img {
  border: 1px solid var(--primary);
  outline: 6px solid var(--bg);
  width: 100%;
  height: auto;
}
.hero-figure figcaption {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 0.625rem;
}
.hero-figure figcaption strong {
  color: var(--primary);
  font-weight: 500;
  font-style: italic;
  font-family: var(--font-heading);
}
@media (max-width: 768px) {
  .hero-with-image { grid-template-columns: 1fr; }
  .hero-figure { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius-btn);
  transition: border-color var(--transition), background-color var(--transition);
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary {
  border: 1px solid var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-primary:hover { border-width: 1.5px; background-color: rgba(212,165,116,0.08); }
.btn-secondary {
  border: none;
  color: var(--text);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-underline-offset: 3px;
  padding-inline: 0;
}
.btn-secondary:hover { text-decoration-thickness: 1.5px; }

/* ---- Main content area ---- */
main { padding-block: clamp(2.5rem, 6vw, 5rem); }

/* ---- Sections ---- */
.content-section {
  padding-block: 3rem;
  border-top: 0 none;
}
.section-heading {
  position: relative;
  margin-bottom: 1.5rem;
  padding-top: 0.5rem;
}
.section-heading::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background-color: var(--primary);
  margin-bottom: 1.25rem;
}
.body-prose p,
.body-prose li {
  font-size: var(--body);
  line-height: 1.7;
  color: var(--text);
  max-width: 62ch;
}
.body-prose ul {
  list-style: none;
  padding-left: 1.25rem;
}
.body-prose ul li {
  position: relative;
  margin-bottom: 0.625rem;
}
.body-prose ul li::before {
  content: '—';
  position: absolute;
  left: -1.25rem;
  color: var(--sage);
}
.body-prose ol {
  padding-left: 1.5rem;
  counter-reset: body-ol;
}
.body-prose ol li {
  counter-increment: body-ol;
  margin-bottom: 0.625rem;
  position: relative;
}
.body-prose ol li::marker { color: var(--primary); font-weight: 500; }
.body-prose h3 {
  font-size: var(--h3);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.body-prose h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--body);
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.body-prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}
.body-prose a:hover { color: var(--text); }
.body-prose strong { font-weight: 600; }

/* ---- Citation chips ---- */
sup a[data-citation] {
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.75em;
  text-decoration: underline;
  text-underline-offset: 1px;
  transition: color var(--transition);
}
sup a[data-citation]:hover { color: var(--text); }

/* ---- Inline code / dose strings ---- */
code {
  font-family: var(--font-body);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background-color: var(--surface-elevated);
  border-radius: 0.125rem;
  padding: 0.0625rem 0.25rem;
  font-size: 0.9em;
}

/* ---- Cards (FAQ, research findings) ---- */
.card {
  background-color: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-card);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.card-eyebrow {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.375rem;
  display: block;
}
.card h3 {
  font-size: var(--h3);
  color: var(--text);
  margin-bottom: 0.875rem;
}
.card p, .card li { max-width: 56ch; }

/* ---- Callouts ---- */
.callout {
  background-color: var(--surface-elevated);
  border: 1px solid var(--neutral-200);
  border-left: 2px solid var(--primary);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin-block: 2rem;
}
.callout-eyebrow {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
  text-transform: none;
  letter-spacing: 0;
}
.callout p { max-width: 62ch; font-size: var(--body); }
.callout-danger {
  border-left-color: var(--danger);
}
.callout-danger .callout-eyebrow { color: var(--danger); }

/* ---- Figures ---- */
figure {
  margin-block: 2.5rem;
}
figure img {
  border: 1px solid var(--primary);
  outline: 6px solid var(--bg);
  width: 100%;
}
figcaption {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 0.625rem;
}
figcaption strong {
  color: var(--primary);
  font-weight: 500;
  font-family: var(--font-heading);
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin-block: 2rem; }
table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--surface);
}
thead tr {
  border-bottom: 1.5px solid var(--primary);
}
th {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--small);
  color: var(--text);
  letter-spacing: 0.12em;
  text-align: left;
  padding: 0.875rem 1rem;
  text-transform: uppercase;
}
td {
  font-size: var(--small);
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--neutral-200);
  vertical-align: top;
}
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.id-col { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- References list ---- */
.references-list {
  padding: 0;
  counter-reset: ref-list;
  list-style: none;
}
.references-list li {
  counter-increment: ref-list;
  padding: 1rem 0 1rem 3rem;
  position: relative;
  border-bottom: 1px solid var(--rule);
  font-size: var(--small);
  line-height: 1.55;
  max-width: 68ch;
}
.references-list li::before {
  content: counter(ref-list);
  position: absolute;
  left: 0;
  top: 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  min-width: 2rem;
}
.references-list a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}
.references-list a:hover { color: var(--text); }
.ref-meta { color: var(--text-muted); display: block; margin-top: 0.25rem; }

/* ---- FAQ accordion ---- */
details.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
details.faq-item summary {
  cursor: pointer;
  padding: 1.25rem 1.75rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--body);
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: '+';
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 400;
  flex-shrink: 0;
  transition: transform var(--transition);
}
details[open].faq-item summary::after { transform: rotate(45deg); }
.faq-answer {
  padding: 0 1.75rem 1.5rem;
  font-size: var(--body);
  line-height: 1.7;
  color: var(--text);
  max-width: 56ch;
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}
.faq-answer p + p { margin-top: 0.875rem; }

/* ---- Contact form ---- */
.contact-form {
  max-width: 44rem;
  margin-top: 2rem;
}
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block;
  font-size: var(--small);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}
.form-input,
.form-textarea {
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-card);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--body);
  color: var(--text);
  transition: border-color var(--transition);
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-textarea { min-height: 8rem; resize: vertical; }
.form-note {
  font-size: var(--small);
  color: var(--text-muted);
  margin-top: 0.375rem;
}

/* ---- CTA centered variant ---- */
.cta-row--centered { justify-content: center; margin-top: 2rem; }

/* ---- 404 ---- */
.not-found {
  text-align: center;
  padding-block: clamp(4rem, 10vw, 8rem);
}
.not-found h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  color: var(--primary);
  line-height: 1;
  margin-bottom: 1rem;
}
.not-found p { margin-inline: auto; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--primary);
  padding-block: 3rem 2rem;
  margin-top: auto;
}
.footer-disclaimer-line {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}
.footer-disclaimer-line::before {
  content: '';
  display: block;
  width: 1px;
  height: 3.5rem;
  background-color: var(--primary);
  flex-shrink: 0;
  margin-top: 0.25rem;
}
.footer-disclaimer {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: var(--small);
  color: var(--text);
  line-height: 1.55;
  max-width: 52ch;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-col-heading {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--small);
  color: var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}
.footer-col ul li {
  margin-bottom: 0.5rem;
}
.footer-col ul li a {
  font-size: var(--small);
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--text); }
.footer-copyright {
  font-size: var(--micro);
  color: var(--text-muted);
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}

@media (max-width: 768px) {
  .footer-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-columns { grid-template-columns: 1fr; }
}

/* ---- Tippy.js custom theme ---- */
.tippy-box[data-theme~='botanical'] {
  background-color: var(--surface-elevated);
  color: var(--text);
  border: 1px solid var(--neutral-200);
  border-top-color: var(--primary);
  border-radius: var(--radius-card);
  font-family: var(--font-body);
  font-size: var(--small);
  max-width: 24rem;
  line-height: 1.55;
}
.tippy-box[data-theme~='botanical'] .tippy-arrow { color: var(--surface-elevated); }
.tippy-box[data-theme~='botanical'] .tippy-content { padding: 0.75rem 1rem; }

/* ---- Reading progress bar ---- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background-color: var(--primary);
  width: 0%;
  z-index: 200;
  transition: width 100ms linear;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary);
  z-index: 999;
  font-size: var(--small);
}
.skip-link:focus { top: 1rem; }

/* ---- Utility ---- */
.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;
}
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--primary); }
.italic-serif { font-family: var(--font-heading); font-style: italic; }
.page-breadcrumb {
  font-size: var(--small);
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.page-breadcrumb a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.page-breadcrumb a:hover { color: var(--text); }
.page-breadcrumb span { color: var(--text); margin-inline: 0.375rem; }
