/* Copyright 2013 - 2026 Waiterio LLC */

/* ---------- Design tokens ---------- */
:root {
  --brand: #1a9e91;
  --brand-strong: #10776e;
  --brand-ink: #0b5a53;
  --brand-soft: #e7f6f4;
  --brand-glow: rgba(26, 158, 145, 0.18);
  --accent: #3b82f6;
  --link: #10776e;
  --bg: #ffffff;
  --bg-subtle: #f7faf9;
  --bg-muted: #f0f5f4;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: #e2eae8;
  --border-strong: #cad7d4;
  --text: #0f1e1c;
  --text-muted: #46605c;
  --text-subtle: #6b827e;
  --code-bg: #0c1a19;
  --code-header: #10211f;
  --code-border: #1d3431;
  --code-text: #d8ebe8;
  --code-muted: #7f9c97;
  --tok-property: #7dd3c8;
  --tok-string: #f2c97d;
  --tok-number: #f59f7a;
  --tok-literal: #c4a7ff;
  --tok-keyword: #ff8fb1;
  --tok-function: #8ec5ff;
  --tok-comment: #6e8a85;
  --tok-flag: #8ec5ff;
  --tok-variable: #c4a7ff;
  --danger: #c2410c;
  --danger-soft: #fff1ea;
  --warning: #a16207;
  --warning-soft: #fdf7e3;
  --info-soft: #eef6ff;
  --shadow-sm: 0 1px 2px rgba(15, 30, 28, 0.06);
  --shadow: 0 1px 2px rgba(15, 30, 28, 0.05), 0 8px 24px rgba(15, 30, 28, 0.06);
  --shadow-lg:
    0 2px 6px rgba(15, 30, 28, 0.06), 0 24px 60px rgba(15, 30, 28, 0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --header-height: 64px;
  --font-sans:
    'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:
    ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas,
    'Liberation Mono', monospace;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --brand: #2cc0b0;
  --brand-strong: #5fd6c9;
  --brand-ink: #8be7dc;
  --brand-soft: rgba(44, 192, 176, 0.12);
  --brand-glow: rgba(44, 192, 176, 0.2);
  --link: #3fcfbf;
  --bg: #0a1413;
  --bg-subtle: #0d1918;
  --bg-muted: #10201e;
  --surface: #0f1d1c;
  --surface-raised: #132423;
  --border: #1e3330;
  --border-strong: #2c4642;
  --text: #e6f1ef;
  --text-muted: #a4bab6;
  --text-subtle: #7f9893;
  --code-bg: #071110;
  --code-header: #0b1817;
  --code-border: #1a2e2b;
  --danger: #ff9f7a;
  --danger-soft: rgba(255, 120, 80, 0.1);
  --warning: #f3c969;
  --warning-soft: rgba(243, 201, 105, 0.09);
  --info-soft: rgba(96, 165, 250, 0.09);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

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

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

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

h3 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

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

:not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85em;
  white-space: nowrap;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.icon {
  flex: none;
  display: inline-block;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 860px;
}

.center {
  text-align: center;
  justify-content: center;
}

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

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1400px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text) !important;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  text-decoration: none !important;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.site-nav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--text);
  background: var(--bg-muted);
}

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

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  min-width: 36px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.search-button {
  min-width: 190px;
  justify-content: flex-start;
}

.search-button kbd {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.theme-dark,
:root[data-theme='dark'] .theme-light {
  display: none;
}

:root[data-theme='dark'] .theme-dark {
  display: inline-flex;
}

.nav-toggle {
  display: none;
}

/* Locale picker */
.locale-picker {
  position: relative;
}

.locale-picker summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.locale-picker summary::-webkit-details-marker {
  display: none;
}

.locale-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 330px;
  max-height: 70vh;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.locale-menu-title {
  margin: 4px 8px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

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

.locale-menu li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
}

.locale-menu li.is-current {
  background: var(--brand-soft);
}

.locale-country {
  font-size: 0.9rem;
}

.locale-languages {
  display: flex;
  gap: 4px;
}

.locale-languages a {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.locale-languages a[aria-current='true'],
.locale-languages a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--brand);
  color: #fff !important;
  box-shadow:
    0 1px 2px rgba(16, 119, 110, 0.4),
    0 6px 18px var(--brand-glow);
}

.button-primary:hover {
  background: var(--brand-strong);
}

:root[data-theme='dark'] .button-primary {
  color: #04211e !important;
}

:root[data-theme='dark'] .button-primary:hover {
  background: var(--brand-strong);
}

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

.button-secondary:hover {
  border-color: var(--text-subtle);
}

.button-inverse {
  background: #fff;
  color: var(--brand-ink) !important;
}

.button-link {
  height: auto;
  padding: 0;
  color: var(--brand-strong) !important;
  border-radius: 0;
}

.button-block {
  width: 100%;
}

.header-cta {
  height: 36px;
  padding: 0 16px;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* ---------- Sections ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-theme='dark'] .eyebrow {
  color: var(--brand);
}

.eyebrow .flag {
  font-size: 1.05rem;
}

.lead,
.hero-lead {
  color: var(--text-muted);
  font-size: 1.13rem;
  line-height: 1.65;
}

.section {
  padding: 96px 0;
}

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

.section-heading {
  max-width: 760px;
  margin-bottom: 44px;
}

.section-heading h2 + .lead {
  margin-top: 14px;
}

.section-more {
  margin-top: 28px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: center;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 72px;
  background:
    radial-gradient(
      900px 420px at 88% -10%,
      var(--brand-glow),
      transparent 70%
    ),
    radial-gradient(
      700px 360px at -10% 10%,
      rgba(59, 130, 246, 0.08),
      transparent 70%
    );
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hero-compact {
  padding: 72px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: center;
}

.hero-copy h1 {
  margin-bottom: 20px;
}

.hero-lead {
  max-width: 620px;
}

.hero h1 + .hero-lead {
  margin-top: 18px;
}

.hero .center .hero-lead {
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 18px;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.hero-note .icon {
  color: var(--brand);
}

.hero-code {
  display: grid;
  gap: 14px;
  min-width: 0;
}

/* Stats */
.stats {
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 30px 24px;
  border-left: 1px solid var(--border);
}

.stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.stats-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 26px;
  color: var(--text-muted);
}

.stats-inline strong {
  color: var(--text);
  font-size: 1.3rem;
}

/* Cards and grids */
.source-grid,
.feature-grid,
.usecase-grid,
.country-grid,
.docs-cards {
  display: grid;
  gap: 18px;
}

.source-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.source-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.source-card header h3 {
  margin-top: 4px;
}

.source-authority {
  font-size: 0.76rem !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle) !important;
}

.source-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 0;
  padding: 12px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}

.source-facts dt {
  color: var(--text-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.source-facts dd {
  margin: 2px 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.source-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.source-id {
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.87rem;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.chip {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 550;
}

code.chip {
  font-size: 0.76rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.feature {
  padding: 30px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feature:nth-child(3n) {
  border-right: 0;
}

.feature:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.feature h3 {
  margin: 16px 0 8px;
}

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

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

:root[data-theme='dark'] .feature-icon {
  color: var(--brand);
}

.usecase-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.usecase {
  display: flex;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.usecase .icon {
  margin-top: 3px;
  color: var(--brand);
}

.usecase h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.usecase p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.country-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.country-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text) !important;
  text-decoration: none !important;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.country-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.country-card.is-current {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.country-flag {
  grid-row: span 2;
  font-size: 1.7rem;
  line-height: 1;
}

.country-name {
  font-weight: 600;
}

.country-records {
  color: var(--text-subtle);
  font-size: 0.85rem;
}

.checklist {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-muted);
}

.checklist .icon {
  margin-top: 3px;
  color: var(--brand);
}

/* FAQ */
.faq {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  list-style: none;
  font-weight: 600;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary .icon {
  color: var(--text-subtle);
  transition: transform 0.2s ease;
}

.faq-item[open] summary .icon {
  transform: rotate(180deg);
}

.faq-item p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--text-muted);
}

/* CTA band */
.cta-band {
  padding: 64px 0;
  background:
    radial-gradient(
      600px 300px at 90% 0%,
      rgba(255, 255, 255, 0.18),
      transparent 70%
    ),
    linear-gradient(135deg, #10776e, #1a9e91 55%, #23b3a3);
  color: #fff;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cta-band h2 {
  margin-bottom: 8px;
  color: #fff;
}

.cta-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Code ---------- */
.code {
  margin: 0;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--code-border);
  background: var(--code-bg);
  color: var(--code-text);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-code .code {
  box-shadow: var(--shadow-lg);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--code-border);
  background: var(--code-header);
}

.code-title {
  overflow: hidden;
  color: var(--code-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-tablist {
  display: flex;
  gap: 2px;
}

.code-tab {
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--code-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

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

.code-tab[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.code-tabs .code-title {
  margin-left: auto;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--code-muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.code-tabs .code-copy {
  margin-left: 0;
}

.code-copy:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.7;
  tab-size: 2;
}

.code-response pre {
  max-height: 360px;
}

.tok-property {
  color: var(--tok-property);
}
.tok-string {
  color: var(--tok-string);
}
.tok-number {
  color: var(--tok-number);
}
.tok-literal {
  color: var(--tok-literal);
}
.tok-keyword {
  color: var(--tok-keyword);
}
.tok-function {
  color: var(--tok-function);
}
.tok-comment {
  color: var(--tok-comment);
  font-style: italic;
}
.tok-flag {
  color: var(--tok-flag);
}
.tok-variable {
  color: var(--tok-variable);
}
.tok-punctuation {
  color: var(--code-muted);
}

/* ---------- Docs ---------- */
.docs-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  gap: 48px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.docs-shell-wide {
  grid-template-columns: 260px minmax(0, 1fr);
}

.docs-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 32px 8px 40px 0;
  border-right: 1px solid var(--border);
}

.docs-nav-group + .docs-nav-group {
  margin-top: 26px;
}

.docs-nav-title {
  margin: 0 0 8px;
  padding-left: 10px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.docs-sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.docs-sidebar a code {
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: inherit;
}

.docs-sidebar a:hover {
  color: var(--text);
  background: var(--bg-muted);
}

.docs-sidebar a[aria-current='page'] {
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-weight: 600;
}

:root[data-theme='dark'] .docs-sidebar a[aria-current='page'] {
  color: var(--brand);
}

.method {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(26, 158, 145, 0.14);
  color: var(--brand-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

:root[data-theme='dark'] .method {
  color: var(--brand);
}

.docs-menu-button {
  display: none;
}

.docs-article {
  min-width: 0;
  padding: 40px 0 80px;
}

.docs-article > h1 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  margin-bottom: 14px;
}

.docs-breadcrumbs {
  margin-bottom: 18px;
  color: var(--text-subtle);
  font-size: 0.88rem;
}

.docs-lead {
  max-width: 760px;
  color: var(--text-muted);
  font-size: 1.12rem;
}

.docs-section {
  margin-top: 44px;
}

.docs-section > h2 {
  margin-bottom: 16px;
  font-size: 1.45rem;
}

.docs-section h3 {
  margin: 28px 0 12px;
  font-size: 1.05rem;
}

.docs-section > p,
.docs-section > ul,
.endpoint-main > p {
  max-width: 760px;
  color: var(--text-muted);
}

.docs-section .code {
  margin: 18px 0;
}

.anchored {
  position: relative;
}

.anchor {
  position: absolute;
  left: -1.1em;
  color: var(--text-subtle) !important;
  opacity: 0;
  text-decoration: none !important;
}

.anchored:hover .anchor {
  opacity: 1;
}

.docs-list {
  padding-left: 1.2em;
}

.docs-list li {
  margin: 0.45em 0;
}

.docs-list strong {
  color: var(--text);
}

.docs-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 32px 0 8px;
}

.docs-cards-3 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.docs-card {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 2px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text) !important;
  text-decoration: none !important;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.docs-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.docs-card-icon {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

:root[data-theme='dark'] .docs-card-icon {
  color: var(--brand);
}

.docs-card-title {
  font-weight: 600;
}

.docs-card-text {
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.docs-toc {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 44px 0 40px;
}

.docs-toc-title {
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.docs-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--border);
}

.docs-toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 14px;
  border-left: 2px solid transparent;
  color: var(--text-subtle);
  font-size: 0.86rem;
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--text);
}

.docs-toc a.is-active {
  color: var(--brand-strong);
  border-left-color: var(--brand);
}

.docs-pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.docs-page-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text) !important;
  font-weight: 600;
  text-decoration: none !important;
}

.docs-page-link span {
  color: var(--text-subtle);
  font-size: 0.8rem;
  font-weight: 500;
}

.docs-page-next {
  text-align: right;
}

.docs-page-link:hover {
  border-color: var(--brand);
}

/* Callouts */
.callout {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--info-soft);
  color: var(--text-muted);
}

.callout > .icon {
  margin-top: 3px;
  color: var(--accent);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  margin-bottom: 4px !important;
  color: var(--text);
  font-weight: 600;
}

.callout-warning {
  background: var(--warning-soft);
}

.callout-warning > .icon {
  color: var(--warning);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.table th,
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--bg-subtle);
  color: var(--text-subtle);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Attributes */
.attributes {
  margin: 8px 0 24px;
  border-top: 1px solid var(--border);
}

.attribute {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.attribute dt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.attribute-name {
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  font-size: 0.9rem !important;
  font-weight: 650;
}

.attribute-type {
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
}

.badge-required {
  background: var(--danger-soft);
  color: var(--danger);
}

.attribute dd {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.attribute-values {
  margin: 8px 0 0;
  font-size: 0.86rem;
}

/* Endpoint pages */
.endpoint-signature {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.endpoint-signature code {
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.95rem;
}

.endpoint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: 44px;
  align-items: start;
}

.endpoint-code {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  display: grid;
  gap: 14px;
}

.endpoint-code .code {
  margin: 0;
}

.endpoint-list {
  display: grid;
  gap: 10px;
}

.endpoint-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text) !important;
  text-decoration: none !important;
}

.endpoint-link:hover {
  border-color: var(--brand);
}

.endpoint-link code {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 600;
}

.endpoint-link span:last-child {
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.endpoint-list-large .endpoint-link {
  padding: 18px 20px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.facts .icon {
  margin-top: 2px;
  color: var(--brand);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.step h3 {
  margin: 16px 0 8px;
}

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

.step a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

/* ---------- Forms ---------- */
.signup {
  padding: 72px 0 96px;
  background: radial-gradient(
    800px 380px at 100% 0%,
    var(--brand-glow),
    transparent 70%
  );
}

.signup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 64px;
  align-items: start;
}

.signup-intro h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 3.6vw, 2.9rem);
}

.signup-intro .checklist {
  margin-top: 28px;
}

.signup-steps {
  margin-top: 32px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
}

.signup-steps-title {
  margin-bottom: 8px;
  font-weight: 650;
}

.signup-steps ol {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-muted);
}

.signup-steps li {
  margin: 6px 0;
}

.signup-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field label,
.field legend {
  padding: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='search'],
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 84px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-glow);
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--danger);
}

.field-error,
.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.85rem;
}

.field-error:empty,
.form-error:empty {
  display: none;
}

.field-hint {
  margin: 4px 0 0;
  color: var(--text-subtle);
  font-size: 0.82rem;
}

.required {
  color: var(--danger);
}

.field-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.country-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.country-option {
  position: relative;
  font-weight: 500 !important;
}

.country-option input {
  position: absolute;
  opacity: 0;
}

.country-option span {
  display: inline-flex;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.86rem;
  cursor: pointer;
  user-select: none;
}

.country-option input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
}

:root[data-theme='dark'] .country-option input:checked + span {
  color: var(--brand-strong);
}

.country-option input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.checkbox {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500 !important;
  color: var(--text-muted);
}

.checkbox input {
  margin-top: 4px;
  accent-color: var(--brand);
}

.button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.signup-result h2 {
  margin: 14px 0 10px;
  font-size: 1.6rem;
}

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

.signup-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink) !important;
  font-size: 0.85rem;
  font-weight: 600;
}

:root[data-theme='dark'] .signup-result-badge {
  color: var(--brand-strong) !important;
}

.key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 24px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand-soft);
}

.key-box code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  white-space: normal !important;
  font-size: 0.86rem !important;
}

.key-box .button {
  height: 36px;
  padding: 0 14px;
}

.signup-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Legal and coverage */
.legal {
  padding: 64px 0 96px;
}

.legal h1 {
  margin-bottom: 10px;
}

.legal-body h2 {
  margin: 36px 0 12px;
  font-size: 1.25rem;
}

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

.coverage-tools {
  margin-bottom: 16px;
}

.search-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-subtle);
}

.search-field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.coverage-note {
  margin-top: 16px;
  font-size: 0.88rem;
}

/* ---------- Search dialog ---------- */
.search-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 120px));
  margin: 80px auto auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.search-dialog::backdrop {
  background: rgba(5, 15, 14, 0.45);
  backdrop-filter: blur(3px);
}

.search-dialog-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-subtle);
}

.search-dialog-input input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
}

.search-results {
  max-height: 480px;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  list-style: none;
}

.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text) !important;
  text-decoration: none !important;
}

.search-results a[aria-selected='true'],
.search-results a:hover {
  background: var(--brand-soft);
}

.search-result-title {
  font-weight: 600;
}

.search-result-text {
  display: block;
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 24px;
  color: var(--text-subtle);
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 40px;
}

.footer-brand p {
  max-width: 300px;
  margin-top: 14px;
  color: var(--text-subtle);
  font-size: 0.92rem;
}

.site-footer nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-title {
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-footer nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Responsive ---------- */
/* The search box keeps its label only where every translated header fits
   with it (Spanish needs about 1,280px). */
@media (max-width: 1320px) {
  .search-button {
    min-width: 0;
  }

  .search-button .search-label,
  .search-button kbd {
    display: none;
  }
}

@media (max-width: 1240px) {
  .docs-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .split,
  .signup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .endpoint-code {
    position: static;
  }

  .feature-grid,
  .usecase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature:nth-child(3n) {
    border-right: 1px solid var(--border);
  }

  .feature:nth-child(2n) {
    border-right: 0;
  }

  .feature:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--border);
  }

  .feature:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .docs-cards-3,
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* The navigation folds into the menu button before the longest translated
   labels would crowd the header (Spanish needs about 1,130px). */
@media (max-width: 1200px) {
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    box-shadow: var(--shadow);
  }

  body[data-nav-open] .site-nav {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 900px) {
  .header-cta {
    display: none;
  }

  .docs-shell,
  .docs-shell-wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .docs-sidebar {
    display: none;
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  body[data-docs-open] .docs-sidebar {
    display: block;
  }

  .docs-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.9rem;
    justify-self: start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }

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

@media (max-width: 640px) {
  .container,
  .docs-shell {
    padding: 0 16px;
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    padding: 56px 0 48px;
  }

  .feature-grid,
  .usecase-grid,
  .docs-cards,
  .docs-cards-3,
  .facts,
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature {
    border-right: 0 !important;
    border-bottom: 1px solid var(--border) !important;
  }

  .feature:last-child {
    border-bottom: 0 !important;
  }

  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .signup-card {
    padding: 22px;
  }

  .header-inner {
    gap: 12px;
  }

  .header-actions {
    gap: 6px;
  }

  .locale-menu {
    position: fixed;
    left: 16px;
    right: 16px;
    width: auto;
    top: calc(var(--header-height) + 8px);
  }

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

  .docs-pagination {
    flex-direction: column;
  }

  .endpoint-link {
    flex-wrap: wrap;
  }

  .endpoint-link span:last-child {
    margin-left: 0;
    width: 100%;
  }

  .code-tabs .code-title {
    display: none;
  }

  .code-tabs .code-copy {
    margin-left: auto;
  }
}

/* The phone header keeps its gutter: the globe alone opens the locale menu. */
@media (max-width: 480px) {
  .locale-current {
    display: none;
  }
}

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

/* Sample explorer uses the site's existing form/card primitives. */
[data-demo] select {
  width: 100%;
  padding: 12px;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.demo-record {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
[data-demo-results] {
  margin: 20px 0;
}
[data-profile-form] {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
