/* ==========================================================================
   Aptlab — design tokens
   Dark is the default; light is a full first-class theme, not an inversion.
   ========================================================================== */

:root {
  --mint-400: #3ddc97;
  --mint-500: #22c98a;
  --mint-050: rgba(61, 220, 151, 0.1);
  --peri-400: #8b9bff;
  --peri-500: #6c7cf5;
  --amber-400: #f5b64e;
  --rose-400: #f4718b;

  --bg: #08090d;
  --bg-elevated: #0e1016;
  --surface: #12141c;
  --surface-2: #171a24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef0f6;
  --text-muted: #9ba2b4;
  --text-faint: #6b7183;
  --accent: var(--mint-400);
  --accent-ink: #04120b;
  --link: var(--peri-400);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 2px 10px -4px rgba(0, 0, 0, 0.5);
  --grid-line: rgba(255, 255, 255, 0.035);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --maxw: 1140px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f8;
  --border: rgba(12, 16, 32, 0.1);
  --border-strong: rgba(12, 16, 32, 0.18);
  --text: #14161f;
  --text-muted: #565d70;
  --text-faint: #838a9c;
  --accent: var(--mint-500);
  --accent-ink: #032013;
  --link: var(--peri-500);
  --shadow-lg: 0 24px 50px -24px rgba(16, 20, 40, 0.22);
  --shadow-sm: 0 1px 3px rgba(16, 20, 40, 0.08);
  --grid-line: rgba(12, 16, 32, 0.04);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fbfbfd;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --border: rgba(12, 16, 32, 0.1);
    --border-strong: rgba(12, 16, 32, 0.18);
    --text: #14161f;
    --text-muted: #565d70;
    --text-faint: #838a9c;
    --accent: var(--mint-500);
    --accent-ink: #032013;
    --link: var(--peri-500);
    --shadow-lg: 0 24px 50px -24px rgba(16, 20, 40, 0.22);
    --shadow-sm: 0 1px 3px rgba(16, 20, 40, 0.08);
    --grid-line: rgba(12, 16, 32, 0.04);
    color-scheme: light;
  }
}

/* --------------------------------------------------------------- reset --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 640;
}

p { margin: 0; }
img, svg { max-width: 100%; display: block; }

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code, pre, kbd {
  font-family: var(--mono);
  font-size: 0.875em;
  font-variant-ligatures: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--mint-050);
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- layout --- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: clamp(64px, 9vw, 112px);
}

.section--tight { padding-block: clamp(48px, 6vw, 72px); }

.section-head {
  max-width: 660px;
  margin-bottom: 48px;
}

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

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.h2 { font-size: clamp(28px, 4vw, 40px); }
.h3 { font-size: clamp(20px, 2.4vw, 24px); }

.lede {
  color: var(--text-muted);
  font-size: clamp(16px, 1.6vw, 18px);
  margin-top: 16px;
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 0;
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease,
    opacity 0.16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  --btn-border: var(--accent);
  font-weight: 620;
}
.btn--primary:hover { --btn-bg: var(--mint-500); --btn-border: var(--mint-500); }

.btn--ghost { --btn-bg: var(--surface); }
.btn--ghost:hover { --btn-bg: var(--surface-2); --btn-border: var(--border-strong); }

.btn--sm { padding: 7px 13px; font-size: 13.5px; }
.btn--lg { padding: 14px 26px; font-size: 16px; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* --------------------------------------------------------------- chips --- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 540;
  white-space: nowrap;
}

.chip--accent {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--mint-050);
  color: var(--accent);
}

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.dot--pulse { animation: pulse 2.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--mint-050); }
  50% { opacity: 0.65; box-shadow: 0 0 0 5px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------- header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 660;
  font-size: 17px;
  letter-spacing: -0.02em;
  flex: none;
}
.brand:hover { text-decoration: none; }

.brand__mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--mint-400), var(--peri-400));
  display: grid;
  place-items: center;
  color: #04120b;
  font-size: 15px;
  font-weight: 800;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

.nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 520;
}
.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.nav a[aria-current="page"] { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav {
    position: absolute;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 10px 16px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .nav:not([data-open="true"]) { display: none; }
  .nav a { padding: 11px 12px; font-size: 15.5px; }
  .nav-toggle { display: grid; }
  .header-actions .btn--nav { display: none; }
}

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

.hero {
  position: relative;
  padding-top: clamp(56px, 8vw, 96px);
  padding-bottom: clamp(48px, 7vw, 88px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  top: -280px; left: 50%;
  width: 900px; height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--mint-400) 14%, transparent),
    transparent 68%
  );
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(34px, 5.6vw, 58px);
  letter-spacing: -0.035em;
  margin-top: 20px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--mint-400), var(--peri-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  color: var(--text-muted);
  font-size: clamp(16px, 1.9vw, 19px);
  margin-top: 20px;
  max-width: 54ch;
}

.hero .btn-row { margin-top: 32px; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

/* -------------------------------------------------------- demo widget --- */

.demo {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.demo__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-faint);
}

.demo__bar .lights { display: flex; gap: 6px; margin-right: 6px; }
.demo__bar .lights i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.demo__body { padding: 18px; }

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.input,
.select,
textarea.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input::placeholder { color: var(--text-faint); }
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--mint-050);
}

.select {
  font-family: var(--font);
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 51%, calc(100% - 13px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.input-row {
  display: flex;
  gap: 8px;
}
.input-row .input { flex: 1; min-width: 0; }

.demo__samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.sample {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
}
.sample:hover { border-color: var(--accent); color: var(--accent); }

.demo__out {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ------------------------------------------------------------ verdict --- */

.verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.verdict__icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  flex: none;
}

.verdict--valid { border-color: color-mix(in srgb, var(--mint-400) 45%, transparent); }
.verdict--valid .verdict__icon { background: var(--mint-050); color: var(--accent); }
.verdict--invalid { border-color: color-mix(in srgb, var(--rose-400) 45%, transparent); }
.verdict--invalid .verdict__icon {
  background: color-mix(in srgb, var(--rose-400) 14%, transparent);
  color: var(--rose-400);
}
.verdict--idle { color: var(--text-faint); }
.verdict--idle .verdict__icon { background: var(--surface-2); color: var(--text-faint); }

.verdict__title { font-weight: 620; font-size: 15px; }
.verdict__meta { font-size: 13px; color: var(--text-muted); }

.meter {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 10px;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.meter--low i { background: var(--rose-400); }
.meter--mid i { background: var(--amber-400); }

/* ------------------------------------------------------------- checks --- */

.checks {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.checks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: var(--surface);
  font-size: 13.5px;
}

.checks li b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-muted);
}

.checks li span.state { margin-left: auto; font-weight: 600; font-size: 12.5px; }
.state--pass { color: var(--accent); }
.state--fail { color: var(--rose-400); }
.state--skip { color: var(--text-faint); }

.kv {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 14px;
  font-size: 13.5px;
}
.kv dt, .kv dd {
  margin: 0;
  padding: 9px 13px;
  background: var(--surface);
}
.kv dt { color: var(--text-muted); font-size: 12.5px; }
.kv dd { font-family: var(--mono); font-size: 12.5px; word-break: break-word; }

/* --------------------------------------------------------------- code --- */

.code {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}

.code__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.code__title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

.code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}

.code pre::-webkit-scrollbar { height: 8px; }
.code pre::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.copy {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  flex: none;
}
.copy:hover { color: var(--text); border-color: var(--border-strong); }
.copy[data-done="true"] { color: var(--accent); border-color: var(--accent); }

/* token colours */
.t-key { color: var(--peri-400); }
.t-str { color: var(--mint-400); }
.t-num { color: var(--amber-400); }
.t-bool { color: var(--rose-400); }
.t-null { color: var(--text-faint); }
.t-punc { color: var(--text-faint); }
.t-cmt { color: var(--text-faint); font-style: italic; }
.t-fn { color: var(--peri-400); }

/* --------------------------------------------------------------- tabs --- */

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.tabs button {
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 540;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button[aria-selected="true"] {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.tabpanel[hidden] { display: none; }

/* -------------------------------------------------------------- cards --- */

.grid {
  display: grid;
  gap: 16px;
}
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.card--hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 14.5px; }

.card__icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--mint-050);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

/* --------------------------------------------------------- steps rail --- */

.steps {
  counter-reset: step;
  display: grid;
  gap: 20px;
}

.step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: start;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--mint-050);
  color: var(--accent);
  font-size: 14px;
  font-weight: 680;
}

.step h3 { font-size: 16px; margin-bottom: 4px; }
.step p { color: var(--text-muted); font-size: 14.5px; }

/* ---------------------------------------------------------- type grid --- */

.cat {
  margin-top: 34px;
}
.cat__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.cat__head h3 { font-size: 15px; }
.cat__head span { font-size: 13px; color: var(--text-faint); }

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 10px;
}

.type {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.type:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--surface-2);
  text-decoration: none;
}
.type strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); }
.type code {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------- stats --- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stat {
  padding: 22px;
  background: var(--surface);
  text-align: center;
}
.stat b {
  display: block;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 680;
  letter-spacing: -0.03em;
}
.stat span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ pricing --- */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(266px, 1fr));
  gap: 16px;
  align-items: start;
}

.plan {
  position: relative;
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.plan--featured {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(180deg, var(--mint-050), transparent 46%), var(--surface);
}

.plan__tag {
  position: absolute;
  top: -11px; left: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-weight: 680;
  letter-spacing: 0.03em;
}

.plan__name { font-size: 15px; font-weight: 620; }
.plan__price {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.plan__price b {
  font-size: 36px;
  font-weight: 680;
  letter-spacing: -0.035em;
}
.plan__price span { color: var(--text-muted); font-size: 14px; }
.plan__desc { color: var(--text-muted); font-size: 14px; }

.plan ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  font-size: 14px;
}
.plan li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--text-muted);
}
.plan li::before {
  content: "";
  width: 15px; height: 15px;
  margin-top: 4px;
  flex: none;
  border-radius: 50%;
  background: var(--mint-050);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233ddc97' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}
.plan .btn { margin-top: auto; width: 100%; }

/* ---------------------------------------------------------------- faq --- */

.faq { display: grid; gap: 1px; background: var(--border); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }

.faq details {
  background: var(--surface);
}
.faq summary {
  padding: 17px 20px;
  cursor: pointer;
  font-weight: 560;
  font-size: 15.5px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-left: auto;
  color: var(--text-faint);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--accent); }
.faq p {
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 14.5px;
  max-width: 74ch;
}

/* --------------------------------------------------------------- cta --- */

.cta {
  position: relative;
  padding: clamp(40px, 6vw, 64px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(140deg, var(--mint-050), transparent 55%), var(--surface);
  text-align: center;
  overflow: hidden;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 48px 32px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(130px, 1fr));
  gap: 32px;
}

.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  font-weight: 640;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--text); }

.footer-note {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 13px;
}

/* ------------------------------------------------------------- notice --- */

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--peri-400) 35%, transparent);
  background: color-mix(in srgb, var(--peri-400) 8%, transparent);
  font-size: 14px;
  color: var(--text-muted);
}
.notice strong { color: var(--text); }
.notice--warn {
  border-color: color-mix(in srgb, var(--amber-400) 40%, transparent);
  background: color-mix(in srgb, var(--amber-400) 9%, transparent);
}

/* =========================================================== playground = */

.pg {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-block: 36px 72px;
}

@media (max-width: 940px) {
  .pg { grid-template-columns: 1fr; }
  .pg__aside { position: static !important; max-height: none !important; }
}

.pg__aside {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 14px;
}

.pg__search { margin-bottom: 12px; }
.pg__search .input { font-family: var(--font); font-size: 13.5px; padding: 9px 12px; }

.pg__group { margin-bottom: 14px; }
.pg__group > h4 {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 6px 6px;
  font-weight: 640;
}

.pg__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}
.pg__item:hover { background: var(--surface-2); color: var(--text); }
.pg__item[aria-current="true"] {
  background: var(--mint-050);
  color: var(--accent);
  font-weight: 580;
}

.pg__main { display: grid; gap: 20px; min-width: 0; }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.panel__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.panel__head h2 { font-size: 17px; }
.panel__head p { font-size: 13.5px; color: var(--text-muted); width: 100%; }
.panel__body { padding: 20px; }

.opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.opts:empty { display: none; }

/* Excludes .switch — a bare `.opt label` rule outranks `.switch` on
   specificity and would flatten the toggle back to a block. */
.opt label:not(.switch) { display: block; }
.opt .field-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text-muted); }
.opt .input { font-family: var(--font); font-size: 14px; }

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
}
/* Scoped to .switch so the hidden input cannot escape to another ancestor. */
.switch input {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.switch i {
  box-sizing: border-box;
  flex: 0 0 36px;
  width: 36px; height: 21px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.switch input:disabled ~ span { opacity: 0.65; }
.switch i::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.16s ease, background 0.16s ease;
}
.switch input:checked + i { background: var(--mint-050); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(15px); background: var(--accent); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.batch-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.batch-summary div { padding: 12px; background: var(--surface); text-align: center; }
.batch-summary b { display: block; font-size: 20px; font-weight: 660; }
.batch-summary span { font-size: 12px; color: var(--text-muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td code { font-size: 12.5px; }
td.wrap-cell { white-space: normal; min-width: 200px; }

/* ================================================================= docs = */

.docs {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-block: 36px 80px;
}

@media (max-width: 940px) {
  .docs { grid-template-columns: 1fr; gap: 24px; }
  .docs__aside { position: static !important; max-height: none !important; }
}

.docs__aside {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.docs__aside h4 {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 20px 0 8px;
  font-weight: 640;
}
.docs__aside h4:first-child { margin-top: 0; }
.docs__aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.docs__aside a {
  display: block;
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 14px;
  border-left: 2px solid transparent;
}
.docs__aside a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.docs__aside a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--mint-050);
}

.docs__main { min-width: 0; display: grid; gap: 44px; }

/* Grid items default to min-width:auto, so a wide <pre> would stretch the
   column past the page instead of scrolling inside its own container. */
.docs__main > *,
.pg__main > * { min-width: 0; }

.doc-sec > h2 {
  font-size: clamp(24px, 3vw, 30px);
  scroll-margin-top: 90px;
}
.doc-sec > h3 {
  font-size: 18px;
  margin-top: 30px;
  scroll-margin-top: 90px;
}
.doc-sec p { color: var(--text-muted); margin-top: 12px; max-width: 76ch; }
.doc-sec > .code, .doc-sec > .table-wrap, .doc-sec > .notice, .doc-sec > .tabs { margin-top: 16px; }
.doc-sec ul, .doc-sec ol { color: var(--text-muted); margin-top: 12px; padding-left: 22px; max-width: 76ch; }
.doc-sec li { margin-bottom: 7px; }
.doc-sec code:not(pre code) {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13.5px;
}
.method {
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex: none;
}
.method--get { background: var(--mint-050); color: var(--accent); }
.method--post {
  background: color-mix(in srgb, var(--peri-400) 15%, transparent);
  color: var(--peri-400);
}
.method--del {
  background: color-mix(in srgb, var(--rose-400) 15%, transparent);
  color: var(--rose-400);
}

.anchor {
  color: var(--text-faint);
  margin-left: 8px;
  font-weight: 400;
  opacity: 0;
  font-size: 0.75em;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* ------------------------------------------------------------- toasts --- */

.toast {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

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

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}
