/* ============================================================
   The Curated Health — shared stylesheet
   Visual identity: "Modern Apothecary"
   Warm paper canvas, emerald green, clean white cards,
   Instrument Serif display type over Hanken Grotesk.
   ============================================================ */

/* ---- Reset --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; padding: 0; }

/* ---- Design tokens ------------------------------------------ */
:root {
  --canvas:    #F4F2EB;
  --surface:   #FFFFFF;
  --ink:       #19241D;
  --ink-soft:  #545E56;
  --ink-faint: #666C66;
  --green:     #246B4E;
  --green-deep:#1A5039;
  --green-soft:#E8EFE7;
  --green-line:#C9DBCD;
  --line:      #E4E0D3;
  --honey:     #BE7E2E;

  --shadow-sm: 0 1px 2px rgba(25,36,29,.04), 0 3px 8px rgba(25,36,29,.05);
  --shadow-md: 0 2px 6px rgba(25,36,29,.05), 0 14px 34px rgba(25,36,29,.09);
  --shadow-lg: 0 4px 14px rgba(25,36,29,.07), 0 28px 64px rgba(25,36,29,.14);

  --r-card: 22px;
  --r-sm:   13px;
  --ease:   cubic-bezier(.22,.61,.36,1);
  --maxw:   1120px;
  --measure:64ch;
}

/* ---- Base --------------------------------------------------- */
html { background: var(--canvas); scroll-behavior: smooth; }

body {
  font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--green); color: #fff; }

:focus-visible {
  outline: 2.5px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Layout helpers ----------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding-block: clamp(40px, 6vw, 76px); }
.section-soft { background: var(--green-soft); }
.section-ink  { background: var(--ink); color: #fff; }

/* offset in-page anchor jumps so the sticky header doesn't cover them */
section[id], [id].anchor { scroll-margin-top: 88px; }

.section-head { max-width: 38rem; margin-bottom: clamp(22px, 3.5vw, 36px); }
.section-head.center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
}
.section-ink .eyebrow { color: #9ec9af; }

/* ---- Typography --------------------------------------------- */
h1, h2, h3, .display {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -.005em;
  line-height: 1.08;
}

.display, h1 {
  font-size: clamp(2.7rem, 6.4vw, 4.6rem);
}
h2 {
  font-size: clamp(2.05rem, 4.2vw, 3.1rem);
  line-height: 1.1;
}
h3 {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.16rem;
  letter-spacing: -.01em;
  line-height: 1.35;
}
em, .italic { font-style: italic; }
.t-green { color: var(--green); }

.lede {
  font-size: clamp(1.06rem, 1.6vw, 1.24rem);
  color: var(--ink-soft);
  line-height: 1.62;
  max-width: var(--measure);
}
.section-head p { color: var(--ink-soft); }
p + p { margin-top: 1em; }

/* ---- Buttons ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  letter-spacing: -.005em;
  transition: transform .2s var(--ease), background-color .2s var(--ease),
              box-shadow .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 2px rgba(25,36,29,.16);
}
.btn-primary:hover {
  background: var(--green-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-2px);
}
.btn-lg { padding: 17px 38px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

.textlink {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--green-line);
  text-underline-offset: 4px;
  transition: text-decoration-color .2s var(--ease);
}
.textlink:hover { text-decoration-color: var(--green); }

/* ---- Header ------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244,242,235,.86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name {
  font-weight: 600;
  font-size: 1.04rem;
  letter-spacing: -.018em;
}
.brand-name b { font-weight: 600; }
.brand-name .serif {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.18rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
}
.nav a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 7px 3px;
  transition: color .18s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--green); font-weight: 600; }

/* ---- Hero --------------------------------------------------- */
.hero {
  position: relative;
  text-align: center;
  padding-block: clamp(44px, 7.5vw, 88px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 56% at 50% -8%, rgba(36,107,78,.16), transparent 70%),
    radial-gradient(ellipse 44% 40% at 86% 108%, rgba(190,126,46,.10), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin-inline: auto; max-width: 16ch; }
.hero .lede { margin: 16px auto 0; text-align: center; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 24px;
}

/* breadcrumb */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-size: .85rem;
  color: var(--ink-faint);
  margin-bottom: 22px;
  justify-content: center;
}
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--green); }
.crumbs span[aria-current] { color: var(--ink); }

/* ---- Generic card ------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
}

/* ---- Partner grid (hub) ------------------------------------- */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.partner-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 30px 30px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .26s var(--ease), box-shadow .26s var(--ease),
              border-color .26s var(--ease);
}
a.partner-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-line);
}
.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.pc-offer {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .01em;
  padding: 7px 13px;
  border-radius: 999px;
}
.pc-mark { width: 38px; height: 38px; flex: none; }
.pc-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.92rem;
  line-height: 1.12;
  margin-bottom: 7px;
}
.pc-desc {
  color: var(--ink-soft);
  font-size: .98rem;
  margin-bottom: 22px;
}
.pc-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--green);
}
.pc-cta svg { width: 16px; height: 16px; transition: transform .22s var(--ease); }
a.partner-card:hover .pc-cta svg { transform: translateX(4px); }

.partner-soon {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px dashed var(--green-line);
  border-radius: var(--r-card);
  padding: 22px 30px;
}
.partner-soon p { color: var(--ink-soft); font-size: .98rem; }
.soon-tag {
  flex: none;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
@media (max-width: 560px) {
  .partner-soon { flex-direction: column; align-items: flex-start; gap: 9px; }
}

/* ---- Steps -------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}
.step { position: relative; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.section-ink .step-num {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
  color: #9ec9af;
}
.step h3 { margin-bottom: 7px; }
.step p { color: var(--ink-soft); font-size: .98rem; }
.section-ink .step p { color: rgba(255,255,255,.72); }

/* ---- Trust points ------------------------------------------- */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.trust-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
}
.trust-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: var(--green-soft);
  margin-bottom: 16px;
}
.trust-icon svg { width: 21px; height: 21px; }
.trust-item h3 { margin-bottom: 7px; }
.trust-item p { color: var(--ink-soft); font-size: .97rem; }

/* ---- Code dispenser card ------------------------------------ */
.code-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  padding: clamp(30px, 5vw, 48px);
  max-width: 520px;
  margin-inline: auto;
  text-align: center;
}
.code-card .eyebrow { margin-bottom: 10px; }
.code-headline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  line-height: 1.14;
  margin-bottom: 22px;
}
.code-note {
  color: var(--ink-faint);
  font-size: .9rem;
  margin-top: 14px;
}
.code-stage .btn { width: 100%; }

.code-result { animation: rise .5s var(--ease) both; }
.code-label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.code-value {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--green-deep);
  background: var(--green-soft);
  border: 1px dashed var(--green-line);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  margin: 8px 0 18px;
  word-break: break-all;
}
.code-actions {
  display: flex;
  gap: 11px;
}
.code-actions .btn { flex: 1; }

.notice {
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  font-size: .94rem;
  color: var(--ink-soft);
  margin-top: 4px;
}
.notice strong { color: var(--ink); }

/* ---- FAQ ---------------------------------------------------- */
.faq { max-width: 46rem; margin-inline: auto; }
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px;
  font-weight: 600;
  font-size: 1.06rem;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 11px; height: 11px;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(45deg);
  transition: transform .25s var(--ease);
  flex: none;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq-a {
  padding: 0 4px 24px;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ---- Affiliate disclosure ----------------------------------- */
.disclosure {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 18px 20px;
  font-size: .9rem;
  color: var(--ink-soft);
  max-width: 46rem;
  margin-inline: auto;
}
.disclosure svg { width: 19px; height: 19px; flex: none; color: var(--green); margin-top: 1px; }

/* ---- Journal ------------------------------------------------ */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.journal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.jc-tag {
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--honey);
  margin-bottom: 14px;
}
.journal-card h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.18;
  margin-bottom: 9px;
}
.journal-card p { color: var(--ink-soft); font-size: .96rem; }
a.journal-card {
  transition: transform .26s var(--ease), box-shadow .26s var(--ease),
              border-color .26s var(--ease);
}
a.journal-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-line);
}
.jc-cta {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: .94rem;
  color: var(--green);
}
.jc-cta svg { width: 15px; height: 15px; transition: transform .22s var(--ease); }
a.journal-card:hover .jc-cta svg { transform: translateX(4px); }
.journal-card p + .jc-cta { margin-top: auto; padding-top: 16px; }

/* ---- Article / prose --------------------------------------- */
.article {
  max-width: 44rem;
  margin-inline: auto;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: .85rem;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.article-lede {
  font-size: clamp(1.08rem, 1.7vw, 1.24rem);
  line-height: 1.6;
  color: var(--ink);
}
.article h2 {
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  margin: 1.15em 0 .04em;
}
.article h3 {
  font-size: 1.2rem;
  margin: 1.1em 0 .1em;
}
.article p { color: var(--ink-soft); margin-top: 1em; }
.article ul, .article ol {
  color: var(--ink-soft);
  margin: 1em 0;
  padding-left: 1.35em;
}
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li { margin-top: .55em; padding-left: .2em; }
.article li::marker { color: var(--green); }
.article strong { color: var(--ink); font-weight: 600; }
.article a:not(.btn) {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--green-line);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s var(--ease);
}
.article a:not(.btn):hover { text-decoration-color: var(--green); }
.article blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--green-line);
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.26;
  color: var(--ink);
}
.article hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin-block: 1.5em;
}
.article-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  border-radius: var(--r-card);
  padding: clamp(24px, 3.5vw, 34px);
  margin-top: 1.6em;
}
.article-cta h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0;
}
.article-cta p { color: var(--ink-soft); margin: 0 0 10px; max-width: 40ch; }

/* ---- Footer ------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.66);
  padding-block: clamp(36px, 5vw, 56px) 28px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-brand .brand-name { color: #fff; }
.footer-blurb {
  margin-top: 14px;
  font-size: .95rem;
  max-width: 34ch;
  line-height: 1.6;
}
.footer-col h4 {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 15px;
}
.footer-col a {
  display: block;
  font-size: .96rem;
  padding: 5px 0;
  color: rgba(255,255,255,.74);
  transition: color .18s var(--ease);
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  font-size: .85rem;
  color: rgba(255,255,255,.5);
}
.footer-disclosure {
  margin-top: 22px;
  font-size: .85rem;
  line-height: 1.6;
  color: rgba(255,255,255,.5);
  max-width: 72ch;
}

/* ---- Scroll reveal ------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
[data-delay="1"] { transition-delay: .08s; }
[data-delay="2"] { transition-delay: .16s; }
[data-delay="3"] { transition-delay: .24s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Responsive --------------------------------------------- */
@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .steps, .trust-grid, .journal-grid { grid-template-columns: 1fr; gap: 16px; }
  .partners-grid { grid-template-columns: 1fr; }
  .header-inner { min-height: 62px; }
  .nav { gap: 16px; }
  .brand-name { font-size: .98rem; }
}
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; min-height: 0; padding-block: 8px; row-gap: 6px; }
  .nav { width: 100%; justify-content: space-between; gap: 10px; }
  .nav a { font-size: .86rem; padding: 11px 4px; }
}
@media (max-width: 460px) {
  .wrap { padding-inline: 18px; }
  .code-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}

/* ---- Reduced motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .code-result { animation: none; }
  * { transition-duration: .01ms !important; }
}
