/* subenum site
 *
 * The palette is the scan itself: amber is the apex you start from, and the
 * four outcome colours (resolved, nxdomain, timeout, refused) are the same
 * everywhere they appear, from the hero ledger to the verdict gauges.
 */

/* ---------- Tokens ---------- */

:root,
:root[data-theme="dark"] {
  --bg: #0e1726;
  --bg-raised: #142036;
  --bg-sunk: #0a111d;
  --line: #22324d;
  --line-soft: #1a2840;
  --text: #e8ecf2;
  --text-2: #a3b0c4;
  --text-3: #7d8aa0;
  --accent: #f2b441;
  --accent-text: #f5c066;
  --on-accent: #1b1406;
  --code-bg: #1a2740;

  --resolved: #4cc9a0;
  --nxdomain: #75849c;
  --timeout: #a991f2;
  --refused: #f08a76;
  --complete: var(--resolved);
  --degraded: var(--accent);
  --unreliable: var(--refused);

  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-raised: #ffffff;
  --bg-sunk: #eef1f5;
  --line: #d6dce5;
  --line-soft: #e4e8ee;
  --text: #13203a;
  --text-2: #475670;
  --text-3: #66748b;
  --accent: #f2b441;
  --accent-text: #9a5b00;
  --on-accent: #1b1406;
  --code-bg: #e9edf3;

  --resolved: #12825e;
  --nxdomain: #64728a;
  --timeout: #6a4fd0;
  --refused: #c2412b;
  --degraded: #a86400;

  --shadow: 0 24px 60px -30px rgba(19, 32, 58, 0.35);
  color-scheme: light;
}

:root {
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --cond: "IBM Plex Sans Condensed", "Arial Narrow", "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --topbar: 60px;
  --radius: 10px;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

code,
kbd,
pre {
  font-family: var(--mono);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-sunk);
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.6;
  text-align: center;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

[hidden] {
  display: none !important;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar);
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 28px;
}

.mark-apex {
  fill: var(--accent);
}

.mark-hit {
  fill: var(--resolved);
}

.mark-miss {
  fill: none;
  stroke: var(--nxdomain);
  stroke-width: 1.5;
}

.brand-word {
  font-family: var(--cond);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.release-tag {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-decoration: none;
}

.release-tag:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.topnav {
  display: flex;
  gap: 4px;
  margin-left: 20px;
}

.topnav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
}

.topnav a:hover {
  background: var(--bg-raised);
  color: var(--text);
}

.topnav a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 6px 6px 0 0;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-sunk);
  color: var(--text-3);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.search-trigger:hover {
  border-color: var(--text-3);
  color: var(--text-2);
}

.search-trigger svg,
.icon-btn svg,
.search-field svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-trigger-label {
  min-width: 7em;
  text-align: left;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--bg-raised);
  color: var(--text);
}

.icon-btn svg.i-fill {
  fill: currentColor;
  stroke: none;
}

:root[data-theme="dark"] .i-moon,
:root[data-theme="light"] .i-sun {
  display: none;
}

.menu-btn {
  display: none;
}

/* ---------- Drawer (small screens) ---------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.drawer-scrim,
.search-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 16, 0.6);
}

.drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(320px, 86vw);
  overflow-y: auto;
  padding: 14px 20px 32px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.drawer-home {
  display: block;
  padding: 6px 0;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Doc navigation (sidebar and drawer) ---------- */

.nav-group {
  margin-top: 22px;
}

.nav-group-title {
  margin: 0 0 6px;
  color: var(--text-3);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
}

.nav-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-group a {
  display: block;
  margin-left: -12px;
  padding: 5px 12px;
  border-left: 2px solid transparent;
  color: var(--text-2);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav-group a:hover {
  color: var(--text);
}

.nav-group a[aria-current="page"] {
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--text-3);
  text-decoration: none;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  border-color: #f7c76b;
  background: #f7c76b;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Home: hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 104px) var(--gutter) clamp(56px, 8vw, 96px);
}

.hero h1 {
  margin: 0 0 22px;
  font-family: var(--cond);
  font-size: clamp(2.6rem, 4.8vw, 4.3rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede {
  max-width: 34em;
  margin: 0 0 30px;
  color: var(--text-2);
  font-size: 1.12rem;
  line-height: 1.6;
}

.install {
  max-width: 560px;
  margin-bottom: 24px;
}

.install-tabs,
.recipe-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}

.install-tabs button,
.recipe-tabs button {
  margin-bottom: -1px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

.install-tabs button:hover,
.recipe-tabs button:hover {
  color: var(--text);
}

.install-tabs button[aria-selected="true"],
.recipe-tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.install-pane {
  padding-top: 12px;
}

.install-note {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 0.95rem;
}

pre.cmd {
  margin: 0;
  padding: 13px 16px;
  white-space: pre-wrap;
  word-break: break-all;
}

pre.cmd code::before {
  content: "$ ";
  color: var(--accent);
  user-select: none;
}

.hero-fineprint {
  margin: 18px 0 0;
  color: var(--text-3);
  font-size: 0.86rem;
}

/* ---------- Home: the console ---------- */

.console {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-sunk);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.console-cmd {
  padding: 14px 92px 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}

.prompt {
  color: var(--accent);
  user-select: none;
}

.console-pane {
  position: relative;
  padding: 14px 18px 16px;
}

.console-pane + .console-pane {
  border-top: 1px solid var(--line-soft);
}

.pane-label {
  margin-bottom: 6px;
  color: var(--text-3);
  font-size: 0.72rem;
}

.console-out {
  min-height: 12.8em;
  /* keeps the pane from growing while lines fade in */
  margin: 0;
  padding: 0;
  color: var(--text-3);
  list-style: none;
}

.console-out li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-out li.flag {
  white-space: normal;
}

.console-out .host {
  color: var(--text);
}

.console-out mark {
  padding: 0 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent-text);
}

.console-out .more {
  color: var(--text-3);
}

.ledger-progress {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--text-3);
}

.ledger-progress .num {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line-soft);
}

.bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--text-3);
  transform: scaleX(var(--p, 1));
  transform-origin: left;
}

.outcomes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.outcomes div {
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-top: 3px solid var(--o);
  border-radius: 6px;
  background: var(--bg);
}

.outcomes dt {
  color: var(--text-3);
  font-size: 0.72rem;
}

.outcomes dd {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.o-resolved { --o: var(--resolved); }
.o-nxdomain { --o: var(--nxdomain); }
.o-timeout { --o: var(--timeout); }
.o-refused { --o: var(--refused); }

.verdict-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
}

.verdict-line .reason {
  color: var(--text-2);
}

.verdict {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid color-mix(in srgb, var(--v) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--v) 14%, transparent);
  color: var(--v);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.v-complete { --v: var(--complete); }
.v-degraded { --v: var(--degraded); }
.v-unreliable { --v: var(--unreliable); }

.console-replay {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-3);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.console-replay:hover {
  color: var(--text);
}

/* Animation states, driven by site.js. Without JS the final state shows. */
.console.is-running .console-out li {
  opacity: 0;
  transform: translateY(4px);
}

.console.is-running .console-out li.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.console.is-running [data-verdict] {
  opacity: 0;
}

.console [data-verdict].is-in {
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* ---------- Home: bands ---------- */

.band {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-raised);
}

.band-plain {
  background: var(--bg);
}

.band-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) var(--gutter);
}

.band h2,
.closer h2 {
  margin: 0 0 18px;
  font-family: var(--cond);
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.band-lede {
  max-width: 40em;
  margin: -6px 0 40px;
  color: var(--text-2);
  font-size: 1.05rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 6vw, 88px);
  align-items: start;
}

.split-copy p {
  max-width: 34em;
  color: var(--text-2);
}

.split-copy pre.cmd {
  margin-top: 22px;
  max-width: 30em;
}

.split-media {
  align-items: center;
}

/* Verdict specimens */

.specimens {
  margin: 0;
  padding: 0;
  list-style: none;
}

.specimen {
  padding: 18px 0 20px;
  border-top: 1px solid var(--line);
}

.specimen:last-child {
  border-bottom: 1px solid var(--line);
}

.specimen-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.specimen-head .verdict {
  font-size: 0.86rem;
}

.rule {
  color: var(--text-2);
  font-size: 0.95rem;
}

.specimen .reason {
  margin: 10px 0 0;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
}

.gauge {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--complete) 45%, transparent) 0 30%,
    color-mix(in srgb, var(--degraded) 45%, transparent) 30% 75%,
    color-mix(in srgb, var(--unreliable) 45%, transparent) 75% 100%
  );
}

.gauge-marker {
  position: absolute;
  top: -6px;
  left: var(--at);
  width: 4px;
  height: 20px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--bg-raised);
}

.gauge-legend {
  position: relative;
  grid-column: 2;
  height: 1.4em;
  margin-top: -8px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.gauge-legend span {
  position: absolute;
  left: var(--x, 0);
  transform: translateX(-50%);
}

.gauge-legend span:first-child {
  transform: none;
}

.gauge-legend span:last-child {
  right: 0;
  left: auto;
  transform: none;
}

/* Claims */

.claims {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px clamp(32px, 5vw, 72px);
}

.claim {
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
}

.claim h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.35;
}

.claim p {
  margin: 0 0 14px;
  color: var(--text-2);
}

.evidence {
  display: inline-block;
  max-width: 100%;
  padding: 4px 10px;
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--bg-sunk);
  color: var(--text);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

/* Recipes */

.recipes {
  max-width: 920px;
}

.recipe {
  padding-top: 22px;
}

.recipe p {
  max-width: 44em;
  margin: 0 0 16px;
  color: var(--text-2);
}

.recipe pre {
  margin: 0 0 16px;
}

.more-link {
  font-weight: 600;
  text-decoration: none;
}

.more-link::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.45em;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-0.1em) rotate(45deg);
}

.more-link:hover {
  text-decoration: underline;
}

/* Screenshot */

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.shot figcaption {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 0.85rem;
}

/* Closer */

.closer {
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(60% 120% at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    var(--bg);
}

.closer-inner {
  display: grid;
  justify-items: center;
  gap: 22px;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 112px) var(--gutter);
  text-align: center;
}

.closer h2 {
  margin: 0;
}

.closer pre.cmd {
  max-width: 100%;
  text-align: left;
}

/* ---------- Docs layout ---------- */

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: clamp(32px, 4vw, 56px);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sidebar,
.toc {
  position: sticky;
  top: var(--topbar);
  max-height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 18px 0 40px;
  scrollbar-width: thin;
}

.doc {
  min-width: 0;
  padding: 40px 0 72px;
}

.toc h2 {
  margin: 22px 0 8px;
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
  list-style: none;
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 14px;
  border-left: 2px solid transparent;
  color: var(--text-3);
  font-size: 0.86rem;
  line-height: 1.4;
  text-decoration: none;
}

.toc li.l3 a {
  padding-left: 26px;
  font-size: 0.82rem;
}

.toc a:hover {
  color: var(--text);
}

.toc a.is-active {
  border-left-color: var(--accent);
  color: var(--text);
}

.doc-foot {
  max-width: 760px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.pager a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.pager a:hover {
  border-color: var(--accent);
}

.pager span {
  display: block;
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 400;
}

.pager-next {
  grid-column: 2;
  text-align: right;
}

.edit-link {
  color: var(--text-3);
  font-size: 0.88rem;
}

/* ---------- Prose (rendered Markdown) ---------- */

.prose {
  max-width: 760px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h1 {
  margin: 0 0 18px;
  font-family: var(--cond);
  font-size: clamp(2.1rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.prose h2 {
  margin: 2.4em 0 0.6em;
  padding-top: 0.2em;
  font-family: var(--cond);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin: 1.9em 0 0.5em;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.35;
}

.prose h4 {
  margin: 1.6em 0 0.4em;
  font-size: 1rem;
  font-weight: 600;
}

.prose h2,
.prose h3,
.prose h4 {
  position: relative;
}

.anchor {
  position: absolute;
  left: -1.1em;
  padding-right: 0.3em;
  color: var(--text-3);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
}

.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor,
.anchor:focus {
  opacity: 1;
}

.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose table,
.prose blockquote,
.prose details {
  margin: 0 0 1.1em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin: 0.3em 0;
}

.prose li::marker {
  color: var(--text-3);
}

.prose strong {
  font-weight: 600;
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose img {
  display: block;
  height: auto;
  margin: 1.5em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.prose :not(pre) > code {
  padding: 0.12em 0.38em;
  border-radius: 4px;
  background: var(--code-bg);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.prose a code {
  color: inherit;
}

.prose blockquote {
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--bg-raised);
  color: var(--text-2);
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

.prose blockquote strong {
  color: var(--text);
}

.prose details {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raised);
}

.prose summary {
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.prose details[open] summary {
  margin-bottom: 8px;
}

/* Tables */

.table-wrap {
  margin: 0 0 1.3em;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.prose table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--bg-raised);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 600;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose td:first-child code {
  white-space: nowrap;
}

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

pre {
  margin: 0 0 1.2em;
  padding: 14px 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-sunk);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.65;
  tab-size: 4;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.prose div.highlighter-rouge,
.prose figure.highlight {
  margin: 0 0 1.2em;
}

.prose .highlight pre,
.prose div.highlighter-rouge pre {
  margin: 0;
}

.code-wrap {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-3);
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.6;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.code-wrap:hover .copy-btn,
.copy-btn:focus-visible,
.copy-btn.is-done {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--text);
}

.copy-btn.is-done {
  border-color: var(--resolved);
  color: var(--resolved);
}

@media (hover: none) {
  .copy-btn {
    opacity: 1;
  }
}

/* Rouge syntax colours, drawn from the outcome palette. */
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cp,
.highlight .cs {
  color: var(--text-3);
  font-style: italic;
}

.highlight .k,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt,
.highlight .kc,
.highlight .nt {
  color: var(--accent-text);
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sh,
.highlight .se,
.highlight .si,
.highlight .sx,
.highlight .dl {
  color: var(--resolved);
}

.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .il,
.highlight .no {
  color: var(--timeout);
}

.highlight .nb,
.highlight .bp,
.highlight .nf,
.highlight .fm {
  color: #7cb7f0;
}

:root[data-theme="light"] .highlight .nb,
:root[data-theme="light"] .highlight .nf,
:root[data-theme="light"] .highlight .fm,
:root[data-theme="light"] .highlight .bp {
  color: #1f64b5;
}

.highlight .nv,
.highlight .vg,
.highlight .vi {
  color: var(--refused);
}

.highlight .err {
  color: inherit;
  background: none;
}

/* ---------- Search ---------- */

.search {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.search-panel {
  position: relative;
  width: min(660px, calc(100vw - 32px));
  max-height: min(70vh, 640px);
  margin: 12vh auto 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 54px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-results {
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  list-style: none;
}

.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.search-results a:hover,
.search-results a.is-active {
  background: var(--bg-raised);
  box-shadow: inset 2px 0 0 var(--accent);
}

.search-results .r-title {
  font-weight: 600;
}

.search-results .r-section {
  margin-left: 8px;
  color: var(--text-3);
  font-size: 0.82rem;
}

.search-results .r-snippet {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.search-results mark {
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: inherit;
}

.search-empty {
  margin: 0;
  padding: 24px;
  color: var(--text-3);
  text-align: center;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-sunk);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr));
  gap: 32px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 48px var(--gutter) 56px;
}

.footer-brand p {
  max-width: 26em;
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

.footer-brand .footer-legal {
  color: var(--text-3);
  font-size: 0.84rem;
}

.footer-col h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li {
  margin: 6px 0;
}

.footer-col a {
  color: var(--text-2);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---------- 404 ---------- */

.notfound {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--topbar) - 260px);
  padding: 64px var(--gutter);
}

.notfound-inner {
  max-width: 640px;
}

.notfound-dig {
  margin-bottom: 28px;
  color: var(--text-3);
  font-size: 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notfound-dig .nx {
  color: var(--refused);
}

.notfound h1 {
  margin: 0 0 12px;
  font-family: var(--cond);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.05;
}

.notfound p {
  margin: 0 0 28px;
  color: var(--text-2);
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .docs {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .toc {
    display: none !important;
  }

  .footer-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .hero,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .gauge-legend {
    grid-column: 1;
  }

  .topnav {
    display: none;
  }

  .menu-btn {
    display: inline-grid;
  }
}

@media (max-width: 860px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .doc {
    padding-top: 28px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .search-trigger {
    width: 36px;
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: transparent;
  }

  .search-trigger-label,
  .search-trigger kbd,
  .release-tag {
    display: none;
  }

  .outcomes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .claims {
    grid-template-columns: minmax(0, 1fr);
  }

  .recipe-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .recipe-tabs button {
    flex: none;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager-next {
    grid-column: 1;
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .anchor {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
