/* Keyline 3D docs: a reading page. A quiet section list at the side (one "On this page" disclosure on a phone), a
   calm column at a real measure, code in grey wells with a copy button, and at most three live figures on crop-marked
   plates. Tokens and the nav, footer, pills, buttons and crop marks come from home/base.css. */
::selection { background: color-mix(in srgb, var(--ink) 16%, transparent); }
html { scroll-padding-top: 24px; }
.nav a[aria-current] { color: var(--ink); }

.docs { max-width: calc(1080px + 2 * var(--gutter)); margin: 0 auto; padding: 96px var(--gutter) 0;
  display: grid; grid-template-columns: 180px minmax(0, 1fr); column-gap: 72px; align-items: start; }
.col { min-width: 0; max-width: 720px; }

/* the section list */
.side { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; font-size: 13px; }
.side p { color: var(--faint); margin-bottom: 8px; }
.side ol, .onpage ol { list-style: none; }
.side a { display: block; padding: 5px 0; color: var(--soft); line-height: 1.35; transition: color .15s; }
.side a:hover, .side a[aria-current] { color: var(--ink); }
.side a[aria-current] { font-weight: 500; }
.onpage { display: none; }

/* type: a document, not a landing page */
.col h1 { font-weight: 500; font-size: 46px; line-height: 1.06; letter-spacing: -0.035em; text-wrap: balance; }
.lede { margin-top: 16px; font-size: 17px; line-height: 1.55; color: var(--soft); max-width: 56ch; }
.col section { margin-top: 88px; }
.col h2 { font-weight: 500; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.col h3 { margin-top: 40px; font-weight: 500; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.col p, .col ul.plain { margin-top: 14px; font-size: 16px; line-height: 1.65; max-width: 60ch; }
.col h2 + p { margin-top: 16px; }
.col ul.plain { padding-left: 20px; }
.col ul.plain li + li { margin-top: 6px; }
.col p a, .col li a, .col dd a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); transition: text-decoration-color .15s; }
.col p a:hover, .col li a:hover, .col dd a:hover { text-decoration-color: var(--ink); }
.col :is(p, li, dd, dt) code { font: 400 0.9em var(--mono); padding: 1px 5px; border-radius: 6px; background: var(--well); overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.note { color: var(--soft); font-size: 14px !important; line-height: 1.55 !important; }

/* code: a grey well that scrolls inside itself */
.code { margin-top: 20px; border-radius: 12px; background: var(--well); max-width: 100%; }
.cbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 0 18px; font-size: 12px; color: var(--soft); }
.code pre { overflow-x: auto; padding: 8px 18px 18px; font: 400 13px/1.65 var(--mono); tab-size: 2; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.code pre:focus-visible { outline-offset: -3px; border-radius: 12px; }
.code code { font: inherit; white-space: pre; }
.code .c { color: var(--soft); }
.copy { height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--bg); color: var(--soft);
  display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--sans); cursor: pointer; flex: none; transition: color .15s, border-color .15s; }
.copy:hover { color: var(--ink); border-color: var(--soft); }
.copy i { font-size: 14px; }
.copy.done { color: var(--ink); }

/* reference lists: the name in code, then what it does */
.ref { margin-top: 20px; display: grid; row-gap: 16px; }
.ref > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 24px; }
.ref dt { font-size: 14px; line-height: 1.6; }
.ref dt code { padding: 0; background: none; font-size: 13px; }
.ref dd { font-size: 15px; line-height: 1.6; color: var(--soft); }
.ref dd code { color: var(--ink); }

/* a live figure on its plate: the page colour and four crop marks */
.plate { position: relative; margin-top: 24px; width: 100%; max-width: 440px; aspect-ratio: 5 / 4; }
.plate .win { inset: 10px; }
.plate.exact { max-width: 420px; }
.cap { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--soft); max-width: 60ch; }
.status { margin-top: 12px; font-size: 15px; line-height: 1.5; min-height: 1.5em; }
.status code { font: 400 13px var(--mono); }

/* the try-it panel: the figure beside its controls */
.try { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); column-gap: 32px; align-items: center; }
.try .plate { margin-top: 0; }
.knobs { display: grid; gap: 14px; }
.knobs > div { display: grid; gap: 6px; }
.knobs .k { font-size: 13px; color: var(--soft); }
.pills button { transition: background .15s, color .15s, border-color .15s; }
.pills button:hover { color: var(--ink); border-color: var(--soft); }
.pills button[aria-pressed="true"]:hover { color: var(--bg); border-color: var(--ink); }
/* swatches of the brand colours the knob sends; they are the demo's data, like the figure's own hero colour */
.pills .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -0.5px; }
.strip { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.strip .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.strip label { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--soft); margin-left: 8px; }
.strip input[type="range"] { width: 160px; accent-color: var(--ink); }

/* next page */
.way { margin-top: 88px; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; }
.way a { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); }
.way a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .docs { display: block; padding-top: 56px; }
  .side { display: none; }
  .col h1 { font-size: 34px; }
  .lede { font-size: 16px; }
  .col section { margin-top: 64px; }
  .col h2 { font-size: 23px; }
  .onpage { display: block; margin-top: 28px; border: 1px solid var(--rule-2); border-radius: 12px; font-size: 14px; padding: 8px 0 2px; }
  .onpage summary { list-style: none; display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 14px; cursor: pointer; color: var(--ink); }
  .onpage summary::-webkit-details-marker { display: none; }
  .onpage summary i { font-size: 15px; color: var(--soft); transition: transform .2s; }
  .onpage[open] summary i { transform: rotate(180deg); }
  .onpage ol { padding: 0 14px 10px; }
  .col .onpage a { display: block; padding: 9px 0; color: var(--soft); text-decoration: none; }
  .col .onpage a[aria-current] { color: var(--ink); font-weight: 500; }
  .try { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .ref > div { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .code pre { padding-inline: 14px; }
  .cbar { padding-left: 14px; }
  .strip label { margin-left: 0; width: 100%; }
  .strip input[type="range"] { flex: 1; width: auto; }
  .way { margin-top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .side a, .copy, .pills button, .onpage summary i { transition: none; }
}
