/* Primer — styles for the new pages (Learn, Foundations, Alternatives, Peptides, About).
   Built on the existing tokens + primer.css conventions. Mobile-first. */

/* ---- mobile nav menu ---- */
.nav-mobile { border-top: 1px solid var(--line-soft); background: var(--cream); }
.nav-mobile .wrap { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; padding-bottom: 16px; }
.nav-mobile-link { text-align: left; background: transparent; border: none; font-size: 17px; color: var(--ink-soft);
  padding: 12px 4px; cursor: pointer; border-radius: 10px; }
.nav-mobile-link:hover, .nav-mobile-link.active { color: var(--ink); font-weight: 600; }
.nav-mobile .btn { margin-top: 8px; }
@media (min-width: 860px) { .nav-mobile { display: none; } }
.nav-links span.active { color: var(--ink); font-weight: 600; }

/* ---- generic page scaffolding ---- */
.page { padding: 36px 0 64px; min-height: 60vh; }
@media (min-width: 760px) { .page { padding: 56px 0 88px; } }
.wrap-narrow { max-width: 760px; }
.page-head { max-width: 760px; margin-bottom: 30px; }
.page-title { font-weight: 400; font-size: clamp(34px, 8vw, 54px); line-height: 1.03; letter-spacing: -.025em; margin: 12px 0 0; text-wrap: balance; }
.page-sub { font-size: clamp(16px, 4vw, 19px); line-height: 1.55; color: var(--ink-soft); margin: 16px 0 0; max-width: 56ch; }

.backlink { background: transparent; border: none; color: var(--muted); font-size: 14.5px; font-weight: 600;
  cursor: pointer; padding: 6px 0; margin-bottom: 18px; display: inline-block; }
.backlink:hover { color: var(--ink); }

.page-cta { margin-top: 48px; padding: 28px 26px; background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); text-align: center; }
.page-cta p { font-size: 16.5px; color: var(--ink-soft); margin: 0 0 18px; max-width: 46ch; margin-inline: auto; line-height: 1.5; }

/* ---- generic card grids ---- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 680px) { .card-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============ LEARN ============ */
.art-card { text-align: left; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 24px; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column; min-height: 200px; }
.art-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line); }
.art-kicker { color: var(--sage-deep); margin-bottom: 12px; }
.art-card h3 { font-family: var(--serif); font-weight: 500; font-size: 23px; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.art-card p { font-size: 14.5px; line-height: 1.5; color: var(--muted); margin: 10px 0 0; flex: 1; }
.art-more { font-size: 14px; font-weight: 600; color: var(--sage-deep); margin-top: 16px; }

.article-title { font-weight: 400; font-size: clamp(32px, 7.5vw, 50px); line-height: 1.05; letter-spacing: -.025em; margin: 10px 0 0; text-wrap: balance; }
.article-dek { font-size: clamp(17px, 4.4vw, 21px); line-height: 1.5; color: var(--ink-soft); margin: 18px 0 0; max-width: 54ch; }
.article-body { margin-top: 30px; }
.article-body p { font-size: 17.5px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 22px; max-width: 66ch; }
.article-body p:first-child::first-letter { font-family: var(--serif); font-size: 1em; }
.article-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; }

.sources { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.sources h4 { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-deep); font-weight: 700; margin: 0 0 14px; }
.sources ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sources li a { font-size: 14.5px; color: var(--ink-soft); border-bottom: 1.5px solid var(--sage-tint2); padding-bottom: 1px; line-height: 1.5; }
.sources li a:hover { border-color: var(--sage-deep); color: var(--ink); }

/* ============ FOUNDATIONS ============ */
.goal-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 24px; }
.foundations-intro { font-size: clamp(16px, 4vw, 19px); line-height: 1.6; color: var(--ink-soft); max-width: 64ch; margin: 0 0 30px; }
.lever-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .lever-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
.lever-card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px; }
.lever-n { font-family: ui-monospace, monospace; font-size: 12px; color: var(--faint); letter-spacing: .1em; }
.lever-card h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 10px 0 0; letter-spacing: -.01em; }
.lever-card p { font-size: 15.5px; line-height: 1.55; color: var(--muted); margin: 10px 0 0; }
.lever-src { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.lever-src a { font-size: 13px; color: var(--sage-deep); border-bottom: 1px solid var(--sage-tint2); width: fit-content; padding-bottom: 1px; }
.lever-src a:hover { border-color: var(--sage-deep); }

/* ============ ALTERNATIVES ============ */
.alt-group { margin-bottom: 46px; }
.alt-group-head { max-width: 60ch; margin-bottom: 18px; }
.alt-group-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 6vw, 34px); margin: 0; letter-spacing: -.02em; }
.alt-group-head p { font-size: 15.5px; line-height: 1.55; color: var(--muted); margin: 8px 0 0; }
.alt-card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; }
.alt-card.alt-rx { background: var(--sage-tint); border-color: var(--sage-tint2); }
.alt-tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--sage-deep);
  background: var(--sage-tint); border-radius: 100px; padding: 5px 11px; width: fit-content; }
.alt-card.alt-rx .alt-tag { background: var(--cream); }
.alt-card h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin: 14px 0 0; letter-spacing: -.01em; }
.alt-card p { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin: 9px 0 0; flex: 1; }
.alt-src { font-size: 13px; color: var(--sage-deep); font-weight: 600; margin-top: 16px; border-bottom: 1px solid var(--sage-tint2); width: fit-content; padding-bottom: 1px; }
.alt-src:hover { border-color: var(--sage-deep); }

/* ============ PEPTIDES — filters + list ============ */
.filters { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 26px; display: flex; flex-direction: column; gap: 16px; }
.search { width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink); background: var(--cream);
  border: 1.5px solid var(--line); border-radius: 100px; padding: 14px 20px; outline: none; transition: border-color .15s; }
.search:focus { border-color: var(--sage-2); }
.search::placeholder { color: var(--faint); }
.filter-row { display: flex; flex-direction: column; gap: 9px; }
@media (min-width: 760px) { .filter-row { flex-direction: row; align-items: baseline; gap: 14px; } }
.filter-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; flex: 0 0 72px; padding-top: 4px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { font-size: 13.5px; font-weight: 600; padding: 8px 14px; border-radius: 100px; border: 1.5px solid var(--line);
  background: var(--cream); color: var(--ink-soft); cursor: pointer; transition: all .14s; }
.fchip:hover { border-color: var(--sage-2); color: var(--ink); }
.fchip.sel { background: var(--sage); border-color: var(--sage); color: #fff; }
.filter-meta { display: flex; align-items: center; gap: 16px; font-size: 13.5px; color: var(--muted); padding-top: 4px; border-top: 1px solid var(--line-soft); }
.clear-filters { background: transparent; border: none; color: var(--sage-deep); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.clear-filters:hover { text-decoration: underline; }

.pep-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .pep-list { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
.pep-list-card { text-align: left; display: flex; gap: 16px; background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 20px; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s; width: 100%; }
.pep-list-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line); }
.pep-list-body { flex: 1; min-width: 0; }
.pep-list-name b { font-family: var(--serif); font-weight: 500; font-size: 20px; display: block; line-height: 1.1; letter-spacing: -.01em; }
.pep-list-name span { font-size: 12.5px; color: var(--muted); display: block; margin-top: 3px; }
.pep-list-mech { font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin: 10px 0 0; }
.pep-list-foot { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pep-goals { font-size: 12.5px; color: var(--faint); }

/* legal pill color variants */
.legal { margin-top: 0; }
.legal-ok::before { background: var(--sage); }
.legal-cosmetic::before { background: #C7A24E; }
.legal-warn::before { background: var(--clay); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty p { font-size: 16px; margin: 0 0 18px; }

/* ============ PEPTIDE DETAIL ============ */
.detail-bottomline { margin-top: 6px; margin-bottom: 24px; background: var(--cream-deep); border-color: var(--line); }
.detail-bottomline .pt b { color: var(--sage-deep); }
.detail-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.detail-title { font-weight: 400; font-size: clamp(30px, 7vw, 44px); line-height: 1.04; letter-spacing: -.025em; margin: 0; }
.detail-class { font-size: 15px; color: var(--muted); margin: 8px 0 0; }
.detail-aliases { font-size: 13.5px; color: var(--faint); margin: 6px 0 0; }
.grade.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }

.grade-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }
.grade-pill { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.route-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.route-pill { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 100px; background: var(--cream-deep); color: var(--ink-soft); border: 1px solid var(--line); }

.detail-section { margin-top: 28px; }
.detail-section h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 12px; letter-spacing: -.01em; }
.detail-section > p { font-size: 16.5px; line-height: 1.65; color: var(--ink-soft); margin: 0; max-width: 66ch; }

.detail-prescriber { margin-top: 24px; }

.risk-table { display: flex; flex-direction: column; gap: 12px; }
.risk-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.risk-row .flag { flex: 0 0 auto; text-transform: capitalize; }
.risk-text b { display: block; font-size: 15.5px; font-weight: 600; }
.risk-text p { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 5px 0 0; }

.gate-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 600px) { .gate-list { grid-template-columns: repeat(2, 1fr); } }
.gate-list li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-soft);
  background: var(--clay-tint); border: 1px solid #E6D2C5; border-radius: var(--radius-sm); padding: 12px 14px; }
.gate-icon { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--clay-deep); position: relative; }
.gate-icon::before, .gate-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 8px; background: var(--clay-deep); }
.gate-icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.gate-icon::after { transform: translate(-50%, -50%) rotate(-45deg); }

.legal-block { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--clay); border-radius: var(--radius); padding: 20px 22px; }
.legal-block.legal-ok { border-left-color: var(--sage); }
.legal-block.legal-cosmetic { border-left-color: #C7A24E; }
.legal-block.legal-warn { border-left-color: var(--clay); }
.legal-cat { font-family: var(--serif); font-weight: 500; font-size: 18px; color: var(--ink); }
.legal-block p { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin: 10px 0 0; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 12.5px; color: var(--faint); }
.legal-src { display: inline-block; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--sage-deep); border-bottom: 1px solid var(--sage-tint2); padding-bottom: 1px; }
.legal-src:hover { border-color: var(--sage-deep); }

.cite-note { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.cite-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.cite-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.cite-list li a { font-size: 14.5px; color: var(--ink-soft); border-bottom: 1.5px solid var(--sage-tint2); padding-bottom: 1px; line-height: 1.45; }
.cite-list li a:hover { border-color: var(--sage-deep); color: var(--ink); }
.cite-type { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); background: var(--cream-deep); border-radius: 100px; padding: 3px 9px; }
.detail-disclaimer { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ============ ABOUT ============ */
.about-section { margin-top: 40px; }
.about-section h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 5.5vw, 32px); margin: 0 0 14px; letter-spacing: -.02em; }
.about-section > p { font-size: 16.5px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 16px; max-width: 66ch; }
.rubric { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 8px; }
.rubric-row { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.rubric-row b { display: block; font-size: 15.5px; font-weight: 600; }
.rubric-row p { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 4px 0 0; max-width: 60ch; }
.about-link { display: inline-block; margin-top: 10px; background: transparent; border: none; cursor: pointer; }
.sources-inline { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.sources-inline a { font-size: 14.5px; color: var(--ink-soft); border-bottom: 1.5px solid var(--sage-tint2); padding-bottom: 1px; line-height: 1.5; }
.sources-inline a:hover { border-color: var(--sage-deep); color: var(--ink); }
.disclaimer-block { margin-top: 40px; padding: 22px 24px; background: var(--cream-deep); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13.5px; line-height: 1.65; color: var(--muted); max-width: 72ch; }
.disclaimer-block b { color: var(--ink-soft); }

/* ============ BOOT / SPINNER ============ */
.boot { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 60px 20px; }
.boot-mark { font-family: var(--serif); font-size: 30px; font-weight: 500; display: flex; align-items: baseline; gap: 8px; }
.boot-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); display: inline-block; }
.boot-bar { width: 180px; height: 6px; border-radius: 100px; background: var(--oat); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--sage); border-radius: 100px; animation: bootslide 1.1s ease-in-out infinite; }
@keyframes bootslide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.boot p { font-size: 14px; color: var(--muted); margin: 0; }
@media (prefers-reduced-motion: reduce) { .boot-bar i { animation: none; width: 100%; } }

/* ============ HERO IMAGE ============ */
.hero-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: center 30%;
  border-radius: var(--radius-lg);
  background: var(--oat);
}
@media (min-width: 860px) {
  .hero-img { aspect-ratio: 5/6; min-height: 500px; }
}
