:root {
  --bg: #f8f6f3;
  --card: #fffcf7;
  --ink: #141413;
  --muted: #6b6257;
  --faint: #8f8a80;
  --line: #d9d0c3;
  --accent: #d97757;
  --accent-soft: #f4e4c1;
  --teal: #9dd4c7;
  --blue: #a8c5e6;
  --gray: #e8e6e3;
  --stroke: #4a4a4a;
  --white: #ffffff;
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

button,
select,
input {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
}

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-head .wrap {
  width: min(1216px, calc(100% - 56px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  font-size: 12px;
}

.mark {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}

.gh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.gh svg {
  width: 16px;
  height: 16px;
}

.intro {
  padding: 56px 0 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.16;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.authors {
  margin: 0 0 14px;
  color: var(--ink);
  font-weight: 600;
}

.lead {
  margin: 0 0 28px;
  max-width: 46rem;
  color: var(--muted);
  font-size: 17px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin: 25px 0;
}

.fact {
  color: var(--muted);
  font-size: 13px;
}

.fact b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
  font-size: 24px;
}

.chip {
  display: inline-block;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: #8c6f5a;
  font-size: 13px;
}

nav.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

nav.pills a {
  background: var(--gray);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 13px;
  text-decoration: none;
}

nav.pills a:hover {
  background: var(--accent-soft);
}

nav.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

nav.cta a,
nav.cta .cta-off {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.75rem;
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--stroke);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition-property: transform, background-color, border-color, color;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}

nav.cta a.cta-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

nav.cta .cta-off {
  background: var(--gray);
  border-color: var(--line);
  color: var(--faint);
  cursor: not-allowed;
}

nav.cta a:active {
  transform: scale(0.96);
}

@media (hover: hover) {
  nav.cta a.cta-primary:hover {
    filter: brightness(0.94);
  }

  nav.cta a:not(.cta-primary):hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}

.fold {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

.fold > summary {
  cursor: pointer;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.fold > summary span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.fold-body {
  padding: 0 18px 18px;
}

.fold-body > .card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 12px 0 0;
}

.fold-body > .card + .card {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  nav.cta a,
  nav.cta .cta-off {
    transition: none;
  }

  nav.cta a:active {
    transform: none;
  }
}

.section-title {
  margin: 34px 0 22px;
}

.section-title > span {
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0;
  font-size: 11px;
  font-weight: 700;
}

.section-title h2 {
  letter-spacing: -0.025em;
  margin: 4px 0;
  font-size: 28px;
  line-height: 1.24;
}

.section-title p {
  color: var(--muted);
  max-width: 850px;
  margin: 3px 0;
}

.method-grid,
.figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 18px;
  align-items: stretch;
}

.method-grid > .card,
.figure-grid > .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  align-self: stretch;
}

.card-heading {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 0 0 16px;
  min-height: 4.9rem;
}

.card-heading h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  min-height: 2.7em;
}

.card-heading small {
  color: var(--faint);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  font-size: 11px;
  display: block;
}

.method-tag {
  color: var(--ink);
  white-space: nowrap;
  border: 1.5px solid var(--stroke);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--teal);
}

.method-tag.secondary {
  background: var(--blue);
}

.method-grid .card > p {
  flex: 1;
  margin-top: 14px;
}

section {
  padding: 8px 0 36px;
}

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.card + .card,
.stack > * + * {
  margin-top: 16px;
}

.method-grid > .card + .card,
.figure-grid > .card + .card {
  margin-top: 0;
}

.figure-grid + .card,
.card + .figure-grid {
  margin-top: 16px;
}

.stack > .figure-grid {
  margin-top: 16px;
}

.stack > .figure-grid + * {
  margin-top: 16px;
}

figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.figure-frame {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  width: 100%;
  min-height: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.figure-frame img,
figure.hero img {
  display: block;
  background: var(--white);
}

.figure-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.figure-grid figcaption {
  min-height: 5.6em;
}

figcaption,
.caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

p {
  margin: 0 0 12px;
}

p:last-child {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ours-row {
  background: #e7f4ef;
}

td.up {
  font-weight: 700;
}

.tbd {
  color: var(--accent);
  font-weight: 600;
}

.bib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

button.copy {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

button.copy:hover,
button.copy:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  background: var(--gray);
  color: var(--muted);
  border-radius: 8px;
  white-space: pre-wrap;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

img.trio,
img.diag {
  width: 100%;
  height: auto;
  display: block;
  background: var(--white);
  border-radius: 8px;
}

img.teaser-img {
  aspect-ratio: 779 / 438;
  max-height: min(640px, 72vh);
  object-fit: contain;
  object-position: top center;
}

img.arch-img {
  aspect-ratio: 1262 / 645;
}

.task-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.task-strip figure {
  flex: none;
  min-height: 0;
}

.task-strip img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #111;
  border-radius: 8px;
}

.task-strip figcaption {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
}

.task-strip + .caption {
  margin: 10px 0 18px;
}

.video-matrix {
  display: grid;
  grid-template-columns: 7.2rem repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-top: 16px;
}

.video-col,
.video-task {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.video-task {
  justify-content: flex-end;
  text-align: right;
  padding-right: 4px;
  color: var(--ink);
}

.video-slot {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--gray);
  text-align: center;
}

.video-slot strong {
  font-size: 13px;
}

.video-slot .tsr {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.video-slot .soon {
  font-size: 11px;
  color: var(--faint);
}

.video-slot.ours {
  border-color: var(--accent);
  background: #f8ece4;
}

.video-slot.has-clip {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-style: solid;
  background-color: #111;
  background-image: var(--poster);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.video-slot.has-clip video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: transparent;
}

.video-slot.has-clip video::-webkit-media-controls-mute-button,
.video-slot.has-clip video::-webkit-media-controls-volume-slider,
.video-slot.has-clip video::-webkit-media-controls-volume-control-container {
  display: none;
}

.video-flag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}

.video-flag.fail {
  background: #b4453a;
  color: #fff8f4;
}

.video-flag.ok {
  background: var(--teal);
  color: #14352e;
}

.video-slot.has-clip:has(.video-flag.fail) {
  border-color: #b4453a;
}

.video-slot.has-clip:has(.video-flag.ok) {
  border-color: #6fafa3;
}

.video-slot.has-clip:has(.video-flag)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}

.video-slot.has-clip:has(.video-flag.fail)::after {
  box-shadow:
    inset 0 0 0 2px #b4453a,
    inset 0 0 16px 4px rgba(180, 58, 48, 0.42);
  background: linear-gradient(
    180deg,
    rgba(180, 58, 48, 0.28) 0%,
    rgba(180, 58, 48, 0) 18%,
    rgba(180, 58, 48, 0) 82%,
    rgba(180, 58, 48, 0.28) 100%
  );
}

.video-slot.has-clip:has(.video-flag.ok)::after {
  box-shadow:
    inset 0 0 0 2px #6fafa3,
    inset 0 0 16px 4px rgba(111, 175, 163, 0.38);
  background: linear-gradient(
    180deg,
    rgba(111, 175, 163, 0.24) 0%,
    rgba(111, 175, 163, 0) 18%,
    rgba(111, 175, 163, 0) 82%,
    rgba(111, 175, 163, 0.24) 100%
  );
}

.site-foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 800px) {
  .wrap {
    width: min(1140px, calc(100% - 28px));
  }

  .intro {
    padding-top: 36px;
  }

  .facts {
    gap: 18px;
  }

  .method-grid,
  .figure-grid,
  .plot-grid {
    grid-template-columns: 1fr;
  }

  .task-strip {
    grid-template-columns: 1fr 1fr;
  }

  .video-matrix {
    grid-template-columns: 1fr 1fr;
  }

  .video-col {
    display: none;
  }

  .video-task {
    grid-column: 1 / -1;
    justify-content: flex-start;
    text-align: left;
    padding: 8px 0 0;
  }

  .figure-frame {
    aspect-ratio: 16 / 11;
  }

  h1 {
    font-size: 1.85rem;
  }
}
