/* Developer documentation layout (/developers). Three columns like a modern
   API docs site: section nav on the left, content in the middle, "On this
   page" on the right. Shares tokens and the nav/footer with site.css. */

/* The docs page uses a wider wrapper than the marketing pages: three columns
   need the room, and the reading column should stay near 70 characters. */
.wrap.docs-wrap { max-width: 1360px; }
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 3.5rem; padding: 1.5rem 0 4rem; align-items: start; }
/* Sidebars stick, but never taller than the viewport: a nav longer than the
   screen scrolls inside itself instead of pinning its top forever. */
.docs aside { position: sticky; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow-y: auto; font-size: .9rem; }
/* site.css lays out every <nav> as the horizontal top bar (flex, space
   between, vertical padding). The section nav and "On this page" are <nav>
   elements too, so undo that here or they render as scrolling strips. */
.docs nav.sidenav, .docs nav.toc { display: block; padding: 0; position: static; }
.docs .sidenav h5 {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 1.4rem 0 .5rem; font-weight: 600;
}
.docs .sidenav h5:first-child { margin-top: .25rem; }
.docs .sidenav a {
  display: block; color: var(--text); padding: .28rem .6rem; border-radius: 6px; margin-left: -.6rem;
}
.docs .sidenav a:hover { background: var(--line-soft); color: var(--ink); }
.docs .sidenav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.docs .sidenav a code { font-size: .82rem; }

.docs .toc { font-size: .84rem; }
.docs .toc h5 { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: .25rem 0 .6rem; font-weight: 600; }
.docs .toc a { display: block; color: var(--muted); padding: .22rem 0 .22rem .75rem; border-left: 2px solid var(--line); }
.docs .toc a:hover { color: var(--ink); }
.docs .toc a.active { color: var(--accent); border-color: var(--accent); }

.docs main { max-width: 50rem; min-width: 0; }
.docs .eyebrow { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .02em; margin-bottom: .6rem; }
.docs h1 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); margin-bottom: .8rem; }
.docs .lede { font-size: 1.08rem; margin-bottom: 1.6rem; }
.docs h2 {
  font-size: 1.5rem; margin: 3rem 0 .8rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
  scroll-margin-top: 1.5rem;
}
.docs h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 2rem; }
.docs h3 { font-size: 1.12rem; color: var(--ink); margin: 2rem 0 .5rem; scroll-margin-top: 1.5rem; }
.docs h4 { font-size: .95rem; color: var(--ink); margin: 1.3rem 0 .4rem; }
.docs p, .docs li { font-size: .97rem; color: var(--text); }
.docs p { margin: 0 0 .9rem; }
.docs ul, .docs ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.docs li { margin-bottom: .35rem; }
.docs a { text-decoration: underline; text-decoration-color: rgba(55, 88, 249, .35); text-underline-offset: 2px; }
.docs a:hover { text-decoration-color: var(--accent); }
.docs code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em;
  background: var(--line-soft); color: var(--ink); border-radius: 5px; padding: .1em .35em;
}
.docs pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* Cards (quickstart, tool index) */
.docs .cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; margin: 1rem 0 1.4rem; }
.docs .card {
  display: block; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem;
  background: var(--card); color: var(--text); text-decoration: none;
}
.docs .card:hover { border-color: var(--accent); }
.docs .card strong { display: block; color: var(--ink); margin-bottom: .25rem; font-size: .98rem; }
.docs .card span { color: var(--muted); font-size: .9rem; }

/* Callouts */
.docs .note {
  border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--card);
  border-radius: 10px; padding: .85rem 1rem; margin: 1rem 0 1.2rem; font-size: .93rem;
}
.docs .note.warn { border-left-color: #b45309; }
.docs .note p:last-child { margin-bottom: 0; }

/* Tables */
.docs table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .6rem 0 1.4rem; display: block; overflow-x: auto; }
.docs th, .docs td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.docs td:first-child code { white-space: nowrap; }
.docs .req { color: #b45309; font-size: .78rem; font-weight: 600; }
.docs .opt { color: var(--muted); font-size: .78rem; }

/* Badges */
.docs .pill {
  display: inline-block; font-size: .72rem; font-weight: 600; border-radius: 999px; padding: .12rem .55rem;
  vertical-align: middle; margin-left: .5rem; letter-spacing: .02em;
}
.docs .pill.read { background: #eff6ff; color: #1d4ed8; }
.docs .pill.write { background: #fffbeb; color: #b45309; }
.docs .pill.free { background: #f0fdf4; color: var(--green); }

/* Code blocks */
.docs figure.code { margin: .8rem 0 1.4rem; border-radius: 12px; overflow: hidden; border: 1px solid #1e293b; background: #0f172a; }
.docs figure.code figcaption {
  display: flex; align-items: center; justify-content: space-between; padding: .45rem .5rem .45rem .9rem;
  background: #111c31; color: #94a3b8; font-size: .76rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border-bottom: 1px solid #1e293b;
}
.docs figure.code button {
  background: transparent; border: 1px solid #334155; color: #cbd5e1; border-radius: 6px; padding: .2rem .55rem;
  font-size: .74rem; cursor: pointer; font-family: var(--sans);
}
.docs figure.code button:hover { background: #1e293b; }
.docs figure.code pre {
  margin: 0; padding: .9rem 1rem; overflow-x: auto; color: #e2e8f0; font-size: .84rem; line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.docs figure.code .k { color: #7dd3fc; }
.docs figure.code .s { color: #bbf7d0; }
.docs figure.code .n { color: #fdba74; }
.docs figure.code .c { color: #64748b; font-style: italic; }

/* Tabs */
.docs .tabs { margin: .8rem 0 1.4rem; }
.docs .tablist { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: .6rem; overflow-x: auto; }
.docs .tablist button {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: .5rem .7rem; margin-bottom: -1px;
  color: var(--muted); font-family: var(--sans); font-size: .9rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.docs .tablist button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.docs .tabs [role="tabpanel"][hidden] { display: none; }
.docs .tabs figure.code { margin-top: 0; }

/* Tool reference blocks */
.docs .tool { border-top: 1px solid var(--line); padding-top: .2rem; }
.docs .tool h3 code { font-size: .95em; background: var(--accent-soft); color: var(--accent); }

/* Below ~1200px the right column goes first; below ~860px the left nav
   becomes a block above the content and nothing sticks. */
@media (max-width: 1200px) {
  .docs { grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem; }
  .docs .toc { display: none; }
  .docs aside:last-child { display: none; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; gap: 1.5rem; }
  .docs aside { position: static; max-height: none; overflow: visible; }
  .docs .sidenav { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1.1rem; background: var(--card); }
  .docs .sidenav h5:first-child { margin-top: 0; }
  .docs .cards { grid-template-columns: 1fr; }
}
