/* ═══════════════════════════════════════════════════════════════
   LungCURE — Design System
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────── */
:root {
  --navy:      #0a1628;
  --navy-mid:  #0f2240;
  --blue:      #1a6dbd;
  --blue-lt:   #ddeeff;
  --blue-glow: rgba(26,109,189,.18);
  --teal:      #00b4d8;
  --teal-lt:   #e0f7fc;
  --red:       #e03131;
  --green:     #2f9e44;
  --gold:      #e67700;
  --gray-0:    #f8f9fc;
  --gray-1:    #f0f2f6;
  --gray-2:    #e2e6ed;
  --gray-3:    #bcc5d3;
  --gray-4:    #6b7a99;
  --gray-5:    #2d3a52;
  --text:      #0d1b2e;
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 4px rgba(10,22,40,.06);
  --shadow:    0 4px 20px rgba(10,22,40,.10);
  --shadow-lg: 0 8px 40px rgba(10,22,40,.16);
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ─── Navigation ─────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 200;
  height: 60px;
  padding: 0 3rem;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226,230,237,.8);
  box-shadow: 0 1px 0 rgba(10,22,40,.04);
}
.nav-brand {
  font-weight: 800; font-size: 1.15rem;
  letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: .86rem; font-weight: 500;
  color: var(--gray-5);
  position: relative; padding-bottom: 2px;
  transition: color var(--transition);
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--blue);
  transform: scaleX(0); transition: transform var(--transition);
  border-radius: 2px;
}
.nav-links a:hover { color: var(--blue); text-decoration: none; }
.nav-links a:hover::after { transform: scaleX(1); }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-mid) 45%, #0d2d5e 100%);
  color: #fff;
  padding: 96px 2rem 80px;
  text-align: center;
  overflow: hidden;
}
/* Mesh grid overlay */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,180,216,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,180,216,.08) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
/* Glow orbs */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 60%, rgba(26,109,189,.25), transparent),
    radial-gradient(ellipse 50% 40% at 80% 30%, rgba(0,180,216,.18), transparent);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,180,216,.15);
  border: 1px solid rgba(0,180,216,.4);
  border-radius: 100px;
  padding: 5px 16px;
  font-size: .73rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: #7ee8fa;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.9rem);
  font-weight: 800;
  line-height: 1.2;
  max-width: 860px;
  margin: 0 auto 18px;
  letter-spacing: -.5px;
}
.hero h1 .accent { color: #7ee8fa; }
.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.75);
  max-width: 660px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.authors {
  font-size: .81rem;
  color: rgba(255,255,255,.6);
  max-width: 780px;
  margin: 0 auto 32px;
  line-height: 2;
}
.authors strong { color: rgba(255,255,255,.9); font-weight: 600; }
.authors em { font-style: normal; color: rgba(255,255,255,.45); font-size: .76rem; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: .87rem; font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none !important;
  letter-spacing: .1px;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: #fff;
  color: var(--navy-mid);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.btn-primary:hover { background: var(--blue-lt); color: var(--blue); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(0,0,0,.2); }

.btn-outline {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  border-color: rgba(255,255,255,.3);
  backdrop-filter: blur(4px);
}
.btn-outline:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.6); transform: translateY(-1px); }

/* ─── Stats bar ──────────────────────────────────────────────── */
.stats-bar {
  background: var(--gray-0);
  border-bottom: 1px solid var(--gray-2);
  display: flex; justify-content: center; flex-wrap: wrap;
}
.stat-item {
  padding: 22px 44px;
  text-align: center;
  border-right: 1px solid var(--gray-2);
  transition: background var(--transition);
}
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: #fff; }
.stat-num {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1;
}
.stat-label {
  font-size: .72rem; color: var(--gray-4);
  margin-top: 5px; text-transform: uppercase;
  letter-spacing: .8px; font-weight: 600;
}

/* ─── Sections ───────────────────────────────────────────────── */
section { padding: 80px 2rem; }
section:nth-child(even) { background: var(--gray-0); }
.container { max-width: 1020px; margin: 0 auto; }

.section-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--teal);
  margin-bottom: 8px;
}
.section-title {
  font-size: 1.65rem; font-weight: 800;
  letter-spacing: -.4px;
  margin-bottom: 12px;
  color: var(--navy);
}
.section-divider {
  width: 48px; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  border-radius: 2px;
  margin-bottom: 18px;
}
.section-subtitle {
  color: var(--gray-4); font-size: .95rem;
  margin-bottom: 40px;
  line-height: 1.65;
  width: 100%;
}

/* ─── Abstract ───────────────────────────────────────────────── */
.abstract-box {
  background: #fff;
  border: 1px solid var(--gray-2);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 30px 36px;
  font-size: .96rem;
  line-height: 1.85;
  box-shadow: var(--shadow);
  color: var(--gray-5);
}
.abstract-box strong { color: var(--blue); font-weight: 700; }

/* ─── Task section ───────────────────────────────────────────── */
.task-image-wrap {
  margin-bottom: 36px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-2);
}
.task-image-wrap img { width: 100%; object-fit: cover; }

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.task-card {
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.task-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.task-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.task-card.t1::before { background: linear-gradient(90deg, var(--blue), var(--teal)); }
.task-card.t2::before { background: linear-gradient(90deg, var(--green), #40c057); }
.task-card.t3::before { background: linear-gradient(90deg, #e03131, #ff6b6b); }

.task-num {
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.2px; margin-bottom: 10px;
}
.t1 .task-num { color: var(--blue); }
.t2 .task-num { color: var(--green); }
.t3 .task-num { color: var(--red); }

.task-card h3 {
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 10px; color: var(--navy);
}
.task-card p { font-size: .86rem; color: var(--gray-4); line-height: 1.7; }
.task-metrics { margin-top: 18px; display: flex; gap: 7px; flex-wrap: wrap; }
.metric-tag {
  font-size: .72rem; font-weight: 600;
  padding: 3px 11px;
  border-radius: 100px;
  background: var(--gray-1);
  color: var(--gray-5);
  border: 1px solid var(--gray-2);
  letter-spacing: .2px;
}

/* ─── Dataset cards — 6 items, 3 per row ────────────────────── */
.dataset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.dataset-card {
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.dataset-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dataset-icon { font-size: 1.9rem; margin-bottom: 10px; }
.dataset-card h4 { font-size: .88rem; font-weight: 700; margin-bottom: 5px; color: var(--navy); }
.dataset-card p { font-size: .79rem; color: var(--gray-4); line-height: 1.55; }

/* ─── Pipeline ────────────────────────────────────────────────── */
.pipeline-title {
  font-size: 1rem; font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  margin-top: 4px;
}
.pipeline {
  display: flex; align-items: stretch;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-2);
}
.pipeline-step {
  flex: 1;
  background: #fff;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  border-right: 1px solid var(--gray-2);
}
.pipeline-step:last-child { border-right: none; }
.pipeline-step:not(:last-child)::after {
  content: '›';
  position: absolute; right: -13px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-3); font-size: 1.4rem;
  font-weight: 300; z-index: 1;
  line-height: 1;
}
.step-icon { font-size: 1.6rem; margin-bottom: 8px; }
.pipeline-step h4 { font-size: .84rem; font-weight: 700; margin-bottom: 5px; color: var(--navy); }
.pipeline-step p  { font-size: .76rem; color: var(--gray-4); line-height: 1.5; }

/* ─── Metrics box — names only, no descriptions ─────────────── */
.metrics-box {
  margin-top: 28px;
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}
.metrics-box h4 { font-size: .95rem; font-weight: 700; margin-bottom: 16px; color: var(--navy); }
.metrics-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.metrics-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: 100px;
  background: var(--blue-lt);
  color: var(--blue);
  font-size: .82rem; font-weight: 600;
  border: 1px solid rgba(26,109,189,.2);
}
.metrics-tag::before { content: ''; width: 6px; height: 6px; background: var(--blue); border-radius: 50%; flex-shrink: 0; }

/* ─── Leaderboard ────────────────────────────────────────────── */
.lb-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.lb-tab {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: .84rem; font-weight: 600;
  border: 1.5px solid var(--gray-2);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--gray-4);
}
.lb-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 2px 10px rgba(26,109,189,.3); }
.lb-tab:hover:not(.active) { border-color: var(--blue); color: var(--blue); }

.task-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.task-tab {
  padding: 5px 15px;
  border-radius: 6px;
  font-size: .79rem; font-weight: 600;
  border: 1.5px solid var(--gray-2);
  background: #fff;
  cursor: pointer;
  color: var(--gray-4);
  transition: all var(--transition);
}
.task-tab.active { background: var(--gray-5); color: #fff; border-color: var(--gray-5); }
.task-tab:hover:not(.active) { border-color: var(--gray-4); color: var(--gray-5); }

.lb-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-2);
}
table { width: 100%; border-collapse: collapse; font-size: .83rem; background: #fff; }
thead th {
  background: var(--gray-5);
  color: #fff;
  padding: 12px 16px;
  text-align: left; font-weight: 600;
  white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--transition);
  letter-spacing: .2px;
}
thead th:hover { background: #3d4f6e; }
thead th .sort-icon { margin-left: 5px; opacity: .45; font-size: .8em; }
thead th.sorted { background: var(--blue); }
thead th.sorted .sort-icon { opacity: 1; }

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--blue-lt); }
tbody tr:nth-child(even) { background: var(--gray-0); }
tbody tr:nth-child(even):hover { background: var(--blue-lt); }
td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-2);
  white-space: nowrap; color: var(--gray-5);
}
td:first-child { font-weight: 600; color: var(--navy); }
.rank-1 td:first-child::before { content: '🥇 '; }
.rank-2 td:first-child::before { content: '🥈 '; }
.rank-3 td:first-child::before { content: '🥉 '; }
.best-val { color: var(--blue); font-weight: 700; }
.lcagent-row { background: #fffbf0 !important; }
.lcagent-row:hover { background: var(--blue-lt) !important; }
.lcagent-row td:first-child::after { content: ' ⚡'; font-size: .78rem; }

.lb-note {
  margin-top: 12px;
  font-size: .77rem; color: var(--gray-4);
  line-height: 1.65;
}

/* ─── LCAgent — 4 cards, all in one row ─────────────────────── */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.agent-card {
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.agent-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.agent-card-icon { font-size: 1.7rem; margin-bottom: 12px; }
.agent-card h4 { font-size: .9rem; font-weight: 700; margin-bottom: 8px; color: var(--navy); line-height: 1.35; }
.agent-card p  { font-size: .8rem; color: var(--gray-4); line-height: 1.65; }

/* ─── Gains — 4 cards, all in one row ───────────────────────── */
.gains-box {
  margin-top: 28px;
  background: #fff;
  border: 1px solid var(--gray-2);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.gains-box h4 { margin-bottom: 18px; font-size: .92rem; font-weight: 700; color: var(--navy); }
.gains-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  text-align: center;
}
.gain-item { padding: 20px 12px; border-radius: var(--radius-sm); }
.gain-item .gain-num { font-size: 1.6rem; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.gain-item .gain-label { font-size: .74rem; color: var(--gray-4); margin-top: 6px; line-height: 1.4; }
.gain-blue  { background: var(--blue-lt); }
.gain-blue  .gain-num { color: var(--blue); }
.gain-green { background: #ebfbee; }
.gain-green .gain-num { color: var(--green); }
.gain-gold  { background: #fff9db; }
.gain-gold  .gain-num { color: var(--gold); }
.gain-red   { background: #fff5f5; }
.gain-red   .gain-num { color: var(--red); }

/* ─── Citation ───────────────────────────────────────────────── */
.citation-wrap { position: relative; }
.citation-block {
  background: var(--navy);
  color: #7ee8fa;
  border-radius: var(--radius);
  padding: 28px 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .79rem;
  overflow-x: auto;
  line-height: 1.8;
  box-shadow: var(--shadow-lg);
}

/* ─── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 44px 2rem;
  font-size: .82rem;
}
footer a { color: rgba(255,255,255,.85); transition: color var(--transition); }
footer a:hover { color: var(--teal); text-decoration: none; }
.footer-links { display: flex; gap: 24px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.footer-note { margin-top: 8px; font-size: .74rem; opacity: .5; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .task-grid       { grid-template-columns: 1fr; }
  .agent-grid      { grid-template-columns: repeat(2, 1fr); }
  .gains-grid      { grid-template-columns: repeat(2, 1fr); }
  .dataset-grid    { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  nav { padding: 0 1.2rem; }
  .nav-links { gap: 1.2rem; }
  .stat-item { padding: 16px 20px; }
  .pipeline { flex-direction: column; }
  .pipeline-step { border-right: none; border-bottom: 1px solid var(--gray-2); }
  .pipeline-step:last-child { border-bottom: none; }
  .pipeline-step:not(:last-child)::after { display: none; }
  .agent-grid   { grid-template-columns: 1fr; }
  .gains-grid   { grid-template-columns: repeat(2, 1fr); }
  .dataset-grid { grid-template-columns: 1fr; }
}
