/* Layer.is docs: shared styles for every page in docs/. */

:root {
  color-scheme: light;
  --bg: #fff;
  --ink: #1a1b1e;
  --ink-strong: #000;
  --muted: #5f6268;
  --faint: #75777c;
  --paren: #a3a5a9;
  --rule: #e4e4e2;
  --code: #f5f5f3;
  --inline: #f2f2f0;
  --hover: #ebebe8;
  --scroll: #d9d9d6;
  --underline: #b8b9b7;
  --tok-comment: #6d7076;
  --tok-string: #2d6a47;
  --tok-number: #a0561b;
  --tok-call: #2a4f8a;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --serif: "Besley", Rockwell, Georgia, serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --matrix-cols: minmax(170px, 210px) minmax(0, 1fr);
  --mobilebar: 57px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131416;
    --ink: #e7e7e4;
    --ink-strong: #fff;
    --muted: #a6a8ac;
    --faint: #8c8e93;
    --paren: #686a6f;
    --rule: #2b2c2f;
    --code: #1c1d20;
    --inline: #242528;
    --hover: #2c2d31;
    --scroll: #3b3c40;
    --underline: #5c5e63;
    --tok-comment: #8d9096;
    --tok-string: #93c9a5;
    --tok-number: #e2a76c;
    --tok-call: #93b6ee;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131416;
  --ink: #e7e7e4;
  --ink-strong: #fff;
  --muted: #a6a8ac;
  --faint: #8c8e93;
  --paren: #686a6f;
  --rule: #2b2c2f;
  --code: #1c1d20;
  --inline: #242528;
  --hover: #2c2d31;
  --scroll: #3b3c40;
  --underline: #5c5e63;
  --tok-comment: #8d9096;
  --tok-string: #93c9a5;
  --tok-number: #e2a76c;
  --tok-call: #93b6ee;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; }

a {
  color: var(--ink);
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--ink-strong); text-decoration-color: var(--ink); }

p, h1, h2, h3 { text-wrap: pretty; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--inline);
  padding: 1px 4px;
  border-radius: 3px;
}

.muted { color: var(--muted); }
.paren { color: var(--paren); }

/* ------------------------------------------------------------------ */
/* Layout: sidebar, mobile header, main column                         */
/* ------------------------------------------------------------------ */

.layout { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 264px;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) transparent;
  border-right: 1px solid var(--rule);
  padding: 28px 22px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidebar__logo { display: flex; align-self: flex-start; }
.sidebar__logo img { display: block; }

.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav__group { display: flex; flex-direction: column; }
.sidenav__page {
  padding: 6px 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.sidenav__page:hover { color: var(--ink); }
.sidenav__page[aria-current="page"] { color: var(--ink); font-weight: 600; }
.sidenav__sections {
  display: flex;
  flex-direction: column;
  margin: 2px 0 12px;
  border-left: 1px solid var(--rule);
}
.sidenav__sections a {
  margin-left: -1px;
  padding: 4px 0 4px 14px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}
.sidenav__sections a:hover { color: var(--ink); }
.sidenav__sections a.sidenav__method {
  padding-left: 28px;
  font-family: var(--mono);
  font-size: 12.5px;
}
.sidenav__sections a.is-active { color: var(--ink); border-left-color: var(--ink); }

.sidebar__foot {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.gh-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
}
.gh-link:hover { color: var(--ink); }
.gh-link svg { display: block; flex-shrink: 0; }
.sidebar__meta { display: flex; align-items: center; gap: 8px; }
.version { font: 12px/1.3 var(--mono); color: var(--faint); }

.icon-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-button svg { display: block; }
.sidebar .theme-toggle { width: 30px; height: 30px; border-radius: 3px; }
.sidebar .theme-toggle:hover { color: var(--ink); background: var(--inline); }

/* The moon switches to the dark theme, the sun back to the light one. */
.icon-sun, .icon-close { display: none !important; }
:root[data-theme="dark"] .icon-sun { display: block !important; }
:root[data-theme="dark"] .icon-moon { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .icon-sun { display: block !important; }
  :root:not([data-theme]) .icon-moon { display: none !important; }
}
:root:not(.js) .theme-toggle { display: none; }

.mobilebar { display: none; }

.main { flex: 1; min-width: 0; }
.main__inner { max-width: 1080px; padding: 44px 40px 0; }

@media (min-width: 1240px) {
  .main__inner { padding: 56px 64px 0; }
}

@media (max-width: 879.98px) {
  html { scroll-padding-top: 76px; }

  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--mobilebar);
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
  }
  .mobilebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
  }
  .mobilebar__brand img { display: block; flex-shrink: 0; }
  .mobilebar__brand .version { font-size: 11.5px; }
  .mobilebar .theme-toggle { margin-left: auto; width: 44px; height: 44px; }
  .menu-toggle {
    margin-left: -6px;
    margin-right: -10px;
    width: 44px;
    height: 44px;
    color: var(--ink);
  }
  .menu-open .menu-toggle .icon-menu { display: none !important; }
  .menu-open .menu-toggle .icon-close { display: block !important; }

  .sidebar {
    display: none;
    position: fixed;
    top: var(--mobilebar);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 19;
    width: auto;
    height: auto;
    border-right: 0;
    background: var(--bg);
    padding: 16px 20px 40px;
  }
  .menu-open .sidebar { display: flex; }
  .menu-open body { overflow: hidden; }
  .sidebar__logo, .sidebar__foot { display: none; }
  .sidenav__page { padding: 7px 0; font-size: 16px; }
  .sidenav__sections a { padding-top: 5px; padding-bottom: 5px; }

  .main__inner { padding: 32px 20px 0; }
}

/* ------------------------------------------------------------------ */
/* Page structure                                                      */
/* ------------------------------------------------------------------ */

.intro { max-width: 760px; }
.intro h1 {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}
.intro__lede { margin: 0; font-size: 17px; line-height: 1.65; }
.intro__lede .swatch {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.3em;
  border-radius: 2px;
  vertical-align: -0.05em;
}

.intro--overview { max-width: 720px; }
.intro .wordmark {
  font-family: var(--mono);
  font-size: 46px;
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.03em;
  margin: 0 0 32px;
}
.intro--overview .intro__lede { margin: 0 0 12px; font-size: 19px; line-height: 1.55; }
.intro__sub { margin: 0; color: var(--muted); }

.section { margin-top: 112px; }
.section > h2 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}
.section--roomy > h2 { margin-bottom: 28px; }
.section--ops > h2 { margin-bottom: 8px; }
.section__intro { margin: 0 0 24px; color: var(--muted); max-width: 64ch; }
.section--recipes .section__intro,
.section--api .section__intro { margin-bottom: 4px; }
.section__outro { margin: 20px 0 0; color: var(--muted); max-width: 64ch; font-size: 15px; }

.subhead {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  margin: 48px 0 16px;
}

.cols { display: flex; flex-wrap: wrap; gap: 24px 36px; align-items: flex-start; }
.cols--tight { gap: 20px 24px; }
.cols--wide { gap: 32px 56px; }
.col {
  flex: var(--flex, 1 1 300px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.col > h3 { margin: 0; font-size: 15px; font-weight: 600; }
.col > p { margin: 0; }
.col--prose { gap: 14px; }
.col__note { font-size: 14.5px; color: var(--muted); }

.method-index {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 24px;
  font: 13.5px/1.6 var(--mono);
}

/* ------------------------------------------------------------------ */
/* Code                                                                */
/* ------------------------------------------------------------------ */

.code { position: relative; min-width: 0; }
.code pre {
  margin: 0;
  padding: 16px 64px 16px 18px;
  overflow-x: auto;
  background: var(--code);
  border-radius: 4px;
  color: var(--ink);
  font: 13px/1.65 var(--mono);
  tab-size: 4;
}
.code pre code { font: inherit; background: none; padding: 0; border-radius: 0; }
.code--tall pre { min-height: 11.5em; }
.code__copy {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px 8px 4px 24px;
  border: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, transparent, var(--code) 18px);
  color: var(--muted);
  font: 500 12px var(--mono);
  cursor: pointer;
}
.code__copy:hover { color: var(--ink); }

.code-file { display: flex; flex-direction: column; gap: 6px; }
.code-file__name { font: 12.5px var(--mono); color: var(--muted); }

.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-string { color: var(--tok-string); }
.tok-number { color: var(--tok-number); }
.tok-call { color: var(--tok-call); }
.tok-keyword, .tok-builtin, .tok-name { color: var(--ink); font-weight: 500; }

/* ------------------------------------------------------------------ */
/* Overview                                                            */
/* ------------------------------------------------------------------ */

/* Walkthrough video on the overview page */
.video { margin: 0; }
.video video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: var(--code);
}

.looks {
  margin-top: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px 36px;
  align-items: flex-start;
}
.looks__text {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.looks__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  border-bottom: 1px solid var(--rule);
}
.looks__tab {
  padding: 8px 0;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: 500 14px var(--sans);
  cursor: pointer;
}
.looks__tab:hover { color: var(--ink); }
.looks__tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.looks__panel { display: flex; flex-direction: column; gap: 14px; }
.looks__note { margin: 0; font-size: 14px; color: var(--muted); }
.looks__stage { flex: 1.25 1 420px; min-width: 0; }
.looks__stage img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: var(--code);
}

.perf { margin: 0; gap: 22px; }
.perf figcaption { font-size: 14.5px; color: var(--muted); }
.perf__metric { display: flex; flex-direction: column; gap: 12px; }
.perf__name { font-size: 14px; font-weight: 600; }
.perf__bar { display: flex; flex-direction: column; gap: 6px; }
.perf__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 12.5px/1.4 var(--mono);
  color: var(--muted);
}
.perf__value { color: var(--ink); }
.perf__track { height: 6px; border-radius: 1px; background: var(--inline); }
.perf__fill { min-width: 3px; height: 100%; border-radius: 1px; background: var(--ink); }
.perf__fill--slow { background: var(--paren); }

.doc-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px 40px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.doc-row:first-child { padding-top: 20px; border-top: 0; }
.doc-row:last-child { padding-bottom: 0; }
.doc-row__text { display: flex; flex-direction: column; gap: 6px; }
.doc-row h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}
.doc-row h3 a { color: var(--ink); text-decoration: none; }
.doc-row h3 a:hover { text-decoration: underline; }
.doc-row__text p { margin: 0; color: var(--muted); }
.doc-row__media {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.doc-row__media--single { display: block; }
.doc-row__media img { display: block; width: 100%; height: auto; border-radius: 2px; }
.doc-row__methods { margin: 0; gap: 2px 16px; line-height: 1.7; }

/* ------------------------------------------------------------------ */
/* Examples                                                            */
/* ------------------------------------------------------------------ */

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin-top: 24px;
  font-size: 14.5px;
}
.toc a {
  display: flex;
  gap: 6px;
  align-items: baseline;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.toc a:hover { text-decoration: underline; }
.toc__count { font: 12px var(--mono); color: var(--faint); }

.filter {
  margin-top: 28px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
:root:not(.js) .filter { display: none; }
.filter__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.filter__label { font-size: 14px; color: var(--muted); }
.filter__btn {
  padding: 2px 0;
  border: 0;
  border-bottom: 1.5px solid transparent;
  background: none;
  color: var(--muted);
  font: 13px/1.6 var(--mono);
  cursor: pointer;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.filter__btn:hover { color: var(--ink); }
.filter__btn[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.filter__count { font-size: 11.5px; color: var(--paren); }
.filter__summary { margin: 0; font-size: 14.5px; color: var(--muted); }
.filter__summary a, .filter__summary button { margin-left: 14px; white-space: nowrap; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { text-decoration-color: var(--ink); }

.recipe {
  padding: 28px 0 48px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 22px 36px;
  align-items: flex-start;
}
.recipe--first { border-top: 0; }
.recipe__media { flex: 1.15 1 420px; min-width: 0; }
.recipe__body {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.recipe h3 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 500;
  margin: 0;
}
.recipe h3 a, .op h3 a, .matrix__label h3 a { color: var(--ink); text-decoration: none; }
.recipe__desc { margin: 0; color: var(--muted); }

.uses { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 13px/1.5 var(--mono); }
.uses__label { color: var(--faint); }
.uses__btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.uses__btn:hover { text-decoration-color: var(--ink); }

/* Before/after slider */
.compare {
  --pos: 50%;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: var(--code);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.compare:has(.compare__range:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.compare img { display: block; width: 100%; height: auto; pointer-events: none; }
.compare__after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare__after img { height: 100%; object-fit: cover; }
.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 12%);
  pointer-events: none;
}
.compare__handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 40px;
  margin: -20px 0 0 -5px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 6px rgb(0 0 0 / 35%);
}
.compare__tag {
  position: absolute;
  bottom: 10px;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgb(0 0 0 / 62%);
  color: #fff;
  font: 500 11.5px var(--mono);
  pointer-events: none;
}
.compare__tag--before { left: 10px; }
.compare__tag--after { right: 10px; }
.compare__range {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.stack { display: flex; flex-direction: column; gap: 20px; }
.batch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 24px;
  margin-top: 28px;
}
.batch figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.batch figcaption { font: 12.5px var(--mono); color: var(--muted); }

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px 14px;
}
.photo-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font: 12.5px var(--mono);
  text-decoration: none;
}
.photo-link:hover { color: var(--ink); }
.photo-link img { display: block; width: 100%; height: auto; border-radius: 2px; }

/* ------------------------------------------------------------------ */
/* Blend modes                                                         */
/* ------------------------------------------------------------------ */

.hint-touch { display: none; }
@media (hover: none) {
  .hint-hover { display: none; }
  .hint-touch { display: inline; }
}

.matrix { margin-top: 56px; }
.matrix__head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  display: grid;
  grid-template-columns: var(--matrix-cols);
  gap: 0 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font: 12.5px var(--mono);
  color: var(--muted);
}
.matrix__head > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.matrix__row {
  display: grid;
  grid-template-columns: var(--matrix-cols);
  gap: 10px 20px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.matrix__row--base { padding: 20px 0; border-top: 0; }
.matrix__group .section__intro { margin-bottom: 12px; }
.matrix__label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.matrix__label h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  line-height: 1.25;
}
.matrix__label p { margin: 0; font-size: 14px; color: var(--muted); }
.matrix__call {
  font: 13px/1.5 var(--mono);
  color: var(--ink);
  background: none;
  padding: 0;
}
.matrix__formula { font: 12.5px/1.5 var(--mono); color: var(--muted); }

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.thumbs figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  scroll-snap-align: start;
}
.thumbs img { display: block; width: 100%; height: auto; border-radius: 2px; }
.thumbs figcaption { display: none; font: 12px var(--mono); color: var(--muted); }

/* Hover (or press and hold) a result to see the base photo. */
.peek {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.peek img { pointer-events: none; }
.peek .peek__base {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.peek__tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 2px;
  background: rgb(0 0 0 / 62%);
  color: #fff;
  font: 500 11px var(--mono);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.peek.is-peeking .peek__base, .peek.is-peeking .peek__tag { opacity: 1; }
@media (hover: hover) {
  .peek:hover .peek__base, .peek:hover .peek__tag { opacity: 1; }
}

.strip { display: grid; gap: 16px 10px; }
.strip--opacity { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.strip--colors { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.strip figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.strip img { display: block; width: 100%; height: auto; border-radius: 2px; }
.strip figcaption {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 12.5px var(--mono);
  color: var(--muted);
}
.strip .swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ------------------------------------------------------------------ */
/* Operations                                                          */
/* ------------------------------------------------------------------ */

.op {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 36px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  align-items: flex-start;
}
.op--first { border-top: 0; }
.op__text {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.op h3 {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 500;
  margin: 0;
}
.op__text p { margin: 0; color: var(--muted); }
.op__figure { flex: 1.6 1 420px; min-width: 0; margin: 0; }
.op__labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 6px;
  font: 12.5px var(--mono);
  color: var(--muted);
}
.op__figure img { display: block; width: 100%; height: auto; border-radius: 2px; }

/* ------------------------------------------------------------------ */
/* API reference                                                       */
/* ------------------------------------------------------------------ */

.api-entry {
  padding: 28px 0 36px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 860px;
}
.api-entry--first { border-top: 0; }
.api-entry h3 { margin: 0; font: 400 16px/1.5 var(--mono); overflow-wrap: anywhere; }
.api-entry h3 a { color: var(--muted); text-decoration: none; }
.api-entry__prefix { color: var(--faint); }
.api-entry__name { color: var(--ink); font-weight: 500; }
.api-entry__desc { margin: 0; max-width: 68ch; }
.api-entry__modes { margin: 0; gap: 4px 16px; font-size: 13px; }
.api-entry__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  font-size: 14px;
  color: var(--muted);
}
.api-entry__meta code { font: 13px var(--mono); color: var(--ink); background: none; padding: 0; }

.params {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(180px, max-content) minmax(0, 1fr);
  gap: 6px 28px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.params dt {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  font: 13px/1.65 var(--mono);
}
.params__name { color: var(--ink); font-weight: 500; }
.params__type { color: var(--faint); }
.params dd { margin: 0 0 8px; font-size: 15px; line-height: 1.55; color: var(--muted); }

.table-scroll { overflow-x: auto; overflow-y: hidden; }
.json-types { width: 100%; min-width: 520px; border-collapse: collapse; }
.json-types th {
  text-align: left;
  padding: 0 24px 10px 0;
  border-bottom: 1px solid var(--ink);
  font: 500 13px var(--sans);
  color: var(--muted);
}
.json-types td {
  padding: 11px 24px 11px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  font: 13px/1.5 var(--mono);
  color: var(--ink);
}
.json-types td:last-child { color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Pager and footer                                                    */
/* ------------------------------------------------------------------ */

.pager {
  margin-top: 112px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.pager__prev, .pager__next { display: flex; }
.pager__next { justify-content: flex-end; text-align: right; }
.pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink);
  text-decoration: none;
}
.pager a:hover { text-decoration: underline; }
.pager__next a { align-items: flex-end; }
.pager__label { font: 12.5px var(--mono); color: var(--faint); }
.pager__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

.footer {
  margin-top: 48px;
  padding: 24px 0 48px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer__meta { display: flex; flex-wrap: wrap; gap: 4px 22px; white-space: nowrap; }
.footer a { color: var(--muted); }
.footer p { margin: 0; max-width: 80ch; }
.footer code { font-size: 0.92em; background: none; padding: 0; }

/* ------------------------------------------------------------------ */
/* Narrow screens                                                      */
/* ------------------------------------------------------------------ */

@media (max-width: 879.98px) {
  :root { --matrix-cols: minmax(0, 1fr); }
  .matrix__head { top: var(--mobilebar); }
}

@media (max-width: 639.98px) {
  .matrix__head { display: none; }
  .thumbs {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 44%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .thumbs figcaption { display: block; }
  .params { grid-template-columns: minmax(0, 1fr); }
}
