/* ==========================================================================
   Linnea Health — design system (Pass 1)
   Palette: "Pine & Petal" — locked 2026-07-04, Brand Identity v1.
   Type: Fraunces (display) / Inter (body), self-hosted variable woff2.
   RULES BAKED IN HERE:
   - The wordmark is NEVER live text — always the SVG asset (brand doc).
   - No font-variation-settings anywhere in this file (brand doc).
   - Clay rose is a micro-accent: <=5% of any page, never a background wash.
   - Compliance-critical content (prices, Tier 1) is static HTML; nothing in
     this stylesheet may hide, collapse, or de-emphasise a .disclosure block.
   ========================================================================== */

/* ---- Fonts (self-hosted; files pending download — fallbacks render clean) */
@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: optional; /* §9: no FOUT — fallback renders if font not ready */
}
@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-latin-400-italic.woff2') format('woff2');
  font-weight: 400 600;
  font-style: italic;
  font-display: optional;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
}

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --pine: #1E3A2F;
  --pine-deep: #162C24;   /* hover state */
  --cream: #FAF7F2;
  --ink: #26312B;
  --sage: #5C7364;
  --mist: #E3EAE2;        /* sage mist surface */
  --clay: #C4756B;        /* micro-accent only */
  --petal: #F4E7E3;       /* rare soft wash */
  --white: #FFFFFF;
  --hairline: #E4E0D8;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --size-0: clamp(2.1rem, 1.5rem + 3vw, 3.4rem);   /* h1 */
  --size-1: clamp(1.6rem, 1.3rem + 1.6vw, 2.3rem); /* h2 */
  --size-2: clamp(1.25rem, 1.15rem + .5vw, 1.5rem);/* h3 */
  --size-body: 1.0625rem;                           /* 17px */
  --size-small: .9rem;

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1120px;
}

/* ---- Reset / base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--pine);
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  font-weight: 560;
}
h1 { font-size: var(--size-0); letter-spacing: -0.01em; }
h2 { font-size: var(--size-1); }
h3 { font-size: var(--size-2); }
p { margin: 0 0 var(--space-2); }
a { color: var(--pine); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--clay); }
ul { margin: 0 0 var(--space-2); padding-left: 1.2rem; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--space-3); }
.small { font-size: var(--size-small); color: var(--sage); }
.kicker {
  font-size: .8rem; font-weight: 500; letter-spacing: .24em;
  text-transform: uppercase; color: var(--sage); margin-bottom: var(--space-1);
}

/* ---- Skip link --------------------------------------------------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--pine); color: var(--cream); padding: .6rem 1rem;
}
.skip-link:focus { left: 0; }

/* ---- Header / nav ------------------------------------------------------ */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--space-3);
  padding-block: var(--space-2);
}
.site-header .wordmark img { height: 30px; width: auto; }
.site-nav { margin-left: auto; }
.site-nav ul {
  list-style: none; display: flex; gap: var(--space-3);
  margin: 0; padding: 0; align-items: center;
}
.site-nav a { text-decoration: none; font-weight: 500; }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--clay); }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .js .nav-toggle {
    display: inline-flex; margin-left: auto;
    background: none; border: 1px solid var(--hairline); border-radius: var(--radius-sm);
    padding: .5rem .8rem; font: inherit; color: var(--pine); cursor: pointer;
  }
  .js .site-nav { display: none; width: 100%; margin: 0; }
  .js .site-nav.open { display: block; }
  .site-header__inner { flex-wrap: wrap; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: var(--space-2); padding-block: var(--space-2); }
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-block; background: var(--pine); color: var(--cream);
  padding: .8rem 1.5rem; border-radius: 999px; text-decoration: none;
  font-weight: 550; border: 1px solid var(--pine);
}
.btn:hover { background: var(--pine-deep); color: var(--cream); }
.btn--secondary { background: transparent; color: var(--pine); }
.btn--secondary:hover { background: var(--mist); color: var(--pine); }
.btn--pending { opacity: .75; cursor: not-allowed; }

/* ---- Bands / sections -------------------------------------------------- */
.band { padding-block: var(--space-5); }
.band--mist { background: var(--mist); }
.band--pine { background: var(--pine); color: var(--cream); }
.band--pine h2, .band--pine h3 { color: var(--cream); }
.band--pine a { color: var(--cream); }
.band--white { background: var(--white); }
.band--hairline { border-top: 1px solid var(--hairline); }
.band--tight { padding-block-start: var(--space-2); }

/* ---- Cards / grids ----------------------------------------------------- */
.grid { display: grid; gap: var(--space-3); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: var(--space-3);
}
.card h3 { margin-top: 0; }

/* ---- Image placeholders (Pass 2 swaps these for real imagery) ---------- */
.imgph {
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; width: 100%;
}
.imgph--mist { background: var(--mist); }
.imgph--petal { background: var(--petal); }
.imgph--cream { background: #F1EBE1; }
.imgph--pine { background: var(--pine); }
.imgph__note { font-size: .8rem; color: var(--sage); letter-spacing: .08em; text-transform: uppercase; }
.imgph--pine .imgph__note { color: var(--mist); }

/* The visible label on AI lifestyle imagery (owner decision, July QA; restyled
   subtle per owner 2026-08-02 — visible on inspection, quiet in the layout).
   Stays with the real images when they replace the placeholders. */
.img-label {
  position: absolute; bottom: .5rem; right: .65rem;
  font-size: .6rem; letter-spacing: .04em;
  color: var(--sage); opacity: .62;
  background: none; padding: 0; text-transform: lowercase;
}

/* ---- Placeholder copy flags (visible until real copy lands) ------------ */
.ph {
  border: 1.5px dashed #C9A24B; border-radius: var(--radius-sm);
  padding: .5rem .8rem; color: #6b5b2a; background: #FCF6E8;
  font-size: .95rem;
}
.ph-chip {
  display: inline-block; font-size: .7rem; letter-spacing: .05em;
  background: #FCF6E8; border: 1px dashed #C9A24B; color: #6b5b2a;
  border-radius: 999px; padding: .1rem .55rem; vertical-align: middle;
}

/* ---- Pricing ----------------------------------------------------------- */
.price { margin-block: var(--space-3); }
.price__anchor {
  font-family: var(--font-display); font-size: 2.4rem; color: var(--pine);
  font-weight: 600;
}
.price__anchor span { font-size: 1.05rem; font-family: var(--font-body); color: var(--sage); font-weight: 400; }
.price__first { font-size: 1.15rem; margin-top: .3rem; }
/* First-cycle coupon. The code is part of the price statement ("$179 with code X"),
   so .price__code sits inline on the .price__first line; the instruction below it is
   body-weight ink — never fine print, never grey, because the discount is only
   applied if the patient actually types it. */
.price__code {
  display: inline-block; white-space: nowrap; letter-spacing: .06em; font-weight: 700;
  background: var(--mist); border: 1px solid var(--sage);
  border-radius: var(--radius-sm); padding: .05rem .45rem;
}
.price__coupon { font-size: 1.05rem; margin-top: .4rem; color: var(--ink); }
.price__stelo { margin-top: .3rem; }
.renewal { margin-top: var(--space-2); }
.renewal__featured {
  background: var(--mist); border-radius: var(--radius-sm);
  padding: .7rem 1rem; display: inline-block;
}
.renewal__alt { display: block; margin-top: .4rem; font-size: var(--size-small); color: var(--sage); }

/* ---- Tier 1 disclosure — equal visual weight with the price ------------ */
/* CLAUDE.md §5: same visual weight. Not smaller, not grey, never collapsed. */
.disclosure {
  background: var(--white);
  border: 1.5px solid var(--pine);
  border-left: 6px solid var(--pine);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-block: var(--space-3);
  font-size: var(--size-body);   /* same size as body/price context */
  color: var(--ink);
}
.disclosure p { margin: 0 0 .5rem; }

/* ---- How-it-works steps ------------------------------------------------ */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative;
  padding-left: 3.2rem; margin-bottom: var(--space-3);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--pine); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600;
}
.steps h3 { margin-bottom: .3rem; }

/* ---- FAQ --------------------------------------------------------------- */
details {
  border-bottom: 1px solid var(--hairline);
  padding-block: var(--space-2);
}
details summary {
  cursor: pointer; font-weight: 550; color: var(--pine);
  font-size: 1.05rem;
}
details[open] summary { margin-bottom: var(--space-1); }

/* ---- Subscribe box ----------------------------------------------------- */
.subscribe { display: flex; gap: var(--space-1); flex-wrap: wrap; max-width: 720px; }
.subscribe label { position: absolute; left: -9999px; }
.subscribe input[type="email"] {
  flex: 1 1 220px; padding: .8rem 1rem; font: inherit;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--white);
  color: var(--ink);
}
.subscribe button {
  font: inherit; font-weight: 550; cursor: pointer;
  background: var(--pine); color: var(--cream);
  border: 1px solid var(--pine); border-radius: 999px; padding: .8rem 1.5rem;
}
.subscribe button:hover { background: var(--pine-deep); }
.subscribe-note { flex: 1 1 100%; font-size: .85rem; opacity: .78; margin: 0; }

/* ---- Hero -------------------------------------------------------------- */
.hero { padding-block: var(--space-6); }
/* minmax(0, …fr) + min-width: 0 kill the grid "auto minimum": without them, image
   content can inflate its track past the container in some browsers (the right
   portrait column overflowed the content boundary in the owner's Chrome). */
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--space-4); align-items: center; }
@media (max-width: 860px) { .hero__inner { grid-template-columns: minmax(0, 1fr); } }
.hero .btn { margin: 0 var(--space-1) var(--space-1) 0; }
.portraits { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-2); }
.portraits > * { min-width: 0; min-height: 0; }
.portraits > :first-child { grid-row: span 2; } /* first portrait fills the left column */

/* ---- Wellness chip row (homepage) --------------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-block: var(--space-2); }
.chip {
  display: inline-block;
  padding: .55rem 1.1rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--white);
  color: var(--pine);
  font-weight: 550;
  text-decoration: none;
}
.chip:hover { border-color: var(--sage); }

/* ---- Hub hero — wrapped card (Mochi-style), image at full frame ----------
   Container-width rounded card, fixed 16:9 — the exact ratio hero assets are
   generated at, so nothing is ever cropped (owner-final 2026-08-02). */
.hub-hero-wrap { padding-block: var(--space-2); }
.hub-hero {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--mist);
  border-radius: var(--radius);
  overflow: hidden;
}
.hub-hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; /* card and asset share 16:9 — full frame shows */
}
.hub-hero__overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: var(--space-4);
  /* Scrim must hold ≥.62 alpha wherever text can sit (copy reaches ~55% of the hero
     width) so pine text clears WCAG AA even over worst-case dark image pixels —
     verified by the per-glyph contrast sweep, 2026-08-03. Fade finishes by 74% to
     keep the right-of-center subjects clear. */
  background: linear-gradient(90deg,
    rgba(250, 247, 242, .96) 0%,
    rgba(250, 247, 242, .92) 40%,
    rgba(250, 247, 242, .55) 62%,
    rgba(250, 247, 242, 0) 74%);
}
.hub-hero__copy { max-width: 34rem; }
.hub-hero h1 { max-width: 26ch; }
.hub-hero .kicker { color: var(--pine); }
@media (max-width: 700px) {
  /* Overlay unstacks on small screens: full image on top, text beneath. */
  .hub-hero { aspect-ratio: auto; }
  .hub-hero__img { position: static; height: auto; aspect-ratio: 16 / 9; display: block; }
  .hub-hero__overlay { position: static; background: none; padding: var(--space-2) 0; }
}

/* ---- Real imagery ------------------------------------------------------- */
.portrait { position: relative; margin: 0; }
.portrait img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; border-radius: var(--radius);
}
/* White contain-frame: renders have pure-white backgrounds, so the frame and image
   merge invisibly and ANY image ratio fits with no crop (owner rule 2026-08-03). */
.product-art {
  margin: 0;
  aspect-ratio: 3 / 4; /* matches the renders' native ratio (owner 2026-08-03) */
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-art img {
  width: auto; height: auto;
  max-width: 100%; max-height: 100%; /* flush — the renders carry their own internal margins (owner 2026-08-03) */
  object-fit: contain;
}
.img-label--on-photo { color: #fff; opacity: .78; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { background: var(--pine); color: var(--cream); padding-block: var(--space-5) var(--space-4); }
.site-footer a { color: var(--cream); text-decoration: none; }
.site-footer a:hover { color: var(--petal); text-decoration: underline; }
.site-footer .wordmark img { height: 26px; width: auto; margin-bottom: var(--space-3); }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
@media (max-width: 820px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
.footer-cols h3 {
  color: var(--mist); font-family: var(--font-body);
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
}
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: .5rem; }
.footer-legal { border-top: 1px solid rgba(250, 247, 242, .25); padding-top: var(--space-3); font-size: var(--size-small); color: var(--mist); }
.footer-legal .ph { background: transparent; color: var(--petal); border-color: rgba(244, 231, 227, .5); }

/* Partner pharmacy network (CLAUDE.md §5) — one component, two render points
   (footer + Tier 2 page). Links inherit each context's colors; nothing here may
   de-emphasise the block relative to the text around it. */
.pharmacy-list { list-style: none; padding: 0; margin: 0 0 var(--space-2); }
.pharmacy-list li { margin-bottom: .4rem; }
.footer-legal .pharmacy-list a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- Misc -------------------------------------------------------------- */
.breadcrumb { font-size: var(--size-small); margin-bottom: var(--space-2); }
.eligibility {
  background: var(--mist); border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3); display: inline-block;
}
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--sage); font-weight: 700; }
.stelo-strip__img { border-radius: var(--radius); }
.age-line { font-weight: 550; }

/* ---- Stelo acknowledgment gate (device CTA only — not a §5 modal) ------- */
.ack {
  background: var(--white);
  border: 1.5px solid var(--pine);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-block: var(--space-3);
  max-width: 720px;
}
.ack-title { margin-top: 0; font-size: 1.05rem; font-weight: 600; }
.ack ul { margin-bottom: var(--space-2); }
.ack li { margin-bottom: .4rem; }
.ack-confirm { display: flex; gap: .6rem; align-items: center; font-weight: 550; margin-bottom: var(--space-1); }
.ack-confirm input { width: 1.15rem; height: 1.15rem; accent-color: var(--pine); }
.ack-gate .btn { opacity: .55; pointer-events: none; }
.ack-gate:has(.ack-confirm input:checked) .btn { opacity: 1; pointer-events: auto; }
