:root {
  --demo-bg: #05060a;
  --demo-bg-raised: #0d0f16;
  --demo-fg: #f2f1ec;
  --demo-fg-muted: #a3a5ad;
  --demo-border: #23252e;
  --demo-accent: #ffc857;
  --demo-accent-contrast: #05060a;
  --demo-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --demo-sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

html[data-theme='light'] {
  --demo-bg: #f5f4ef;
  --demo-bg-raised: #ffffff;
  --demo-fg: #16171c;
  --demo-fg-muted: #5b5d66;
  --demo-border: #ddd9cd;
  --demo-accent: #b5760f;
  --demo-accent-contrast: #fff8ea;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--demo-accent);
  color: var(--demo-accent-contrast);
  padding: 0.75rem 1rem;
  z-index: 100000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

a {
  color: inherit;
}

code {
  font-family: var(--demo-mono);
  background: var(--demo-bg-raised);
  border: 1px solid var(--demo-border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
}

/* --- topbar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--demo-bg) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--demo-border);
}

.topbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--demo-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-size: 1rem;
}

.topbar__nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.88rem;
  color: var(--demo-fg-muted);
  flex: 1;
  flex-wrap: wrap;
}
.topbar__nav a {
  text-decoration: none;
  white-space: nowrap;
}
.topbar__nav a:hover {
  color: var(--demo-fg);
}

.topbar__controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.chip {
  font: inherit;
  font-size: 0.8rem;
  background: var(--demo-bg-raised);
  color: var(--demo-fg);
  border: 1px solid var(--demo-border);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.chip:hover {
  border-color: var(--demo-fg-muted);
}

.chip--status {
  cursor: pointer;
}
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--demo-fg-muted);
  display: inline-block;
}
.chip--status[data-state='on'] {
  border-color: var(--demo-accent);
  color: var(--demo-accent);
}
.chip--status[data-state='on'] .status-dot {
  background: var(--demo-accent);
  box-shadow: 0 0 8px var(--demo-accent);
}

/* --- hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem;
  position: relative;
}

.eyebrow {
  font-family: var(--demo-mono);
  font-size: 0.8rem;
  color: var(--demo-accent);
  letter-spacing: 0.04em;
  margin: 0 0 1.25rem;
  text-transform: uppercase;
}

.hero__title {
  font-family: var(--demo-mono);
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  line-height: 1.08;
}

.hero__body {
  max-width: 56ch;
  color: var(--demo-fg-muted);
  margin: 0 0 3rem;
  font-size: 1.05rem;
}

.hero__cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.cta-button {
  font: inherit;
  font-family: var(--demo-mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--demo-accent);
  color: var(--demo-accent-contrast);
  border: none;
  border-radius: 999px;
  padding: 1.15rem 2.75rem;
  cursor: pointer;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--demo-accent) 40%, transparent),
    0 20px 60px -20px color-mix(in srgb, var(--demo-accent) 70%, transparent);
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.cta-button:hover {
  transform: translateY(-2px);
}
.cta-button:active {
  transform: translateY(0);
}
.cta-button[aria-pressed='true'] {
  background: transparent;
  color: var(--demo-fg);
  border: 1px solid var(--demo-accent);
  box-shadow: none;
}

.hero__cta-hint {
  font-size: 0.85rem;
  color: var(--demo-fg-muted);
  margin: 0;
}

.hero__reveal-hint {
  position: absolute;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--demo-mono);
  font-size: 0.85rem;
  color: var(--demo-fg-muted);
  margin: 0;
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
}
.hero__reveal-hint.is-visible {
  opacity: 1;
}

/* --- sections --- */
.section {
  max-width: 860px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  border-top: 1px solid var(--demo-border);
}

.section--contrast {
  background: var(--demo-bg-raised);
  max-width: none;
  border-top: 1px solid var(--demo-border);
}
.section--contrast > * {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.section__kicker {
  font-family: var(--demo-mono);
  font-size: 0.78rem;
  color: var(--demo-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.6rem;
}

.section h2 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}
.section h3 {
  font-size: 1.05rem;
  margin: 2rem 0 0.75rem;
}

.section__lede {
  color: var(--demo-fg-muted);
  max-width: 65ch;
  margin: 0 0 2rem;
}

.code-block {
  background: var(--demo-bg-raised);
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  max-width: 100%;
}
.section--contrast .code-block,
.option .code-block,
.api-item .code-block,
.example-card .code-block {
  background: var(--demo-bg);
}
.code-block code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88rem;
  white-space: pre;
}

/* --- playground --- */
.playground {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  background: var(--demo-bg-raised);
  border: 1px solid var(--demo-border);
  border-radius: 12px;
  padding: 1.75rem;
}

.playground__control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.playground__control--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.playground__control label span,
.playground__control > span:first-child {
  color: var(--demo-fg-muted);
}

.playground__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

input[type='range'] {
  accent-color: var(--demo-accent);
  width: 100%;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  overflow: hidden;
}
.segmented__option {
  font: inherit;
  font-size: 0.82rem;
  background: transparent;
  color: var(--demo-fg-muted);
  border: none;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}
.segmented__option.is-active {
  background: var(--demo-accent);
  color: var(--demo-accent-contrast);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--demo-fg-muted);
  cursor: pointer;
}
.switch input {
  accent-color: var(--demo-accent);
  width: 1.05rem;
  height: 1.05rem;
}

.ghost-button {
  font: inherit;
  font-size: 0.85rem;
  background: transparent;
  color: var(--demo-fg-muted);
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}
.ghost-button:hover {
  color: var(--demo-fg);
  border-color: var(--demo-fg-muted);
}

/* --- pipeline diagram --- */
.pipeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 2.5rem;
}
.pipeline__step {
  font-family: var(--demo-mono);
  font-size: 0.9rem;
  background: var(--demo-bg-raised);
  border: 1px solid var(--demo-border);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  text-align: center;
}
.pipeline__step--result {
  border-color: var(--demo-accent);
  color: var(--demo-accent);
}
.pipeline__arrow {
  color: var(--demo-fg-muted);
  font-size: 0.9rem;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.checklist li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--demo-fg-muted);
  font-size: 0.95rem;
}
.checklist li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--demo-accent);
}

/* --- compare --- */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.compare__col {
  border: 1px solid var(--demo-border);
  border-radius: 12px;
  padding: 1.5rem;
}
.compare__col--accent {
  border-color: var(--demo-accent);
}
.compare__col h3 {
  margin-top: 0;
  font-size: 0.95rem;
}
.compare__col ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--demo-fg-muted);
  font-size: 0.92rem;
}
.compare__col--accent ul {
  color: var(--demo-fg);
}

/* --- features --- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.feature h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}
.feature p {
  color: var(--demo-fg-muted);
  margin: 0;
  font-size: 0.94rem;
}

/* --- option / api lists --- */
.option-list,
.api-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.option,
.api-item {
  border: 1px solid var(--demo-border);
  border-radius: 12px;
  padding: 1.5rem;
}
.option header,
.api-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.option header code,
.api-item header code {
  font-size: 1rem;
  background: none;
  border: none;
  padding: 0;
}
.option__type {
  font-family: var(--demo-mono);
  font-size: 0.78rem;
  color: var(--demo-fg-muted);
  background: var(--demo-bg-raised);
  border: 1px solid var(--demo-border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  white-space: nowrap;
}
.option p,
.api-item p {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: var(--demo-fg-muted);
}
.option__default code {
  color: var(--demo-fg);
}
.option .code-block,
.api-item .code-block {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* --- examples grid --- */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.example-card {
  border: 1px solid var(--demo-border);
  border-radius: 12px;
  padding: 1.5rem;
}
.example-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.example-card p {
  color: var(--demo-fg-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.example-card .code-block {
  margin: 0;
}

/* --- table --- */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}
th,
td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--demo-border);
  vertical-align: top;
}
th {
  color: var(--demo-fg-muted);
  font-weight: 500;
}

/* --- faq --- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.faq-list details {
  border: 1px solid var(--demo-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 500;
}
.faq-list p {
  color: var(--demo-fg-muted);
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
}

/* --- footer --- */
.footer {
  border-top: 1px solid var(--demo-border);
  padding: 3.5rem 1.5rem 2.5rem;
}
.footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2.5rem;
}
.footer__brand p {
  color: var(--demo-fg-muted);
  max-width: 32ch;
  font-size: 0.9rem;
}
.footer__version {
  font-family: var(--demo-mono);
  font-size: 0.78rem;
  color: var(--demo-fg-muted);
  margin-top: 0.5rem !important;
}
.footer__links {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}
.footer__links h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--demo-fg-muted);
  margin: 0 0 0.75rem;
}
.footer__links a {
  display: block;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.footer__links a:hover {
  color: var(--demo-accent);
}
.footer__meta {
  max-width: 1120px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--demo-border);
  color: var(--demo-fg-muted);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 640px) {
  .cta-button {
    width: 100%;
    padding: 1.1rem 1.5rem;
  }
  .topbar__nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__reveal-hint,
  .cta-button {
    transition: none;
  }
}
