:root {
  --ink: #18202c;
  --muted: #5d6878;
  --line: #d9dee7;
  --paper: #ffffff;
  --wash: #f6f7fb;
  --blue: #2356c4;
  --teal: #0f766e;
  --amber: #b45309;
  --rose: #be123c;
  --shadow: 0 18px 50px rgba(24, 32, 44, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 100%;
  height: 3px;
  background: transparent;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

a {
  color: inherit;
  text-decoration: none;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

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

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

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

nav a.active {
  color: var(--blue);
  font-weight: 800;
}

main {
  overflow: hidden;
}

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 24px 32px;
  text-align: center;
  animation: hero-rise 700ms ease-out both;
}

.hero-logo {
  width: min(300px, 68vw);
  margin: 0 auto 24px;
}

.hero .eyebrow {
  margin-top: 22px;
  font-size: clamp(18px, 2.4vw, 22px);
  text-transform: none;
}

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

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

h1 {
  max-width: 930px;
  margin: 0 auto;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

h1 span:last-child {
  overflow-wrap: normal;
  white-space: nowrap;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.2;
}

.subtitle {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 22px);
}

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

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

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

.button:hover {
  border-color: rgba(35, 86, 196, 0.42);
  box-shadow: 0 10px 24px rgba(35, 86, 196, 0.16);
  transform: translateY(-2px);
}

.button.disabled {
  color: #8a94a3;
  cursor: not-allowed;
}

.draft-note {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--amber);
  font-size: 14px;
}

figure,
.table-wrap,
.demo-card,
.citation pre {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

figure img {
  cursor: zoom-in;
  transition: transform 220ms ease;
}

figure:hover img {
  transform: scale(1.012);
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 78px 24px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 92px;
}

.jump-target {
  scroll-margin-top: 86px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section.narrow {
  max-width: 870px;
}

.section-intro {
  max-width: 760px;
  margin-bottom: 28px;
}

.section p {
  color: var(--muted);
  font-size: 17px;
}

.paradigm {
  color: var(--blue);
}

figure {
  margin: 0;
  overflow: hidden;
}

figure img {
  width: 100%;
}

figcaption {
  padding: 12px 14px 16px;
  color: var(--muted);
  font-size: 14px;
}

.wide-figure {
  background: #fff;
}

.wide-figure img {
  max-height: 78vh;
  object-fit: contain;
}

.case-heading {
  display: flex;
  max-width: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.case-heading > div:first-child {
  max-width: 760px;
}

.language-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(24, 32, 44, 0.08);
}

.language-toggle button {
  min-width: 58px;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.language-toggle button:hover {
  color: var(--blue);
}

.language-toggle button.active {
  background: var(--blue);
  color: #fff;
  transform: translateY(-1px);
}

.case-figure img {
  max-height: none;
}

#evaluation {
  display: block;
  max-width: 1360px;
}

#evaluation > div {
  max-width: 760px;
  margin-bottom: 28px;
}

#evaluation .result-table img {
  width: 100%;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 34px;
  align-items: start;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

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

th {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

.demo-console {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 1360px;
  margin-top: 28px;
}

#demos {
  max-width: 1420px;
}

.demo-menu,
.demo-stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.demo-stage {
  min-width: 0;
  overflow: hidden;
}

.featured-demo {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050814;
}

.featured-demo video {
  display: block;
  width: 100%;
  height: 100%;
  background: #050814;
  object-fit: contain;
  transition: opacity 180ms ease, transform 180ms ease;
}

.featured-demo.is-switching video {
  opacity: 0.22;
  transform: translateY(8px) scale(0.985);
}

.demo-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  padding: 10px;
}

.demo-option {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 5px 10px;
  width: 100%;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.demo-option::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  content: "";
}

.demo-option:hover,
.demo-option:focus-visible {
  border-color: rgba(35, 86, 196, 0.32);
  outline: 0;
  transform: translateX(2px);
}

.demo-option.active {
  border-color: rgba(35, 86, 196, 0.42);
  background: rgba(35, 86, 196, 0.07);
  box-shadow: 0 12px 28px rgba(35, 86, 196, 0.12);
}

.demo-option.active::before {
  background: var(--blue);
}

.demo-option span {
  grid-row: span 2;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.demo-option strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.22;
}

.demo-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-option.active strong,
.demo-option.active span,
.demo-option.active small {
  color: var(--blue);
}

.demo-details {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(320px, 1.2fr);
  grid-template-rows: auto auto 1fr;
  gap: 4px 36px;
  min-height: 180px;
  padding: 26px 30px;
  border-top: 1px solid var(--line);
  transition: opacity 180ms ease, transform 180ms ease;
}

.demo-details.is-switching {
  opacity: 0.22;
  transform: translateY(8px);
}

.demo-details h3 {
  margin-bottom: 10px;
  font-size: clamp(22px, 2.2vw, 30px);
}

.demo-details p:not(.section-kicker) {
  color: var(--muted);
  font-size: 16px;
}

#featured-demo-copy {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  margin: 0;
  padding-left: 32px;
  border-left: 1px solid var(--line);
}

.demo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

.demo-meta span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(35, 86, 196, 0.22);
  border-radius: 999px;
  background: rgba(35, 86, 196, 0.07);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.demo-card {
  overflow: hidden;
}

.demo-card img,
.demo-card video,
.demo-slot {
  width: 100%;
  height: 230px;
  border-bottom: 1px solid var(--line);
}

.demo-card video {
  display: block;
  background: #050814;
  object-fit: contain;
}

.demo-card img {
  object-fit: cover;
  object-position: top;
}

.demo-slot {
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(35, 86, 196, 0.08), rgba(15, 118, 110, 0.1)),
    repeating-linear-gradient(45deg, transparent 0 13px, rgba(24, 32, 44, 0.04) 13px 14px);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.demo-card div {
  padding: 18px;
}

.citation pre {
  overflow-x: auto;
  padding: 18px;
  color: #263244;
  font-size: 14px;
  line-height: 1.55;
}

.copy-status {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--teal);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 22px;
  background: rgba(9, 14, 24, 0.88);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  align-self: center;
  justify-self: center;
  max-width: 96vw;
  max-height: 82vh;
  border-radius: 8px;
  background: #fff;
}

.lightbox p {
  max-width: 980px;
  margin: 0 auto;
  color: #e9eef7;
  text-align: center;
}

.lightbox-close {
  justify-self: end;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

footer {
  padding: 28px 24px 44px;
  color: var(--muted);
  text-align: center;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@media (max-width: 860px) {
  .jump-target {
    scroll-margin-top: 132px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    padding-top: 48px;
  }

  .split-section,
  .demo-console {
    grid-template-columns: 1fr;
  }

  .demo-details {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  #featured-demo-copy {
    grid-column: 1;
    grid-row: auto;
    margin-top: 16px;
    padding-top: 18px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .demo-menu {
    max-height: none;
  }

  .case-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .split-section {
    gap: 22px;
  }

  .demo-card img {
    height: 260px;
  }
}

@media (max-width: 520px) {
  .topbar,
  .hero,
  .section {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 30px;
  }

  .button {
    width: 100%;
  }

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

@media (max-width: 380px) {
  h1 {
    font-size: 26px;
  }
}
