/* Design system for the uitest-sdk site. Bun-like: dark, terminal-first,
   big type, one loud accent. No external fonts, no frameworks. */

:root {
  --bg: #0b0c0e;
  --fg: #f4f5f7;
  --muted: #9aa0aa;
  --accent: #ffd23f;
  --card: #14161a;
  --border: #24272e;
  --sans: -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

code,
pre {
  font-family: var(--mono);
}

.section,
.nav,
.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding-top: 96px;
  padding-bottom: 96px;
}

/* The sticky nav must not cover the section a link just jumped to. */
[id] {
  scroll-margin-top: 88px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

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

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

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 56px;
  padding-top: 88px;
  padding-bottom: 88px;
}

.hero-copy {
  min-width: 0;
}

.hero-kicker {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero-tagline {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 17px;
  color: var(--accent);
}

.hero-sub {
  margin: 16px 0 0;
  max-width: 34em;
  color: var(--muted);
}

.hero-sub code {
  color: var(--fg);
  font-size: 0.92em;
}

.install {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 10px 12px 10px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 15px;
}

.install code {
  color: var(--fg);
}

.install button {
  cursor: pointer;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.hero-shot {
  margin: 0;
  justify-self: center;
}

.hero-shot img {
  display: block;
  width: min(100%, 330px);
  height: auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* -------------------------------------------------------------- terminal */

.term {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.term-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.term-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border);
}

.term-body {
  margin: 0;
  padding: 22px 24px 26px;
  font-size: 15px;
  line-height: 1.9;
  overflow-x: auto;
}

.term-line {
  display: block;
  white-space: pre;
  min-height: 1.9em;
}

.term-line[data-kind="cmd"] {
  color: var(--fg);
}

.term-line[data-kind="ok"] {
  color: #7ee787;
}

/* ------------------------------------------------------------ bench table */

.bench h2,
.features h2,
.terminal h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.01em;
}

.section-lede {
  margin: 14px 0 0;
  color: var(--muted);
  max-width: 46em;
}

.table-wrap {
  margin-top: 32px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

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

th,
td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

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

td:nth-child(3) {
  font-family: var(--mono);
  color: var(--accent);
}

.table-note {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.table-note a {
  color: var(--fg);
}

/* The SDK-vs-CLI table leads with the SDK column and ends on the ratio, so
   the accent moves there: green-ish SDK, muted CLI, loud multiple. */
.table-compare td:nth-child(2) {
  font-family: var(--mono);
  color: #7ee787;
}

.table-compare td:nth-child(3) {
  font-family: var(--mono);
  color: var(--muted);
}

.table-compare td:nth-child(4) {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
}

.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.bench-card {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.bench-card h3 {
  margin: 0;
  font-size: 17px;
}

.bench-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--muted);
}

.bench-card li + li {
  margin-top: 8px;
}

.bench-card code {
  font-size: 0.92em;
  color: var(--fg);
}

/* ------------------------------------------------------------- showcase */

.showcase h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.01em;
}

/* The two screenshots are wide (1020 and 1280 px of real UI). Shrinking them
   to phone width would make every label a smudge, so below 760 px the frame
   scrolls sideways instead — same choice as the pipeline diagram. */
.shot {
  margin: 32px 0 0;
}

.shot-scroll {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}

.shot-frame {
  position: relative;
  line-height: 0;
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* One absolutely-positioned layer over the real screenshot. The rectangles
   are percentages measured from the live DOM, so they land on the row and the
   box that the picture shows at any width. */
.shot-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hl {
  position: absolute;
  border-radius: 4px;
  opacity: 0;
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  box-shadow: 0 0 0 1.5px var(--accent);
  transition: opacity 0.3s ease;
}

.hl.is-on {
  opacity: 1;
}

.hl-box {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 2px;
}

.shot-scroll-hint {
  display: none;
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.shot figcaption {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
}

.shot-title {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.shot-title code {
  color: var(--fg);
  font-size: 0.95em;
}

.shot-step {
  display: grid;
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* All steps occupy the same grid cell, so the caption never reflows while the
   highlights cycle. Only the active one is painted. */
.shot-step span {
  display: block;
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.shot-step span.is-on {
  opacity: 1;
}

@media (max-width: 760px) {
  .shot-scroll {
    overflow-x: auto;
  }

  .shot-frame {
    min-width: 720px;
  }

  .shot-scroll-hint {
    display: block;
  }
}

/* ------------------------------------------------------------ card grid */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.card {
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.card h3 {
  margin: 0;
  font-size: 17px;
}

.card p {
  margin: 10px 0 0;
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- arch */

.arch h2,
.video h2,
.limits h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.01em;
}

.arch-figure {
  margin-top: 32px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.arch-svg {
  display: block;
  width: 100%;
  height: auto;
}

.arch-svg text {
  font-family: var(--sans);
  fill: var(--fg);
}

.arch-svg .sub {
  font-family: var(--mono);
  fill: var(--muted);
}

.arch-svg .node {
  fill: var(--bg);
  stroke: var(--border);
}

.arch-svg .link {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.arch-svg .node-accent {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.arch-svg .link-accent {
  stroke: var(--accent);
}

/* ---------------------------------------------------------- codec section */

.codec h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.01em;
}

.codec .section-lede strong {
  color: var(--fg);
  font-weight: 600;
}

.codec-scroll-hint {
  display: none;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* The pipeline diagram has three labelled lanes; at phone width its 12px
   labels collapse to a smudge. Scroll it sideways instead of shrinking it,
   which keeps the arrows and the lane contrast legible. */
@media (max-width: 720px) {
  .codec .arch-figure {
    overflow-x: auto;
  }

  .codec .arch-svg {
    min-width: 760px;
  }

  .codec-scroll-hint {
    display: block;
  }
}

/* Five columns of prose do not fit the global nowrap rule, and the generic
   `td:nth-child(3)` accent would paint the wrong competitor. Give this table
   its own column treatment: wrap freely, and only the SDK column is loud. */
.table-codec {
  font-size: 14px;
  min-width: 680px;
}

.table-codec th,
.table-codec td {
  white-space: normal;
  vertical-align: top;
  padding: 12px 16px;
}

.table-codec th:first-child,
.table-codec td:first-child {
  min-width: 104px;
}

.table-codec td:nth-child(2),
.table-codec td:nth-child(3),
.table-codec td:nth-child(4) {
  color: var(--muted);
  font-family: var(--sans);
}

.table-codec td:nth-child(5) {
  color: #7ee787;
  font-family: var(--mono);
  font-size: 13px;
}

.table-codec code {
  font-size: 0.92em;
  color: inherit;
}

/* Three short columns fit a phone if the labels wrap; only the numbers stay
   on one line. The accent belongs on the share-of-budget column. */
.table-budget {
  table-layout: fixed;
}

.table-budget th,
.table-budget td {
  white-space: normal;
  vertical-align: top;
}

.table-budget th:nth-child(1),
.table-budget td:nth-child(1) {
  width: 42%;
}

.table-budget th:nth-child(2),
.table-budget td:nth-child(2) {
  width: 31%;
}

.table-budget th:nth-child(3),
.table-budget td:nth-child(3) {
  width: 27%;
}

.table-budget td:nth-child(2),
.table-budget td:nth-child(3) {
  font-family: var(--mono);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .table-budget {
    font-size: 13px;
  }

  .table-budget th,
  .table-budget td {
    padding: 12px 10px;
  }
}

.table-budget td:nth-child(2) {
  color: var(--fg);
}

.table-budget td:nth-child(3) {
  color: var(--accent);
}

/* --------------------------------------------------------------- video */

.video video {
  display: block;
  width: 100%;
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #000;
}

/* -------------------------------------------------------------- limits */

.limits-list {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.limits-list li {
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
}

.limits-list strong {
  color: var(--fg);
}

/* -------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--border);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 40px;
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

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

.footer-links a:hover {
  color: var(--fg);
}

/* ------------------------------------------------------- scroll reveal */

@media (prefers-reduced-motion: no-preference) {
  .js-reveal .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.6s ease,
      transform 0.6s ease;
  }

  .js-reveal .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1024px) {
  /* minmax(0, 1fr), not 1fr: an unbreakable line inside the copy column must
     not stretch the grid past the viewport. */
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .hero-shot {
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .nav-links {
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
  }

  .install {
    flex-wrap: wrap;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------- cli */

.cli h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.01em;
}

.cli-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 32px;
  align-items: start;
}

.cli-col {
  min-width: 0;
}

.cli-col .term {
  margin-top: 0;
}

.cli-col h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

/* A fixed first column keeps the command names aligned while the description
   takes the rest of the row. */
.cli-commands td:first-child {
  width: 170px;
}

.cli-points {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14.5px;
}

.cli-points li + li {
  margin-top: 10px;
}

.cli-points strong {
  color: var(--fg);
}

.cli-table td {
  white-space: normal;
  vertical-align: top;
}

/* The global rule accents every third column; in the CLI tables the command
   name (first column) is the one worth marking, and the second column is a
   measurement, so it stays mono and muted. */
.cli-table td:first-child {
  font-family: var(--mono);
  color: #7ee787;
  white-space: nowrap;
}

.cli-table td:nth-child(2) {
  font-family: var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

.cli-table td:nth-child(3) {
  color: inherit;
}

.cli-sub {
  margin: 52px 0 0;
  font-size: 21px;
  font-weight: 600;
}

.cli-code {
  margin: 18px 0 0;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.9;
}

.cli-code code {
  color: var(--fg);
}

.cli-note {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .cli-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------- comparison */
.compare h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.01em;
}

.compare-sub {
  margin: 44px 0 0;
  font-size: 21px;
  font-weight: 600;
}

.table-matrix td,
.table-matrix th {
  white-space: normal;
  vertical-align: top;
}

.table-matrix td {
  font-size: 14px;
  color: var(--muted);
}

.table-matrix td:last-child {
  color: #7ee787;
}

.table-matrix td code {
  font-size: 0.92em;
  color: inherit;
}

/* ------------------------------------------------------------- docs */
.doc-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}

.doc-toc a {
  padding: 7px 0;
  color: var(--muted);
  text-decoration: none;
}

.doc-toc a:hover {
  color: var(--fg);
}

.doc-body {
  min-width: 0;
}

.doc-body h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.02em;
}

.doc-meta {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.doc-meta a {
  color: var(--fg);
}

.doc-body h2 {
  margin: 56px 0 0;
  padding-top: 18px;
  font-size: 27px;
  letter-spacing: -0.01em;
  border-top: 1px solid var(--border);
}

.doc-body h3 {
  margin: 30px 0 0;
  font-size: 18px;
}

/* Marks a section that is on master but not in the published package yet. */
.doc-tag {
  margin-left: 10px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  vertical-align: middle;
}

.doc-body p,
.doc-body li {
  color: var(--muted);
  font-size: 15.5px;
}

.doc-body li + li {
  margin-top: 6px;
}

.doc-body strong {
  color: var(--fg);
}

.doc-body p code,
.doc-body li code,
.doc-body td code {
  padding: 2px 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.9em;
  color: var(--fg);
}

.doc-body pre {
  margin: 18px 0 0;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.75;
}

.doc-body pre code {
  padding: 0;
  background: none;
  border: 0;
  font-size: inherit;
  color: var(--fg);
}

.doc-table {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}

.doc-table table {
  font-size: 14px;
}

.doc-table th,
.doc-table td {
  white-space: normal;
  vertical-align: top;
}

/* The bench table's accent column is global; inside docs every column is
   body text except the first, which is the API name. */
.doc-body td:nth-child(3) {
  color: inherit;
}

.doc-body .note {
  margin: 18px 0 0;
  padding: 12px 16px;
  background: var(--card);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}

.release {
  margin-top: 44px;
}

.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.release-head h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--mono);
  font-size: 30px;
}

.release-date {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.release-tag {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

.release p {
  margin: 12px 0 0;
}

.release h3 {
  margin-top: 26px;
}

/* API page: generated method tables, status pills and the diagrams above them. */
.api-count {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
}

.api-py {
  color: var(--muted);
}

.api-note {
  display: inline-block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.api-status {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.api-status-verified {
  border-color: rgba(126, 231, 135, 0.45);
  color: #7ee787;
}

.api-status-device {
  border-color: rgba(255, 210, 63, 0.4);
  color: var(--accent);
}

.api-status-host {
  color: var(--muted);
}

.api-status-hardware {
  border-color: rgba(158, 178, 255, 0.4);
  color: #9eb2ff;
}

.api-status-unsupported {
  border-color: rgba(255, 122, 122, 0.4);
  color: #ff7a7a;
}

.api-figure {
  margin: 26px 0 0;
  padding: 22px 20px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.api-figure figcaption {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
}

/* The method tables are wide; the wrapper scrolls them on a phone. */
.doc-table td:first-child code {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .doc-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 36px;
  }

  .doc-toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 18px;
  }
}
