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

:root {
  --primary:     #2563eb;
  --primary-dk:  #1d4ed8;
  --accent:      #7c3aed;
  --bg-light:    #f8fafc;
  --bg-white:    #ffffff;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --radius:      8px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --nav-h:       64px;
  --font:        'Inter', system-ui, sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

p { color: var(--text-muted); line-height: 1.75; }

/* ── Layout ───────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container.narrow { max-width: 760px; }

/* ── Navbar ───────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.5px;
}

.logo-accent { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  padding: .4rem .8rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .15s, background .15s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: #eff6ff;
}

.btn-nav {
  background: var(--primary) !important;
  color: #fff !important;
  padding: .4rem .9rem !important;
}
.btn-nav:hover { background: var(--primary-dk) !important; }

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
  padding: 5rem 0 4rem;
  color: #fff;
  text-align: center;
}

.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #bfdbfe;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .9rem;
  border-radius: 999px;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -2px;
  color: #fff;
  line-height: 1.1;
}

.hero-title .accent { color: #93c5fd; }

.hero-subtitle {
  max-width: 640px;
  font-size: 1.1rem;
  color: #bfdbfe;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: .5rem 0;
}

.stat-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 1rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  min-width: 110px;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
}

.stat-label {
  font-size: .78rem;
  font-weight: 500;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dk); text-decoration: none; }

.btn-secondary {
  background: #fff;
  color: var(--primary);
}
.btn-secondary:hover { background: #eff6ff; text-decoration: none; }

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.4);
}
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: #fff; text-decoration: none; }

/* ── Sections ─────────────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-light { background: var(--bg-light); }
.section-white { background: var(--bg-white); }

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.5px;
  margin-bottom: 1rem;
}

.section-desc {
  max-width: 680px;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.75;
}

/* ── Cards ────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-icon { font-size: 2rem; margin-bottom: .75rem; }

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .5rem;
}

.card p { font-size: .9rem; }

/* ── Tables ───────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--bg-white);
}

.data-table thead {
  background: #f1f5f9;
}

.data-table th {
  padding: .8rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: .75rem 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: #f8fafc; }

.rank-1 td { background: #fffbeb; }

/* ── Tags / Badges ────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.tag-class { background: #dbeafe; color: #1d4ed8; }
.tag-reg   { background: #dcfce7; color: #15803d; }
.tag-bio   { background: #fce7f3; color: #be185d; }
.tag-phys  { background: #ede9fe; color: #6d28d9; }

/* ── Leaderboard ──────────────────────────────────────────────────── */
.lb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.lb-filters { display: flex; gap: .5rem; flex-wrap: wrap; }

.filter-btn {
  padding: .35rem .9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.lb-section { margin-bottom: 3.5rem; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
}

.rank-badge.gold   { background: #fef08a; color: #854d0e; }
.rank-badge.silver { background: #e2e8f0; color: #475569; }
.rank-badge.bronze { background: #fed7aa; color: #9a3412; }

/* ── Dataset page ─────────────────────────────────────────────────── */
.dataset-entry {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.dataset-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.dataset-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.dataset-tags { display: flex; gap: .4rem; flex-wrap: wrap; }

.dataset-entry p { margin-bottom: 1.25rem; }

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.75rem 1rem;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.download-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.dl-icon { font-size: 2.2rem; }
.dl-label { font-weight: 600; font-size: .95rem; color: var(--text); }
.dl-format { font-size: .8rem; color: var(--text-muted); font-family: var(--mono); }

.feature-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
}

.feature-list li { color: var(--text-muted); font-size: .9rem; }
.feature-list strong { color: var(--text); }

/* ── Code block ───────────────────────────────────────────────────── */
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.7;
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}

/* ── Page header (inner pages) ────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  padding: 3rem 0;
  color: #fff;
}

.page-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -.5px;
  color: #fff;
  margin-bottom: .5rem;
}

.page-header p { color: #93c5fd; font-size: 1rem; }

/* ── About / Team ─────────────────────────────────────────────────── */
.narrow p { margin-bottom: 1rem; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.team-card {
  text-align: center;
  padding: 1.75rem 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.team-avatar {
  font-size: 2.5rem;
  margin-bottom: .75rem;
}

.team-card h4 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.team-card p  { font-size: .85rem; margin-bottom: .5rem; }
.team-card a  { font-size: .85rem; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3rem 0 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
  padding-bottom: 3rem;
  border-bottom: 1px solid #1e293b;
}

.footer-brand { max-width: 260px; }
.footer-brand .logo-accent { font-size: 1.2rem; font-weight: 700; }
.footer-brand p { font-size: .85rem; margin-top: .5rem; color: #64748b; }

.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }

.footer-col h4 {
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #cbd5e1;
  margin-bottom: .75rem;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }

.footer-col a {
  font-size: .875rem;
  color: #64748b;
  text-decoration: none;
  transition: color .15s;
}

.footer-col a:hover { color: #93c5fd; }

.footer-bottom {
  padding: 1.25rem 0;
  text-align: center;
}

.footer-bottom p { font-size: .8rem; color: #475569; }

/* ── Diastereomer teaser banner ───────────────────────────────────── */
.diast-teaser {
  background: #eff6ff;
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
  padding: 0.8rem 0;
}

.diast-teaser-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.diast-teaser-icon { font-size: 1.2rem; flex-shrink: 0; }

.diast-teaser p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.diast-teaser a {
  color: var(--primary);
  font-weight: 600;
}

/* ── Molecular Viewer ─────────────────────────────────────────────── */
.mol-viewer-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.mol-card {
  flex: 1;
  min-width: 280px;
  max-width: 460px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

.mol-card-ll { border-top: 3px solid #2563eb; }
.mol-card-ld { border-top: 3px solid #7c3aed; }

.mol-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.mol-badge {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}

.mol-badge-ll { background: #dbeafe; color: #1d4ed8; }
.mol-badge-ld { background: #ede9fe; color: #6d28d9; }

.mol-config {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mol-canvas {
  width: 100%;
  height: 320px;
  border-radius: 6px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.mol-loading,
.mol-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
  pointer-events: none;
}

.mol-hint {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.mol-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  align-self: center;
  flex-shrink: 0;
  padding: 0 0.25rem;
}

.mol-note {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .nav-links { display: none; flex-direction: column; gap: .5rem; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
  }
  .hamburger { display: block; }

  .hero { padding: 3rem 0 2.5rem; }
  .hero-title { font-size: 2.5rem; }
  .stat-card { padding: .75rem 1.25rem; }

  .section { padding: 3rem 0; }
  .section-title { font-size: 1.4rem; }

  .footer-inner { flex-direction: column; gap: 2rem; }
  .footer-links { gap: 2rem; }

  .lb-meta { flex-direction: column; align-items: flex-start; }

  .mol-canvas { height: 240px; }
  .mol-vs { padding: 0.25rem 0; }
}
