:root {
  --ink: #1a1410;
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --rule: #d3c8b6;
  --muted: #6d6458;
  --copper: #b24a16;
  --teal: #215e59;
  --good: #2f6b3a;
  --bad: #8a2f24;
  --shadow: 0 18px 50px rgba(26, 20, 16, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  gap: 1.4rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--copper); }
.nav .btn-home {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0.02em;
  color: #fffaf4;
}
.nav .btn-home:hover { color: #fffaf4; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--copper);
  color: #fffaf4;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--copper);
  box-shadow: 0 6px 16px rgba(178, 74, 22, 0.22);
}
.btn:hover {
  background: #933c10;
  border-color: #933c10;
  color: #fffaf4;
}
.hero-actions { margin: 1.15rem 0 0; }

.authors {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  margin: 0 0 1rem;
  color: #3a342c;
}
.authors a { color: var(--copper); }

main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.4rem 4rem; }
section { margin: 3.2rem 0; }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); line-height: 1.05; margin: 0.3rem 0 1rem; }
h2 { font-size: 2.05rem; margin: 0 0 0.7rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.35rem; }
h3 { font-size: 1.25rem; margin: 1.4rem 0 0.45rem; }
.kicker {
  color: var(--copper);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.lede { font-size: 1.15rem; max-width: 46rem; color: #3a342c; }
.section-lead { max-width: 46rem; color: #3a342c; }
.muted { color: var(--muted); font-size: 0.95rem; }

.hero-frame {
  position: relative;
  margin-top: 1.6rem;
  background: #120e0b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #120e0b;
}
.speed-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--copper);
  color: #fffaf4;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.28rem 0.55rem;
  border-radius: 4px;
}
.hero-caption {
  margin: 0;
  padding: 0.85rem 1.1rem 1.05rem;
  color: #e8dfd2;
  font-size: 0.95rem;
  background: #1c1713;
}

.pipeline {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 1rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.55rem;
}
.pipeline li {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.75rem 0.7rem 0.85rem;
  cursor: pointer;
  min-height: 11.5rem;
}
.pipeline li:hover, .pipeline li.is-active {
  border-color: var(--copper);
  background: #fffaf3;
}
.step-idx {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--copper);
  font-weight: 700;
}
.pipeline h3 { margin: 0.35rem 0 0.35rem; font-size: 1.05rem; }
.pipeline p { margin: 0; font-size: 0.86rem; color: var(--muted); }
.pipeline-detail {
  background: #fffaf3;
  border-left: 3px solid var(--copper);
  padding: 1rem 1.15rem;
  min-height: 6.5rem;
}
.pipeline-detail h3 { margin-top: 0; }

.pipeline-figure,
.award-figure {
  margin: 1.2rem 0 1.6rem;
  background: #fffaf3;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.pipeline-figure img,
.award-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.pipeline-figure figcaption,
.award-figure figcaption {
  margin: 0;
  padding: 0.75rem 1rem 0.95rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.award-figure { max-width: 52rem; }

.impl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}
.impl-grid article {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.05rem 0.85rem;
}
.impl-grid p { margin: 0.35rem 0 0; font-size: 0.95rem; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em; }
.code-block {
  background: #1c1713;
  color: #f3eadc;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.45;
}

.chart { display: grid; gap: 0.55rem; margin: 0.8rem 0 1.1rem; }
.bar-row { display: grid; grid-template-columns: 9.5rem 1fr 3.4rem; gap: 0.6rem; align-items: center; }
.bar-row span.label { font-size: 0.92rem; }
.bar-track { height: 0.72rem; background: #ddd4c4; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--copper)); border-radius: 99px; }
.bar-row .pct { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.92rem; }

.table-wrap { overflow-x: auto; margin-bottom: 1.6rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }
.ok { color: var(--good); font-weight: 600; }
.fail { color: var(--bad); font-weight: 600; }

footer {
  border-top: 1px solid var(--rule);
  padding: 1.2rem 1.4rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
footer a { color: var(--copper); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline li { min-height: auto; }
  .impl-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 7.2rem 1fr 3rem; }
}
@media (max-width: 560px) {
  .pipeline { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; gap: 0.7rem; }
}
