/* The docs pages: shared by everything under /docs/ and by relay.html.
   Builds on site.css's .doc layout. */

/* ---------- Docs hub ---------- */
.docs-hero { padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(24px, 4vw, 48px); max-width: calc(1160px + 2 * var(--gutter)); margin: 0 auto; }
.docs-hero .eyebrow { display: block; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--signal); margin-bottom: 18px; }
.docs-hero h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; margin: 0 0 18px; max-width: 11em; }
.docs-hero p { color: var(--ink); max-width: 34em; margin: 0; font-size: clamp(18px, 1.5vw, 21px); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.quick a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--night3); font: 500 13px/1 var(--mono); color: var(--ink); text-decoration: none; }
.quick a:hover { border-color: var(--muted); color: var(--paper); }
.quick svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.docs-list { padding: 8px var(--gutter) 64px; max-width: calc(1160px + 2 * var(--gutter)); margin: 0 auto; }
.docs-list h2 { font-size: 15px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--signal); margin: 36px 0 14px; }
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.guide { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 20px; border-radius: 20px; border: 1.5px solid var(--night3); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.guide:hover { border-color: var(--muted); transform: translateY(-2px); }
.guide .tile { width: 44px; height: 44px; border-radius: 12px; background: var(--night1); display: grid; place-items: center; }
.guide .tile svg { width: 22px; height: 22px; fill: none; stroke: var(--signal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.guide h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; }
.guide p { color: var(--ink); font-size: 15px; margin: 0; }
.guide .for-row { display: flex; gap: 6px; margin-top: 10px; }
.guide .for { margin: 0; }

/* Two audiences on one page: a tag at the start of a section. */
.for { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; margin: 0 0 10px; background: color-mix(in srgb, var(--mint) 14%, transparent); color: color-mix(in srgb, var(--mint) 70%, var(--paper)); }
.for.devs { background: color-mix(in srgb, var(--signal) 12%, transparent); color: var(--signal); }
.doc h2 + .for { margin-top: -2px; }

/* ---------- Breadcrumb and page meta ---------- */
.doc .crumbs { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.doc .crumbs a { color: var(--muted); text-decoration: none; }
.doc .crumbs a:hover { color: var(--paper); }
.doc .meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; align-items: flex-start; }
.doc .meta a, .doc .meta span {
  font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1.5px solid var(--night3); color: var(--ink); text-decoration: none;
}
.doc .meta a:hover { color: var(--paper); border-color: var(--muted); }

/* ---------- Examples: a picture of the result beside its code ---------- */
.doc .example {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0 0 22px;
  border: 1.5px solid var(--night3); border-radius: 18px; overflow: hidden;
}
.doc .example > figure { margin: 0; padding: 20px; display: grid; place-items: center; background: var(--night1); }
.doc .example > figure.light { background: #f3f1ec; }
.doc .example > figure img { max-width: 100%; height: auto; border-radius: 12px; }
.doc .example > figure figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.doc .example > figure.light figcaption { color: #5b6476; }
.doc .example pre { margin: 0; border-radius: 0; max-height: 520px; height: 100%; }
.doc .example > .caption { padding: 12px 18px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--night3); animation: none; opacity: 1; transform: none; }
.doc .example .code { margin: 0; height: 100%; }
.doc .example > figure + figure { border-top: 1px solid var(--night3); }
@media (min-width: 1100px) {
  .doc .example.side { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
  .doc .example.side > .caption { border-top: 0; border-left: 1px solid var(--night3); }
  .doc .example.side > figure + figure { border-top: 0; border-left: 1px solid var(--night3); }
}

/* A row of pictures. */
.doc .shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 0 0 24px; }
.doc .shots figure { margin: 0; width: auto; }
.doc .shots img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--night3); display: block; }
.doc .shots figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: center; }
.doc .shots.two { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.doc figure.wide { margin: 0 0 24px; }
.doc figure.wide img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--night3); display: block; }
.doc figure.wide figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
@media (max-width: 640px) {
  .doc .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc .shots.two { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Code blocks: a label and a copy button ---------- */
.doc .code { position: relative; margin: 0 0 18px; }
.doc .code > pre { margin: 0; }
.doc .code[data-lang]::before {
  content: attr(data-lang); position: absolute; top: 10px; right: 50px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: #93a1be; pointer-events: none;
}
.doc .copy {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 28px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgb(255 255 255 / .18); background: rgb(255 255 255 / .06); color: #eaf1fb; display: grid; place-items: center;
}
.doc .copy:hover { background: rgb(255 255 255 / .14); }
.doc .copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.doc .copy.done { color: #7ee2b8; border-color: #7ee2b8; }
.doc pre .k { color: #8fd3ff; }
.doc pre .s { color: #ffd37a; }
.doc pre .n { color: #ffb86b; }
.doc pre .c { font-style: italic; }
.doc pre .f { color: #c9b6ff; }

/* ---------- Callouts ---------- */
.doc .callout.tip::before { background: var(--mint); }
.doc .callout.dev::before { background: var(--signal); }
.doc .callout > b:first-child { color: var(--paper); }

/* A definition list for fields. */
.doc dl.fields { margin: 0 0 18px; display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 18px; }
.doc dl.fields dt code { white-space: nowrap; }
.doc dl.fields dd { margin: 0; color: var(--ink); }
@media (max-width: 640px) {
  .doc dl.fields { grid-template-columns: 1fr; }
  .doc dl.fields dd { margin-bottom: 8px; }
}

/* Next and previous page. */
.doc .pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 56px 0 0; }
.doc .pager a { display: grid; gap: 4px; padding: 18px 20px; border-radius: 16px; border: 1.5px solid var(--night3); color: var(--paper); font-weight: 800; font-size: 16px; text-decoration: none; transition: border-color .15s; }
.doc .pager a:hover { border-color: var(--muted); }
.doc .pager a small { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.doc .pager a:last-child { text-align: right; }
.doc .pager a:only-child { grid-column: 1; text-align: left; }
@media (max-width: 640px) { .doc .pager { grid-template-columns: 1fr; } .doc .pager a:last-child { text-align: left; } }
