:root {
  color-scheme: light;
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;
  --blue-soft: #eff6ff;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --surface: #f8fafc;
  --white: #ffffff;
  --green: #15803d;
  --purple: #7e22ce;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
}

button,
select,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.archive-banner {
  color: #eef2ff;
  background: linear-gradient(110deg, #172554, #312e81 52%, #4c1d95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.archive-banner__inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 10px;
}

.archive-banner__badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-banner p {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
}

.archive-banner a {
  flex: 0 0 auto;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  backdrop-filter: blur(18px);
}

.site-nav__inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav__links a {
  color: #475467;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav__links a:hover {
  color: var(--blue);
}

.hero {
  min-height: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 76px 104px;
  text-align: center;
}

.hero__logo {
  width: min(410px, 80vw);
  max-height: 180px;
  object-fit: contain;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 6.6rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.84;
}

.hero h1 span {
  display: block;
}

.hero__eyebrow {
  margin: 44px 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  font-weight: 850;
  letter-spacing: -0.035em;
}

.hero__copy {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.24);
}

.button--primary:hover {
  background: #1e40af;
}

.button--secondary {
  color: #344054;
  background: #fff;
  border-color: #d0d5dd;
}

.button--secondary:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.section {
  padding-block: 90px;
}

.section-heading {
  max-width: 740px;
  margin-bottom: 42px;
}

.section-heading--centered {
  margin-inline: auto;
  text-align: center;
}

.kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-heading h2,
.closing h2 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

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

.video-frame {
  position: relative;
  overflow: hidden;
  width: min(920px, 100%);
  aspect-ratio: 16 / 9;
  margin-inline: auto;
  border: 1px solid #d0d5dd;
  border-radius: 16px;
  background: #111827;
  box-shadow: var(--shadow);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

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

.feature-card {
  overflow: hidden;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.feature-card h3 {
  margin: 13px 0 4px;
  font-size: 1.8rem;
  letter-spacing: -0.035em;
}

.feature-card p {
  min-height: 52px;
  margin: 0 0 24px;
  color: var(--muted);
}

.feature-card img {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.feature-card--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  align-items: center;
  gap: 40px;
}

.pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

.pill--visual {
  color: var(--green);
  background: #dcfce7;
}

.pill--analytical {
  color: var(--purple);
  background: #f3e8ff;
}

.pill--data {
  color: #0369a1;
  background: #e0f2fe;
}

.lab-section {
  padding-block: 100px;
  color: #f8fafc;
  background:
    radial-gradient(circle at 5% 5%, rgba(59, 130, 246, 0.22), transparent 32%),
    radial-gradient(circle at 95% 65%, rgba(124, 58, 237, 0.2), transparent 35%),
    #0f172a;
}

.section-heading--light .kicker {
  color: #93c5fd;
}

.section-heading--light > p:last-child {
  color: #b8c2d3;
}

.lab {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.lab__toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.lab__toolbar label {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lab select {
  width: 100%;
  min-height: 44px;
  padding-inline: 12px;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #1e293b;
}

.opacity-control output {
  color: #fff;
}

.opacity-control input {
  width: 100%;
  accent-color: #60a5fa;
}

.mode-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.035);
}

.mode-tab {
  flex: 0 0 auto;
  padding: 8px 13px;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
}

.mode-tab:hover,
.mode-tab.is-active {
  color: #0f172a;
  border-color: #fff;
  background: #fff;
}

.canvas-shell {
  position: relative;
  min-height: 320px;
  background:
    linear-gradient(45deg, #172033 25%, transparent 25%),
    linear-gradient(-45deg, #172033 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #172033 75%),
    linear-gradient(-45deg, transparent 75%, #172033 75%),
    #111827;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

#comparison-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.canvas-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.82);
  font-weight: 700;
}

.canvas-loading[hidden] {
  display: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  min-height: 58px;
  align-items: center;
  padding: 14px 24px;
  color: #cbd5e1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend__swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--swatch);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metrics article {
  display: grid;
  gap: 3px;
  padding: 26px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.metrics article:last-child {
  border-right: 0;
}

.metrics span,
.metrics small {
  color: #94a3b8;
}

.metrics span {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metrics strong {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
}

.metrics small {
  font-size: 0.75rem;
}

.metric--accent strong {
  color: #86efac;
}

.matrix-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(540px, 1.35fr);
  gap: 34px;
  padding: 34px 24px;
}

.matrix-panel h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.matrix-panel > div:first-child > p:last-child {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.matrix-scroll {
  overflow-x: auto;
}

.confusion-matrix {
  width: 100%;
  min-width: 540px;
  border-collapse: separate;
  border-spacing: 3px;
  font-size: 0.7rem;
}

.confusion-matrix th {
  max-width: 72px;
  overflow: hidden;
  padding: 4px;
  color: #94a3b8;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confusion-matrix th:first-child {
  text-align: right;
}

.confusion-matrix td {
  min-width: 46px;
  height: 38px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #f8fafc;
  background: rgba(59, 130, 246, var(--heat));
  text-align: center;
}

.confusion-matrix td.is-diagonal {
  background: rgba(34, 197, 94, var(--heat));
}

.closing {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 36px;
}

.closing > img {
  width: 90px;
}

.closing h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.closing .button {
  white-space: nowrap;
}

.footer {
  color: #94a3b8;
  background: #111827;
}

.footer__inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.82rem;
}

.footer__inner div {
  display: flex;
  gap: 20px;
}

.footer a:hover {
  color: #fff;
}

@media (max-width: 820px) {
  .archive-banner__inner {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-block: 12px;
  }

  .archive-banner p {
    flex-basis: calc(100% - 140px);
  }

  .archive-banner a {
    margin-left: 140px;
  }

  .site-nav__links a:not(:last-child) {
    display: none;
  }

  .hero {
    min-height: 590px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card--wide {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .lab__toolbar,
  .matrix-panel {
    grid-template-columns: 1fr;
  }

  .metrics article {
    padding: 18px;
  }

  .closing {
    grid-template-columns: 70px 1fr;
  }

  .closing > img {
    width: 70px;
  }

  .closing .button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .archive-banner__badge {
    margin-bottom: 2px;
  }

  .archive-banner p,
  .archive-banner a {
    flex-basis: 100%;
    margin-left: 0;
  }

  .site-nav__links a:last-child {
    font-size: 0.8rem;
  }

  .hero {
    min-height: 520px;
    padding-block: 54px 74px;
  }

  .hero__logo {
    width: 66vw;
  }

  .hero h1 {
    font-size: clamp(3rem, 16vw, 4.6rem);
  }

  .section,
  .lab-section {
    padding-block: 68px;
  }

  .feature-card {
    padding: 24px;
  }

  .lab__toolbar {
    padding: 18px;
  }

  .mode-tabs {
    padding-inline: 18px;
  }

  .canvas-shell {
    min-height: 170px;
  }

  .legend {
    padding-inline: 18px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metrics article {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .metrics article:last-child {
    border-bottom: 0;
  }

  .closing {
    grid-template-columns: 1fr;
  }

  .closing > img {
    width: 76px;
  }

  .closing .button {
    grid-column: auto;
  }

  .footer__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 22px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
