/* WabiOne public site (www.wabione.com). Shared by index, signup and docs. */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-text: #1d4ed8;
  --on-primary: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-text: #b91c1c;
  --success-soft: #ecfdf5;
  --success-text: #047857;
  --warning-soft: #fffbeb;
  --warning-text: #b45309;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.35);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.14);
  --radius: 8px;
  --radius-lg: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --get: #047857;
  --post: #1d4ed8;
  --put: #b45309;
  --patch: #7c3aed;
  --delete: #b91c1c;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-soft: rgba(59, 130, 246, 0.14);
    --primary-text: #93c5fd;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --bg: #0b0f17;
    --bg-alt: #0f1522;
    --surface: #121826;
    --surface-alt: #172033;
    --border: #243045;
    --border-strong: #334155;
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --danger-text: #fca5a5;
    --success-soft: rgba(16, 185, 129, 0.14);
    --success-text: #6ee7b7;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --warning-text: #fcd34d;
    --code-bg: #0a0e17;
    --focus: 0 0 0 3px rgba(96, 165, 250, 0.45);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
    --get: #6ee7b7;
    --post: #93c5fd;
    --put: #fcd34d;
    --patch: #c4b5fd;
    --delete: #fca5a5;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--primary-text);
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

code,
pre,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.muted {
  color: var(--text-muted);
}

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

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
  box-shadow: var(--shadow-lg), var(--focus);
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header and footer ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--text);
}

.logo-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.logo-bg {
  fill: var(--primary);
}

.logo-fg {
  fill: #ffffff;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.site-nav a:not(.btn) {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:not(.btn):hover {
  background: var(--surface-alt);
}

.site-nav a[aria-current='page'] {
  color: var(--primary-text);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.925rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.5rem 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-lg {
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  font-size: 1.0625rem;
}

.btn-sm {
  min-height: 32px;
  padding: 0.3125rem 0.75rem;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--on-primary);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--text);
}

.btn-block {
  width: 100%;
}

/* ---------- Landing page ---------- */

.hero {
  padding: 5rem 0 4rem;
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%),
    var(--bg);
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 3rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 0.875rem;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.lead {
  font-size: 1.1875rem;
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.providers {
  margin-top: 2rem;
  font-size: 0.925rem;
  color: var(--text-muted);
}

.providers ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.providers li {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
}

/* The illustrated sign-in card (decorative). */
.mock {
  justify-self: center;
  width: 100%;
  max-width: 360px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.mock-title {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.mock-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.mock-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.mock-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--focus);
  font-size: 0.925rem;
  margin-bottom: 1rem;
}

.mock-button {
  padding: 0.625rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: #ffffff;
  text-align: center;
  font-weight: 600;
  font-size: 0.925rem;
}

.mock-note {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--success-text);
  background: var(--success-soft);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}

.mock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.feature {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 4.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.5rem;
  top: 1.5rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.steps h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.375rem;
}

.steps p {
  margin: 0;
  color: var(--text-muted);
}

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem 2rem;
}

.checks li {
  position: relative;
  padding-left: 1.75rem;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.45em;
  width: 0.5rem;
  height: 0.85rem;
  border: solid var(--success-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cta {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #3b82f6);
  color: #ffffff;
}

.cta h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.cta p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.75rem;
}

.cta .btn-light {
  background: #ffffff;
  color: #1d4ed8;
}

.cta .btn-light:hover {
  background: #eff6ff;
  color: #1e40af;
}

/* ---------- Sign-up ---------- */

.auth-page {
  min-height: calc(100vh - 64px);
  padding: 3rem 0 4rem;
  background: var(--bg-alt);
}

.auth-card {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-card .intro {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.form {
  display: grid;
  gap: 1.125rem;
}

.field {
  display: grid;
  gap: 0.375rem;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.label {
  font-weight: 600;
  font-size: 0.925rem;
}

.input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.input[aria-invalid='true'] {
  border-color: var(--danger);
}

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

.field-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger-text);
  font-weight: 500;
}

.turnstile {
  min-height: 65px;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.925rem;
  margin: 0;
}

.alert-danger {
  background: var(--danger-soft);
  color: var(--danger-text);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}

.alert-warning {
  background: var(--warning-soft);
  color: var(--warning-text);
}

.signup-done {
  text-align: center;
  padding: 1rem 0;
}

.signup-done:focus {
  outline: none;
  box-shadow: none;
}

.done-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success-text);
}

.done-icon svg {
  width: 28px;
  height: 28px;
}

.auth-alt {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.925rem;
  color: var(--text-muted);
}

/* ---------- API docs ---------- */

.docs {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3rem;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  font-size: 0.9rem;
  padding-right: 0.5rem;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 1.25rem 0 0.5rem;
}

.toc-title:first-child {
  margin-top: 0;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc a {
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.toc a:hover {
  background: var(--surface-alt);
}

.toc-group > a {
  font-weight: 600;
}

.toc-ops a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-left: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toc-ops .method {
  min-width: 3.25rem;
}

.docs-content {
  min-width: 0;
}

.docs-content > h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 750;
}

.docs-section {
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.docs-section > h2 {
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.docs-section h3 {
  font-size: 1.125rem;
  margin-top: 1.5rem;
}

.op {
  margin: 1.25rem 0 2rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.op-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}

.op-path {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.op h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.op h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}

.op-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.method {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.op-line .method {
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  border: 1px solid currentColor;
}

.method-get {
  color: var(--get);
}

.method-post {
  color: var(--post);
}

.method-put {
  color: var(--put);
}

.method-patch {
  color: var(--patch);
}

.method-delete {
  color: var(--delete);
}

.table-wrap {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

.table td:first-child {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.table .type {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.req {
  color: var(--danger-text);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
}

.code {
  position: relative;
  margin: 0.5rem 0 0;
}

.code pre {
  margin: 0;
  padding: 1rem 1.25rem;
  padding-right: 5rem;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.code .copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.code .copy:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.docs-loading {
  color: var(--text-muted);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .hero {
    padding: 3.5rem 0 3rem;
  }

  .hero .container {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-top: 1.5rem;
  }

  .toc {
    position: static;
    max-height: none;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-alt);
  }

  .toc-ops {
    display: none;
  }

  .toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }

  .site-nav .nav-optional {
    display: none;
  }

  .site-nav .btn {
    padding: 0.5rem 0.75rem;
  }

  .section {
    padding: 3rem 0;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-page {
    padding: 1.5rem 0 3rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
  }

  .op {
    padding: 1.125rem;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 380px) {
  .site-nav .nav-signin {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
