/* =============================================================================
   Peptide Source Review — design system
   Light theme · DM Sans · navy text · gold for top-10 · traffic-light bars
   ============================================================================= */

:root {
  /* Surfaces */
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --bg-hover: #f3f4f6;
  --bg-inset: #f8fafc;

  /* Text */
  --text: #0f172a;
  --text-dim: #475569;
  --text-mute: #94a3b8;

  /* Borders */
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Accent */
  --gold: #c89b3c;       /* slightly muted gold for top-10 */
  --gold-strong: #a37b1f;
  --link: #1e3a8a;
  --link-hover: #1e40af;

  /* Score bar colors (traffic-light) */
  --bar-excellent: #16a34a;  /* green */
  --bar-good:      #eab308;  /* yellow */
  --bar-fair:      #ea580c;  /* orange */
  --bar-poor:      #dc2626;  /* red */
  --bar-track:     #f1f5f9;

  /* Status colors */
  --status-tested-bg:  #ecfdf5;
  --status-tested-fg:  #047857;
  --status-gate-bg:    #fef3c7;
  --status-gate-fg:    #92400e;
  --status-cap-bg:     #fee2e2;
  --status-cap-fg:     #b91c1c;
  --status-unrated-bg: #f1f5f9;
  --status-unrated-fg: #64748b;

  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* --- top nav ------------------------------------------------------------- */

.site-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.nav-brand:hover {
  text-decoration: none;
  color: var(--text);
}

.nav-brand .brand-mark {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 5px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--text-dim);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-hover);
  text-decoration: none;
}

.site-nav a.active {
  color: var(--text);
  background: var(--bg-hover);
}

/* --- header / hero ------------------------------------------------------- */

.site-header {
  background:
    radial-gradient(ellipse at top left, rgba(200, 155, 60, 0.06), transparent 50%),
    radial-gradient(ellipse at top right, rgba(30, 58, 138, 0.05), transparent 60%),
    var(--bg);
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 40%, var(--gold) 60%, transparent);
  opacity: 0.4;
}

.site-header h1 {
  margin: 0 0 0.65rem;
  font-size: 2.4rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 700;
}

@media (min-width: 720px) {
  .site-header h1 {
    font-size: 2.75rem;
  }
}

.tagline {
  margin: 0;
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 56ch;
}

.header-meta {
  color: var(--text-mute);
  font-size: 0.9rem;
  margin: 1rem 0 0;
}

.header-meta a {
  margin-left: 0.5rem;
}

.stat-strip {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat-cell {
  flex: 1 1 130px;
  padding: 0.85rem 1.1rem;
  border-right: 1px solid var(--border);
  text-align: left;
}

.stat-cell:last-child {
  border-right: none;
}

.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-cell.is-tested .stat-num { color: var(--status-tested-fg); }
.stat-cell.is-caution .stat-num { color: var(--status-gate-fg); }
.stat-cell.is-capped .stat-num { color: var(--status-cap-fg); }

.stat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
  margin-top: 0.35rem;
}

/* --- sponsor available slot --------------------------------------------- */

.sponsor-slot {
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.08), rgba(200, 155, 60, 0.02));
  border: 1px dashed var(--gold);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.sponsor-slot::before {
  content: "★";
  color: var(--gold);
  font-size: 1rem;
}

.sponsor-slot strong {
  color: var(--text);
}

.sponsor-slot a {
  margin-left: auto;
}

/* --- chips (named labs, review sources) --------------------------------- */

.chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-weight: 500;
}

.chip-lab {
  background: var(--status-tested-bg);
  border-color: rgba(4, 120, 87, 0.25);
  color: var(--status-tested-fg);
}

.chip-source {
  background: var(--bg-inset);
  border-color: var(--border);
  color: var(--text-dim);
}

.chip-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-right: 0.35rem;
  display: inline-block;
}

/* --- main content layout ------------------------------------------------- */

main {
  padding: 2rem 1.5rem 4rem;
}

.page-content {
  padding: 2rem 1.5rem 4rem;
  max-width: 820px;
}

/* --- leaderboard metadata + controls ------------------------------------- */

.lb-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.lb-meta .sep {
  color: var(--text-mute);
}

.controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.controls input[type="search"],
.controls select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.controls input[type="search"] {
  flex: 1;
  min-width: 200px;
}

.controls input[type="search"]:focus,
.controls select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  user-select: none;
  cursor: pointer;
}

.status {
  margin: 0 0 1rem;
  color: var(--text-mute);
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* --- vendor table -------------------------------------------------------- */

.vendor-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.vendor-table {
  position: relative;
}

.vendor-table thead th {
  background: var(--bg-inset);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.vendor-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.vendor-table thead th.sortable:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.vendor-table thead th .sort-arrow {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.7em;
  color: var(--gold-strong);
}

.vendor-table thead th.col-rank   { width: 56px; text-align: center; }
.vendor-table thead th.col-score  { width: 140px; }
.vendor-table thead th.col-status { width: 140px; }

.vendor-row {
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
}

.vendor-row:first-child {
  border-top: none;
}

.vendor-table tbody > tr:nth-child(4n + 3):not(.vendor-detail) {
  background: var(--bg-inset);
}

.vendor-row .vendor-favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 0.5rem;
  flex-shrink: 0;
  background: var(--bg-inset);
  border: 1px solid var(--border);
}

.vendor-row td {
  padding: 1rem;
  vertical-align: middle;
}

.vendor-row:hover {
  background: var(--bg-hover);
}

.vendor-row.is-expanded {
  background: var(--bg-alt);
}

.vendor-row .rank {
  text-align: center;
  font-weight: 700;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.vendor-medal {
  display: inline-block;
  font-size: 1.05rem;
  margin-right: 0.35rem;
  line-height: 1;
  vertical-align: middle;
}

.vendor-row .vendor-name {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vendor-row .vendor-name.is-top-10 {
  color: var(--gold-strong);
}

.vendor-row .vendor-name .price-tier {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-mute);
  background: var(--bg-inset);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.vendor-row .score {
  font-weight: 600;
}

.vendor-row .score .stars {
  color: var(--gold);
  margin-right: 0.35rem;
  letter-spacing: 1px;
}

.vendor-row .score.unrated {
  color: var(--text-mute);
  font-weight: 500;
  font-style: italic;
}

.expand-icon {
  margin-left: auto;
  color: var(--text-mute);
  font-size: 1rem;
  font-weight: 400;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-inset);
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.vendor-row:hover .expand-icon {
  background: var(--bg-hover);
}

.vendor-row.is-expanded .expand-icon {
  transform: rotate(45deg);
  background: var(--text);
  color: white;
}

/* --- status badges ------------------------------------------------------- */

.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.status-badge.tested {
  background: var(--status-tested-bg);
  color: var(--status-tested-fg);
}

.status-badge.gate-soft {
  background: var(--status-gate-bg);
  color: var(--status-gate-fg);
}

.status-badge.gate-hard {
  background: var(--status-cap-bg);
  color: var(--status-cap-fg);
}

.status-badge.unrated {
  background: var(--status-unrated-bg);
  color: var(--status-unrated-fg);
}

/* --- expanded detail row ------------------------------------------------- */

.vendor-detail {
  background: var(--bg-alt);
}

.vendor-detail td {
  padding: 0;
  border-top: 0;
}

.detail-inner {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 1.5rem;
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.2s ease;
}

.vendor-detail.is-expanded .detail-inner {
  max-height: 1500px;
  padding: 1.5rem 1.5rem 1.75rem;
  opacity: 1;
  border-top: 1px solid var(--border);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.detail-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.detail-notes {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.detail-meta {
  margin: 1rem 0 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.scored-date {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-mute);
  font-style: italic;
}

/* --- sub-score bars ------------------------------------------------------ */

.subscores {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.subscore {
  display: grid;
  grid-template-columns: minmax(0, 11rem) 1fr 2.5rem;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
}

.subscore-label {
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subscore-bar {
  display: block;
  background: var(--bar-track);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.subscore-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.subscore-bar.bar-excellent > span { background: var(--bar-excellent); }
.subscore-bar.bar-good      > span { background: var(--bar-good); }
.subscore-bar.bar-fair      > span { background: var(--bar-fair); }
.subscore-bar.bar-poor      > span { background: var(--bar-poor); }

.subscore-val {
  text-align: right;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --- detail action row --------------------------------------------------- */

.detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--text);
  color: white;
}

.btn-primary:hover {
  background: #1e293b;
  color: white;
  text-decoration: none;
}

.btn {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
}

/* --- consumer reviews line (in expanded detail) -------------------------- */

.consumer-reviews {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.consumer-reviews strong {
  color: var(--text);
  font-weight: 600;
}

/* --- gate row meta ------------------------------------------------------- */

.gate-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--status-gate-bg);
  color: var(--status-gate-fg);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-top: 0.75rem;
}

.gate-meta.gate-hard {
  background: var(--status-cap-bg);
  color: var(--status-cap-fg);
}

/* --- footer -------------------------------------------------------------- */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 1.75rem 0 2rem;
  margin-top: 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  margin: 0 auto;
  max-width: 60ch;
  line-height: 1.55;
}

/* --- content pages (How We Rate, About) ---------------------------------- */

.info-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.info-block h2 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.info-block h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 36px;
  height: 2px;
  background: var(--gold);
}

.info-block p,
.info-block ul {
  color: var(--text-dim);
  line-height: 1.65;
}

.info-block strong {
  color: var(--text);
}

.info-block ul {
  padding-left: 1.25rem;
}

.info-block li {
  margin-bottom: 0.4rem;
}

/* dimension cards in how-we-rate */

.rating-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.dimension {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.dimension h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.dimension-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.weight-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  background: var(--text);
  color: white;
  letter-spacing: 0.02em;
}

.dimension ul {
  padding-left: 1.15rem;
  margin: 0.5rem 0;
  font-size: 0.88rem;
}

.why-it-matters {
  margin: 0.75rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.85rem;
}

.weight-bar {
  display: flex;
  width: 100%;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  font-size: 0.7rem;
}

.weight-bar .seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.seg-lab          { background: #0f766e; }
.seg-shipping     { background: #2563eb; }
.seg-pricing      { background: #ca8a04; }
.seg-tenure       { background: #7c3aed; }
.seg-transparency { background: #db2777; }

.callout {
  background: var(--bg-inset);
  border-left: 3px solid var(--text);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  font-size: 0.95rem;
}

.inline-gate {
  background: var(--status-gate-bg);
  color: var(--status-gate-fg);
  font-size: 0.8rem;
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
  white-space: nowrap;
  font-weight: 600;
}

.example {
  background: var(--bg-inset);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
}

.example-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.example-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.example-table td:last-child {
  text-align: right;
  color: var(--text);
}

.example-table tr.total td {
  border-top: 2px solid var(--text);
  border-bottom: none;
  padding-top: 0.6rem;
  color: var(--text);
  font-weight: 600;
}

.red-flags {
  border-color: #fecaca;
}

.placeholder {
  background: #fffbeb;
  border: 1px dashed #fbbf24;
  padding: 0.65rem 0.95rem;
  border-radius: 6px;
  color: var(--text-dim);
}

.cta {
  text-align: center;
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- submission forms ---------------------------------------------------- */

.submit-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.submit-form label {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.submit-form label > input,
.submit-form label > select,
.submit-form label > textarea {
  display: block;
  margin-top: 0.4rem;
}

.submit-form .req {
  color: var(--bar-poor);
}

.submit-form input[type="text"],
.submit-form input[type="email"],
.submit-form input[type="url"],
.submit-form select,
.submit-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.submit-form textarea {
  resize: vertical;
  min-height: 80px;
}

.submit-form input:focus,
.submit-form select:focus,
.submit-form textarea:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.submit-form .btn-primary {
  align-self: flex-start;
  margin-top: 0.5rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}
