/* Docs pages: the roadmap's night header, then paper with a sidebar, the page and "On this page". */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.docs-top { padding-bottom: clamp(36px, 5vw, 64px); }
.docs-intro { padding-top: clamp(18px, 4vh, 44px); padding-bottom: 8px; }
.docs-intro h1 { font-size: clamp(38px, 5vw, 66px); line-height: 1; max-width: 16em; margin: 0 0 16px; }
.docs-lede { margin: 0; max-width: 38em; font-size: clamp(16.5px, 0.4vw + 15px, 19.5px); line-height: 1.5; color: rgba(255, 248, 234, 0.86); }
.docs-crumb { margin: 0 0 14px; font: 700 12.5px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 248, 234, 0.62); }
.docs-crumb a { color: #f6c14f; text-decoration: none; }
.docs-crumb a:hover { text-decoration: underline; }

.docs-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: clamp(28px, 4vw, 56px);
  align-items: start; padding-top: clamp(32px, 4vw, 56px); padding-bottom: clamp(64px, 8vw, 112px);
}
.docs-layout:not(:has(.docs-toc)) { grid-template-columns: 220px minmax(0, 1fr); }

/* ---- sidebar ---- */
.docs-nav { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
.dn-toggle > summary { display: none; }
.dn-group { margin: 0 0 22px; }
.dn-head { margin: 0 0 8px; font: 800 11.5px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-subtle); }
.dn-group ul, .toc ul, .dn-results { list-style: none; margin: 0; padding: 0; }
.dn-group a { display: block; padding: 6px 10px; margin-left: -10px; border-radius: 9px; color: var(--ink-muted); text-decoration: none; font-size: 15px; line-height: 1.35; }
.dn-group a:hover { color: var(--ink); background: var(--track); }
.dn-group a[aria-current="page"] { color: var(--ink); font-weight: 700; background: var(--accent-bg); }

.dn-search { position: relative; margin: 0 0 22px; }
.dn-search input {
  width: 100%; min-height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); font: 500 14.5px/1 var(--sans);
}
.dn-search input::placeholder { color: var(--ink-subtle); }
.dn-results { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: -120px; max-height: 60vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.dn-results a { display: block; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.dn-results a:hover, .dn-results a:focus { background: var(--track); }
.dn-results b { display: block; font-size: 14.5px; }
.dn-results span { display: block; margin-top: 3px; font-size: 13px; color: var(--ink-subtle); line-height: 1.4; }
.dn-results .none { padding: 10px; font-size: 14px; color: var(--ink-subtle); }

/* ---- on this page ---- */
.docs-toc { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; }
.toc-head { margin: 0 0 10px; font: 800 11.5px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-subtle); }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--rule); color: var(--ink-subtle); text-decoration: none; font-size: 13.5px; line-height: 1.35; }
.toc .toc-3 a { padding-left: 24px; font-size: 13px; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--accent-fill); font-weight: 600; }

/* ---- the page ---- */
.prose { max-width: 720px; font-size: 17px; line-height: 1.68; color: var(--ink); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0 0 6px; }
.prose li::marker { color: var(--ink-subtle); }
.prose h2 { font: 800 clamp(26px, 2vw + 16px, 34px)/1.12 var(--sans); font-stretch: 105%; letter-spacing: -0.02em; margin: 52px 0 16px; scroll-margin-top: 20px; }
.prose h3 { font: 750 21px/1.25 var(--sans); margin: 36px 0 10px; scroll-margin-top: 20px; }
.prose h4 { font: 750 17px/1.3 var(--sans); margin: 26px 0 8px; }
.prose h2, .prose h3, .prose h4 { position: relative; }
.prose .anchor { position: absolute; left: -0.9em; width: 0.9em; color: var(--ink-subtle); text-decoration: none; opacity: 0; transition: opacity 0.15s; }
.prose :is(h2, h3, h4):hover .anchor { opacity: 1; }
.prose a { color: var(--accent); text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }
.prose blockquote { margin: 0 0 18px; padding: 4px 0 4px 18px; border-left: 3px solid var(--rule); color: var(--ink-muted); }
.prose img { max-width: 100%; height: auto; border-radius: 14px; }

.code { position: relative; margin: 0 0 20px; }
.code pre { margin: 0; overflow-x: auto; padding: 16px 18px; border-radius: 14px; background: var(--code-bg); color: var(--code-ink); font-size: 14px; line-height: 1.6; }
.code pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.code .copy { position: absolute; top: 8px; right: 8px; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(246, 240, 228, 0.22);
  background: rgba(246, 240, 228, 0.08); color: var(--code-ink); font: 600 12px/1 var(--sans); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.code:hover .copy, .code .copy:focus-visible { opacity: 1; }
@media (hover: none) { .code .copy { opacity: 0.85; } }

.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose th, .prose td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 750; background: var(--surface-2); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code, .prose th code { white-space: nowrap; }

.callout { margin: 0 0 22px; padding: 14px 18px 2px; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); }
.callout-label { margin: 0 0 4px !important; font: 800 12px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.callout-note { border-left: 4px solid var(--leaf); } .callout-note .callout-label { color: var(--leaf); }
.callout-tip { border-left: 4px solid var(--accent-fill); } .callout-tip .callout-label { color: var(--accent); }
.callout-warning { border-left: 4px solid #c2412a; } .callout-warning .callout-label { color: #c2412a; }
@media (prefers-color-scheme: dark) { .callout-warning { border-left-color: #f08a6c; } .callout-warning .callout-label { color: #f08a6c; } }

/* screenshots and clips, from docs/demo in the app repo */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 8px 0 26px; }
.shots figure, .clips figure { margin: 0; }
.shots img { width: 100%; border-radius: 16px; border: 1px solid var(--rule); box-shadow: var(--shadow); }
.shots figcaption, .clips figcaption { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--ink-muted); }
.shots figcaption b, .clips figcaption b { color: var(--ink); }
.clips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 8px 0 26px; }
.clips video, .feature-video video { width: 100%; border-radius: 16px; background: #0b100a; border: 1px solid var(--rule); }
.feature-video { max-width: 360px; margin: 6px 0 26px; }

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 720px; margin: 56px 0 0; }
.docs-pager a { display: block; padding: 14px 18px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 700; line-height: 1.3; }
.docs-pager a:hover { border-color: var(--ink-subtle); }
.docs-pager span { display: block; margin-bottom: 4px; font: 700 11.5px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-subtle); }
.pg-next { text-align: right; grid-column: 2; }
.docs-edit { max-width: 720px; margin: 22px 0 0; font-size: 14px; color: var(--ink-subtle); }
.docs-edit a { color: var(--ink-subtle); }

/* start-here cards on /docs/ */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 8px 0 28px; padding: 0 !important; list-style: none; }
.cards li { margin: 0; }
.cards a { display: block; height: 100%; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); text-decoration: none; color: var(--ink-muted); font-size: 15px; line-height: 1.45; }
.cards a:hover { border-color: var(--ink-subtle); }
.cards a b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 16.5px; }

@media (max-width: 1180px) {
  .docs-layout, .docs-layout:not(:has(.docs-toc)) { grid-template-columns: 210px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-layout, .docs-layout:not(:has(.docs-toc)) { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .docs-nav { position: static; max-height: none; overflow: visible; padding: 0; }
  .dn-toggle { border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
  .dn-toggle > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; font-weight: 700; }
  .dn-toggle > summary::-webkit-details-marker { display: none; }
  .dn-toggle > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform 0.2s; }
  .dn-toggle[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
  .dn-toggle[open] { padding-bottom: 6px; }
  .dn-toggle > :not(summary) { margin-left: 16px; margin-right: 16px; }
  .dn-results { right: 0; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .prose .anchor { display: none; }
}
@media (max-width: 480px) {
  .docs-pager { grid-template-columns: minmax(0, 1fr); }
  .pg-next { grid-column: 1; }
  .prose { font-size: 16.5px; }
}
