:root {
  color-scheme: light dark;
  --page: Canvas;
  --text: CanvasText;
  --muted: color-mix(in srgb, CanvasText 65%, Canvas);
  --border: color-mix(in srgb, CanvasText 16%, Canvas);
  --surface: color-mix(in srgb, CanvasText 4%, Canvas);
  --accent: LinkText;
  --accent-surface: color-mix(in srgb, LinkText 9%, Canvas);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
  scroll-behavior: smooth;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--page); line-height: 1.55; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, a, input, select { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); }
.container { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--border); background: var(--page); }
.header-inner, .main-nav, .footer-inner, .footer-inner nav, .banner-inner, .button-row, .demo-actions, .cta-row { display: flex; align-items: center; }
.header-inner { min-height: 64px; justify-content: space-between; gap: 1rem; }
.brand { font-weight: 650; text-decoration: none; white-space: nowrap; }
.main-nav { gap: .25rem; }
.main-nav a, .footer-inner nav a { padding: .45rem .55rem; text-decoration: none; font-size: .9rem; }
.icon-button { min-width: 2.4rem; min-height: 2.4rem; border: 0; border-radius: .35rem; background: transparent; color: var(--text); cursor: pointer; }
.icon-button:hover { background: var(--surface); }
.support-banner { border-bottom: 1px solid var(--border); background: var(--accent-surface); }
.banner-inner { gap: .85rem; padding-block: .75rem; }
.banner-inner p { flex: 1; margin: 0; font-size: .9rem; }
.hero-section { padding-block: clamp(4rem, 10vw, 7rem) 4.5rem; text-align: center; }
.hero-section h1 { max-width: 48rem; margin: .55rem auto 1rem; font-size: clamp(2.1rem, 5vw, 3.35rem); line-height: 1.12; }
.eyebrow { margin: 0 0 .55rem; color: var(--muted); font-size: .9rem; font-weight: 600; }
.lead { max-width: 42rem; margin-inline: auto; color: var(--muted); font-size: 1.1rem; }
.button-row { flex-wrap: wrap; gap: .65rem; }
.hero-section .button-row { justify-content: center; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.7rem; padding: .6rem 1rem; border: 1px solid var(--border); border-radius: .35rem; color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; }
.button-primary { border-color: var(--accent); background: var(--accent); color: Canvas; }
.button-primary:hover { filter: brightness(.92); color: Canvas; }
.button-soft { background: var(--surface); }
.button-small { min-height: 2rem; padding: .3rem .65rem; font-size: .82rem; }
.page-section { padding-block: 3.5rem; }
.section-rule { border-block: 1px solid var(--border); background: var(--surface); }
.section-heading { max-width: 48rem; margin: 0 auto 2rem; text-align: center; }
.section-heading h1, .section-heading h2 { margin: .25rem 0 .5rem; font-size: 2rem; line-height: 1.2; }
.section-heading p:last-child { color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.feature-grid article { padding: 1.2rem 0; border-top: 1px solid var(--border); }
.feature-grid h3, .endpoint-card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.feature-grid p, .endpoint-card p, .cta-row p { margin: 0; color: var(--muted); }
.demo-panel { max-width: 48rem; margin: 0 auto; padding: 1.4rem; border: 1px solid var(--border); border-radius: .45rem; background: var(--page); }
.field { display: grid; gap: .4rem; min-width: 0; }
.field label { color: var(--muted); font-size: .87rem; font-weight: 600; }
.field input, .field select { width: 100%; min-height: 2.6rem; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: .3rem; background: var(--page); color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.field-note { align-self: end; margin: 0; color: var(--muted); font-size: .9rem; }
.demo-actions { flex-wrap: wrap; gap: .75rem; margin-top: 1.2rem; }
.copy-control { display: flex; align-items: center; gap: .45rem; }
.muted, .small { color: var(--muted); }
.small { font-size: .8rem; }
.htmx-indicator { display: none; color: var(--muted); }
.htmx-indicator.htmx-request { display: inline; }
.curl-command { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: .75rem; }
.response-panel { margin-top: 1rem; overflow: hidden; border: 1px solid var(--border); border-radius: .35rem; }
.response-heading { padding: .5rem .75rem; border-bottom: 1px solid var(--border); background: var(--surface); font-size: .8rem; font-weight: 600; }
pre { max-width: 100%; margin: .8rem 0; padding: 1rem; overflow: auto; border: 1px solid var(--border); border-radius: .3rem; background: var(--surface); font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.response-panel pre { margin: 0; border: 0; border-radius: 0; }
.response-curl { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-right: .75rem; border-bottom: 1px solid var(--border); }
.response-curl .curl-output { flex: 1; min-width: 0; }
.notice { margin-top: 1rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: .35rem; }
.notice p { margin: .25rem 0 0; }
.notice-error { border-color: color-mix(in srgb, LinkText 50%, var(--border)); }
.endpoint-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.endpoint-card { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: .4rem; }
.endpoint-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.endpoint-heading p { font-size: .88rem; }
.method-badge { flex: none; padding: .08rem .35rem; border-radius: .2rem; background: var(--surface); font-size: .68rem; font-weight: 700; }
.endpoint-path { display: block; margin-top: .85rem; overflow-wrap: anywhere; color: var(--accent); font-size: .78rem; }
.endpoint-card pre { margin-block: .75rem; }
.comparison-page { max-width: 72rem; }
.comparison-recommendation { max-width: 64rem; margin: 0 auto 3rem; padding: 1.4rem; border: 1px solid var(--border); border-left: .3rem solid var(--accent); border-radius: .4rem; background: var(--accent-surface); }
.comparison-recommendation h2 { margin: .2rem 0 .5rem; font-size: 1.5rem; }
.comparison-recommendation p { max-width: 54rem; margin: .4rem 0; color: var(--muted); }
.comparison-recommendation .button-row { margin-top: 1rem; }
.comparison-recommendation .eyebrow { font-weight: 700; }
.comparison-section { max-width: 64rem; margin: 0 auto 3rem; }
.comparison-section h2 { margin: 0 0 .8rem; font-size: 1.45rem; }
.comparison-section p { color: var(--muted); }
.comparison-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: .4rem; }
.comparison-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.comparison-table th, .comparison-table td { min-width: 10rem; padding: .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.comparison-table thead th { background: var(--surface); font-weight: 700; }
.comparison-table th.comparison-ours { background: var(--accent-surface); }
.comparison-table th.comparison-ours span { display: block; margin-top: .25rem; color: var(--accent); font-size: .72rem; }
.comparison-table td.comparison-ours { background: var(--accent-surface); }
.comparison-table tbody th { font-weight: 650; }
.comparison-table tbody tr:last-child th, .comparison-table tbody tr:last-child td { border-bottom: 0; }
.comparison-note { margin-top: .7rem; font-size: .82rem; }
.source-links { display: grid; gap: .5rem; padding-left: 1.2rem; }
.faq-section details { padding: .9rem 0; border-bottom: 1px solid var(--border); }
.faq-section summary { cursor: pointer; font-weight: 650; }
.faq-section details p { margin-bottom: 0; }
.cta-row { justify-content: space-between; gap: 2rem; }
.cta-row h2 { margin: 0 0 .35rem; font-size: 1.45rem; }
.cta-row p { max-width: 42rem; }
.terms-content { display: grid; gap: 1.2rem; max-width: 48rem; margin: 0 auto; }
.terms-content section { padding: 1.2rem; border: 1px solid var(--border); border-radius: .4rem; }
.terms-content h2 { margin: 0 0 .6rem; font-size: 1.15rem; }
.terms-content p { color: var(--muted); }
.terms-content ul { display: grid; gap: .8rem; padding-left: 1.2rem; color: var(--muted); }
.terms-return { max-width: 48rem; margin: 2rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.site-footer { border-top: 1px solid var(--border); }
.footer-inner { min-height: 5rem; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .85rem; }
.footer-inner nav { flex-wrap: wrap; gap: .2rem; }

@media (max-width: 700px) {
  .container { width: min(100% - 1.25rem, 72rem); }
  .header-inner { min-height: 58px; gap: .25rem; }
  .main-nav { display: none; }
  .banner-inner { align-items: flex-start; }
  .banner-inner .button { margin-top: .15rem; }
  .hero-section { padding-block: 3.5rem 3rem; }
  .feature-grid, .endpoint-grid { grid-template-columns: 1fr; gap: .5rem; }
  .page-section { padding-block: 2.6rem; }
  .demo-panel { padding: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .cta-row, .footer-inner { align-items: flex-start; flex-direction: column; }
  .footer-inner { padding-block: 1.5rem; }
  .footer-inner nav { margin-inline: -.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}