/* The docs page (docs.html): plain white and grey, with the app's purple neon
   kept for flavor (the logo, your future self's lines, the tutorial screens). */

html.docs {
  --bg: #f6f6f9;
  --panel: #ffffff;
  --text: #1d1b26;
  --muted: #5c5a6b;
  --line: #e3e2ea;
  --accent: #6d3df5;
  --neon: #b48cff;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body.docs { line-height: 1.65; }

/* Nav: light bar; the logo keeps its phasing neon echoes on a dark core. */
.docs .nav { background: rgba(255, 255, 255, .86); border-bottom: 1px solid var(--line); }
.docs .brand { color: var(--text); }
.docs .logo .core { color: #2a2240; filter: none; }
.docs .nav-label { color: var(--muted); font-size: 15px; }
.docs .nav nav { gap: 14px; }
.nav-btn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 12px; cursor: pointer;
  color: var(--text); background: var(--panel); border: 1px solid #d3d1de; transition: border-color .2s, color .2s, box-shadow .2s;
}
.nav-btn:hover { color: var(--accent); border-color: var(--neon); box-shadow: 0 0 12px rgba(150, 110, 255, .3); }
.nav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* The menu: this page's sections, in a panel below the nav (the app's, in white). */
.menu-scrim { position: fixed; inset: 73px 0 0; z-index: 11; background: rgba(29, 27, 38, .18); }
.menu {
  position: fixed; top: 73px; right: 0; bottom: 0; z-index: 12; width: min(280px, 82vw); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 16px;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(80, 50, 160, .12);
  animation: menu-in .2s ease-out;
}
.menu[hidden], .menu-scrim[hidden] { display: none; }
@keyframes menu-in { from { transform: translateX(24px); opacity: 0; } }
.menu a { display: block; padding: 10px 14px; border-radius: 12px; font-size: 16px; color: var(--text); transition: background .2s, box-shadow .2s; }
.menu a:hover { background: #f3eefe; box-shadow: inset 0 0 0 1px #d9ccff; }
@media (prefers-reduced-motion: reduce) { .menu { animation: none; } }

.docs-layout { width: min(1120px, calc(100vw - 32px)); margin: 0 auto; padding: 104px 0 96px; display: grid; grid-template-columns: 200px 1fr; gap: 48px; }
.toc { position: sticky; top: 104px; align-self: start; display: grid; gap: 6px; font-size: 14px; }
.toc a { color: var(--muted); padding: 3px 0 3px 12px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); border-left-color: var(--neon); }

.docs-main { min-width: 0; display: grid; gap: 40px; }
.docs-main h1 { font-size: clamp(30px, 4vw, 40px); font-weight: 600; letter-spacing: -.01em; margin-bottom: 14px; }
.docs-main h2 { font-size: 24px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.docs-main h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.docs-main ul + h3 { margin-top: 20px; }
.docs-main p, .docs-main li, .docs-main dd { color: var(--muted); }
.docs-main p + p { margin-top: 12px; }
.docs-main a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.docs-main b { color: var(--text); font-weight: 600; }
.docs-main ul, .docs-main ol { padding-left: 22px; display: grid; gap: 6px; }
.lede { font-size: 19px; color: var(--text) !important; line-height: 1.55; margin-bottom: 14px; }
.intent { margin-top: 16px !important; padding: 12px 16px; border-left: 3px solid var(--neon); background: #f0ecfb; border-radius: 0 10px 10px 0; font-size: 15px; }
.soon { font-size: 12px; font-weight: 500; letter-spacing: .04em; color: var(--accent); background: #efe9ff; border: 1px solid #d9ccff; border-radius: 999px; padding: 2px 10px; }

.concepts { display: grid; grid-template-columns: 150px 1fr; gap: 12px 24px; }
.concepts dt { font-weight: 600; color: var(--text); }

/* Your future self's own lines, in the app's neon. */
blockquote.neon {
  margin-top: 18px; padding: 14px 18px; border-radius: 14px; font-size: 16px; line-height: 1.45;
  color: #f2ecff; background: #160f2b; border: 1px solid rgba(176, 140, 255, .7);
  box-shadow: 0 0 0 1px rgba(176, 140, 255, .15), 0 0 24px rgba(150, 110, 255, .35);
  text-shadow: 0 0 10px rgba(190, 160, 255, .55);
}
blockquote.neon p { color: inherit; margin: 0; }
blockquote.neon p + p { margin-top: 10px; }
blockquote.neon b { color: #fff; }
blockquote.neon cite { display: block; margin-top: 6px; font-size: 12px; font-style: normal; color: #b9a6ef; text-shadow: none; letter-spacing: .04em; }

/* A way to plan: the steps, then the app's animation (a little neon screen). */
.way { display: grid; grid-template-columns: 1fr 280px; gap: 32px; align-items: start; padding: 28px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.way .tut-stage { width: 280px; box-shadow: 0 0 0 1px rgba(176, 140, 255, .35), 0 8px 30px rgba(80, 50, 160, .25); }

/* What to copy for each app. */
.connect-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: -24px; }
.connect-app { padding: 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.connect-listing { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; }
.connect-listing:hover { border-color: var(--accent); }
.connect-listing svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.connect-step { font-size: 14px; color: var(--text) !important; margin-bottom: 4px; }
.connect-step::before { content: '\2192\00a0'; color: var(--accent); }
.copy-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.copy-row code { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; color: var(--text); background: #f1f0f6; border: 1px solid var(--line); overflow-wrap: anywhere; user-select: all; }
.copy { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 9px; cursor: pointer; color: var(--muted); background: var(--panel); border: 1px solid #d3d1de; transition: border-color .2s, color .2s, box-shadow .2s; }
.copy:hover { color: var(--accent); border-color: var(--neon); box-shadow: 0 0 10px rgba(150, 110, 255, .3); }
.copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy.copied { color: var(--accent); border-color: var(--neon); }
.note { font-size: 14px; margin-top: -24px; }
.note code, .docs-main li code { font: 12.5px ui-monospace, Menlo, Consolas, monospace; background: #efeef5; padding: 1px 6px; border-radius: 6px; color: var(--text); }

/* Tools. */
.tools { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tools th { text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; background: #f3f2f8; border-bottom: 1px solid var(--line); }
.tools td { padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.tools tr:last-child td { border-bottom: 0; }
.tools td:first-child code { font: 12.5px ui-monospace, Menlo, Consolas, monospace; color: var(--text); white-space: nowrap; }
.tools td:last-child { white-space: nowrap; font-size: 12px; }
.tools tr.confirm td:last-child { color: #c2334d; font-weight: 500; }

.examples { list-style: none; padding: 0 !important; display: flex !important; flex-wrap: wrap; gap: 10px !important; }
.examples li { padding: 7px 14px; border-radius: 999px; color: var(--text) !important; background: var(--panel); border: 1px solid #d9ccff; box-shadow: 0 0 12px rgba(150, 110, 255, .12); }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 92px; }
  .toc { display: none; }
  .way { grid-template-columns: 1fr; padding: 20px; }
  .way .tut-stage { width: 100%; max-width: 320px; }
  .connect-steps { grid-template-columns: 1fr; margin-top: -20px; }
  .concepts { grid-template-columns: 1fr; gap: 4px; }
  .concepts dd { margin-bottom: 10px; }
  .tools td:first-child code { font-size: 11.5px; }
  .tools th, .tools td { padding: 8px; }
  .tools th:nth-child(3), .tools td:nth-child(3) { display: none; }
  .tools tr.confirm td:first-child code { color: #c2334d; }
}

/* ---------- In-fiction (signed in): the same page, told by the narrator, in
   the app's dark. Each section's facts step aside for .fic (docs.ts). */
.fic { display: none; }
html.docs.fiction {
  --bg: #07061a; --panel: #110c2a; --text: #ece6ff; --muted: #a59cc8; --line: rgba(176, 140, 255, .22); --accent: #b48cff;
}
html.docs.fiction body { background: radial-gradient(ellipse at 50% 0%, rgba(90, 60, 200, .25), transparent 60%), var(--bg); color: var(--text); }
html.docs.fiction .nav { background: rgba(10, 8, 30, .82); }
html.docs.fiction .docs .logo .core, html.docs.fiction .logo .core { color: #ece6ff; }
html.docs.fiction .nav-btn { background: var(--panel); border-color: var(--line); }
html.docs.fiction .menu { background: var(--panel); }
html.docs.fiction .fic { display: block; }
html.docs.fiction .docs-main section:not(.connect-app) > :not(.fic):not(.tut-stage),
html.docs.fiction .docs-main > .note { display: none; }
html.docs.fiction .connect-app { background: var(--panel); border-color: var(--line); }
html.docs.fiction .connect-app code { background: rgba(255, 255, 255, .06); color: var(--text); }
.fic-head { margin-bottom: 14px; }
.fic-line { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; }
.fic-who { position: relative; width: 56px; height: 56px; }
.fic-who > canvas.avatar { position: absolute; left: -28px; top: -28px; width: 112px; height: 112px; pointer-events: none; }
.fic-say { margin-top: 0; }
.fic-say p + p { margin-top: 10px; }
.fic-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; border: 1px solid #d3d1de; background: var(--panel); }
.fic-toggle button { font: inherit; font-size: 13px; padding: 5px 12px; border: 0; border-radius: 999px; cursor: pointer; color: var(--muted); background: transparent; transition: color .2s, background .2s, box-shadow .2s; }
.fic-toggle button:hover { color: var(--text); }
.fic-toggle button[aria-pressed="true"] { color: #fff; background: var(--accent); box-shadow: 0 0 12px rgba(150, 110, 255, .4); }
html.docs.fiction .fic-toggle { border-color: var(--line); }
html.docs.fiction .fic-toggle button[aria-pressed="true"] { color: #0a0a18; background: #ece6ff; }
@media (max-width: 720px) { .docs .nav:has(.fic-toggle) .nav-label { display: none; } .fic-toggle button { padding: 5px 9px; } }
/* Preview only: a slot still waiting for Eric's words. */
.fic-gap { min-height: 1.4em; min-width: 8em; outline: 1px dashed rgba(255, 207, 90, .6); outline-offset: 4px; }
.fic-say.fic-gap { min-height: 3.2em; }
.fic-notice { display: none; }
html.docs.fiction .fic-notice { display: block; margin-bottom: 24px; padding: 10px 14px; border-radius: 10px; font-size: 14px; color: #3d3b4a; background: #f4f4f7; border: 1px solid #d3d1de; }
html.docs.fiction .fic-notice a { color: #6d3df5; font-weight: 500; }
