:root {
  --bg: #ffffff;
  --bg-panel: #f6f8f6;
  --bg-panel-alt: #eef1ee;
  --border: #e0e4e0;
  --text: #1a1f1c;
  --text-dim: #55605a;
  --accent: #1f8a4c;
  --accent-dim: #17693a;
  --max-width: 1080px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.nav-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 22px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-dim);
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero-logos {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-logos img {
  height: 40px;
  width: auto;
}

.hero-eyebrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.hero-byline {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 30px;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

.btn-ghost {
  color: var(--text);
  background: var(--bg);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Teaser */
.teaser {
  padding: 0 0 56px;
  border-bottom: 1px solid var(--border);
}

.teaser img {
  max-width: 923px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Sections */
section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

.section-label {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.7rem;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.lede {
  color: var(--text-dim);
  margin-bottom: 32px;
}

/* Pipeline diagram figure */
.pipeline-figure {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
}

.pipeline-figure img {
  min-width: 640px;
  margin: 0 auto;
}

/* Figure grid */
.fig-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 28px;
}

@media (max-width: 700px) {
  .fig-grid {
    grid-template-columns: 1fr;
  }
}

/* Pairs a portrait photo with a landscape one at roughly matched render height */
.fig-grid-uneven {
  grid-template-columns: 1fr 2fr;
}

@media (max-width: 700px) {
  .fig-grid-uneven {
    grid-template-columns: 1fr;
  }
}

.demo-figure {
  margin: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.demo-figure video {
  width: 100%;
  display: block;
  background: #000;
}

.demo-figure figcaption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.demo-figure figcaption strong {
  color: var(--text);
}

figure {
  margin: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

figure img,
figure video {
  width: 100%;
  display: block;
  border-bottom: 1px solid var(--border);
  background: #000;
}

figcaption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

figcaption strong {
  color: var(--text);
}

/* Approach cards */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .approach-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.card code {
  background: var(--bg-panel-alt);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82em;
}

/* Equations */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

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

.eq-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.eq-card h3 {
  margin: 0 0 14px;
  font-size: 0.95rem;
}

.eq-card .katex-display {
  margin: 0.5em 0;
  text-align: left;
}

.eq-legend {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.eq-legend li {
  margin: 3px 0;
}

.eq-legend .katex {
  font-size: 1em;
}

/* Results table */
.results-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 480px;
}

table.results th {
  background: var(--accent);
  color: #fff;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
}

table.results td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

table.results tr.highlight td {
  background: #eaf6ee;
  font-weight: 600;
}

.results-note {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 16px;
}

/* Repo structure */
pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  font-size: 0.85rem;
  color: var(--text-dim);
}

pre .dir {
  color: var(--accent-dim);
  font-weight: 600;
}

/* Stack pills */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.pill {
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Footer */
footer {
  padding: 36px 0 60px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-dim);
}

footer a:hover {
  color: var(--accent);
}
