@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --line: rgba(23, 23, 23, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(1200px 300px at 5% -10%, rgba(15, 118, 110, 0.12), transparent 60%),
    radial-gradient(1000px 300px at 100% 0%, rgba(249, 115, 22, 0.08), transparent 62%),
    #f8f5ef;
}

.tw-shell {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.tw-surface {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 20px 60px rgba(33, 28, 20, 0.08);
  backdrop-filter: blur(8px);
}

.tw-nav-open {
  display: grid;
}

.tw-auth-menu {
  position: relative;
}

.tw-docs-menu {
  position: relative;
}

.tw-dropdown-btn {
  gap: 0.35rem;
}

.tw-dropdown-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 160ms ease;
}

.tw-docs-menu[open] .tw-dropdown-btn svg,
.tw-auth-menu[open] .tw-dropdown-btn svg {
  transform: rotate(180deg);
}

.tw-dropdown-btn-light {
  min-width: 104px;
}

.tw-dropdown-btn-dark {
  min-width: 148px;
}

.tw-auth-menu summary {
  list-style: none;
  cursor: pointer;
}

.tw-auth-menu summary::-webkit-details-marker,
.tw-docs-menu summary::-webkit-details-marker {
  display: none;
}

.tw-auth-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 180px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 40px rgba(33, 28, 20, 0.12);
}

.tw-auth-pop a {
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  color: #171717;
}

.tw-auth-pop a:hover {
  background: rgba(0, 0, 0, 0.06);
}

.tw-docs-pop {
  left: 0;
  right: auto;
  min-width: 240px;
}

.tw-pop-group-label {
  padding: 0.5rem 0.75rem 0.125rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a3a09a;
  margin: 0;
}

.faq-accordion summary {
  list-style: none;
}

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

.tw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tw-lightbox.is-open {
  display: flex;
}

.tw-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

.tw-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 20px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.tw-lightbox-image {
  display: block;
  width: 100%;
  height: auto;
  background: #0b0b0b;
}

.tw-lightbox-caption {
  margin: 0;
  padding: 10px 14px 14px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
}

.tw-lightbox-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 340ms ease, transform 340ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== DOCS ===== */

:root {
  --docs-sidebar-w: 260px;
  --header-h: 76px;
}

.docs-page-layout {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

/* Right-side "On this page" TOC — hidden below 1280px */
.docs-toc {
  display: none;
}

@media (min-width: 1280px) {
  .docs-toc {
    display: block;
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    max-height: calc(100vh - var(--header-h) - 4rem);
    overflow-y: auto;
    padding-left: 1.5rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}

.docs-toc-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5c5b57;
  margin-bottom: 0.75rem;
}

.docs-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-toc-item {
  line-height: 1.4;
}

.docs-toc-item-h3 {
  padding-left: 0.75rem;
}

.docs-toc-link {
  display: block;
  font-size: 0.8rem;
  color: #5c5b57;
  padding: 3px 6px;
  border-radius: 6px;
  text-decoration: none;
  transition: color 120ms, background 120ms;
  line-height: 1.5;
}

.docs-toc-link:hover {
  color: #171717;
  background: rgba(0,0,0,0.04);
}

.docs-toc-link.is-active {
  color: #0d9488;
  font-weight: 500;
}

.docs-sidebar {
  width: var(--docs-sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 1.5rem 0.75rem 2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}

.docs-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem 4rem;
  max-width: 820px;
}

/* Tab switcher */
.docs-tab-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}

.docs-tab-btn {
  flex: 1;
  padding: 6px 0;
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #5c5b57;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 140ms;
}

.docs-tab-btn.is-active {
  background: #fff;
  color: #171717;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Sidebar search */
.docs-sidebar-search-wrapper {
  margin-bottom: 1.25rem;
}

.docs-sidebar-search {
  width: 100%;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.8);
  font-size: 0.8125rem;
  color: #171717;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}

.docs-sidebar-search:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.12);
}

.docs-sidebar-search::placeholder {
  color: #a09e99;
}

/* Breadcrumb current page */
.docs-breadcrumb span[aria-current="page"] {
  color: #171717;
  font-weight: 500;
}

.docs-breadcrumb span[aria-hidden="true"] {
  color: #c5c3bc;
}

/* Sidebar nav */
.docs-nav-group {
  margin-bottom: 1.25rem;
}

.docs-nav-group-label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5c5b57;
  padding: 0 10px;
  margin-bottom: 4px;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #5c5b57;
  transition: background 120ms, color 120ms;
  line-height: 1.4;
}

.docs-nav-link:hover {
  background: rgba(0,0,0,0.05);
  color: #171717;
}

.docs-nav-link.is-active {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
  font-weight: 600;
}

/* Badges (in sidebar nav links) */
.docs-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.docs-badge-get {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.docs-badge-post {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.docs-badge-patch {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
}

/* Content area */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: #5c5b57;
  margin-bottom: 1.5rem;
}

.docs-breadcrumb a {
  color: #5c5b57;
  transition: color 120ms;
}

.docs-breadcrumb a:hover {
  color: #171717;
}

.docs-h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: #171717;
  margin-bottom: 0.5rem;
}

.docs-lead {
  font-size: 1rem;
  line-height: 1.7;
  color: #5c5b57;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

/* Content headings */
.docs-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #171717;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}

.docs-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #171717;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  scroll-margin-top: 90px;
}

.docs-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #171717;
  margin-top: 1.25rem;
  margin-bottom: 0.375rem;
}

.docs-content p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #5c5b57;
  margin-bottom: 1rem;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: #5c5b57;
  font-size: 0.9375rem;
  line-height: 1.75;
}

.docs-content ul li,
.docs-content ol li {
  margin-bottom: 0.25rem;
}

.docs-content ul { list-style: disc; }
.docs-content ol { list-style: decimal; }

.docs-content strong {
  color: #171717;
  font-weight: 600;
}

.docs-content a:not(.docs-card):not(.docs-nav-footer-link) {
  color: #0f766e;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-content code {
  font-family: 'Geist Mono', monospace;
  font-size: 0.8125rem;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 1px 5px;
  color: #171717;
}

/* Code blocks */
.docs-pre {
  position: relative;
  background: #1c1c1e;
  border-radius: 12px;
  overflow: hidden;
  margin: 1.25rem 0;
}

.docs-pre-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #252528;
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-pre pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: 'Geist Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #e4e4e7;
}

/* Reset inline code styles inside code blocks */
.docs-pre pre code {
  background: none;
  border-radius: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Syntax highlight tokens */
.docs-pre .sh-keyword   { color: #c792ea; }
.docs-pre .sh-string    { color: #c3e88d; }
.docs-pre .sh-comment   { color: #546e7a; font-style: italic; }
.docs-pre .sh-number    { color: #f78c6c; }
.docs-pre .sh-boolean   { color: #f78c6c; }
.docs-pre .sh-null      { color: #f78c6c; }
.docs-pre .sh-key       { color: #82aaff; }
.docs-pre .sh-builtin   { color: #82aaff; }
.docs-pre .sh-decorator { color: #ffcb6b; }
.docs-pre .sh-function  { color: #82aaff; }
.docs-pre .sh-operator  { color: #89ddff; }
.docs-pre .sh-punctuation { color: #89ddff; }
.docs-pre .sh-variable  { color: #e4e4e7; }
.docs-pre .sh-cmd       { color: #82aaff; font-weight: 600; }
.docs-pre .sh-flag      { color: #ffcb6b; }

.docs-copy-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  padding: 2px 8px;
  color: rgba(255,255,255,0.45);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 120ms;
  font-family: 'Geist', sans-serif;
}

.docs-copy-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
}

/* Callouts */
.docs-callout {
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.65;
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}

.docs-callout p { margin: 0; font-size: inherit; color: inherit; }
.docs-callout strong { color: inherit; }

.docs-callout-info {
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: #134e4a;
}

.docs-callout-tip {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.2);
  color: #14532d;
}

.docs-callout-warning {
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.2);
  color: #7c2d12;
}

/* Tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1.25rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.docs-content thead th {
  background: rgba(0,0,0,0.03);
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c5b57;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.docs-content tbody td {
  padding: 10px 14px;
  color: #5c5b57;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.6;
}

.docs-content tbody tr:last-child td {
  border-bottom: none;
}

.docs-content tbody td code {
  font-size: 0.78rem;
}

/* Card grid */
.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.docs-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.125rem;
  background: rgba(255,255,255,0.7);
  box-shadow: 0 1px 4px rgba(33,28,20,0.06);
  transition: border-color 140ms, box-shadow 140ms;
  color: #171717;
}

.docs-card:hover {
  border-color: rgba(0,0,0,0.2);
  box-shadow: 0 4px 16px rgba(33,28,20,0.1);
}

.docs-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #171717;
  margin-bottom: 4px;
}

.docs-card-desc {
  font-size: 0.8125rem;
  color: #5c5b57;
  line-height: 1.5;
  margin: 0;
}

/* Steps */
.docs-steps {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.docs-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.6);
  counter-increment: step-counter;
}

.docs-step::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.docs-step-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #171717;
  margin-bottom: 4px;
}

.docs-step p {
  font-size: 0.875rem;
  color: #5c5b57;
  margin: 0;
}

/* Param fields */
.docs-params {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 1rem 0;
}

.docs-param-row {
  display: grid;
  grid-template-columns: 160px 90px 1fr;
  gap: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  align-items: baseline;
}

.docs-param-row:last-child { border-bottom: none; }

.docs-param-name {
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
  color: #171717;
  font-size: 0.8rem;
}

.docs-param-type {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  color: #0f766e;
}

.docs-param-required {
  font-size: 0.65rem;
  font-weight: 700;
  color: #dc2626;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-param-desc {
  color: #5c5b57;
  line-height: 1.5;
}

/* Content tabs */
.docs-content-tabs {
  margin: 1.25rem 0;
}

.docs-content-tab-list {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.docs-content-tab-btn {
  padding: 7px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #5c5b57;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 120ms;
  border-radius: 6px 6px 0 0;
}

.docs-content-tab-btn.is-active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}

.docs-content-tab-panel { display: none; }
.docs-content-tab-panel.is-active { display: block; }

/* Prev/next footer nav */
.docs-nav-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.docs-nav-footer-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  transition: border-color 120ms, box-shadow 120ms;
  max-width: 48%;
}

.docs-nav-footer-link:hover {
  border-color: rgba(0,0,0,0.2);
  box-shadow: 0 2px 8px rgba(33,28,20,0.08);
}

.docs-nav-footer-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5c5b57;
}

.docs-nav-footer-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #171717;
}

/* HTTP method badge (large, in page heading) */
.docs-method-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-right: 8px;
  vertical-align: middle;
}

/* Sidebar overlay (mobile) */
.docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 30;
  backdrop-filter: blur(2px);
}

.docs-sidebar-overlay.is-open { display: block; }

/* Mobile: sidebar drawer */
@media (max-width: 1023px) {
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100%;
    max-height: 100vh;
    z-index: 40;
    background: #f8f5ef;
    transition: left 200ms ease;
    padding-top: 1.5rem;
    width: 280px;
    border-right: 1px solid var(--line);
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }

  .docs-sidebar.is-open {
    left: 0;
  }

  .docs-content {
    padding: 1.5rem 1.25rem 3rem;
  }
}

@media (max-width: 640px) {
  .docs-card-grid {
    grid-template-columns: 1fr;
  }

  .docs-param-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 4px;
  }

  .docs-param-desc {
    grid-column: 1 / -1;
  }

  .docs-h1 {
    font-size: 1.625rem;
  }
}
