/* =======================================================================
   Monocular Dynamic Gaussian Splatting Overfits — project page stylesheet
   ======================================================================= */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f9fc;
  --bg-dark: #101522;
  --fg: #1a1f36;
  --fg-muted: #5b6378;
  --accent: #0055ff;
  --accent-2: #00aa7a;
  --accent-dim: rgba(0, 85, 255, 0.1);
  --border: #e5e8f0;
  --card-shadow: 0 2px 12px rgba(16, 21, 34, 0.06);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --serif: "Georgia", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.container.narrow {
  max-width: 820px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: #0033cc;
  text-decoration: underline;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin-top: 0;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
  margin-top: 30px;
  margin-bottom: 12px;
}

.muted {
  color: var(--fg-muted);
}

/* --------- Site header --------- */
.site-header {
  padding: 72px 0 44px;
  background: linear-gradient(
    180deg,
    #fafbff 0%,
    #fff 100%
  );
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 8px;
}

.subtitle {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 400;
  color: var(--fg-muted);
  margin-bottom: 30px;
}

.authors {
  font-size: 1.05rem;
  margin: 10px 0 4px;
}

.author {
  font-weight: 500;
  margin: 0 8px;
}

.affiliations {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--bg-dark);
  color: #fff;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.12s, background 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
  background: #1a2240;
  color: #fff;
  text-decoration: none;
}

.btn .icon {
  font-size: 0.8rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* --------- TL;DR --------- */
.tldr {
  padding: 48px 0 16px;
  background: var(--bg);
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 8px;
}

.lead {
  font-size: 1.1rem;
  color: var(--fg);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
  margin-top: 28px;
  padding: 28px;
  background: var(--bg-alt);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat .num {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.stat .lbl {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --------- Hero figure --------- */
.hero-figure {
  padding: 24px 0 32px;
}

.hero-figure figure {
  margin: 0;
  text-align: center;
}

.hero-figure img {
  width: 100%;
  max-width: 1100px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

figcaption {
  margin-top: 14px;
  color: var(--fg-muted);
  font-size: 0.94rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
  text-align: left;
}

/* --------- Sections --------- */
.section {
  padding: 54px 0;
}

.section.alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.section figure {
  margin: 24px 0;
}

.sub {
  margin-top: 44px;
}

/* --------- Cards --------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 28px 0 36px;
}

.card {
  padding: 22px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
}

.card.highlight {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.card h3 {
  margin-top: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* --------- Taxonomy --------- */
.taxonomy {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0 36px;
}

.axis {
  background: #fff;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.axis h4 {
  font-size: 0.95rem;
  color: var(--accent);
  margin: 0 0 10px;
  font-weight: 600;
}

.axis ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.92rem;
}

.axis li { margin: 4px 0; }

/* --------- Equation --------- */
.equation {
  font-family: var(--mono);
  background: var(--bg-alt);
  padding: 16px 18px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  margin: 16px 0;
  font-size: 0.98rem;
  overflow-x: auto;
  letter-spacing: 0.01em;
}

/* --------- Viz grid --------- */
.viz-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 24px 0;
}

@media (min-width: 900px) {
  .viz-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.viz-grid figure {
  margin: 0;
  text-align: center;
}

.viz-grid img {
  border-radius: 8px;
  border: 1px solid var(--border);
}

.viz-grid figcaption {
  text-align: center;
  font-size: 0.92rem;
  margin-top: 8px;
}

.caption-note {
  font-size: 0.92rem;
  color: var(--fg-muted);
  margin-top: 18px;
  text-align: left;
}

/* --------- Table --------- */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.94rem;
}

.results-table thead {
  background: var(--bg-dark);
  color: #fff;
}

.results-table th, .results-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.results-table tbody tr:nth-child(even) {
  background: var(--bg-alt);
}

/* --------- Strain table --------- */
.strain-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 0;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.strain-table th, .strain-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.strain-table th:first-child, .strain-table td:first-child {
  text-align: left;
}

.strain-table thead th {
  background: var(--bg-dark);
  color: #fff;
  font-weight: 500;
  border-bottom: none;
}

.strain-table tbody td.pct {
  color: var(--accent-2);
  font-weight: 600;
}

/* --------- BibTeX --------- */
.bibtex {
  background: var(--bg-dark);
  color: #f5f6fa;
  padding: 20px 22px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* --------- Footer --------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.site-footer code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* --------- 3D Viewer --------- */
.viewer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-dark);
  border-radius: 10px 10px 0 0;
  color: #e0e4f0;
  font-size: 0.92rem;
}

.viewer-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-controls select,
.viewer-controls input[type="range"] {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 0.88rem;
}

.viewer-controls select option { color: #000; }

.viewer-controls input[type="range"] {
  width: 160px;
  accent-color: var(--accent);
}

.viewer-controls button {
  padding: 5px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
}

.viewer-controls button:hover {
  background: #0033cc;
}

.slider-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-label span {
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  text-align: center;
}

.viewer-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--border);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}

.viewer-panel {
  position: relative;
  height: 420px;
  background: #f0f2f8;
}

.viewer-stats {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.5;
  font-family: var(--mono);
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.viewer-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,85,255,0.3);
}

.viewer-legend {
  position: absolute;
  bottom: 44px;
  right: 10px;
  width: 140px;
  padding: 8px 10px 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.72rem;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.legend-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--fg);
  font-size: 0.75rem;
}

.legend-bar {
  height: 10px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.legend-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

@media (max-width: 700px) {
  .viewer-pair {
    grid-template-columns: 1fr;
  }
  .viewer-panel {
    height: 300px;
  }
  .viewer-legend {
    width: 110px;
  }
}

/* --------- Responsive tweaks --------- */
@media (max-width: 560px) {
  .site-header { padding: 48px 0 32px; }
  .section { padding: 36px 0; }
  .stats-row { padding: 18px; }
  .stat .num { font-size: 1.35rem; }
}
