/* ============================================
   PEPTIDE LIBRARY HUB — Global Styles
   Modern biotech aesthetic, warm & inviting
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0a1628;
  --navy-light: #132038;
  --steel: #3a5a8c;
  --steel-light: #5a7fad;
  --blue-accent: #4a90d9;
  --blue-accent-light: rgba(74, 144, 217, 0.06);
  --blue-accent-lighter: rgba(74, 144, 217, 0.03);
  --blue-accent-focus: rgba(74, 144, 217, 0.15);
  --blue-glow: #5ba3f5;
  --gray-50: #f8f9fb;
  --gray-100: #eef1f5;
  --gray-200: #dce1e9;
  --gray-300: #9ca8b8;
  --gray-400: #7a8694;
  --gray-500: #5a6678;
  --gray-600: #5c6a7a;
  --gray-700: #3d4a5c;
  --gray-800: #2a3342;
  --white: #ffffff;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --orange: #f97316;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1200px;
  --header-height: 76px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--blue-glow); }

img { max-width: 100%; display: block; }

/* --- Typography --- */
h1, h2, h3, h4 { color: var(--navy); line-height: 1.3; font-weight: 700; }
h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.75rem; margin-top: 2.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; margin-top: 1.5rem; }
h4 { font-size: 1.05rem; margin-bottom: 0.4rem; margin-top: 1.25rem; }
p { margin-bottom: 1rem; }

/* --- Utility classes --- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-600); }
.text-sub { color: var(--gray-700); font-size: 1.08rem; line-height: 1.65; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-alt { background: var(--gray-50); }

/* --- Header / Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  height: var(--header-height);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
}
.site-header .container {
  display: flex; align-items: center;
  height: 100%;
  gap: 1.5rem;
}
.site-header nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
.logo {
  display: inline-flex; align-items: center;
  text-decoration: none;
}
.logo img {
  height: 44px; width: auto;
}
.logo-text {
  font-size: 1.25rem; font-weight: 800; color: var(--white);
  letter-spacing: -0.02em;
}
.logo-text .blue { color: #2E86AB; }
.logo-text .green { color: #36B37E; }
.logo-text .com { color: var(--gray-600); font-size: 0.85rem; font-weight: 500; }
.footer-brand .logo img { height: 36px; }
.footer-brand .logo-full img { height: 40px; }

.nav-links { display: flex; gap: 1.25rem; list-style: none; align-items: center; }
.nav-links a {
  color: rgba(255,255,255,0.65); font-size: 0.88rem; font-weight: 500;
  transition: color 0.2s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); }

.mobile-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; padding: 0.5rem; z-index: 101; }

/* Mobile nav menu */
.nav-links.mobile-open {
  display: flex !important;
  flex-direction: column;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--navy);
  padding: 1rem 1.5rem 1.5rem;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
}
.nav-links.mobile-open li {
  width: 100%;
}
.nav-links.mobile-open a {
  display: block;
  padding: 0.75rem 0;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, #1a2d4a 100%);
  color: var(--white);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 70% 20%, rgba(74,144,217,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(91,163,245,0.08) 0%, transparent 50%);
}
.hero::after {
  content: '';
  position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
  border-radius: 50%;
  border: 1px solid rgba(74,144,217,0.08);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--white); font-size: 3rem; max-width: 700px; }
.hero .subtitle {
  color: var(--gray-300); font-size: 1.15rem; max-width: 600px;
  margin-bottom: 2rem; line-height: 1.7;
}
.hero .tagline {
  display: inline-block;
  background: rgba(74,144,217,0.15); border: 1px solid rgba(74,144,217,0.3);
  padding: 0.4rem 1rem; border-radius: 100px;
  font-size: 0.82rem; color: var(--blue-glow); font-weight: 600;
  letter-spacing: 0.05em; margin-bottom: 1.5rem;
  text-transform: uppercase;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 1rem 0; font-size: 0.85rem; color: var(--gray-600);
}
.breadcrumbs a { color: var(--gray-600); }
.breadcrumbs a:hover { color: var(--blue-accent); }
.breadcrumbs span { margin: 0 0.4rem; }

/* --- Status Badges (subtle) --- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.12rem 0.5rem; border-radius: 100px;
  font-size: 0.66rem; font-weight: 500; letter-spacing: 0.02em;
  white-space: nowrap; flex-shrink: 0;
  background: transparent;
  text-transform: uppercase;
  opacity: 0.85;
}
.badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
}
.badge-green { color: #16a34a; }
.badge-green::before { background: var(--green); }
.badge-yellow { color: #a16207; }
.badge-yellow::before { background: var(--yellow); }
.badge-red { color: #9ca3af; }
.badge-red::before { background: #9ca3af; }

/* --- Cards --- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem; margin-top: 1.5rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.75rem;
  transition: all 0.25s ease;
}
.card:hover {
  border-color: var(--blue-accent);
  box-shadow: 0 8px 30px rgba(74,144,217,0.1);
  transform: translateY(-2px);
}
.card h3 { margin-top: 0; }
.card p { color: var(--gray-600); font-size: 0.95rem; }
.card .card-meta {
  display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap;
}
.card a { color: var(--navy); }
.card a:hover { color: var(--blue-accent); }

/* --- Comparison Table --- */
.comparison-table-wrapper {
  overflow-x: auto; margin: 2rem 0;
  border: 1px solid var(--gray-200); border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.comparison-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.92rem;
}
.comparison-table thead {
  background: var(--navy);
}
.comparison-table th {
  color: var(--white); padding: 1rem 1.25rem;
  text-align: left; font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.comparison-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}
.comparison-table tbody tr {
  transition: background 0.15s ease;
}
.comparison-table tbody tr:hover {
  background: var(--gray-50);
}
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table .row-label {
  font-weight: 600; color: var(--navy);
  background: var(--gray-50); min-width: 160px;
}

/* --- Content Page Layout (Two-Column with Sidebar) ---
   This handles BOTH structures:
   1. <div class="content-page"> with content-main + toc (original)
   2. <main class="content-page"> with nested container (agent-built)
   3. Inline grid styles (overridden by these rules)
*/
.content-page {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}
/* When the sidebar/TOC is the FIRST child in the HTML (aside before content-main),
   flip the grid so the narrow column is on the left and content gets the wide column.
   Fixes pages where content was being squeezed into the 260px column. */
.content-page:has(> aside:first-child),
.content-page:has(> .toc:first-child),
.content-page:has(> .content-toc:first-child),
.content-page:has(> .sidebar:first-child) {
  grid-template-columns: 260px 1fr;
}
.content-main {
  min-width: 0;
  max-width: 100%;
}

/* Handle pages that wrapped content-page around a container */
main.content-page {
  display: block; /* Reset grid on main tag - let inner container handle layout */
}
main.content-page > .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Catch-all for agent pages using content-wrapper class */
.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}

/* Let inline grid styles on content-page children work naturally */
/* Removed !important overrides that were swapping sidebar/content order */

/* --- Sidebar / Table of Contents --- */
.toc, .content-toc, .sidebar {
  position: sticky; top: calc(var(--header-height) + 2rem);
  background: var(--gray-50); border-radius: 12px;
  padding: 1.5rem; border: 1px solid var(--gray-200);
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
}
.toc h3, .toc h4, .content-toc h3, .sidebar h3 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--gray-600); margin-bottom: 0.75rem; margin-top: 0;
}
.toc ul, .content-toc ul, .sidebar ul { list-style: none; }
.toc li, .content-toc li, .sidebar li { margin-bottom: 0.4rem; }
.toc a, .content-toc a, .sidebar a {
  font-size: 0.85rem; color: var(--gray-600);
  display: block; padding: 0.25rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  transition: all 0.2s;
  text-decoration: none;
}
.toc a:hover, .toc a.active, .toc a.current,
.content-toc a:hover, .sidebar a:hover {
  color: var(--blue-accent);
  border-left-color: var(--blue-accent);
}

/* --- Info Box / Callouts --- */
.info-box, .info-box-warning, .info-box-info {
  background: rgba(74,144,217,0.06);
  border-left: 4px solid var(--blue-accent);
  border-radius: 0 10px 10px 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.93rem;
}
.info-box.warning, .info-box-warning {
  background: rgba(249,115,22,0.06);
  border-left-color: var(--orange);
}
.info-box.disclaimer {
  background: var(--gray-50);
  border-left-color: var(--gray-300);
  font-size: 0.85rem; color: var(--gray-600);
}

/* --- Key Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem; margin: 2rem 0;
}
.stat-card {
  background: var(--gray-50); border-radius: 12px;
  padding: 1.5rem; text-align: center;
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}
.stat-card:hover {
  border-color: var(--blue-accent);
  box-shadow: 0 4px 12px rgba(74,144,217,0.08);
}
.stat-card .stat-value {
  font-size: 1.8rem; font-weight: 800; color: var(--navy);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 0.78rem; color: var(--gray-600);
  margin-top: 0.3rem; text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- References --- */
.references {
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}
.references h2 { font-size: 1.25rem; }
.references ol {
  padding-left: 1.5rem; font-size: 0.88rem;
  color: var(--gray-600); line-height: 1.8;
}
.references p {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.8;
}
.references a { word-break: break-all; }

/* --- Disclaimer Footer --- */
.page-disclaimer {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.7;
}
.page-disclaimer strong { color: var(--gray-700); }

/* --- Site Footer --- */
.site-footer {
  background: var(--navy);
  color: var(--gray-300);
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand p { max-width: 300px; line-height: 1.6; margin-top: 0.75rem; }
.site-footer h4 {
  color: var(--white); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: var(--gray-300); }
.site-footer a:hover { color: var(--white); }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center; font-size: 0.8rem; color: var(--gray-600);
}
/* Handle footer variants from agent-built pages */
.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 0.4rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  transition: all 0.2s; cursor: pointer;
  border: none; text-decoration: none;
}
.btn-primary {
  background: var(--blue-accent); color: var(--white);
}
.btn-primary:hover { background: var(--blue-glow); color: var(--white); }
.btn-outline {
  background: transparent; color: var(--blue-accent);
  border: 1.5px solid var(--blue-accent);
}
.btn-outline:hover { background: rgba(74,144,217,0.08); }
.btn-white {
  background: var(--white); color: var(--navy);
}
.btn-white:hover { background: var(--gray-100); color: var(--navy); }

/* --- Card Links (for safety hub, etc.) --- */
.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blue-accent);
}
.card-link:hover { color: var(--blue-glow); }
.card-link.disabled {
  color: var(--gray-300);
  pointer-events: none;
}

/* Badge for coming soon */
.badge-coming {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.5rem;
}

/* --- Content Polish --- */
.content-main a {
  color: var(--blue-accent);
  text-decoration: underline;
  text-decoration-color: rgba(74,144,217,0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}
.content-main a:hover {
  text-decoration-color: var(--blue-accent);
}

/* Section dividers */
.content-main section {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}
.content-main section:last-of-type {
  border-bottom: none;
}

/* Lists in content */
.content-main ul, .content-main ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
.content-main li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

/* --- Page Header Area (for peptide profiles) --- */
.page-header {
  margin-bottom: 1rem;
}
.page-header h1 {
  margin-bottom: 0.5rem;
}
.page-header .subtitle {
  color: var(--gray-600);
  font-size: 1.1rem;
  max-width: 700px;
}

/* --- Decorative Elements --- */
.section-decorated {
  position: relative;
  overflow: hidden;
}
.section-decorated::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74,144,217,0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* --- Alert Boxes (for safety pages) --- */
.alert, .alert-warning, .alert-danger, .alert-info {
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  margin: 1.5rem 0;
  font-size: 0.93rem;
}
.alert-warning {
  background: rgba(249,115,22,0.06);
  border-left: 4px solid var(--orange);
}
.alert-danger {
  background: rgba(239,68,68,0.06);
  border-left: 4px solid var(--red);
}
.alert-info {
  background: rgba(74,144,217,0.06);
  border-left: 4px solid var(--blue-accent);
}

/* --- FAQ Accordion --- */
.content-main h3 + p {
  margin-top: 0.25rem;
}
.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item:hover {
  border-color: var(--blue-accent);
}
.faq-item .faq-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  gap: 1rem;
}
.faq-item .faq-trigger h3,
.faq-item .faq-trigger h4 {
  margin: 0;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}
.faq-item .faq-trigger .faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.2s;
  color: var(--gray-600);
  font-size: 0.85rem;
  font-weight: 600;
}
.faq-item.faq-open .faq-trigger .faq-icon {
  transform: rotate(45deg);
  background: rgba(74,144,217,0.1);
  color: var(--blue-accent);
}
.faq-item .faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 1.5rem;
}
.faq-item.faq-open .faq-body {
  max-height: 600px;
  padding: 0 1.5rem 1.25rem;
}
.faq-item .faq-body p {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.95rem;
  line-height: 1.7;
}
.faq-item .faq-body p + p {
  margin-top: 0.75rem;
}
/* Pattern D: .faq-question / .faq-answer */
.faq-item .faq-question {
  margin: 0;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}
.faq-item .faq-answer {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Filter Bar (shared by database, tracker, etc.) --- */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  align-items: center;
}
.filter-btn {
  padding: 0.45rem 1rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--blue-accent);
  color: var(--blue-accent);
  background: rgba(74,144,217,0.05);
}

/* --- Mobile Responsive --- */
@media (max-width: 1024px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.82rem; }
}

@media (max-width: 900px) {
  .content-page,
  .content-wrapper {
    display: block !important;
  }
  .toc, .content-toc, .sidebar {
    position: static;
    margin-bottom: 2rem;
    max-height: none;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-content { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  .hero h1 { font-size: 2.2rem; }
  .hero { padding: 3rem 0 2.5rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .site-header .container { gap: 0.75rem; }
  .site-header nav { flex: 0; min-width: 0; }
  .search-trigger { margin-left: auto; }
  .card-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  /* Mobile table scroll */
  .comparison-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem -1rem;
    padding: 0 1rem;
    position: relative;
  }
  .comparison-table-wrapper::after {
    content: '← Scroll →';
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-300);
    padding: 0.5rem 0;
    letter-spacing: 0.05em;
  }
  .comparison-table {
    font-size: 0.82rem;
    min-width: 600px;
  }

  /* Mobile quick-ref improvements */
  .quick-ref { padding: 1.25rem; }
  .quick-ref h2 { font-size: 1.2rem; }
  .quick-ref-detail {
    flex-direction: column;
    gap: 0.15rem;
  }
  .quick-ref-detail .value {
    text-align: left;
    max-width: 100%;
  }

  /* Mobile filter bar */
  .filter-bar {
    flex-wrap: wrap;
  }
  .filter-btn {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }

  /* Touch-friendly link/button targets */
  .peptide-grid a, .card-grid a {
    padding: 1.25rem;
  }
  .btn { padding: 0.75rem 1.5rem; font-size: 0.95rem; }
  .container { padding: 0 1rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .stats-row { grid-template-columns: 1fr; }
  .badge { font-size: 0.62rem; padding: 0.1rem 0.45rem; }
}

/* --- Visual Enhancements --- */

/* Quick Reference Card */
.quick-ref {
  background: linear-gradient(135deg, var(--gray-50), #f0f4fa);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2.5rem;
}
.quick-ref h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: var(--navy);
}
.quick-ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.quick-ref-col h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--steel);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--blue-accent);
  display: inline-block;
}
.quick-ref-col ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
}
.quick-ref-col ul li {
  padding: 0.3rem 0;
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.5;
}
.quick-ref-col ul li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  margin-right: 0.5rem;
}
.quick-ref-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.92rem;
}
.quick-ref-detail:last-child {
  border-bottom: none;
}
.quick-ref-detail .label {
  color: var(--gray-600);
  font-weight: 500;
}
.quick-ref-detail .value {
  color: var(--navy);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}
.quick-ref-warning {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.6;
}
.quick-ref-warning strong {
  color: var(--orange);
}
@media (max-width: 768px) {
  .quick-ref-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   PLAIN-ENGLISH TL;DR CALLOUT
   For beginners. Appears near top of peptide profiles.
   ============================================ */
.tldr {
  background: linear-gradient(135deg, #f0f6ff 0%, #e8f1fd 100%);
  border: 1px solid #c8dcf5;
  border-left: 4px solid var(--blue-accent);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.tldr-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--blue-accent);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}
.tldr-body { flex: 1; }
.tldr-body .tldr-label {
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.tldr-body p {
  margin: 0;
  color: var(--gray-800, #2a3345);
  font-size: 1rem;
  line-height: 1.6;
}
@media (max-width: 640px) {
  .tldr { flex-direction: column; gap: 0.5rem; }
  .tldr-icon { width: auto; padding: 0.35rem 0.7rem; height: auto; }
}

/* ============================================
   WHY PEOPLE ARE INTERESTED CALLOUT
   Plain-English, goal-based block below TL;DR.
   ============================================ */
.why-interested {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 0 0 2rem;
}
.why-interested .wi-label {
  display: inline-block;
  color: var(--blue-accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.why-interested h3 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  color: var(--navy);
}
.why-interested p.wi-intro {
  margin: 0 0 0.85rem;
  color: var(--gray-700);
  font-size: 0.98rem;
  line-height: 1.65;
}
.why-interested ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.why-interested ul li {
  position: relative;
  padding: 0.45rem 0 0.45rem 1.75rem;
  font-size: 0.98rem;
  color: var(--gray-800, #2a3345);
  line-height: 1.55;
  border-bottom: 1px solid var(--gray-200);
}
.why-interested ul li:last-child { border-bottom: none; }
.why-interested ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1rem;
  width: 8px;
  height: 8px;
  background: var(--blue-accent);
  border-radius: 50%;
}
.why-interested .wi-footer {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--gray-600);
  font-style: italic;
}

/* ============================================
   HOMEPAGE-SPECIFIC UTILITY CLASSES
   Moved from inline styles for maintainability
   ============================================ */

/* Hero CTA row */
.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Quick stats bar */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 3rem 0 1rem;
}
.quick-stat {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(74,144,217,0.04);
  border-radius: 12px;
  border: 1px solid rgba(74,144,217,0.1);
}
.quick-stat .qs-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--blue-accent);
  line-height: 1;
}
.quick-stat .qs-label {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-top: 0.4rem;
  font-weight: 500;
}

/* Find Your Peptide CTA banner */
.fyp-banner {
  display: block;
  text-decoration: none;
  color: inherit;
}
.fyp-banner-inner {
  background: linear-gradient(135deg, #0b2540 0%, #1e4976 100%);
  color: #fff;
  border-radius: 16px;
  padding: 2.25rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  box-shadow: 0 10px 40px rgba(11,37,64,0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fyp-banner-inner:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 50px rgba(11,37,64,0.25);
}
.fyp-banner .fyp-kicker {
  color: #7fb8ff;
  letter-spacing: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.fyp-banner h2 {
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}
.fyp-banner p {
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-size: 1rem;
  max-width: 620px;
}
.fyp-banner .fyp-cta {
  background: #4a90d9;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* Media strip ("As Covered In") */
.media-strip {
  padding: 2.25rem 0 1.25rem;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  background: #fafbfd;
}
.media-strip .media-label {
  text-align: center;
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.media-strip .media-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2rem 2.5rem;
}
.media-strip .media-logos a {
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.25s;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gray-700);
  letter-spacing: -0.02em;
}
.media-strip .media-logos a:hover {
  opacity: 1;
}
.media-strip .media-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* "Why peptides" section */
.why-section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}
.section-kicker {
  color: var(--blue-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.why-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 1.6rem 1.7rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.why-card:hover {
  border-color: var(--blue-accent);
  box-shadow: 0 4px 20px rgba(74,144,217,0.08);
}
.why-card .why-num {
  color: var(--blue-accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.why-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  color: var(--navy);
}
.why-card p {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.95rem;
  line-height: 1.6;
}
.why-card .why-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--blue-accent);
  text-decoration: none;
  font-weight: 600;
}
.why-card .why-link:hover { color: var(--blue-glow); }

/* Goal grid */
.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.goal-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 14px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.goal-card:hover {
  border-color: var(--blue-accent);
  box-shadow: 0 8px 30px rgba(74,144,217,0.12);
  transform: translateY(-2px);
}
.goal-card .goal-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}
.goal-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--navy);
}
.goal-card p {
  font-size: 0.88rem;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.goal-card .goal-peptides {
  font-size: 0.78rem;
  color: var(--steel);
  font-weight: 500;
}
.goal-card .goal-arrow {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  color: var(--blue-accent);
  font-size: 1.2rem;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.25s ease;
}
.goal-card:hover .goal-arrow {
  opacity: 1;
  transform: translateX(0);
}
.goal-card-highlight {
  border-color: var(--blue-accent);
  background: rgba(74,144,217,0.02);
}

/* Featured peptide grid */
.featured-peptide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.fp-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.fp-card:hover {
  border-color: var(--blue-accent);
  box-shadow: 0 4px 16px rgba(74,144,217,0.08);
}
.fp-card h4 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.fp-card .fp-type {
  font-size: 0.78rem;
  color: var(--steel);
  margin-bottom: 0.5rem;
}
.fp-card p {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.5;
}
.fp-card .fp-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

/* Explore section */
.explore-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.explore-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s;
}
.explore-link:hover {
  border-color: var(--blue-accent);
  color: var(--blue-accent);
  background: rgba(74,144,217,0.03);
}
.explore-link .el-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Trust methodology grid */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.trust-item {
  text-align: center;
  padding: 1.25rem;
}
.trust-item .trust-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.trust-item h4 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}
.trust-item p {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin: 0;
}

/* Disclaimer banner (inline context) */
.context-disclaimer {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--gray-700);
  text-align: center;
}

/* ============================================
   MOBILE OVERRIDES FOR HOMEPAGE COMPONENTS
   ============================================ */
@media (max-width: 768px) {
  .quick-stats { grid-template-columns: repeat(2, 1fr); }
  .goal-grid { grid-template-columns: 1fr; }
  .fyp-banner-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .fyp-banner .fyp-cta {
    justify-self: center;
  }
  .why-grid { grid-template-columns: 1fr; }
  .media-strip .media-logos {
    gap: 1.25rem 1.75rem;
  }
  .media-strip .media-logos a {
    font-size: 0.9rem;
  }
}
@media (max-width: 480px) {
  .quick-stats { grid-template-columns: 1fr; }
}

/* ============================================
   NOTABLE COMMENTARY BLOCK (standardized)
   ============================================ */
.notable-quote {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--blue-accent);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
}
.notable-quote .nq-text {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--navy);
  font-style: italic;
}
.notable-quote .nq-attr {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}
.notable-quote .nq-micro {
  margin: 0.75rem 0 0;
  font-size: 0.72rem;
  color: var(--gray-600);
  font-style: italic;
}
.notable-quote .nq-kicker {
  font-size: 0.7rem;
  color: var(--blue-accent);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

/* ========================================
   SITE SEARCH
   ======================================== */

/* Header search trigger button */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-trigger:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
}
.search-trigger svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.search-trigger .search-shortcut {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.search-overlay.search-open {
  opacity: 1;
  visibility: visible;
}

/* Modal card */
.search-modal {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  width: 92%;
  max-width: 620px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-12px) scale(0.97);
  transition: transform 0.2s;
}
.search-open .search-modal {
  transform: translateY(0) scale(1);
}

/* Input row */
.search-input-row {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  gap: 0.75rem;
}
.search-input-icon {
  flex-shrink: 0;
  color: var(--gray-400);
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--navy);
  background: transparent;
}
.search-input::placeholder {
  color: var(--gray-400);
}
.search-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}
.search-close:hover {
  color: var(--navy);
}

/* Results area */
.search-results {
  overflow-y: auto;
  padding: 0.5rem 0;
}

.search-result {
  display: block;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.12s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover {
  background: var(--gray-50);
}
.search-result-cat {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--blue-accent);
  margin-bottom: 0.2rem;
}
.search-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.2rem;
}
.search-result-snippet {
  font-size: 0.8rem;
  color: var(--gray-500);
  line-height: 1.4;
}
.search-result mark {
  background: rgba(74, 144, 217, 0.15);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.search-empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Active (keyboard-selected) result */
.search-result-active,
.search-result-active:hover {
  background: var(--gray-100);
  outline: 2px solid var(--blue-accent);
  outline-offset: -2px;
}

/* Esc hint badge */
.search-esc-hint {
  font-size: 0.65rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  color: var(--gray-400);
  font-family: var(--font-sans);
  margin-right: 0.5rem;
}

/* Search footer with keyboard hints */
.search-footer {
  padding: 0.5rem 1.25rem;
  font-size: 0.7rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  text-align: center;
}
.search-footer kbd {
  display: inline-block;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  padding: 0 0.3rem;
  font-size: 0.65rem;
  font-family: var(--font-sans);
  margin: 0 0.1rem;
  line-height: 1.5;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .search-trigger .search-label,
  .search-trigger .search-shortcut {
    display: none;
  }
  .search-trigger {
    padding: 0.4rem;
  }
  .search-overlay {
    padding-top: 5vh;
  }
  .search-modal {
    max-height: 80vh;
    border-radius: 10px;
  }
  .search-footer { display: none; }
  .search-esc-hint { display: none; }
}

/* ========================================
   BREADCRUMB NAVIGATION
   ======================================== */
.breadcrumb {
  padding: 0.6rem 0;
  font-size: 0.8rem;
  color: var(--gray-600);
}
.breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--blue-accent);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb a:hover {
  color: var(--blue-glow);
  text-decoration: underline;
}
.breadcrumb .sep {
  color: var(--gray-300);
  margin: 0 0.1rem;
  font-size: 0.7rem;
}
.breadcrumb .current {
  color: var(--gray-700);
  font-weight: 500;
}

/* ========================================
   BACK-TO-TOP BUTTON
   ======================================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--blue-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(74, 144, 217, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--blue-glow);
  box-shadow: 0 6px 20px rgba(74, 144, 217, 0.5);
}

/* ========================================
   READING PROGRESS BAR
   ======================================== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 10001;
  background: transparent;
  pointer-events: none;
}
.reading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-accent), var(--blue-glow));
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
  }
  .breadcrumb { font-size: 0.75rem; }
}
