/* Kisspeptin Research — Bento Grid Aesthetic */
/* Palette: deep midnight-indigo ground, bioluminescent rose + cyan + violet */

:root {
  --primary: #FF4D8D;
  --primary-50: #3A1526;
  --primary-900: #FFB3CE;
  --secondary: #22D3EE;
  --accent: #A78BFA;
  --neutral-50: #1A1B2E;
  --neutral-200: #2A2C45;
  --neutral-500: #8B8EAE;
  --neutral-900: #EDEEF7;
  --bg: #0B0C18;
  --surface: #15172A;
  --text: #EDEEF7;
  --text-muted: #9C9FC2;
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #FB7185;
  --max-width: 75rem;
  --container-px: clamp(1rem, 3vw, 2rem);
  --font-heading: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius-card: 18px;
  --radius-button: 12px;
  --bento-gap: 14px;
  --bento-border: 1px solid rgba(167, 139, 250, 0.14);
  --bento-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --bento-hover-border: rgba(167, 139, 250, 0.3);
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-900);
}

ul, ol {
  list-style: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--neutral-900);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  font-weight: 900;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 700;
}

h3 {
  font-size: 1.375rem;
  font-weight: 700;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

p {
  margin-bottom: 1.25rem;
}

p:last-child {
  margin-bottom: 0;
}

.text-muted {
  color: var(--text-muted);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}

.subheadline {
  font-size: 1.0625rem;
  line-height: 1.62;
  color: var(--text-muted);
  max-width: 46ch;
}

.mono {
  font-family: var(--font-mono);
}

/* ===== LAYOUT ===== */
.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(11, 12, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.12);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 1rem;
}

.site-brand {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--neutral-900);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.site-brand:hover {
  color: var(--primary);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
}

.site-nav a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: color 150ms ease, background-color 150ms ease;
}

.site-nav a:hover {
  color: var(--neutral-900);
  background-color: rgba(167, 139, 250, 0.08);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-toggle:hover {
  color: var(--neutral-900);
}

.nav-toggle svg {
  display: block;
}

/* ===== BENTO GRID ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--bento-gap);
}

.bento-cell {
  background-color: var(--surface);
  border: var(--bento-border);
  border-radius: var(--radius-card);
  box-shadow: var(--bento-shadow);
  padding: 1.5rem;
  transition: transform 200ms ease-out, border-color 200ms ease-out;
  overflow: hidden;
}

.bento-cell:hover {
  transform: translateY(-2px);
  border-color: var(--bento-hover-border);
}

.bento-cell--2x2 {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-cell--2x1 {
  grid-column: span 2;
}

.bento-cell--1x2 {
  grid-row: span 2;
}

.bento-cell--accent-top {
  border-top: 3px solid var(--secondary);
}

.bento-cell--accent-rose {
  border-top: 3px solid var(--primary);
}

/* ===== HERO ===== */
.site-hero {
  padding: 4rem 0 3rem;
  min-height: 88vh;
  display: flex;
  align-items: center;
}

.hero-bento {
  width: 100%;
}

.hero-headline-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}

.hero-headline-cell h1 {
  max-width: 44ch;
  margin-top: 0.75rem;
}

.hero-headline-cell .subheadline {
  margin-top: 0.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-sequence-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-sequence-cell::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--primary), transparent);
  opacity: 0.6;
}

.sequence-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.sequence-string {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--neutral-900);
  line-height: 1.8;
  word-break: break-all;
  padding-left: 1rem;
}

.sequence-string span {
  display: block;
  color: var(--primary);
}

/* ===== STAT TILES ===== */
.stat-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.3;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  color: var(--neutral-900);
  line-height: 1;
  margin: 0.5rem 0 0.25rem;
}

.stat-unit {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== IMAGE CELLS ===== */
.hero-image-cell {
  padding: 0;
  overflow: hidden;
}

.hero-image-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-card) - 2px);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-button);
  padding: 0.8125rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #0B0C18;
}

.btn-primary:hover {
  background-color: var(--primary);
  color: #0B0C18;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 77, 141, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--neutral-900);
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.btn-secondary:hover {
  color: var(--neutral-900);
  border-color: var(--secondary);
  transform: translateY(-1px);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
  padding: 5rem 0;
}

.content-section--alt {
  background-color: rgba(21, 23, 42, 0.5);
}

.section-intro {
  max-width: 64ch;
  margin-bottom: 3rem;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.prose {
  max-width: 70ch;
}

.prose h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.5rem;
  line-height: 1.62;
}

.prose strong {
  color: var(--neutral-900);
  font-weight: 600;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--neutral-50);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 6px;
  padding: 0.15em 0.45em;
}

/* ===== BENTO CONTENT GRID ===== */
.bento-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--bento-gap);
  margin-top: 2rem;
}

/* ===== CALLOUT ===== */
.callout {
  background-color: var(--surface);
  border: var(--bento-border);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

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

.callout--info {
  border-left-color: var(--secondary);
}

.callout p {
  margin-bottom: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* ===== CITATIONS ===== */
sup a {
  font-family: var(--font-mono);
  font-size: 0.7em;
  color: var(--secondary);
  text-decoration: none;
  padding: 0 0.1em;
}

sup a:hover {
  color: var(--primary);
}

/* ===== FAQ ACCORDION ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.faq-item {
  background-color: var(--surface);
  border: var(--bento-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color 200ms ease-out;
}

.faq-item:hover {
  border-color: var(--bento-hover-border);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.25rem 1.5rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--neutral-900);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  transition: color 150ms ease;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  transition: transform 200ms ease, color 200ms ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.62;
  border-top: 1px solid rgba(167, 139, 250, 0.08);
  padding-top: 1rem;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ===== REFERENCES TABLE ===== */
.references-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
}

.references-list li {
  background-color: var(--surface);
  border: var(--bento-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.75rem;
  align-items: start;
  transition: border-color 200ms ease-out;
}

.references-list li:hover {
  border-color: var(--bento-hover-border);
}

.ref-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  padding-top: 0.15rem;
}

.ref-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ref-citation {
  color: var(--text);
}

.ref-link {
  font-size: 0.8rem;
  color: var(--secondary);
  text-decoration: none;
  word-break: break-all;
}

.ref-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ===== PAGE LAYOUT ===== */
.page-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.1);
}

.page-header .eyebrow {
  margin-bottom: 1rem;
}

.page-title {
  margin-bottom: 1rem;
}

.page-lede {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.62;
}

.page-body {
  padding: 3.5rem 0 5rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  color: rgba(167, 139, 250, 0.4);
  font-size: 0.75rem;
}

/* ===== CHART CONTAINER ===== */
.chart-cell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chart-wrapper {
  position: relative;
  width: 100%;
}

/* ===== CONTACT FORM ===== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 48rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-900);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-input,
.form-select,
.form-textarea {
  background-color: var(--surface);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease;
  width: 100%;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B8EAE' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-select option {
  background-color: var(--surface);
  color: var(--text);
}

.form-textarea {
  resize: vertical;
  min-height: 8rem;
}

/* ===== FOOTER ===== */
.site-footer {
  background-color: var(--neutral-50);
  border-top: 1px solid rgba(167, 139, 250, 0.12);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-brand .site-brand {
  font-size: 1.25rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 32ch;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 150ms ease;
}

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

.footer-bottom {
  border-top: 1px solid rgba(167, 139, 250, 0.08);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.disclaimer {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}

.copyright {
  font-size: 0.8rem;
  color: var(--neutral-500);
  font-family: var(--font-mono);
}

/* ===== 404 ===== */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  opacity: 0.5;
  margin-bottom: 1.5rem;
}

.error-heading {
  margin-bottom: 1rem;
}

.error-text {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

/* ===== UTILITY SPACING ===== */
.mt-sm { margin-top: 0.25rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mt-xl { margin-top: 2rem; }
.mt-2xl { margin-top: 3rem; }
.mb-md { margin-bottom: var(--bento-gap); }
.mb-lg { margin-bottom: 2.5rem; }
.mb-xl { margin-bottom: 3rem; }
.my-md { margin-top: 2rem; margin-bottom: 2rem; }
.text-center { text-align: center; }

/* ===== BENTO INLINE OVERRIDES AS CLASSES ===== */
.bento-2col-sm { grid-template-columns: repeat(2, 1fr); }
.stat-value--sm { font-size: 2rem; }
.stat-value--investigational { font-size: clamp(1rem, 2.5vw, 1.5rem); margin: 0.75rem 0 0.25rem; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===== TABLET (768px) ===== */
@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-cell--2x2 {
    grid-column: span 2;
    grid-row: span 1;
  }

  .bento-cell--1x2 {
    grid-row: span 1;
  }

  .bento-content {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .site-hero {
    min-height: auto;
    padding: 3rem 0 2rem;
  }
}

/* ===== MOBILE (max 640px) ===== */
@media (max-width: 640px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg);
    border-bottom: 1px solid rgba(167, 139, 250, 0.12);
    padding: 1rem;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .site-nav a {
    padding: 0.6rem 0.75rem;
    width: 100%;
    display: block;
  }

  .nav-toggle {
    display: block;
  }

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

  .bento-cell--2x2,
  .bento-cell--2x1,
  .bento-cell--1x2 {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento-content {
    grid-template-columns: 1fr;
  }

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

  .footer-brand {
    grid-column: span 1;
  }

  .cta-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
