:root {
  --ground: #f4f5f7;
  --ink: #0e1116;
  --muted: #565d68;
  --rule: #d3d7de;
  --accent: #0040ff;
  --code-bg: #0e1116;
  --code-ink: #e3e6ea;
  --code-dim: #8a929e;
  --code-hi: #8fa8ff;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
}

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }

header.site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--ink);
}
.mark {
  font: 800 1.25rem/1 var(--display);
  font-stretch: 125%;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.mark img { display: block; margin-right: 0.5rem; }
.mark span { color: var(--accent); }
header.site nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; justify-content: flex-end; }
header.site nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
header.site nav a:hover, header.site nav a[aria-current] { color: var(--accent); }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; }
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  max-width: 14em;
  margin: 4rem 0 1.25rem;
}
h1 em { font-style: normal; color: var(--accent); }

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  font-stretch: 118%;
  margin: 4rem 0 1rem;
}
h3 { font-size: 1.15rem; font-weight: 700; font-stretch: 110%; margin: 0 0 0.4rem; }

p { margin: 0 0 1rem; max-width: 40em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 34em; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

.notice {
  border-left: 4px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 2rem 0;
  max-width: 40em;
}

code { font-family: var(--mono); font-size: 0.9em; }
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  font: 400 0.85rem/1.65 var(--mono);
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 1rem;
}
pre .dim { color: var(--code-dim); }
pre .hi { color: var(--code-hi); }

.table { overflow-x: auto; margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 0.9rem 1rem 0.9rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; font-size: 0.85rem; color: var(--muted); border-bottom: 2px solid var(--ink); }
td:first-child { white-space: nowrap; font-family: var(--mono); font-weight: 500; }
td:first-child a { text-decoration: none; }
tbody tr { transition: background-color 0.15s; }
tbody tr:hover { background: #e9ecf2; }
table.saved td:first-child { font-family: var(--body); font-weight: 400; white-space: normal; }
table.saved td:nth-child(n+2), table.saved th:nth-child(n+2) { text-align: right; font-family: var(--mono); padding-left: 1rem; }
table.saved td:last-child { color: var(--accent); font-weight: 500; }

.tag.live { color: var(--accent); border-color: var(--accent); }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--muted);
  border-radius: 2px;
  color: var(--muted);
}

.tool { border-top: 1px solid var(--rule); padding: 2rem 0; display: grid; grid-template-columns: 12rem 1fr; gap: 1.5rem; }
.tool:first-of-type { border-top: 2px solid var(--ink); }
.tool h2 { margin: 0; font-family: var(--mono); font-stretch: normal; font-size: 1.3rem; }
.tool .sig { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; }
.tool dl { margin: 0; }
.tool dt { font-weight: 600; margin-top: 0.75rem; }
.tool dd { margin: 0; max-width: 40em; }
@media (max-width: 40rem) { .tool { grid-template-columns: 1fr; gap: 0.5rem; } }

ol.steps { padding-left: 1.25rem; max-width: 40em; }
ol.steps li { margin-bottom: 0.6rem; }

footer.site {
  margin-top: 5rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Terminal animation (fetch page). CSS only: the CSP blocks scripts. */
.term {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 10px;
  box-shadow: 0 1px 0 var(--rule), 0 20px 40px -24px rgba(14, 17, 22, 0.55);
  margin: 2.5rem 0;
  max-width: 46rem;
  overflow: hidden;
  font: 400 0.85rem/1.7 var(--mono);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #252a33;
  color: var(--code-dim);
  font-size: 0.75rem;
}
.term-bar i { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: #2c323c; }
.term-bar span { margin-left: 0.6rem; }
.term-body { padding: 1rem 1.25rem 1.25rem; overflow-x: auto; }
.term p { margin: 0 0 0.35rem; max-width: none; padding-left: 1.5em; text-indent: -1.5em; }
.term b { color: var(--code-hi); font-weight: 500; }
.t-prompt { color: var(--code-dim); }
.t-star { color: #d97757; }
.t-dot { color: var(--code-ink); }
.t-dot.ok { color: #5fd38d; }
.t-dim { color: var(--code-dim); margin-left: 0.5em; }
.t-win {
  display: inline-block;
  text-indent: 0;
  margin-left: 0.4em;
  padding: 0 0.45em;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  animation: t-pop 0.5s ease-out 7.3s backwards;
}
@keyframes t-pop { from { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } }

.t-type {
  display: inline-block;
  vertical-align: bottom;
  text-indent: 0;
  white-space: nowrap;
  overflow: hidden;
  width: 0;
  animation: t-type 1.6s steps(29) 0.6s forwards;
}
.t-cursor {
  display: inline-block;
  vertical-align: -0.15em;
  width: 0.55em;
  height: 1.1em;
  background: var(--code-ink);
  animation: t-blink 0.8s steps(1) infinite, t-hide 0.01s 2.4s forwards;
}
.t-l { opacity: 0; animation: t-show 0.35s ease-out forwards; }
.t1 { animation-delay: 2.6s; }
.t2 { animation-delay: 3.6s; }
.t3 { animation-delay: 4.6s; }
.t4 { animation-delay: 5.8s; }
.t5 { animation-delay: 7s; }

@keyframes t-type { to { width: 29ch; } }
@keyframes t-blink { 50% { opacity: 0; } }
@keyframes t-hide { to { visibility: hidden; } }
@keyframes t-show { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .t-type { width: auto; animation: none; }
  .t-cursor { display: none; }
  .t-l, .t-win { opacity: 1; animation: none; }
}

/* Shared shell: breadcrumb, page meta, answer box, related links, footer. */
.crumbs ol { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.crumbs li + li::before { content: "A"; margin: 0 0.5rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs + main h1 { margin-top: 1.5rem; }
.meta { font-size: 0.85rem; color: var(--muted); margin-top: -0.5rem; }
.answer { background: #fff; border: 2px solid var(--ink); border-left: 6px solid var(--accent); padding: 1rem 1.25rem; margin: 1.5rem 0 2rem; max-width: 46rem; }
.answer p { margin: 0 0 0.5rem; }
.answer p:last-child { margin-bottom: 0; }
caption { caption-side: top; text-align: left; font-size: 0.85rem; color: var(--muted); padding-bottom: 0.5rem; }
td.num, th.num { text-align: right; font-family: var(--mono); }
dl.faq dt { font-weight: 600; margin-top: 1.25rem; max-width: 40em; }
dl.faq dd { margin: 0.35rem 0 0; max-width: 40em; }
.cite { font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1rem; }
.cite p { max-width: 50em; }
.related { margin-top: 3rem; }
.related h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.related ul { margin: 0; padding-left: 1.1rem; max-width: 40em; }
.related li { margin-bottom: 0.4rem; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-bottom: 1rem; }
footer.site nav a { color: var(--ink); text-decoration: none; }
footer.site nav a:hover { color: var(--accent); }
footer.site p { margin: 0; }

@media (max-width: 40rem) {
  header.site { flex-direction: column; align-items: flex-start; gap: 0.6rem; padding: 0.9rem 0; }
  header.site nav { justify-content: flex-start; gap: 0.25rem 1.1rem; }
  h1 { font-size: 2rem; margin: 1.25rem 0 0.75rem; }
  .crumbs + main h1 { margin-top: 0.75rem; }
  h2 { margin-top: 2.75rem; }
  .lead { font-size: 1.05rem; }
  body { font-size: 16px; }
}

@media print {
  header.site nav, .crumbs, footer.site nav, .related, .term { display: none; }
  body { background: #fff; font-size: 11pt; }
  pre { white-space: pre-wrap; background: #fff; color: #000; border: 1px solid #999; }
  a { color: inherit; }
  h1 { margin-top: 0; }
}
