/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #1A0B3E;
  background: #F0EFF5;
  line-height: 1.7;
  font-size: 1.05rem;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #6D28D9; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.3; }
h1 { font-size: 2.5rem; font-weight: 900; }
h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 1.5rem; }
h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.lead { font-size: 1.15rem; color: #4C1D95; line-height: 1.8; margin-bottom: 2rem; }

/* ===== LAYOUT ===== */
.container { max-width: 900px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-light { background: #FFFFFF; }
.section-tinted { background: #F0EFF5; }

.two-col { display: grid; grid-template-columns: 1.8fr 1fr; gap: 2.5rem; align-items: start; }
.col-main p { margin-bottom: 1rem; }
.col-side { position: sticky; top: 80px; }

/* ===== HERO ===== */
.hero-section { position: relative; min-height: 520px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: rgba(46,16,101,0.82); }
.hero-content { position: relative; z-index: 1; text-align: center; padding: 3rem 1.5rem; max-width: 820px; color: #fff; }
.hero-label { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; margin-bottom: 1rem; }
.hero-section h1 { color: #fff; margin-bottom: 0.5rem; }
.hero-subtitle { font-size: 1.3rem; font-weight: 400; opacity: 0.9; margin-bottom: 0.75rem; font-family: 'Playfair Display', Georgia, serif; }
.hero-authors { font-size: 0.9rem; opacity: 0.7; margin-bottom: 1.5rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-bottom: 1.5rem; }
.badge {
  display: inline-block; padding: 0.4rem 1rem; border-radius: 999px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}
.hero-actions { margin-top: 1rem; }
.btn {
  display: inline-block; padding: 0.65rem 1.5rem; border-radius: 8px;
  background: #6D28D9; color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.95rem; transition: background 0.2s;
}
.btn:hover { background: #7C3AED; }

/* ===== FIGURES ===== */
.figure-card {
  background: #fff; border: 1px solid #D5D0E5; border-radius: 12px;
  padding: 1.25rem; margin: 2rem 0; box-shadow: 0 2px 12px rgba(46,16,101,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}
.figure-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(46,16,101,0.10); }
.figure-card img { border-radius: 6px; margin: 0 auto; }
.figure-card figcaption { margin-top: 0.75rem; font-size: 0.88rem; color: #8B85A0; line-height: 1.5; }
.fig-medium { max-width: 650px; margin-left: auto; margin-right: auto; }

/* ===== CARDS ===== */
.card-grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }
.card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }
.card-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }

.mechanism-card, .advance-card, .disease-card, .biomarker-card, .ethics-card, .direction-card, .modality-card {
  background: #fff; border-radius: 12px; padding: 1.5rem;
  border: 1px solid #D5D0E5; box-shadow: 0 2px 8px rgba(46,16,101,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}
.mechanism-card:hover, .advance-card:hover, .disease-card:hover, .biomarker-card:hover,
.ethics-card:hover, .direction-card:hover, .modality-card:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(46,16,101,0.10);
}
.mechanism-card p, .advance-card p, .disease-card p, .biomarker-card p,
.ethics-card p, .direction-card p, .modality-card p {
  font-size: 0.95rem; line-height: 1.65;
}

.border-primary { border-left: 4px solid #2E1065; }
.border-accent { border-left: 4px solid #6D28D9; }
.border-secondary { border-left: 4px solid #4C1D95; }
.border-muted { border-left: 4px solid #8B85A0; }

.advance-card { border-top: 3px solid #6D28D9; }
.card-wide {
  background: #fff; border-radius: 12px; padding: 1.5rem; margin: 1.5rem 0;
  border: 1px solid #D5D0E5; border-left: 4px solid #4C1D95;
  box-shadow: 0 2px 8px rgba(46,16,101,0.05);
}
.card-wide p { font-size: 0.95rem; line-height: 1.65; }

/* ===== METRICS ===== */
.metrics-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; justify-content: center; }
.metric-card {
  background: #EDE8F5; border-radius: 10px; padding: 1rem 1.25rem;
  text-align: center; min-width: 120px; flex: 1;
  border: 1px solid #D5D0E5;
}
.metric-number { display: block; font-size: 2rem; font-weight: 900; color: #2E1065; font-family: 'Playfair Display', serif; }
.metric-label { display: block; font-size: 0.8rem; color: #8B85A0; font-weight: 600; margin-top: 0.25rem; }

/* ===== TABLES ===== */
.table-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }
.table-container { background: #fff; border-radius: 12px; padding: 1.25rem; border: 1px solid #D5D0E5; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th { background: #2E1065; color: #fff; padding: 0.6rem 1rem; text-align: left; font-weight: 600; }
thead th:first-child { border-radius: 6px 0 0 0; }
thead th:last-child { border-radius: 0 6px 0 0; }
tbody td { padding: 0.5rem 1rem; border-bottom: 1px solid #EDE8F5; }
tbody tr:hover { background: #F9F8FC; }

/* ===== DIRECTION NUMBERS ===== */
.direction-card { position: relative; padding-left: 3.5rem; }
.direction-number {
  position: absolute; left: 1rem; top: 1.25rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: #6D28D9; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem;
}

/* ===== CALLOUTS ===== */
.callout-box {
  background: #EDE8F5; border-radius: 12px; padding: 1.5rem 2rem;
  border-left: 4px solid #6D28D9; margin: 2rem 0;
}
.callout-box p { font-size: 0.95rem; }
.callout-warning {
  background: #FEF9E7; border-radius: 12px; padding: 1.5rem 2rem;
  border-left: 4px solid #D4A017; margin: 2rem 0;
}
.callout-warning h3 { color: #92400E; }
.callout-warning p { font-size: 0.95rem; }

/* ===== TAKEAWAY LIST ===== */
.takeaway-list { list-style: none; padding: 0; }
.takeaway-list li {
  padding: 0.75rem 1rem 0.75rem 2rem; margin-bottom: 0.5rem;
  background: #fff; border-radius: 8px; border-left: 3px solid #6D28D9;
  font-size: 0.95rem; position: relative;
}
.takeaway-list li::before {
  content: "\2713"; position: absolute; left: 0.6rem; color: #6D28D9; font-weight: 700;
}

/* ===== REFERENCES ===== */
details { margin: 1rem 0; }
details summary {
  cursor: pointer; font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem; font-weight: 700; color: #2E1065; padding: 0.5rem 0;
}
details summary:hover { color: #6D28D9; }
.ref-note { font-size: 0.9rem; color: #8B85A0; margin-top: 1rem; line-height: 1.6; }

/* ===== REVEAL ANIMATION ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== FLECTO EXPLANATION UI ===== */
.flecto-note, .flecto-callout, .flecto-card, .flecto-panel {
  border-radius: 10px; padding: 1rem 1.25rem; margin: 1.25rem 0;
  font-size: 0.93rem; line-height: 1.65;
}
.flecto-note::before, .flecto-callout::before, .flecto-card::before, .flecto-panel::before {
  content: "\1F916 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-note {
  background: #F9F8FC; border-left: 3px solid #6D28D9;
  font-size: 0.9rem; padding: 0.75rem 1rem;
}
.flecto-callout {
  background: #EDE8F5; border: 1px solid #D5D0E5;
}
.flecto-card {
  background: #fff; border: 1px solid #D5D0E5; box-shadow: 0 2px 8px rgba(46,16,101,0.06);
}
.flecto-card h4 { font-size: 1rem; margin-bottom: 0.5rem; color: #2E1065; }
.flecto-panel {
  background: #fff; border: 1px solid #D5D0E5; padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(46,16,101,0.08);
}
.flecto-panel h4 { font-size: 1.1rem; margin-bottom: 0.75rem; color: #2E1065; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .two-col { grid-template-columns: 1fr; }
  .card-grid-2x2, .card-grid-2, .card-grid-3 { grid-template-columns: 1fr; }
  .table-grid { grid-template-columns: 1fr; }
  .hero-section { min-height: 400px; }
  .hero-content { padding: 2rem 1rem; }
  .metrics-row { flex-direction: column; }
  .col-side { position: static; }
}
