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

:root {
  --accent:    #2563eb;
  --accent-lt: #eff6ff;
  --text:      #1e293b;
  --muted:     #64748b;
  --border:    #e2e8f0;
  --bg:        #ffffff;
  --card:      #f8fafc;
  --radius:    10px;
  --max-w:     860px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

section { padding: 3rem 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }

/* ── Context banner ─────────────────────────────────────────── */
.context-banner {
  background: #f7f2ea;
  border-top: none;
  border-bottom: 1px solid #e0d5bf;
  padding: 1.75rem 0;
}
.context-banner p {
  font-size: 0.97rem;
  line-height: 1.75;
  color: #3a2e1e;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
  background: linear-gradient(180deg, #e8dcc8 0%, #d4c4a0 60%, #f7f2ea 100%);
  color: #2c1f0e;
  padding: 4rem 0 3rem;
  text-align: center;
  border-bottom: none;
}

header .venue {
  display: inline-block;
  background: rgba(44,31,14,0.10);
  color: #5c3d11;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  color: #1a1008;
}

.authors {
  font-size: 1rem;
  color: #3d2b10;
  margin-bottom: 0.4rem;
}
.affiliations {
  font-size: 0.85rem;
  color: #6b4c1e;
  margin-bottom: 2rem;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  cursor: default;
}
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-primary   { background: #3d2b10; color: #f5efe4; }
.btn-secondary { background: rgba(44,31,14,0.12); color: #2c1f0e; border: 1px solid rgba(44,31,14,0.3); }
.btn-disabled  { background: rgba(44,31,14,0.06); color: #9a7d5a; border: 1px solid rgba(44,31,14,0.15); cursor: default; }

/* ── Section headings ───────────────────────────────────────── */
h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.4rem 0 0.4rem;
  color: var(--text);
}

p { margin-bottom: 0.9rem; color: var(--text); }
p:last-child { margin-bottom: 0; }

/* ── Abstract ───────────────────────────────────────────────── */
.abstract-box {
  background: var(--accent-lt);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  font-size: 0.97rem;
  line-height: 1.7;
}

/* ── Figures ────────────────────────────────────────────────── */
figure { margin: 1.5rem 0; text-align: center; }
figure img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
figcaption {
  margin-top: 0.6rem;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: left;
}

/* ── Results table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  background: var(--card);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  padding: 0.55rem 0.8rem;
  text-align: left;
}
tbody td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
tbody tr:hover { background: var(--card); }
tbody tr.highlight { background: #eff6ff; font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Error analysis grid ────────────────────────────────────── */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.img-grid figure { margin: 0; }
.img-grid figure img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}
.img-grid figcaption { font-size: 0.75rem; text-align: center; }
.tag-fp { color: #dc2626; font-weight: 600; }
.tag-fn { color: #2563eb; font-weight: 600; }

/* ── Cluster strip ──────────────────────────────────────────── */
.cluster-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.cluster-strip figure img {
  width: 100%;
  border-radius: 8px;
}

/* ── Citation ───────────────────────────────────────────────── */
pre.bibtex {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  font-size: 0.78rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  header { padding: 2.5rem 0 2rem; }
  section { padding: 2rem 0; }
}
