/* tokens */
:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: #111114;
  --panel-2: #17171c;
  --line: #26262e;
  --line-strong: #3a3a45;
  --text: #ecebe6;
  --muted: #9b9aa3;
  --dim: #8b8a94;
  --accent: #c4b5fd;
  --accent-ink: #ddd5ff;
  --ok: #7ee2a8;
  --bad: #ff8a7a;
  --warn: #f5c97a;
  --na: #9b9aa3;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 4px 4px 0 0 var(--accent);
  --press: #ecebe6;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
@media (max-width: 400px) {
  body { font-size: 16px; }
}
img, video { max-width: 100%; height: auto; display: block; }
.page figure video,
.page video {
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color 120ms; }
a:hover { color: var(--accent-ink); }
p a, li a, dd a { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 3;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 4px;
}
.skip:focus { top: 8px; }
.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
@media (max-width: 480px) {
  .wrap {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}
p, dd, td { overflow-wrap: anywhere; }
h1, h2, h3, p { overflow-wrap: break-word; }

/* type */
.intro, .page { padding-top: 48px; }
.eyebrow {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  text-transform: lowercase;
}
h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 650;
  line-height: 1.1;
  max-width: 18ch;
}
h2 { margin: 0 0 12px; font-size: 24px; font-weight: 600; line-height: 1.25; }
.page > section {
  margin-top: 2.2rem;
  padding-top: 0;
  border-top: 0;
}
.page > .check-note + section {
  margin-top: 2.2rem;
  padding-top: 0;
  border-top: 0;
}
.page > section > h2:first-child { margin-top: 0; }
h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.hl { color: var(--accent); }
.lead { margin: 0; max-width: 68ch; color: var(--muted); font-size: 19px; }
.page > p, section > p, section > ul, .toc { max-width: 68ch; }
.mono, .num, .tools td:first-child, .tools th:first-child { font-family: var(--mono); }
table.tools .lbl { display: none; }
@media (max-width: 560px) {
  table.tools .lbl {
    display: inline-block;
    width: 2.5em;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 12px;
  }
}
.num { margin: 0 0 8px; font-size: 13px; color: var(--dim); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.na { color: var(--na); }
main section {
  margin-top: 72px;
  padding-top: 72px;
  border-top: 1px solid var(--line);
}
@media (max-width: 600px) {
  main section { margin-top: 48px; padding-top: 48px; }
}

/* top */
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  min-height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
}
.brand-mark { color: var(--accent); flex: none; }
.nav-wide { display: flex; align-items: center; gap: 14px; }
.nav-wide a { color: var(--accent); text-decoration: none; font-size: 15px; }
.nav-wide a:hover { text-decoration: underline; }
.nav-wide a[aria-current="page"], .menu a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
@media (max-width: 980px) {
  .nav-wide { gap: 10px; }
  .nav-wide a { font-size: 14px; }
}

/* menu */
.menu { display: none; position: relative; }
.menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  background: var(--panel);
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::marker { content: ""; }
.bars { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 18px; height: 18px; }
.bars span { display: block; width: 18px; height: 2px; background: var(--text); }
.menu-word, .menu-word-open { font-size: 15px; font-weight: 600; }
.menu-word-open { display: none; }
.menu[open] > summary .menu-word { display: none; }
.menu[open] > summary .menu-word-open { display: inline; }
.menu[open] > summary .bars span:first-child { transform: translateY(7px) rotate(45deg); }
.menu[open] > summary .bars span:nth-child(2) { visibility: hidden; }
.menu[open] > summary .bars span:last-child { transform: translateY(-7px) rotate(-45deg); }
.menu nav {
  position: absolute;
  right: 0;
  left: auto;
  top: 100%;
  width: min(100vw - 32px, 280px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.menu a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: var(--accent);
  text-decoration: none;
  font-size: 17px;
  border-top: 1px solid var(--line);
}
@media (max-width: 759px) {
  .nav-wide { display: none; }
  .menu { display: block; position: static; }
  .menu nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    margin-left: 0;
    z-index: 10;
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-left: 0;
    border-right: 0;
  }
}

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1;
  text-decoration: none;
  box-shadow: 3px 3px 0 0 var(--line-strong);
}
.btn:hover, .btn:focus-visible {
  color: var(--text);
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--line-strong);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--line-strong);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 3px 3px 0 0 var(--press);
}
.btn-primary:hover, .btn-primary:focus-visible {
  color: var(--bg);
  box-shadow: 4px 4px 0 0 var(--press);
}
.btn-primary:active { box-shadow: 1px 1px 0 0 var(--press); }
@media (hover: hover) {
  .sample:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 var(--accent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:focus-visible, .btn:active, .sample:hover { transform: none; }
}

/* home */
.demo {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 36px;
}
@media (max-width: 979px) {
  .demo { grid-template-columns: 1fr; }
}
.gets, .who, .samples, .pair {
  display: grid;
  gap: 16px;
}
.gets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.who { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.samples, .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .who { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 759px) {
  .samples { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .gets, .pair, .who { grid-template-columns: 1fr; }
}
.gets article, .who article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}
.gets article p:last-child, .who article p:last-child { margin: 0; }

/* hard panels */
.sample, .panel, .meta {
  background: var(--panel);
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.sample { padding: 0; }
.sample img { width: 100%; display: block; margin: 0; border-radius: 2px 2px 0 0; }
.sample .pad { padding: 0 16px 16px; line-height: 1.45; }
.sample .pad > * + * { margin-top: 6px; }
.sample h2 { font-size: 20px; margin: 0; }
.panel { padding: 16px; }

/* mini receipt */
.mini {
  position: relative;
  margin: 0 0 16px;
  padding: 0 0 12px;
  background: var(--panel);
  border: 1.5px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  filter: drop-shadow(4px 4px 0 var(--accent));
}
.mini-head {
  display: flex;
  justify-content: space-between;
  gap: 8px 12px;
  align-items: baseline;
  margin: 0;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.mini-head span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-head span:last-child { white-space: nowrap; flex: none; }
.mini::after {
  content: "";
  position: absolute;
  left: -1.5px;
  right: -1.5px;
  bottom: -8px;
  height: 8px;
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, var(--panel) 50%, transparent 50%),
    linear-gradient(225deg, var(--panel) 50%, transparent 50%);
  background-size: 16px 8px;
  background-repeat: repeat-x;
  background-position: left bottom;
  pointer-events: none;
}
.mini dl { margin: 0; padding: 4px 14px 0; }
.mini dl div {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.mini dt { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.mini dd { margin: 0; font-size: 15px; }
.mini-open { margin: 12px 14px 8px; }
.split { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.grow {
  flex: 1 1 12em;
  min-width: min(100%, 12em);
  overflow-wrap: break-word;
  word-break: normal;
}
.mark {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  font-family: var(--mono);
  font-size: 13px;
}
@media (max-width: 560px) {
  .mini dl div {
    display: block;
    min-height: 0;
    margin-top: 0;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line);
  }
  .mini dt { display: block; }
  .mini dd { display: block; }
  .mini dd.split,
  .split {
    display: block;
    min-height: 0;
    margin-top: 0;
  }
  .mini .grow,
  .grow { display: inline; min-width: 0; flex: none; }
  .mini .mark,
  .mark {
    display: inline;
    margin-left: 6px;
    white-space: nowrap;
    text-align: left;
  }
}

/* tables */
.scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--dim); }
.compare td { vertical-align: top; }
.compare .x,
.compare .y { display: none; }
.compare .col { display: none; }
@media (max-width: 560px) {
  .compare .x,
  .compare .y {
    display: inline;
    margin-right: 6px;
  }
  .compare .col { display: inline; }
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100%; }
  .compare td:first-child { border-bottom: 0; padding-bottom: 0; }
  .compare td:first-child::before,
  .compare td:last-child::before { content: none; }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  table.tools,
  table.tools tbody { display: block; width: 100%; }
  table.tools { position: relative; }
  table.tools tr {
    display: block;
    border: 1px solid var(--line);
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  table.tools td {
    display: block;
    padding: 0;
    border: 0;
  }
  table.tools td:first-child {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
  }
}

/* pages */
.steps { list-style: none; margin: 0; padding: 0; max-width: 68ch; }
.steps li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 12px; margin: 0 0 16px; }
.steps .n { font-family: var(--mono); font-size: 24px; line-height: 1.2; color: var(--accent); }
.steps p { margin: 0; }
.log,
.session {
  margin: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 14px;
  white-space: pre;
}
.docs pre {
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.toc { margin: 0 0 24px; padding-left: 1.1em; font-family: var(--mono); font-size: 14px; }
.toc a { text-decoration: none; }
.toc a:hover,
.toc a:focus { text-decoration: underline; }
.meta {
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr);
  margin: 28px 0;
  padding: 8px 16px;
}
.meta dt, .meta dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.meta dt { font-family: var(--mono); font-size: 13px; color: var(--dim); }
@media (max-width: 560px) {
  .meta { grid-template-columns: 1fr; }
  .meta dt { padding-bottom: 0; border-bottom: 0; }
}
.clip { margin: 0; padding-left: 16px; border-left: 2px solid var(--accent); }
.before, .after { margin: 0; color: var(--muted); font-size: 15px; }
.check-note { margin: 12px 0 0; color: var(--dim); font-size: 14px; }
.fixes { margin: 8px 0 0; padding-left: 1.2em; }

/* footer */
.site-foot { margin-top: 72px; padding: 40px 0; border-top: 1px solid var(--line); }
.foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-label { margin: 0 0 8px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.foot a { display: flex; align-items: center; min-height: 44px; color: var(--accent); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.legal { margin: 24px auto 0; color: var(--muted); font-size: 14px; max-width: 1080px; }
@media (max-width: 700px) {
  .foot { grid-template-columns: 1fr; }
  .foot a { min-height: 44px; }
}

code.hash,
.hash {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  overflow-wrap: anywhere;
}
span.fetched { display: block; white-space: nowrap; }
dl.meta .check-note,
.meta .check-note { display: block; margin-top: 6px; }
table.checks td:last-child { font-family: var(--mono); font-size: 13px; }
table.checks tr.na td:last-child { color: var(--text); }
table.checks tr.warn td:last-child { color: var(--warn); }
table.checks td .mono { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
del { color: var(--bad); text-decoration: line-through; }
ins { color: var(--ok); text-decoration: none; }

/* layout qa v8 fixes */
.demo { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.demo > * { min-width: 0; }
@media (max-width: 979px) {
  .demo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .mini-head { flex-wrap: wrap; white-space: normal; }
  .mini-head span:first-child { overflow: visible; }
}
figure { margin: 0 0 16px; }
@media (max-width: 560px) {
  .compare .col {
    margin-right: 8px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 13px;
  }
}
table.checks td .mono { display: inline; margin: 0 0 0 8px; }
main section > h2, .page > h2 { margin-top: 40px; }
main section > h2:first-child, .page > h2:first-child { margin-top: 0; }
.page > h1 + p, .page > h1 + section { margin-top: 12px; }
.tools td:first-child { white-space: nowrap; }
.menu nav { border: 1.5px solid var(--line-strong); box-shadow: var(--shadow); }
.ctx-label { margin: 16px 0 6px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.clip .ctx-label:first-child { margin-top: 0; }
