:root {
  color-scheme: light;
  --bg: #f8fbff;
  --paper: #ffffff;
  --ink: #17212b;
  --muted: #5b6876;
  --line: #dce6ee;
  --teal: #0e7c78;
  --blue: #245bb3;
  --orange: #c85f13;
  --green: #2e7d52;
  --amber: #b98705;
  --shadow: 0 18px 50px rgba(21, 36, 52, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(232, 244, 255, 0.72), rgba(255, 255, 255, 0.94) 34rem),
    var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--orange));
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.milestone-toast {
  position: fixed;
  top: 5.25rem;
  left: 50%;
  z-index: 45;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(14, 124, 120, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 820;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -0.65rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.milestone-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.finish-celebration {
  position: fixed;
  left: 0;
  bottom: 1.25rem;
  z-index: 45;
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-18rem);
}

.finish-celebration.is-visible {
  animation: catWalk 5.2s ease-in-out both;
}

.finish-message {
  margin-bottom: 4.5rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(36, 91, 179, 0.24);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 850;
  white-space: nowrap;
}

.cat-runner {
  display: block;
  width: 10rem;
  height: auto;
  animation: catBounce 620ms ease-in-out infinite alternate;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 4rem;
  border-bottom: 1px solid rgba(220, 230, 238, 0.72);
  background: rgba(248, 251, 255, 0.88);
  backdrop-filter: blur(16px);
}

.brand,
.site-nav,
.hero-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.55rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
}

.site-nav {
  gap: 1.2rem;
}

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

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

.hero {
  position: relative;
  min-height: 32rem;
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: auto -8rem -2rem auto;
  width: min(62rem, 86vw);
  opacity: 0.28;
  filter: saturate(1.2);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(248, 251, 255, 0.98) 0%, rgba(248, 251, 255, 0.88) 42%, rgba(248, 251, 255, 0.55) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.72));
}

.hero-inner {
  position: relative;
  width: calc(100% - 3rem);
  max-width: 72rem;
  margin: 0 auto;
  padding: 5rem 0 4rem;
}

.eyebrow,
.section-kicker,
.label {
  margin: 0 0 0.8rem;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 54rem;
  margin: 0;
  font-size: 4.6rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.subtitle {
  max-width: 44rem;
  margin: 1.25rem 0 0;
  color: #344252;
  font-size: 1.34rem;
  line-height: 1.42;
}

.authors {
  margin: 1rem 0 0;
  color: var(--muted);
  font-weight: 650;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
  max-width: 28rem;
}

.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9c8d8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 0.72rem 0.95rem;
  font-weight: 760;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  background: #fff;
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.metric-strip {
  width: calc(100% - 3rem);
  max-width: 72rem;
  margin: -2rem auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metric-strip div {
  padding: 1.25rem;
  border-right: 1px solid var(--line);
}

.metric-strip div:last-child {
  border-right: 0;
}

.metric-strip strong {
  display: block;
  font-size: 1.72rem;
  line-height: 1.2;
}

.metric-strip > div > span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.metric-strip strong {
  white-space: nowrap;
}

.metric-strip strong span {
  display: inline;
  color: inherit;
  font-size: inherit;
}

.section {
  width: calc(100% - 3rem);
  max-width: 72rem;
  margin: 0 auto;
  padding: 5.25rem 0;
}

.two-column {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 2rem;
  align-items: center;
}

h2 {
  margin: 0;
  font-size: 2.45rem;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.copy p:not(.section-kicker),
.section-heading p,
.evidence-copy p {
  color: var(--muted);
}

.media-panel,
.wide-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.media-panel img,
.wide-figure img {
  width: 100%;
  border-radius: 8px 8px 0 0;
}

figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.85rem 1rem 1rem;
}

.architecture img {
  padding: 1rem;
}

.spacious-media img {
  padding: 2rem 2rem 1rem;
  background: #fff;
  object-fit: contain;
}

.section-heading {
  max-width: 48rem;
  margin-bottom: 1.7rem;
}

.section-heading.narrow {
  max-width: 42rem;
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.flow-step {
  position: relative;
  min-height: 14rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.flow-step::after {
  content: "";
  position: absolute;
  top: 2.2rem;
  right: -1rem;
  width: 1rem;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--orange));
}

.flow-step:last-child::after {
  display: none;
}

.flow-step span {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.85rem;
  border-radius: 6px;
  background: #e8f5f4;
  color: var(--teal);
  font-weight: 850;
}

.flow-step p,
.result-card p,
.repo-grid p,
.try-card li {
  color: var(--muted);
}

.try-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.try-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.try-card ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
}

.try-card li + li {
  margin-top: 0.65rem;
}

.try-card code {
  color: var(--blue);
  font-weight: 700;
}

.accent-card {
  border-color: rgba(14, 124, 120, 0.34);
  background: linear-gradient(180deg, #ffffff, #f4fbfa);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.result-card,
.repo-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 1.25rem;
}

.result-card dl {
  margin: 1.15rem 0 0;
}

.result-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.result-card dt {
  color: var(--muted);
}

.result-card dd {
  margin: 0;
  font-weight: 850;
}

.footnote {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.figure-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1rem;
  margin-top: 1rem;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.repo-grid code {
  color: var(--blue);
  font-weight: 700;
}

.pr-panel {
  margin-bottom: 1rem;
}

.pr-panel img {
  border-radius: 8px 8px 0 0;
}

.evidence-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 1.5rem;
  align-items: center;
}

.evidence-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.evidence-metrics div {
  min-height: 9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.evidence-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.1;
}

.evidence-metrics span {
  display: block;
  margin-top: 0.75rem;
  color: var(--muted);
}

.cite-section {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  row-gap: 2.35rem;
  align-items: start;
  padding-top: 3rem;
}

.paper-viewer {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.paper-viewer iframe {
  display: block;
  width: 100%;
  height: min(78vh, 54rem);
  border: 0;
  background: #f4f7fa;
}

.copy-button {
  cursor: pointer;
}

pre {
  grid-column: 1 / -1;
  overflow-x: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10202a;
  color: #e9f7ff;
  padding: 1.1rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.final-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding-top: 2.5rem;
}

.final-cta p:not(.section-kicker) {
  max-width: 42rem;
  color: var(--muted);
}

.final-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: calc(100% - 3rem);
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.wandb-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wandb-logo img {
  width: min(13rem, 36vw);
  height: auto;
}

[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 520ms ease, transform 520ms ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes flowPulse {
  0%,
  100% {
    border-color: var(--line);
    transform: translateY(0);
  }
  50% {
    border-color: rgba(14, 124, 120, 0.65);
    transform: translateY(-3px);
  }
}

.flow-step:nth-child(1) {
  animation: flowPulse 5s ease-in-out infinite;
}

.flow-step:nth-child(2) {
  animation: flowPulse 5s ease-in-out 0.5s infinite;
}

.flow-step:nth-child(3) {
  animation: flowPulse 5s ease-in-out 1s infinite;
}

.flow-step:nth-child(4) {
  animation: flowPulse 5s ease-in-out 1.5s infinite;
}

@keyframes catWalk {
  0% {
    opacity: 0;
    transform: translateX(-10rem);
  }
  10% {
    opacity: 1;
    transform: translateX(1rem);
  }
  72% {
    opacity: 1;
    transform: translateX(calc(100vw - 17rem));
  }
  100% {
    opacity: 0;
    transform: translateX(calc(100vw + 4rem));
  }
}

@keyframes catBounce {
  from {
    transform: translateY(0) rotate(-1deg);
  }
  to {
    transform: translateY(-0.28rem) rotate(1.5deg);
  }
}

@media (max-width: 900px) {
  .site-header {
    padding: 0.75rem 1.25rem;
  }

  .site-nav {
    gap: 0.8rem;
  }

  .hero {
    min-height: 30rem;
  }

  .hero-inner {
    width: calc(100% - 2rem);
    max-width: 44rem;
    padding: 4rem 0 3.5rem;
  }

  .hero h1 {
    font-size: 3.2rem;
  }

  .subtitle {
    font-size: 1.12rem;
  }

  .metric-strip,
  .two-column,
  .flow,
  .try-grid,
  .result-grid,
  .figure-grid,
  .repo-grid,
  .evidence-metrics,
  .evidence-section,
  .cite-section,
  .final-cta {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    width: calc(100% - 2rem);
    max-width: 44rem;
    margin-top: -1.25rem;
  }

  .metric-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-strip div:last-child {
    border-bottom: 0;
  }

  .section {
    width: calc(100% - 2rem);
    max-width: 44rem;
    padding: 3.7rem 0;
  }

  h2 {
    font-size: 2rem;
  }

  .flow-step {
    min-height: auto;
  }

  .flow-step::after {
    top: auto;
    right: auto;
    left: 2.25rem;
    bottom: -1rem;
    width: 2px;
    height: 1rem;
  }

  .final-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .hero {
    min-height: 34rem;
  }

  .hero-inner,
  .metric-strip,
  .section,
  .site-footer {
    max-width: 22rem;
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .hero-bg {
    inset: auto -9rem 0 auto;
    width: 44rem;
    opacity: 0.2;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .spacious-media img {
    padding: 1.2rem 1.2rem 0.6rem;
  }

  .cta-row .button {
    width: 100%;
  }

  .paper-viewer iframe {
    height: 28rem;
  }

  .milestone-toast {
    top: 6.8rem;
    width: calc(100% - 2rem);
    text-align: center;
  }

  .finish-celebration {
    bottom: 0.8rem;
  }

  .finish-message {
    margin-bottom: 4.2rem;
  }

  .cat-runner {
    width: 7.5rem;
    transform-origin: bottom right;
  }

  .final-actions .button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    width: calc(100% - 2rem);
    max-width: 44rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }

  .milestone-toast,
  .finish-celebration {
    display: none;
  }
}
