/* ==========================================================
   Peptide Reference — premium medical reference theme
   Deep charcoal · warm gold accent · editorial typography
   ========================================================== */

:root {
  --bg-0: #0d0f12;
  --bg-1: #14171c;
  --bg-2: #1a1e24;
  --card: #16191f;
  --card-hover: #1c2028;
  --border: #262a32;
  --border-strong: #353a44;
  --ink: #e8e4dc;
  --ink-soft: #b8b3a8;
  --ink-mute: #7a7568;
  --accent: #c9a76b;          /* muted warm gold */
  --accent-soft: #d9bd86;
  --accent-deep: #8a7344;
  --safe: #8da678;            /* muted sage */
  --warn: #c9986b;            /* muted ochre */
  --danger: #b87878;          /* muted clay-red */
  --exp: #9988a8;             /* muted plum */
  --pop-1: #c9a76b;
  --pop-2: #8d9eb8;
  --pop-3: #b08c98;
  --pop-4: #a8a888;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);

  --font-sans: "Inter", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-0);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Subtle gradient — no patterns, no glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at top, rgba(40, 38, 32, 0.4), transparent 60%),
    var(--bg-0);
}

/* ---------- Layout ---------- */

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 44px 80px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 28px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.5; }

.brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand .sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intro {
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0;
  line-height: 1.65;
}

.intro strong { color: var(--ink); font-weight: 600; }

/* ---------- Section headers ---------- */

.section {
  margin-top: 60px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.section-head .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-head .rule {
  flex: 1;
}

/* ---------- Category groups ---------- */

.category {
  margin-bottom: 40px;
}

.category-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  padding: 0 0 6px 0;
}

.category-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.category-head .blurb {
  color: var(--ink-mute);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Peptide grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
  min-height: 96px;
}

.tile:hover {
  background: var(--card-hover);
  border-color: var(--accent-deep);
}

.tile-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.3;
}

.tile-also {
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.tile-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}

/* ---------- Badges (solid, restrained) ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink-soft);
  line-height: 1.6;
}

.badge-safe { color: var(--safe); border-color: rgba(141, 166, 120, 0.4); }
.badge-mod  { color: var(--accent); border-color: rgba(201, 167, 107, 0.4); }
.badge-cau  { color: var(--danger); border-color: rgba(184, 120, 120, 0.4); }
.badge-exp  { color: var(--exp); border-color: rgba(153, 136, 168, 0.4); }

.badge-pop-mainstream { color: var(--ink); border-color: var(--ink-mute); }
.badge-pop-popular    { color: var(--ink-soft); border-color: var(--border-strong); }
.badge-pop-niche      { color: var(--ink-mute); border-color: var(--border); }
.badge-pop-cutting    { color: var(--accent-soft); border-color: rgba(201, 167, 107, 0.3); }

.badge-route {
  color: var(--ink-mute);
  border-color: var(--border);
  font-weight: 500;
}

/* ---------- Hover tooltip ---------- */

.tile-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  background: #1f2229;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
  box-shadow: var(--shadow);
}

.tile-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-strong);
}

.tile:hover .tile-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tile-tip strong { color: var(--accent-soft); font-weight: 600; }

/* ---------- Stacks ---------- */

.stacks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 12px;
}

.stack-card {
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
}

.stack-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-deep);
}

.stack-goal {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.stack-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.chip {
  position: relative;
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
  font-family: var(--font-mono);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent-soft);
}

.chip-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 240px;
  background: #1f2229;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.5;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
  box-shadow: var(--shadow);
}

.chip-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-strong);
}

.chip:hover .chip-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.chip-tip strong { color: var(--accent-soft); font-weight: 600; }

.stack-why {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- Detail page ---------- */

.detail {
  max-width: 800px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 36px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.back-link:hover {
  border-color: var(--accent);
  color: var(--accent-soft);
}
.back-link svg { stroke: currentColor; fill: none; stroke-width: 2; width: 12px; height: 12px; }

.detail-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.detail-head .eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

.detail-head h1 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}

.detail-head .also {
  font-family: var(--font-mono);
  color: var(--ink-mute);
  font-size: 12px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.detail-head .meta-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.detail h2 {
  margin: 36px 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* removed the // marker — too "terminal" */

.detail p { color: var(--ink-soft); margin: 0 0 14px; font-size: 15px; line-height: 1.7; }
.detail p strong { color: var(--ink); }
.detail ul { color: var(--ink-soft); padding-left: 22px; margin: 0 0 14px; font-size: 15px; line-height: 1.7; }
.detail li { margin-bottom: 6px; }
.detail a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.15s ease; }
.detail a:hover { color: var(--accent-soft); border-bottom-color: var(--accent-soft); }

.callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-deep);
  border-radius: 0;
  padding: 14px 20px;
  margin: 16px 0 20px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.callout strong { color: var(--ink); }

.callout.warn {
  border-left-color: var(--warn);
}
.callout.danger {
  border-left-color: var(--danger);
}

.timeline {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px 22px;
  margin: 14px 0 20px;
}
.timeline dt {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: start;
  padding-top: 3px;
}
.timeline dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.dosing {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 22px;
  margin: 14px 0 20px;
  font-size: 14px;
}
.dosing-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.dosing-row:last-child { border: none; }
.dosing-row .k {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 1px;
}
.dosing-row .v { color: var(--ink-soft); line-height: 1.55; }

.price {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-deep);
  border-radius: 0;
  padding: 16px 22px;
  margin: 14px 0 20px;
}
.price .amount {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.price .note {
  color: var(--ink-mute);
  font-size: 12.5px;
  line-height: 1.55;
}

.studies-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.studies-list li {
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.studies-list li strong { color: var(--ink); font-weight: 600; }
.studies-list .src {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 80px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .container { padding: 24px 20px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .stacks-grid { grid-template-columns: 1fr; }
  .detail-head h1 { font-size: 28px; }
  .timeline { grid-template-columns: 90px 1fr; padding: 14px 16px; }
  .dosing-row { grid-template-columns: 110px 1fr; }
  .tile-tip { width: 220px; }
  .brand h1 { font-size: 18px; }
  .section-head h2 { font-size: 18px; }
}
