/* Electric Sage palette */
:root {
  --bg: #F0F7F4;
  --surface: #FFFFFF;
  --primary: #1565C0;
  --secondary: #2E7D32;
  --accent: #1B5E20;
  --text: #0D2818;
  --muted: #6E8B73;
  --line: #CDE0D0;
  --th2high: #1565C0;
  --th2high-bg: #E3F0FF;
  --th2low: #2E7D32;
  --th2low-bg: #E8F5E9;
  --both-bg: #F5F5F5;
}

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

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

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

/* Hero */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  padding: 5rem 0 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(21,101,192,0.82) 0%, rgba(27,94,32,0.72) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
}
.badge-approved { background: #2E7D32; color: #fff; }
.badge-phase1 { background: #1565C0; color: #fff; }
.badge-preclinical { background: #6E8B73; color: #fff; }
.badge-early { background: #F57F17; color: #fff; }

h1 {
  font-family: 'Merriweather', serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  color: #fff;
}
.hero-journal {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 0.75rem;
}
.hero-hook {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  max-width: 680px;
  margin-bottom: 1.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary {
  background: #fff;
  color: var(--primary);
}
.btn-primary:hover { background: #e8f0fe; transform: translateY(-1px); }
.hero-actions .btn { background: rgba(255,255,255,0.15); color: #fff; border: 1.5px solid rgba(255,255,255,0.5); }
.hero-actions .btn:hover { background: rgba(255,255,255,0.28); }

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--surface); }

h2 {
  font-family: 'Merriweather', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--line);
}
h3 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
}

/* Cards */
.card-grid { display: grid; gap: 1.5rem; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.three-col { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.card-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.card ul { margin: 0.75rem 0 0 1.25rem; }
.card ul li { margin-bottom: 0.4rem; font-size: 0.95rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; flex-wrap: wrap; gap: 0.4rem; }
.card-limitation {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: #FFF8E1;
  border-left: 3px solid #F57F17;
  border-radius: 0 4px 4px 0;
  font-size: 0.88rem;
  color: #5D4037;
}

/* Summary box */
.summary-box {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #E3F0FF 0%, #E8F5E9 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.summary-box p { font-size: 1rem; line-height: 1.7; }

/* Stats sidebar layout */
.intro-layout { display: grid; grid-template-columns: 1fr 200px; gap: 2rem; align-items: start; }
@media (max-width: 680px) { .intro-layout { grid-template-columns: 1fr; } }
.stats-sidebar { display: flex; flex-direction: column; gap: 0.75rem; }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-number {
  font-family: 'Merriweather', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }

/* Accordion */
.accordion {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.accordion summary {
  padding: 0.9rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion summary::after { content: '▸'; transition: transform 0.2s; }
.accordion[open] summary::after { transform: rotate(90deg); }
.accordion-body { padding: 1.25rem; background: var(--surface); }

/* Endotype split */
.endotype-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 2rem; }
@media (max-width: 640px) { .endotype-split { grid-template-columns: 1fr; } }
.endotype-card {
  border-radius: 10px;
  padding: 1.25rem;
  border: 2px solid;
}
.endotype-card.th2high { background: var(--th2high-bg); border-color: var(--th2high); }
.endotype-card.th2high h3 { color: var(--th2high); }
.endotype-card.th2low { background: var(--th2low-bg); border-color: var(--th2low); }
.endotype-card.th2low h3 { color: var(--th2low); }
.endotype-card ul { margin-left: 1.2rem; }
.endotype-card ul li { font-size: 0.92rem; margin-bottom: 0.35rem; }

/* Tables */
.table-scroll { overflow-x: auto; margin-top: 1rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  background: var(--primary);
  color: #fff;
  padding: 0.65rem 0.8rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--bg); }

/* Endotype row coloring */
.th2high-row td:nth-child(2) { color: var(--th2high); font-weight: 600; }
.th2low-row td:nth-child(2) { color: var(--th2low); font-weight: 600; }
.th2high-row { background: rgba(21,101,192,0.04); }
.th2low-row { background: rgba(46,125,50,0.04); }

/* Figures */
.paper-figure {
  margin: 2rem 0;
  text-align: center;
}
.paper-figure img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}
.figure-small img { max-width: 420px; }
figcaption {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: left;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Biologic tabs */
.tab-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
}
.tab-btn {
  padding: 0.55rem 1.1rem;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn.active, .tab-btn:hover { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; padding: 1.5rem 0; }
.tab-content.active { display: block; }

/* Drug cards */
.drug-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.drug-investigational { border-left: 4px solid #F57F17; opacity: 0.9; }
.drug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.drug-name {
  font-family: 'Merriweather', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}
.drug-card ul { margin: 0.6rem 0 0 1.2rem; }
.drug-card ul li { font-size: 0.93rem; margin-bottom: 0.35rem; }

/* Conclusions box */
.conclusions-box {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #E8F5E9 0%, #E3F2FD 100%);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.conclusions-box h3 { color: var(--secondary); margin-bottom: 1rem; }
.conclusions-box ol { margin-left: 1.4rem; }
.conclusions-box ol li { margin-bottom: 0.65rem; font-size: 0.97rem; }

/* Flecto UI classes */
.flecto-note {
  padding: 0.65rem 1rem;
  border-left: 4px solid var(--primary);
  background: rgba(21,101,192,0.06);
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.flecto-callout {
  padding: 1rem 1.25rem;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 8px;
  margin: 1rem 0 1.5rem;
}
.flecto-note::before, .flecto-callout::before {
  content: '🤖 AI explanation';
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.5em;
}
.flecto-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  margin: 1rem 0;
}
.flecto-card::before {
  content: '🤖 AI explanation';
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.5em;
}
.flecto-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.flecto-panel::before {
  content: '🤖 AI explanation';
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.5em;
}

/* References */
.references-accordion { margin-top: 1rem; }
.references-list { margin-left: 1.5rem; }
.references-list li { margin-bottom: 0.5rem; font-size: 0.87rem; line-height: 1.5; }
.refs-note { font-size: 0.87rem; color: var(--muted); margin-bottom: 1rem; font-style: italic; }

/* Footer */
.site-footer {
  background: #0D2818;
  color: rgba(255,255,255,0.7);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.88rem;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.4rem; }
  .hero { padding: 4rem 0 3rem; }
}
