/* aycode.ai/docs: three columns (chapters, article, on this page), built on the tokens in site.css.
 * The base rules up to "the manual" are shared with the feature, radar, changelog and legal pages, which load this
 * file too; everything after it is for the docs alone (.docs-shell) and reads like a printed manual in the new look:
 * the overview opens under the start page's horizon, the chapters list like a contents page, screenshots are prints
 * with a torn edge and a strip of tape, notes are paper slips. New motion runs at 10 frames a second (steps) and
 * stands still under "reduce motion". */

.docs { background: var(--bg); }
.docs-top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.docs-top__inner { max-width: 1440px; gap: 14px; }
.docs-badge { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--accent-ink); background: var(--accent-soft); font: 600 0.78rem/1 var(--font-mono); letter-spacing: 0.04em; text-decoration: none; }
.docs-menu { display: none; }
.docs-menu svg, .docs-search-btn svg, .docs-search__field svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.docs-search-btn { display: flex; align-items: center; gap: 10px; flex: 0 1 320px; margin-inline: auto 0; height: 38px; padding: 0 8px 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--faint); font: 500 0.88rem/1 var(--font-ui); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.docs-search-btn:hover { border-color: var(--accent); color: var(--muted); }
.docs-search-btn span { flex: 1; text-align: left; }
.docs-top .top__tools { margin-left: 0; }
kbd { display: inline-grid; place-items: center; min-width: 1.6em; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--panel-2); color: var(--ink); font: 600 0.78em/1.2 var(--font-mono); white-space: nowrap; }

.docs-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr) 232px; max-width: 1440px; margin-inline: auto; }

/* chapters */
.docs-side { position: sticky; top: 64px; align-self: start; height: calc(100dvh - 64px); overflow-y: auto; padding: 28px 18px 48px 24px; border-right: 1px solid var(--line); scrollbar-width: thin; }
.docs-nav__group { margin-bottom: 22px; }
.docs-nav__label { margin: 0 0 8px 10px; color: var(--faint); font: 600 0.7rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.docs-nav ul { margin: 0; padding: 0; list-style: none; }
.docs-nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--muted); font-size: 0.92rem; text-decoration: none; transition: background-color 0.2s ease, color 0.2s ease; }
.docs-nav a:hover { background: var(--panel); color: var(--ink); }
.docs-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
/* the chapter you are in is marked like the header's progress line: violet running into ember */
.docs-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--accent-bar), var(--look-ember)); }
.docs-nav__icon { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; background: var(--panel-2); color: var(--accent-ink); }
.docs-nav a[aria-current="page"] .docs-nav__icon { background: var(--accent); color: #fff; }
.docs-nav__icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.docs-nav__sub { margin: 2px 0 6px 34px !important; border-left: 1px solid var(--line); }
.docs-nav__sub a { padding: 5px 10px; font-size: 0.84rem; border-radius: 0 8px 8px 0; }

/* article */
.docs-main { min-width: 0; padding: 44px clamp(20px, 4.5vw, 64px) 96px; }
.doc { max-width: 780px; margin-inline: auto; }
.doc__crumb { display: flex; gap: 8px; align-items: center; color: var(--faint); font: 600 0.74rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.doc__crumb span { color: var(--accent-ink); }
.doc h1 { margin-top: 14px; font: 750 clamp(2.2rem, 1.5rem + 2.6vw, 3.25rem)/1.05 var(--font-display); letter-spacing: -0.035em; background: linear-gradient(180deg, var(--ink) 30%, color-mix(in srgb, var(--accent-ink) 70%, var(--ink))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc__lead { margin-top: 16px; color: var(--muted); font-size: 1.16rem; line-height: 1.65; max-width: 680px; }
.doc__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.doc__pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }
.doc h2 { position: relative; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); font: 700 1.6rem/1.2 var(--font-display); letter-spacing: -0.025em; scroll-margin-top: 84px; }
.doc h3 { margin-top: 34px; font: 650 1.14rem/1.3 var(--font-display); letter-spacing: -0.01em; scroll-margin-top: 84px; }
.doc h2 .anchor, .doc h3 .anchor { position: absolute; margin-left: -1.1em; padding-right: 0.3em; color: var(--faint); text-decoration: none; opacity: 0; transition: opacity 0.2s ease; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc .anchor:focus-visible { opacity: 1; }
.doc p, .doc li { color: var(--ink-2); font-size: 1.01rem; line-height: 1.75; }
.doc p { margin-top: 14px; }
.doc a:not(.btn, .anchor, .docs-entry a, .docs-pager a, .docs-jump a) { color: var(--accent-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); text-underline-offset: 3px; }
.doc strong { color: var(--ink); font-weight: 650; }
.doc code { padding: 2px 6px; border-radius: 6px; background: var(--panel-2); color: var(--ink); font: 500 0.86em/1.4 var(--font-mono); }
.doc ul.doc-list { margin-top: 12px; padding-left: 0; list-style: none; }
.doc ul.doc-list li { position: relative; padding-left: 22px; margin-top: 8px; }
.doc ul.doc-list li::before { content: ""; position: absolute; left: 4px; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-bar); box-shadow: 0 0 0 4px var(--accent-soft); }

/* key tables and plain tables */
.doc-table { width: 100%; margin-top: 18px; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 0.93rem; }
.doc-table th { padding: 11px 14px; background: var(--panel-2); color: var(--muted); font-weight: 600; text-align: left; }
.doc-table td { padding: 11px 14px; border-top: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.doc-table td:first-child { white-space: nowrap; }
.doc-table-wrap { overflow-x: auto; }

/* ---------- the manual: everything below is for the docs alone ---------- */

/* a chapter opens with its number, large and faint behind the title */
.doc__head { position: relative; isolation: isolate; }
.doc__no {
  position: absolute; z-index: -1; top: -0.2em; right: -0.04em;
  font: italic 300 clamp(6.5rem, 3.6rem + 8vw, 11.5rem)/1 var(--font-serif);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  letter-spacing: -0.06em;
  color: color-mix(in srgb, var(--accent-ink) 7%, transparent);
  -webkit-text-stroke: 1px color-mix(in srgb, var(--accent-ink) 32%, transparent);
  pointer-events: none; user-select: none;
}
.docs-shell .doc__crumb span { color: var(--look-ember); }
.docs-shell .doc__meta { margin-top: 22px; }
.docs-shell .doc__pill { padding: 6px 9px; border: 1px dashed var(--line-2); border-radius: 6px; color: var(--muted); font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; }

/* sections are numbered like the start page's questions, (01) over a serif heading with an ember rule */
.docs-shell .doc { counter-reset: doc-part; }
.docs-shell .doc > section > h2 {
  counter-increment: doc-part;
  font: 430 clamp(1.75rem, 1.4rem + 1vw, 2.2rem)/1.12 var(--font-serif);
  font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 72;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.docs-shell .doc > section > h2::before {
  content: "(" counter(doc-part, decimal-leading-zero) ")";
  display: block; width: max-content; margin-bottom: 14px; padding-right: 38px;
  color: var(--faint); font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.06em;
  background: linear-gradient(var(--look-ember), var(--look-ember)) right 55% / 26px 1.5px no-repeat;
}
.docs-shell .doc h3 { font-weight: 640; }
/* list marks drawn with the pencil: a short ember stroke */
.docs-shell .doc ul.doc-list li::before { left: 3px; top: 0.86em; width: 11px; height: 2px; border-radius: 2px; background: var(--look-ember); box-shadow: none; rotate: -14deg; }

/* numbered steps: serif numerals in the accent ink, a dotted pencil line between them */
.doc-steps { counter-reset: step; margin: 20px 0 0; padding: 0; list-style: none; }
.doc-steps li { position: relative; counter-increment: step; padding: 0 0 20px 52px; }
.doc-steps li::before {
  content: counter(step); position: absolute; left: 0; top: -0.08em; width: 34px; text-align: center;
  color: var(--look-acc-ink); font: italic 400 1.8rem/1 var(--font-serif); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72;
}
.doc-steps li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 2.25em; bottom: 6px; border-left: 1.5px dotted color-mix(in srgb, var(--look-ember) 60%, transparent); }

/* notes are paper slips taped into the manual; the page's colours turn to ink on paper inside them */
.callout {
  --ink: #1c1820; --ink-2: #3d3644; --muted: #5f5866; --accent-ink: #5b2fc2;
  --panel-2: rgb(40 30 44 / 0.07); --line-2: rgb(40 30 44 / 0.2);
  position: relative; display: flex; gap: 14px; margin: 34px 0 6px; padding: 20px 22px 18px 18px;
  border-radius: 2px; background: var(--look-paper); color: var(--ink-2);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.4) inset, 0 14px 26px -12px rgb(4 2 10 / 0.55);
  rotate: -0.35deg;
}
.callout + .callout, section > .callout:nth-of-type(even) { rotate: 0.3deg; }
.callout::before {
  content: ""; position: absolute; top: -13px; left: 26px; width: 92px; height: 28px; rotate: -5deg; opacity: 0.92;
  background: url("/assets/look/klebeband-a.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.18));
}
.callout p { margin: 0; color: var(--ink-2); font-size: 0.97rem; line-height: 1.65; }
/* the mark is a stamp: a ring with the letter in serif italic, pressed in slightly askew */
.callout__icon {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -1px; border-radius: 50%;
  border: 1.5px solid currentColor; color: var(--accent-ink); rotate: -10deg;
  font: italic 600 1rem/1 var(--font-serif); font-variation-settings: "SOFT" 100, "WONK" 1;
}
.callout--tip .callout__icon { color: #0d6f4f; }
.callout--warn { background: color-mix(in srgb, var(--look-paper) 86%, #ffb48c); }
.callout--warn .callout__icon { color: #a83c0c; }
.callout--warn::before { background-image: url("/assets/look/klebeband-b.webp"); rotate: 4deg; left: auto; right: 30px; }

/* screenshots are prints: a paper margin, a torn foot, tape at the top, laid down slightly askew; click to look closer */
.shot { margin: 46px 0 10px; }
.shot__frame {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  filter: drop-shadow(var(--look-print));
  rotate: -0.3deg;
  transition: rotate 0.3s steps(3), translate 0.3s steps(3);
}
.doc section .shot:nth-of-type(even) .shot__frame { rotate: 0.35deg; }
.shot__frame:hover, .shot__frame:focus-visible { rotate: 0deg; translate: 0 -3px; }
.shot__frame::after {
  content: ""; position: absolute; z-index: 1; top: -15px; left: 50%; width: clamp(88px, 14%, 124px); aspect-ratio: 560 / 169;
  translate: -50% 0; rotate: -3deg; opacity: 0.94;
  background: url("/assets/look/klebeband-a.webp") center / 100% 100% no-repeat;
}
.doc section .shot:nth-of-type(even) .shot__frame::after { background-image: url("/assets/look/klebeband-b.webp"); aspect-ratio: 560 / 223; rotate: 4deg; left: 62%; }
.shot__print {
  display: block; padding: clamp(6px, 0.9vw, 11px) clamp(6px, 0.9vw, 11px) clamp(18px, 2vw, 26px); border-radius: 3px; background: var(--look-paper);
  -webkit-mask: url("/assets/look/riss-unten.png") bottom / 100% 22px no-repeat, linear-gradient(#000 0 0) top / 100% calc(100% - 21px) no-repeat;
  mask: url("/assets/look/riss-unten.png") bottom / 100% 22px no-repeat, linear-gradient(#000 0 0) top / 100% calc(100% - 21px) no-repeat;
}
.shot__frame img { display: block; width: 100%; height: auto; border-radius: 1px; background: var(--bg-2); }
.shot figcaption { max-width: 62ch; margin-top: 14px; color: var(--muted); font: 500 0.78rem/1.6 var(--font-mono); letter-spacing: 0.01em; }
.shot__no { color: var(--ink); white-space: nowrap; }
.shot__no::after { content: " ·"; color: var(--faint); }
.shot--narrow { max-width: 520px; margin-inline: auto; }

/* tables in print: rules above and below, column heads in small caps of the mono */
.docs-shell .doc-table { border: 0; border-radius: 0; border-top: 1.5px solid color-mix(in srgb, var(--ink) 55%, transparent); border-bottom: 1px solid var(--line-2); font-size: 0.94rem; }
.docs-shell .doc-table th { padding: 12px 14px 10px; background: none; border-bottom: 1px solid var(--line-2); color: var(--faint); font: 600 0.7rem/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.docs-shell .doc-table td { padding: 12px 14px; }
.docs-shell .doc-table tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }

/* ---------- the overview: a contents page ---------- */
.docs-index { margin: 32px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.docs-entry { position: relative; display: grid; grid-template-columns: 8.25rem minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.docs-entry__part { grid-column: 1; padding: 25px 12px 0 0; color: var(--faint); font: 600 0.66rem/1.35 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.docs-entry > a {
  grid-column: 2; display: grid; grid-template-columns: 2.5rem minmax(0, max-content) minmax(18px, 1fr) auto;
  grid-template-areas: "no title dots time" ". lead lead lead"; column-gap: 12px; row-gap: 6px;
  padding: 18px 0 20px; color: inherit; text-decoration: none;
}
.docs-entry__no { grid-area: no; padding-top: 0.6em; color: var(--faint); font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.04em; }
.docs-entry__title {
  grid-area: title; position: relative; color: var(--ink);
  font: 440 1.42rem/1.2 var(--font-serif); font-variation-settings: "SOFT" 50, "opsz" 48; letter-spacing: -0.015em;
  transition: translate 0.3s steps(3);
}
.docs-entry > a::after { content: ""; grid-area: dots; align-self: end; margin-bottom: 0.5em; border-bottom: 2px dotted var(--line-2); }
.docs-entry__time { grid-area: time; align-self: end; padding-bottom: 0.12em; color: var(--muted); font: 500 0.76rem/1.6 var(--font-mono); white-space: nowrap; }
.docs-entry__lead { grid-area: lead; max-width: 56ch; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }
/* pointed at, the chapter's number turns ember and a pencil line is drawn under its title in five frames (uncovered
 * from the left: a dash pattern on a stretched, non-scaling stroke repeats under long titles) */
.docs-ink {
  position: absolute; left: 0; bottom: -0.16em; width: 100%; height: 0.26em; overflow: visible; pointer-events: none;
  fill: none; stroke: var(--look-ember); stroke-width: 0.08em; stroke-linecap: round;
  clip-path: inset(-50% 100% -50% 0); transition: clip-path 0.5s steps(5);
}
.docs-ink path { vector-effect: non-scaling-stroke; }
.docs-entry > a:hover .docs-ink, .docs-entry > a:focus-visible .docs-ink { clip-path: inset(-50% -2% -50% 0); }
.docs-entry > a:hover .docs-entry__no, .docs-entry > a:focus-visible .docs-entry__no { color: var(--look-ember); }
.docs-entry > a:hover .docs-entry__title, .docs-entry > a:focus-visible .docs-entry__title { translate: 6px 0; }

/* the overview opens under the start page's horizon */
.docs-hero { position: relative; margin: -44px calc(-1 * clamp(20px, 4.5vw, 64px)) 0; padding: 72px clamp(20px, 4.5vw, 64px) 56px; overflow: hidden; isolation: isolate; }
.docs-hero::before { content: ""; position: absolute; inset: -30% -20% -10%; z-index: -2; background: radial-gradient(640px circle at 28% 40%, var(--accent-glow), transparent 70%), radial-gradient(520px circle at 82% 22%, rgb(79 142 245 / 0.16), transparent 70%); animation: docs-breathe 9s ease-in-out infinite alternate; }
.docs-hero__mark { position: absolute; right: -40px; top: 20px; z-index: -1; width: 340px; opacity: 0.1; transform: rotate(-8deg); }
@keyframes docs-breathe { to { transform: translate3d(4%, 6%, 0) scale(1.08); } }
.docs-hero .doc { max-width: 900px; }
.docs-hero h1 { font-size: clamp(2.6rem, 1.6rem + 3.6vw, 4.2rem); }
/* The print: a torn strip of the horizon along the hero's foot. Its ember line runs right through the middle of
 * the search field, which lies on it like the app window on the start page; below the line the ground fades into
 * the page. The photo is wider than the strip so the line stays where it is at any width (the share of the line
 * is measured on each photo: dusk 0.567, dawn 0.70 of its height). */
.docs-sky {
  --sky-line: 132px;   /* from the strip's top edge to the ember line */
  --sky-foot: 83px;    /* from the line to the hero's foot: half the search field and the padding below it */
  --sky-photo: max(100cqw, 940px);
  position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: calc(var(--sky-line) + var(--sky-foot));
  container-type: inline-size; overflow: hidden; pointer-events: none;
  background: var(--look-ground);
  -webkit-mask: url("/assets/look/riss-oben.png") top / 100% 30px no-repeat, linear-gradient(#000 0 56%, transparent 100%) bottom / 100% calc(100% - 29px) no-repeat;
  mask: url("/assets/look/riss-oben.png") top / 100% 30px no-repeat, linear-gradient(#000 0 56%, transparent 100%) bottom / 100% calc(100% - 29px) no-repeat;
}
.docs-sky img { position: absolute; left: 50%; width: var(--sky-photo); max-width: none; height: auto; translate: -50% 0; }
.docs-sky .docs-sky__dark { display: var(--look-dark); top: calc(var(--sky-line) - var(--sky-photo) * 0.5625 * 0.567); }
.docs-sky .docs-sky__light { display: var(--look-light); top: calc(var(--sky-line) - var(--sky-photo) * 0.4021 * 0.70); }
.docs-sky__glow {
  position: absolute; left: 0; right: 0; top: calc(var(--sky-line) - 100px); height: 200px;
  background: var(--look-glow); mix-blend-mode: var(--look-glow-blend);
  animation: look-breathe 6s steps(60) infinite alternate;
}
/* The strip's swallow and the one in the sky over every page take turns: look-fly crosses in the first 18 of its
 * 30 seconds, and this one sets off as the sky's (delay -26s in look.css) reaches the far side. */
.docs-sky .look-flight { top: 34px; animation-delay: -8s; }
/* the search is a pane of glass on the horizon; its top edge catches the ember like the header's */
.docs-hero__search {
  position: relative; display: flex; align-items: center; gap: 12px; width: min(100%, 560px); height: 54px; margin-top: 118px; padding: 0 12px 0 16px;
  border-radius: 16px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel) 64%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  color: var(--muted); font: 500 1rem/1 var(--font-ui); cursor: text; box-shadow: var(--look-window-shadow); transition: border-color 0.2s ease;
}
.docs-hero__search::after {
  content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--look-ember) 75%, transparent) 30%, color-mix(in srgb, var(--accent) 75%, transparent) 70%, transparent);
}
.docs-hero__search:hover { border-color: var(--accent); }
.docs-hero__search svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.docs-hero__search span { flex: 1; min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
/* a phone has no keys to press */
@media (hover: none), (pointer: coarse) {
  .docs-hero__search kbd, .docs-search__field kbd { display: none; }
}

/* previous / next: the next chapter's title in the serif, underlined in pencil when pointed at */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 780px; margin: 96px auto 0; padding-top: 24px; border-top: 1px solid var(--line-2); }
.docs-pager a { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; color: inherit; text-decoration: none; }
.docs-pager small { color: var(--faint); font: 600 0.7rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.docs-pager b {
  align-self: flex-start; color: var(--ink); font: italic 420 clamp(1.3rem, 1.1rem + 0.6vw, 1.65rem)/1.15 var(--font-serif); font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.015em; padding-bottom: 4px;
  background: linear-gradient(var(--look-ember), var(--look-ember)) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.4s steps(4), color 0.2s ease;
}
.docs-pager a:hover b, .docs-pager a:focus-visible b { background-size: 100% 1.5px; color: var(--look-acc-ink); }
.docs-pager .is-next { grid-column: 2; text-align: right; }
.docs-pager .is-next b { align-self: flex-end; background-position: 100% 100%; }

/* on this page: numbered, the section you are reading marked in ember */
.docs-toc { position: sticky; top: 64px; align-self: start; max-height: calc(100dvh - 64px); overflow-y: auto; padding: 44px 24px 40px 8px; }
.docs-toc p { margin: 0 0 12px; color: var(--faint); font: 600 0.7rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.docs-toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); counter-reset: toc; }
.docs-toc li { counter-increment: toc; }
.docs-toc li a { display: grid; grid-template-columns: 2.1em minmax(0, 1fr); margin-left: -1px; padding: 5px 12px; border-left: 2px solid transparent; color: var(--muted); font-size: 0.84rem; line-height: 1.4; text-decoration: none; transition: color 0.2s ease, border-color 0.2s ease; }
.docs-toc li a::before { content: counter(toc, decimal-leading-zero); color: var(--faint); font: 500 0.68rem/2 var(--font-mono); }
.docs-toc a:hover { color: var(--ink); }
.docs-toc li a.is-active { color: var(--ink); border-left-color: var(--look-ember); }
.docs-toc li a.is-active::before { color: var(--look-ember); }
.docs-toc__top { display: inline-block; margin-top: 18px; color: var(--faint); font-size: 0.8rem; text-decoration: none; }

/* where that column is gone, the same list folds in under the title */
.docs-jump { display: none; }
.docs-jump summary { display: flex; align-items: center; gap: 10px; padding: 14px 2px; list-style: none; cursor: pointer; color: var(--muted); font: 600 0.72rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.docs-jump summary::-webkit-details-marker { display: none; }
.docs-jump summary span { color: var(--faint); }
.docs-jump summary span::before { content: "("; }
.docs-jump summary span::after { content: ")"; }
.docs-jump summary::after { content: "+"; margin-left: auto; color: var(--look-ember); font: 400 1.2rem/1 var(--font-mono); }
.docs-jump[open] summary::after { content: "–"; }
.docs-jump ol { margin: 0; padding: 0 0 12px; list-style: none; counter-reset: jump; }
.docs-jump li { counter-increment: jump; margin: 0; }
.docs-jump a { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); padding: 7px 2px; color: var(--ink-2); font-size: 0.95rem; line-height: 1.45; text-decoration: none; }
.docs-jump a::before { content: counter(jump, decimal-leading-zero); color: var(--faint); font: 500 0.7rem/2.1 var(--font-mono); }
.docs-jump a:hover { color: var(--ink); }

/* search: a glass pane with the ember edge; the chosen hit is marked like the reading place */
.docs-search { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: rgb(8 6 14 / 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.docs-search[hidden] { display: none; }
.docs-search__panel {
  position: relative; width: min(100%, 640px); max-height: 70vh; display: flex; flex-direction: column;
  border-radius: 20px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 40px 120px -30px rgb(4 2 10 / 0.7), 0 0 0 1px var(--accent-soft); overflow: hidden; animation: docs-pop 0.28s var(--ease);
}
.docs-search__panel::before { content: ""; position: absolute; left: 10%; right: 10%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--look-ember) 30%, var(--accent) 70%, transparent); }
@keyframes docs-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.docs-search__field { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--faint); }
.docs-search__field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 1.05rem/1.2 var(--font-ui); }
.docs-search__field input::-webkit-search-cancel-button { display: none; }
.docs-search__results { margin: 0; padding: 8px; list-style: none; overflow-y: auto; }
.docs-search__results a { position: relative; display: block; padding: 11px 14px 11px 16px; border-radius: 12px; color: inherit; text-decoration: none; }
.docs-search__results a[aria-selected="true"] { background: var(--accent-soft); }
.docs-search__results a[aria-selected="true"]::before { content: ""; position: absolute; left: 5px; top: 13px; bottom: 13px; width: 2px; border-radius: 2px; background: var(--look-ember); }
.docs-search__results small { display: block; color: var(--accent-ink); font: 600 0.68rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.docs-search__results b { display: block; margin-top: 6px; color: var(--ink); font: 460 1.08rem/1.25 var(--font-serif); font-variation-settings: "SOFT" 50, "opsz" 36; letter-spacing: -0.01em; }
.docs-search__results span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.85rem; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-search__results mark { background: none; color: var(--ink); font-weight: 700; }
/* nothing found: the drawn swallow keeps flying on the spot */
.docs-search__empty { margin: 0; padding: 26px 22px 28px; color: var(--muted); text-align: center; }
.docs-search__empty .look-bird { position: relative; display: block; width: 46px; margin: 0 auto 14px; color: var(--look-bird); }

/* zoomed screenshot: the print, larger, on its paper */
.docs-zoom { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 3vw; background: rgb(8 6 14 / 0.84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: zoom-out; }
.docs-zoom[hidden] { display: none; }
.docs-zoom img { max-width: 100%; max-height: 92vh; border: clamp(5px, 0.8vw, 10px) solid var(--look-paper); border-radius: 3px; box-shadow: 0 40px 120px -20px rgb(0 0 0 / 0.8); animation: docs-pop 0.3s var(--ease); }

/* prints and contents lines are laid down once they are near: five frames, the tape a moment later */
.rises .doc .shot, .rises .docs-entry { opacity: 0; }
.rises .doc .shot { translate: 0 18px; rotate: -1.4deg; }
.rises .docs-entry { translate: 0 14px; }
.rises .doc .shot.is-in, .rises .docs-entry.is-in { opacity: 1; translate: none; rotate: none; transition: opacity 0.5s steps(5), translate 0.5s steps(5), rotate 0.5s steps(5); }
.rises .doc .shot.is-in .shot__frame::after { animation: look-stick 0.4s steps(4) 0.5s backwards; }

/* Beside the column "on this page" the hero's glow and its strip of horizon thin out across the padding instead of
 * ending at a line, so they meet the sky over the page softly. */
@media (min-width: 1181px) {
  .docs-hero {
    -webkit-mask: linear-gradient(90deg, #000 calc(100% - clamp(20px, 4.5vw, 64px)), transparent);
    mask: linear-gradient(90deg, #000 calc(100% - clamp(20px, 4.5vw, 64px)), transparent);
  }
}

@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: 256px minmax(0, 1fr); }
  .docs-toc { display: none; }
  .docs-jump { display: block; margin-top: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
}
@media (max-width: 880px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-menu { display: grid; }
  /* the closed drawer leaves nothing behind: no shadow at the screen's edge, no links to tab into */
  .docs-side { position: fixed; z-index: 60; top: 64px; left: 0; width: min(86vw, 320px); background: var(--bg); transform: translateX(-102%); visibility: hidden; transition: transform 0.4s var(--ease), visibility 0s linear 0.4s; }
  .docs-side.is-open { transform: none; visibility: visible; transition: transform 0.4s var(--ease); box-shadow: 30px 0 80px -30px rgb(0 0 0 / 0.6); }
  .docs-scrim { position: fixed; inset: 64px 0 0; z-index: 55; background: rgb(8 8 10 / 0.5); }
  .docs-scrim[hidden] { display: none; }
  .docs-search-btn span, .docs-search-btn kbd, .top .docs-search-btn span, .top .docs-search-btn kbd { display: none; }
  .docs-search-btn, .top .docs-search-btn { flex: none; width: 38px; max-width: none; padding: 0; justify-content: center; margin-left: auto; }
  .docs-badge { display: none; }
  .docs-main { padding-top: 28px; }
  .docs-hero { margin-top: -28px; padding-top: 48px; }
  .docs-hero__mark { width: 200px; right: -50px; }
  .docs-hero__search { margin-top: 104px; }
  .docs-sky { --sky-line: 118px; }
}
@media (max-width: 640px) {
  /* the contents page in one column: the group's name above its first chapter, no leader */
  .docs-entry { grid-template-columns: minmax(0, 1fr); }
  .docs-entry__part { padding: 26px 0 0; }
  .docs-entry > a { grid-column: 1; grid-template-columns: 2.1rem minmax(0, 1fr) auto; grid-template-areas: "no title time" ". lead lead"; padding: 14px 0 16px; }
  .docs-entry > a::after { display: none; }
  .docs-entry__title { font-size: 1.24rem; }
  .doc__no { font-size: 5.6rem; top: -0.1em; }
}
@media (max-width: 560px) {
  .docs-top .btn--small { display: none; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager .is-next { grid-column: 1; }
  .doc h2 { margin-top: 56px; }
  .shot__frame, .doc section .shot:nth-of-type(even) .shot__frame { rotate: none; }
  .docs-search { padding: 10px; }
  .docs-search__panel { max-height: calc(100dvh - 20px); }
}
@media (prefers-reduced-motion: reduce) {
  .docs-hero::before, .docs-sky__glow, .rises .doc .shot.is-in .shot__frame::after { animation: none; }
  .rises .doc .shot, .rises .docs-entry { opacity: 1; translate: none; rotate: none; transition: none; }
  .shot__frame, .docs-entry__title, .docs-ink, .docs-pager b { transition: none; }
  .docs-search__panel, .docs-zoom img { animation: none; }
  .docs-side, .docs-side.is-open { transition: none; }
}
