:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #52616f;
  --line: #d8e1ea;
  --blue: #2f66c1;
  --blue-dark: #224f96;
  --green: #2f8f68;
  --coral: #d65f49;
  --shadow: 0 22px 70px rgba(27, 39, 55, 0.12);
  --radius: 8px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--blue-dark);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 20;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(216, 225, 234, 0.88);
  background: rgba(247, 249, 251, 0.86);
  backdrop-filter: blur(16px);
}

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

.brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 650;
}

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

.nav-links a:hover {
  color: var(--ink);
}

.section-shell {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 72px 0;
}

.hero {
  padding-top: 86px;
  text-align: center;
}

.paper-kicker,
.section-label {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spotlight-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--coral);
  color: #ffffff;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 970px;
  margin: 0 auto;
  font-size: clamp(2.4rem, 4.7vw, 5rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 3.3vw, 3rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  line-height: 1.25;
}

.paper-summary {
  max-width: 820px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.24rem);
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 0;
  margin: 28px auto 0;
  list-style: none;
  font-size: 16px;
  font-weight: 680;
}

.authors a {
  color: var(--blue);
}

.affiliations {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 34px 0 0;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(27, 39, 55, 0.06);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
}

.action-button:hover {
  color: var(--ink);
  border-color: #b9c8d8;
  transform: translateY(-1px);
}

.action-button.primary {
  color: var(--surface);
  border-color: var(--blue);
  background: var(--blue);
}

.action-button.primary:hover {
  color: var(--surface);
  background: var(--blue-dark);
}

.button-icon {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(16, 24, 40, 0.08);
  font-size: 11px;
  line-height: 1;
}

.primary .button-icon {
  background: rgba(255, 255, 255, 0.18);
}

.teaser {
  margin: 48px auto 0;
  text-align: left;
}

.teaser img,
.results-grid img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  border-top: 1px solid var(--line);
}

.prose p,
.section-heading p,
.media-panel p,
.acknowledgements p {
  margin: 0;
  color: var(--muted);
}

.highlights,
.method-flow,
.results-grid {
  display: grid;
  gap: 18px;
}

.highlights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.highlights article,
.method-flow article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.highlights article:nth-child(1) {
  border-top: 4px solid var(--blue);
}

.highlights article:nth-child(2) {
  border-top: 4px solid var(--green);
}

.highlights article:nth-child(3) {
  border-top: 4px solid var(--coral);
}

.highlights p,
.method-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.method-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-number {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 820;
}

.section-heading {
  max-width: 780px;
}

.section-heading h2 {
  margin-bottom: 12px;
}

.results-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 28px;
}

.results-grid figure {
  margin: 0;
}

/* Result tables */
.table-block {
  margin: 0;
}

.table-caption {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.5;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.results-table th,
.results-table td {
  padding: 9px 11px;
  text-align: center;
  white-space: nowrap;
}

.results-table thead th {
  background: #eef2f7;
  color: var(--ink);
  font-weight: 760;
}

.results-table thead tr:first-child th {
  border-bottom: 1px solid var(--line);
}

.results-table thead tr:last-child th {
  border-bottom: 2px solid #c4d0dd;
}

.results-table tbody td,
.results-table tbody th {
  border-top: 1px solid var(--line);
}

.results-table tbody tr.model-start td,
.results-table tbody tr.model-start th {
  border-top: 2px solid #c4d0dd;
}

.results-table .model-name {
  text-align: left;
  color: var(--ink);
  font-weight: 720;
  vertical-align: middle;
}

.results-table .variant {
  text-align: left;
  color: var(--muted);
  font-weight: 650;
}

.results-table .sep {
  border-left: 2px solid #c4d0dd;
}

.results-table .gd {
  border-right: 1px solid var(--line);
}

.results-table .delta {
  color: var(--coral);
  font-weight: 760;
}

.results-table .multi {
  color: var(--green);
  font-weight: 760;
}

.results-table .avg {
  background: rgba(47, 102, 193, 0.06);
}

.results-table thead .avg {
  background: rgba(47, 102, 193, 0.12);
}

.media-panel {
  min-width: 0;
}

.video-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #244c39;
  background:
    linear-gradient(135deg, rgba(47, 143, 104, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(214, 95, 73, 0.13), transparent 44%),
    #ffffff;
  box-shadow: 0 16px 48px rgba(27, 39, 55, 0.08);
  font-weight: 760;
  text-align: center;
}

.media-panel p {
  margin-top: 18px;
}

.resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.resource-list a {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
}

.citation-box {
  position: relative;
  min-width: 0;
}

.copy-button {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 1;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--surface);
  background: #2f66c1;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.copy-button:hover {
  background: var(--blue-dark);
}

pre {
  margin: 0;
  padding: 62px 22px 22px;
  overflow-x: auto;
  border-radius: var(--radius);
  color: #e7edf5;
  background: #172033;
  font-size: 14px;
  line-height: 1.6;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.copy-status {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 720;
}

.acknowledgements {
  padding-bottom: 86px;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.footer p {
  margin: 0;
}

/* Case study carousel */
.carousel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  outline: none;
}

.carousel-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  padding: 0 2px;
}

.carousel-slide img {
  width: 100%;
  max-height: 66vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.carousel-slide figcaption {
  margin-top: 14px;
}

.case-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case-badge-error {
  color: #8c2f1f;
  background: rgba(214, 95, 73, 0.14);
}

.case-badge-good {
  color: #1d6347;
  background: rgba(47, 143, 104, 0.16);
}

.carousel-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(27, 39, 55, 0.1);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.carousel-arrow:hover {
  border-color: #b9c8d8;
  color: var(--blue);
  transform: translateY(-1px);
}

.carousel-arrow span {
  display: block;
  margin-top: -3px;
}

.carousel-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-dot:hover {
  background: #b9c8d8;
}

.carousel-dot.is-active {
  background: var(--blue);
  transform: scale(1.3);
}

.carousel-counter {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.carousel-resources {
  justify-content: center;
  margin-top: 26px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(16, 24, 40, 0.88);
}

.lightbox.is-open {
  display: grid;
}

.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  color: var(--blue);
}

@media (max-width: 860px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
  }

  .nav-links {
    width: 100%;
    gap: 8px 14px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    padding-top: 58px;
  }

  .section-shell {
    padding: 56px 0;
  }

  .content-grid,
  .highlights,
  .method-flow,
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  .section-shell,
  .nav {
    width: min(100% - 24px, var(--max-width));
  }

  .resource-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .action-button {
    justify-content: center;
    width: 100%;
  }

  .authors {
    align-items: center;
    flex-direction: column;
    gap: 4px;
  }

  .copy-button {
    position: static;
    margin-bottom: 10px;
  }

  pre {
    padding: 18px;
  }

  .carousel {
    gap: 8px;
  }

  .carousel-arrow {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .carousel-slide img {
    max-height: 56vh;
  }

  .results-table th,
  .results-table td {
    padding: 7px 8px;
    font-size: 12px;
  }
}
