/* style.css — TWW Peptide Portal Design Tokens & Components */

/* ========== FONTS ========== */
/* Zodiak (display) + Satoshi (body) — matching TWW main site */

/* ========== DESIGN TOKENS ========== */
:root,
[data-theme='light'] {
  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* TWW Brand Colors — Light */
  --color-bg: #FAFAF8;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F5F4F0;
  --color-text: #0A1628;
  --color-text-muted: #5A6577;
  --color-text-faint: #9CA3AF;
  --color-primary: #0A1628;
  --color-gold: #C9A86C;
  --color-gold-hover: #B8974F;
  --color-gold-light: rgba(201, 168, 108, 0.12);
  --color-border: #E5E3DD;
  --color-divider: #E5E3DD;
  --color-warning-bg: #FFF8EE;
  --color-warning-border: #E8D5B0;
  --color-warning-text: #7A5E2F;
  --color-info-bg: #F0F4FA;
  --color-info-border: #C2D1E8;
  --color-info-text: #2A4A7F;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(10, 22, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(10, 22, 40, 0.12);

  /* Content widths */
  --content-narrow: 720px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Fonts */
  --font-display: 'Zodiak', Georgia, serif;
  --font-body: 'Satoshi', Inter, sans-serif;
}

/* DARK MODE */
[data-theme='dark'] {
  --color-bg: #0A1020;
  --color-surface: #111827;
  --color-surface-alt: #1A2332;
  --color-text: #E8E6E1;
  --color-text-muted: #9CA3AF;
  --color-text-faint: #6B7280;
  --color-primary: #E8E6E1;
  --color-gold: #C9A86C;
  --color-gold-hover: #D4B87E;
  --color-gold-light: rgba(201, 168, 108, 0.15);
  --color-border: #2A3444;
  --color-divider: #1F2937;
  --color-warning-bg: #1C1A14;
  --color-warning-border: #4A3F2A;
  --color-warning-text: #D4B87E;
  --color-info-bg: #0F1520;
  --color-info-border: #2A3A55;
  --color-info-text: #8AAAD4;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0A1020;
    --color-surface: #111827;
    --color-surface-alt: #1A2332;
    --color-text: #E8E6E1;
    --color-text-muted: #9CA3AF;
    --color-text-faint: #6B7280;
    --color-primary: #E8E6E1;
    --color-gold: #C9A86C;
    --color-gold-hover: #D4B87E;
    --color-gold-light: rgba(201, 168, 108, 0.15);
    --color-border: #2A3444;
    --color-divider: #1F2937;
    --color-warning-bg: #1C1A14;
    --color-warning-border: #4A3F2A;
    --color-warning-text: #D4B87E;
    --color-info-bg: #0F1520;
    --color-info-border: #2A3A55;
    --color-info-text: #8AAAD4;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}

/* ========== LAYOUT ========== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--content-narrow);
}

.container--default {
  max-width: var(--content-default);
}

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  height: 72px;
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: var(--space-6);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.site-logo img {
  height: 48px;
  width: auto;
}

/* Logo dark/light mode switching */
.logo-light { display: none; }
.logo-dark { display: block; }

[data-theme='dark'] .logo-light { display: block; }
[data-theme='dark'] .logo-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-light { display: block; }
  :root:not([data-theme]) .logo-dark { display: none; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  color: var(--color-gold);
  background: var(--color-gold-light);
}

/* ========== SECTION LABEL ========== */
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
  text-align: center;
  max-width: none;
  margin-inline: auto;
}

/* ========== HERO ========== */
.hero {
  padding-block: clamp(var(--space-12), 8vw, var(--space-20));
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.hero-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

/* ========== DISCLAIMER BANNER ========== */
.disclaimer-banner {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-8);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.disclaimer-banner svg {
  flex-shrink: 0;
  color: var(--color-gold);
  margin-top: 2px;
}

.disclaimer-banner p {
  font-size: var(--text-sm);
  color: var(--color-warning-text);
  line-height: 1.6;
  max-width: none;
}

.disclaimer-banner strong {
  font-weight: 700;
}

/* ========== BACK TO LIST BUTTON ========== */
.back-to-list {
  display: none;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-6);
}

.back-to-list:hover {
  color: var(--color-gold-hover);
}

.back-to-list.visible {
  display: inline-flex;
}

/* ========== WELCOME STATE ========== */
.welcome-state {
  text-align: center;
  margin-bottom: var(--space-6);
}

.welcome-state.hidden {
  display: none;
}

.welcome-state p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: none;
}

/* ========== SEARCH ========== */
.search-section {
  margin-bottom: var(--space-10);
}

.search-wrapper {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  font-size: var(--text-base);
  font-family: var(--font-body);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  outline: none;
}

.search-input::placeholder {
  color: var(--color-text-faint);
}

.search-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--color-gold-light);
}

.search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}

.search-count {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-3);
}

/* ========== GENERAL HIDDEN ========== */
.toc-grid.hidden,
.welcome-state.hidden {
  display: none !important;
}

/* ========== TOC GRID ========== */
.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-12);
}

.toc-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
}

.toc-card:hover {
  border-color: var(--color-gold);
  background: var(--color-gold-light);
}

.toc-card .toc-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-gold);
  flex-shrink: 0;
}

.toc-card .toc-name {
  flex: 1;
  font-weight: 600;
}

.toc-card .toc-category {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 400;
}

.toc-card.hidden {
  display: none;
}

/* ========== PEPTIDE SECTIONS ========== */
.peptide-section {
  margin-bottom: var(--space-16);
  scroll-margin-top: 100px;
}

.peptide-section.hidden {
  display: none;
}

.peptide-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-gold);
}

.peptide-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text);
}

.peptide-header .peptide-category {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  background: var(--color-gold-light);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

/* Disclaimer per peptide */
.peptide-disclaimer {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.peptide-disclaimer svg {
  flex-shrink: 0;
  color: var(--color-info-text);
  margin-top: 2px;
}

.peptide-disclaimer p {
  font-size: var(--text-sm);
  color: var(--color-info-text);
  line-height: 1.5;
  max-width: none;
}

/* Peptide overview / benefits */
.peptide-overview {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
}

.peptide-overview h3 {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-gold);
  margin-bottom: var(--space-4);
}

.peptide-mechanism {
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  max-width: none;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.peptide-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-8);
}

.peptide-benefits li {
  position: relative;
  padding-left: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.6;
}

.peptide-benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gold);
}

/* Instruction cards */
.instruction-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.instruction-card h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.instruction-card h3 .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-gold);
  color: #0A1628;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.instruction-list {
  list-style: none;
  padding: 0;
}

.instruction-list li {
  padding: var(--space-2) 0;
  padding-left: var(--space-6);
  position: relative;
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.6;
  max-width: none;
}

.instruction-list li::before {
  content: '';
  position: absolute;
  left: var(--space-2);
  top: 0.8em;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-gold);
}

.timing-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.timing-badge svg {
  width: 14px;
  height: 14px;
  display: inline;
}

/* Storage callout */
.storage-callout {
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

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

/* ========== CONTACT STRIP ========== */
.contact-strip {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
}

.contact-strip p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: none;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-gold);
  text-decoration: none;
}

.contact-link:hover {
  color: var(--color-gold-hover);
}

.contact-divider {
  width: 1px;
  height: 16px;
  background: var(--color-border);
}

/* ========== REFILL BANNER ========== */
.refill-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, #162a4a 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-8);
  margin-block: var(--space-12);
  text-align: center;
  color: #E8E6E1;
}

.refill-banner h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  margin-bottom: var(--space-3);
  color: #FFFFFF;
}

.refill-banner p {
  font-size: var(--text-base);
  color: #C5CAD2;
  margin: 0 auto var(--space-6);
  max-width: 560px;
}

.refill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-gold);
  color: #0A1628;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-gold:hover {
  background: var(--color-gold-hover);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  color: #E8E6E1;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
}

.btn-outline:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* ========== CONSULTATION CTA ========== */
.consultation-cta {
  text-align: center;
  padding-block: var(--space-12);
  border-top: 1px solid var(--color-divider);
}

.consultation-cta h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.consultation-cta p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0 auto var(--space-6);
  max-width: 520px;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-8);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.footer-left p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-gold);
}

/* ========== ACCESS GATE ========== */
.access-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.access-gate.hidden {
  display: none;
}

.gate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.gate-card svg {
  margin: 0 auto var(--space-6);
}

.gate-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.gate-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: none;
}

.gate-input-group {
  display: flex;
  gap: var(--space-3);
}

.gate-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  text-align: center;
  letter-spacing: 0.15em;
}

.gate-input::placeholder {
  letter-spacing: 0;
  color: var(--color-text-faint);
}

.gate-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px var(--color-gold-light);
}

.gate-btn {
  background: var(--color-gold);
  color: #0A1628;
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.gate-btn:hover {
  background: var(--color-gold-hover);
}

.gate-error {
  font-size: var(--text-xs);
  color: #C24A4A;
  margin-top: var(--space-3);
  display: none;
}

.gate-error.visible {
  display: block;
}

/* ========== NO RESULTS ========== */
.no-results {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  display: none;
}

.no-results.visible {
  display: block;
}

.no-results p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  max-width: none;
}

.no-results .contact-prompt {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}

.no-results .contact-prompt a {
  color: var(--color-gold);
  text-decoration: none;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-gold);
  color: #0A1628;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease, transform 300ms ease;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-2px);
  background: var(--color-gold-hover);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .container {
    padding-inline: var(--space-4);
  }

  .header-inner {
    padding-inline: var(--space-4);
  }

  .header-actions .btn-gold span {
    display: none;
  }

  .header-actions .btn-gold {
    padding: var(--space-2) var(--space-3);
  }

  .toc-grid {
    grid-template-columns: 1fr;
  }

  .peptide-header {
    flex-direction: column;
    gap: var(--space-2);
  }

  .contact-strip {
    flex-direction: column;
    text-align: center;
  }

  .contact-links {
    justify-content: center;
  }

  .refill-banner {
    padding: var(--space-6);
  }

  .refill-actions {
    flex-direction: column;
    align-items: center;
  }

  .gate-input-group {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .peptide-overview {
    padding: var(--space-5) var(--space-5);
  }

  .peptide-benefits {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .disclaimer-banner {
    flex-direction: column;
    gap: var(--space-2);
  }

  .peptide-disclaimer {
    flex-direction: column;
    gap: var(--space-2);
  }
}
