:root {
  --ink: #172126;
  --muted: #5b686d;
  --line: #dce3e4;
  --paper: #ffffff;
  --mist: #f4f7f7;
  --teal: #0b6e75;
  --teal-dark: #07555b;
  --cyan: #0d91a7;
  --green: #16845b;
  --amber: #b97712;
  --max-width: 1120px;
  --wide-width: 1380px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

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

.page-shell,
.wide-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.wide-shell {
  width: min(calc(100% - 32px), var(--wide-width));
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 60px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.nav-inner {
  width: min(calc(100% - 40px), var(--max-width));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  color: var(--teal-dark);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--teal);
}

.paper-header {
  padding: 86px 0 68px;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  text-align: center;
}

.paper-header h1 {
  max-width: 1020px;
  margin: 0 auto 28px;
  font-size: clamp(2.25rem, 4vw, 3.55rem);
  line-height: 1.04;
  font-weight: 760;
  letter-spacing: 0;
}

.authors,
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 20px;
}

.authors {
  font-size: 1.08rem;
  font-weight: 650;
}

.affiliations {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.authors sup,
.affiliations sup {
  color: var(--teal);
  font-size: 0.68em;
  font-weight: 800;
}

.lead {
  max-width: 900px;
  margin: 34px auto 0;
  color: #3c4a4f;
  font-size: 1.2rem;
  line-height: 1.55;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.video-button,
.code-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.video-button {
  color: #fff;
  background: var(--teal);
}

.video-button:hover,
.video-button:focus-visible {
  color: #fff;
  background: var(--teal-dark);
}

.code-button {
  color: #6e7a7e;
  background: #f6f8f8;
  border-color: var(--line);
  cursor: default;
}

.pipeline-section {
  padding: 54px 0 82px;
}

.pipeline-image {
  width: 100%;
  height: auto;
}

.phase-grid,
.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 54px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.phase-grid article,
.task-grid article {
  min-width: 0;
  padding: 30px 32px 34px;
}

.phase-grid article + article,
.task-grid article + article {
  border-left: 1px solid var(--line);
}

.phase-label,
.eyebrow {
  margin: 0 0 12px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.phase-one { color: var(--cyan); }
.phase-two { color: var(--green); }
.phase-three { color: var(--amber); }

.phase-grid h2,
.task-grid h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 750;
}

.phase-grid article > p:last-child,
.task-grid article > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.tasks-section,
.video-section {
  padding: 82px 0;
  border-top: 1px solid var(--line);
}

.tasks-section {
  background: var(--mist);
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 45px;
  text-align: center;
}

.eyebrow {
  color: var(--teal);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  font-weight: 760;
}

.section-heading > p:last-child {
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.task-grid {
  margin-top: 0;
  background: #fff;
}

.task-number {
  display: block;
  margin-bottom: 24px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 850;
}

.video-frame {
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.video-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.site-footer {
  padding: 32px 0;
  color: #738085;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--teal);
}

@media (max-width: 760px) {
  .page-shell,
  .wide-shell,
  .nav-inner {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 0.78rem;
  }

  .paper-header {
    padding: 54px 0 48px;
  }

  .paper-header h1 {
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  .affiliations {
    display: grid;
    gap: 2px;
  }

  .lead {
    font-size: 1.05rem;
  }

  .pipeline-section {
    padding: 30px 0 64px;
  }

  .phase-grid,
  .task-grid {
    grid-template-columns: 1fr;
    margin-top: 38px;
  }

  .phase-grid article + article,
  .task-grid article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .tasks-section,
  .video-section {
    padding: 64px 0;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
