/*
 * css/docs.css: the docs page (docs.html). A left table of contents (a sheet on phones) and calm prose.
 */
.docs-head { margin-bottom: 36px; }
.docs-head h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 300; letter-spacing: -0.035em; margin: 10px 0 12px; }
.docs-head h1 b { font-weight: 700; }
.docs-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; align-items: start; }
.docs-toc { position: sticky; top: calc(var(--nav-h) + 24px); }
.docs-toc-btn { display: none; }
.docs-toc-nav { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 1px solid var(--line); }
.docs-toc-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.docs-toc-nav a { position: relative; display: flex; align-items: center; min-height: 36px; color: var(--muted); font-size: 14.5px; transition: color var(--dur) var(--ease); }
.docs-toc-nav a:hover { color: var(--ink); }
.docs-toc-nav a.is-active { color: #fff; }
.docs-toc-nav a.is-active::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--glow); box-shadow: 0 0 10px var(--glow); }

.prose { max-width: 740px; min-width: 0; color: var(--body); font-size: 16.5px; line-height: 1.7; }
.prose section { padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose section:last-child { border-bottom: 0; }
.prose h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -0.025em; margin: 0 0 16px; }
.prose h3 { font-size: 18px; font-weight: 600; margin: 28px 0 8px; color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose a { color: var(--ice); text-decoration: underline; text-decoration-color: rgba(174, 185, 255, 0.35); text-underline-offset: 3px; }
.prose a:hover { color: #fff; text-decoration-color: #fff; }
.prose ol, .prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose pre { margin: 14px 0 18px; padding: 16px 18px; border-radius: 16px; background: rgba(6, 8, 40, 0.75); border: 1px solid var(--line); overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: var(--ice); white-space: pre; }
.prose .table-wrap { margin: 14px 0 20px; }
.prose .table { font-size: 14.5px; }
.prose .table code { font-size: 13px; }
.prose details { border-bottom: 1px solid var(--line); }
.prose details:first-of-type { border-top: 1px solid var(--line); }
.prose summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 12px 2px; cursor: pointer; list-style: none; color: var(--ink); font-weight: 500; }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: ''; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--glass-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aeb9ff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / 13px no-repeat; transition: transform 300ms var(--ease); }
.prose details[open] summary::after { transform: rotate(45deg); }
.prose details p { padding: 0 2px 8px; }
.dest-list { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px !important; }
.dest-list li { display: flex; align-items: baseline; gap: 12px; margin: 0; }
.dest-list .dot { position: relative; top: -2px; }
.prose .note { padding: 14px 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }

@media (max-width: 960px) {
  .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-toc { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 20; margin-bottom: 20px; }
  .docs-toc-nav { display: none; }
  .docs-toc-btn { display: inline-flex; background: rgba(11, 15, 58, 0.88); }
  .prose { font-size: 16px; }
}
.toc-sheet .docs-toc-nav { display: flex; border-left: 0; padding-left: 0; }
.toc-sheet .docs-toc-nav a { min-height: 50px; font-size: 17px; color: var(--ink); padding: 0 6px; border-radius: 12px; }
.toc-sheet .docs-toc-nav a.is-active { background: var(--glass-2); }
.toc-sheet .docs-toc-nav a.is-active::before { display: none; }
.toc-sheet .docs-toc-title { display: none; }

/* ------------------------------------------------------------------ 404 (404.html shares this sheet) */
.notfound { display: flex; align-items: center; min-height: 72vh; }
.notfound-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.notfound h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 300; letter-spacing: -0.035em; max-width: 14em; text-wrap: balance; margin: 12px 0 14px; }
.notfound h1 b { font-weight: 700; }
.notfound .lead { margin: 0 auto 28px; text-align: center; }
.notfound-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.lost { position: relative; width: 220px; height: 220px; margin-bottom: 18px; display: grid; place-items: center; }
.lost-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(170, 182, 255, 0.24); animation: spin 40s linear infinite; }
.lost-ring-2 { inset: 34px; border-style: solid; border-color: rgba(109, 123, 255, 0.16); animation-duration: 26s; animation-direction: reverse; }
.lost-core { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 35% 30%, #4b58ff, #111bc4 70%); box-shadow: 0 0 0 12px rgba(52, 66, 255, 0.08), 0 0 70px rgba(52, 66, 255, 0.7); animation: drift 9s ease-in-out infinite; }
.lost-core svg { width: 56px; height: auto; }
.lost-moon { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 16px var(--warn); animation: moon 12s linear infinite; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(6px, -8px) rotate(-8deg); } }
@keyframes moon { from { transform: rotate(0deg) translateX(110px) rotate(0deg); } to { transform: rotate(360deg) translateX(110px) rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .lost-ring, .lost-core, .lost-moon { animation: none; } }
