/* Doc pages: guide, changelog, support, permissions, privacy, terms, brand, 404 */
.doc-hero { padding: calc(var(--header-h) + 96px) var(--gutter) var(--block); border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.doc-hero-inner { max-width: var(--max); margin: 0 auto; }
.doc-hero h1 { font-size: clamp(32px, 3.6vw, 56px); letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 20px; }
.doc-lede { font-size: var(--lead); color: var(--fg-2); max-width: 44ch; line-height: 1.5; }
.doc-meta { margin-top: 28px; font: 400 13px var(--mono); color: var(--fg-2); }
.doc-hero .ruler-line { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; opacity: .5;
  background: repeating-linear-gradient(90deg, var(--fg-3) 0 1px, transparent 1px 16px) 0 100% / 100% 6px no-repeat,
              repeating-linear-gradient(90deg, var(--fg-3) 0 1px, transparent 1px 80px) 0 100% / 100% 10px no-repeat; }

.doc-body { max-width: var(--max); margin: 0 auto; padding: 96px var(--gutter) 160px;
  display: grid; grid-template-columns: 220px minmax(0, 720px); gap: var(--col); }
.toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.toc p { margin-bottom: 16px; }
.toc a { display: block; padding: 4px 0 4px 16px; font-size: 14px; color: var(--fg-2); border-left: 1.5px solid var(--rule); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--fg); }
.toc a.on { color: var(--fg); border-color: var(--fg); }

.prose { font-size: 17px; line-height: 1.65; }
.prose > * + * { margin-top: 20px; }
.prose h2 { font-size: clamp(28px, 2.8vw, 40px); letter-spacing: -0.035em; line-height: 1.1; margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { font-size: 21px; letter-spacing: -0.02em; line-height: 1.3; margin-top: 40px; }
.prose p, .prose li { color: var(--fg); opacity: .84; }
.prose strong { font-weight: 500; color: var(--fg); }
.prose ul, .prose ol { padding-left: 20px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--fg-3); }
.prose a:not(.btn) { border-bottom: 1px solid var(--rule-2); transition: border-color .2s; }
.prose a:not(.btn):hover { border-color: var(--fg); }
.prose code { font: 400 .88em var(--mono); background: var(--bg-2); padding: 4px 8px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--rule); }
.prose kbd.key { min-width: 26px; height: 26px; font-size: 13px; vertical-align: 1px; }
.prose figure { margin: 32px 0; }
.prose figure img, .prose figure video { border-radius: 12px; box-shadow: 0 0 0 1px var(--rule), 0 24px 60px -30px rgba(23, 23, 23, .3); width: 100%; height: auto; }
.prose figcaption { margin-top: 12px; font-size: 14px; color: var(--fg-2); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 24px 0; }
.prose th { text-align: left; font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); padding: 0 16px 12px 0; border-bottom: 1px solid var(--rule-2); }
.prose td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--fg); }
.prose td:first-child { white-space: nowrap; color: var(--fg); }
.note { padding: 20px 20px; border-radius: 10px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--rule); font-size: 15px; }
.note strong { display: block; margin-bottom: 4px; }

/* changelog */
.release { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 40px 0; border-top: 1px solid var(--rule); }
.release:first-child { border-top: 0; padding-top: 0; }
.rel-v { font: 500 32px/1 var(--sans); letter-spacing: -0.03em; }
.rel-v small { display: block; margin-top: 12px; font: 400 12px var(--mono); color: var(--fg-2); letter-spacing: .06em; text-transform: uppercase; }
.release h3 { margin-top: 0; }
.release h4 { font: 400 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); margin: 24px 0 8px; }
.release h4:first-of-type { margin-top: 12px; }

/* support */
.contact-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 28px; border-radius: 14px; background: var(--inv-bg); color: var(--inv-fg); }
.contact-card p { color: var(--inv-fg); opacity: .6; margin: 0; }
.contact-card a.mail { font-size: clamp(22px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; border: 0; color: var(--inv-fg); }
details { border-top: 1px solid var(--rule); padding: 20px 0; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font-weight: 500; font-size: 18px; letter-spacing: -0.01em; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--fg-2); font-weight: 400; transition: transform .2s var(--ease-out); }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding-top: 12px; color: var(--fg); }
/* the answer opens with its height and a fade; browsers without ::details-content open it instantly, as before */
@supports (interpolate-size: allow-keywords) {
  details { interpolate-size: allow-keywords; }
  details::details-content { block-size: 0; opacity: 0; overflow: clip;
    transition: block-size .25s var(--ease-out), opacity .25s var(--ease-out), content-visibility .25s allow-discrete; }
  details[open]::details-content { block-size: auto; opacity: 1; }
}

/* permissions */
.perm { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 28px 0; border-top: 1px solid var(--rule); }
.perm-name { font: 400 15px var(--mono); display: inline-flex; width: fit-content; padding: 8px 12px; border-radius: 7px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--rule); }
.perm dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 20px; margin: 8px 0 0; }
.perm dt { color: var(--fg-2); font-size: 15px; }
.perm dd { margin: 0; }

/* brand viewer */
.brand-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.bv { max-width: var(--max); margin: 0 auto; padding: 96px var(--gutter) 160px; }
.bv-quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 48px 0 96px; }
.bv-sw { border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule); background: var(--bg-2); }
.bv-sw i { display: block; aspect-ratio: 4 / 3; }
.bv-sw p { padding: 12px 12px; font-size: 14px; line-height: 1.4; }
.bv-sw span { display: block; font: 400 12px var(--mono); color: var(--fg-2); }
.bv-pages { display: grid; gap: 40px; }
.bv-page { margin: 0; }
.bv-page img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--rule), 0 30px 70px -40px rgba(23, 23, 23, .35); background: var(--bg-2); }
.bv-page figcaption { margin-top: 12px; font: 400 12px var(--mono); color: var(--fg-2); }

/* 404 */
.nf { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--header-h) var(--gutter) 64px; position: relative; }
.nf h1 { font-size: clamp(32px, 3.6vw, 56px); letter-spacing: -0.04em; margin: 20px auto 28px; }
.nf .nf-px { position: absolute; left: calc(50% + 1px); top: 22%; width: 16px; height: 16px; background: var(--stray); }
.nf .nf-ghost { position: absolute; left: 50%; top: 22%; width: 16px; height: 16px; outline: 1.5px dashed var(--fg); outline-offset: -1.5px; }

@media (max-width: 900px) {
  .doc-body { grid-template-columns: 1fr; }
  .toc { display: none; }
  .release { grid-template-columns: 1fr; gap: 12px; }
  .bv-quick { grid-template-columns: repeat(3, 1fr); }
  .perm dl { grid-template-columns: 1fr; gap: 4px; }
  .perm dd { margin-bottom: 12px; }
  .prose td:first-child { white-space: normal; }
}
