/* Query Anvil product site.
 *
 * The page is printed like the badger's workshop notebook: ink and one ochre
 * spot colour on warm paper. Paper, ink and ochre are sampled from the badger
 * artwork; brass is the app's own primary (#d9aa78 in
 * apps/queryanvil/src/theme.rs). The demo window keeps the app's dark theme,
 * so the product is the one dark, heavy object on the page, standing on an
 * ink anvil. Direction and measurements: docs/design/website-art-direction.json */

@font-face {
  font-family: "Commissioner";
  src: url("assets/commissioner.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f2ecdf;
  --oat: #e6dcc8;
  --ink: #23272a;
  --ink-soft: #4a4d4c;
  --ochre: #c9923f;
  --ochre-deep: #a9772c;
  --brass: #d9aa78;
  --rust: #8a4f1e;
  --sage: #4a6646;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --sans: "Commissioner", -apple-system, "Segoe UI", sans-serif;
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --rule: url("assets/marks/rule.svg");
  --rule-heavy: url("assets/marks/rule-heavy.svg");
}

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

html {
  color-scheme: light;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-variation-settings: "FLAR" 0, "VOLM" 0;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg { display: block; }
img { max-width: 100%; height: auto; }

::selection { background: rgba(201, 146, 63, 0.38); color: var(--ink); }

a { color: var(--rust); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }

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

:where(p, li, td, dd) > code {
  padding: 0.06em 0.3em;
  background: rgba(35, 39, 42, 0.07);
  font-size: 0.86em;
  white-space: nowrap;
}

kbd {
  padding: 0.04em 0.4em;
  border: 1.5px solid currentColor;
  border-bottom-width: 2.5px;
  border-radius: 4px;
  font-size: 0.8em;
}

:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--brass);
  color: var(--ink);
  font-weight: 640;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Display voice: Commissioner with full flare and some volume, the swelling
 * wedge terminals of a cast foundry plate. Body text keeps both axes at 0. */
h1,
h2,
h3 {
  margin: 0;
  font-weight: 680;
  line-height: 1.05;
  letter-spacing: 0;
  font-variation-settings: "FLAR" 100, "VOLM" 30;
  text-wrap: balance;
}
h3 { font-weight: 660; line-height: 1.2; font-variation-settings: "FLAR" 80, "VOLM" 10; }

p { margin: 0; text-wrap: pretty; }

/* -------------------------------------------------------------- buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--brass);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.button:hover { background: var(--ochre); color: var(--ink); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button-small { gap: 0; min-height: 40px; padding: 0 15px; font-size: 15px; }
.button-large { min-height: 54px; padding: 0 26px; font-size: 17px; }
.nav-price { white-space: pre; }

/* ------------------------------------------------------------ masthead */

.site-header {
  background: var(--rule) left bottom / 100% 8px no-repeat;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 76px;
  padding-bottom: 4px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  font-variation-settings: "FLAR" 100, "VOLM" 60;
}
.wordmark:hover { color: var(--ink); }
.wordmark img { width: 32px; height: 32px; }

.site-nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
  font-size: 15.5px;
}
.site-nav a,
.back-link {
  padding: 6px 0;
  color: var(--ink);
  text-decoration: none;
  background: url("assets/marks/rule-short.svg") left bottom / 0 5px no-repeat;
}
.site-nav a:hover,
.back-link:hover { color: var(--ink); background-size: 100% 5px; }
.back-link { margin-left: auto; font-size: 15.5px; }

/* ---------------------------------------------------------------- hero */

.hero {
  /* The ledge badger's width, and the room the margin notes take beside the
   * window. The text column narrows so the badger's head never meets it. */
  --ledge-w: 272px;
  --notes: 0px;
  padding-top: clamp(48px, 6.5vw, 88px);
}

.hero-copy {
  max-width: min(620px, calc((100% - var(--notes)) * 0.93 - var(--ledge-w) - 40px));
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  font-weight: 720;
  line-height: 0.98;
  font-variation-settings: "FLAR" 100, "VOLM" 60;
}

/* An ochre brush stroke under the words the page is about. */
.stroke {
  white-space: nowrap;
  padding-bottom: 0.04em;
  background: url("assets/marks/underline.svg") left 100% / 100% 0.26em no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero-lede { margin-top: 28px; color: var(--ink-soft); font-size: 18px; max-width: 58ch; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 32px;
}
.hero-actions p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.4; }
.hero-actions strong { color: var(--ink); font-weight: 680; }

.noscript-note { margin-top: 14px; color: var(--ink-soft); font-size: 15px; }

/* ---------------------------------------------------------- demo stage */

.demo { margin-top: 40px; }

.demo-rig {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--notes);
}
.stage { grid-area: 1 / 1; position: relative; }
.anvil-base { grid-area: 2 / 1; width: 100%; height: auto; margin-top: -2px; color: var(--ink); }
.anvil-base .brass { stroke: var(--brass); }
.margin-notes { display: none; }

/* The badger leans on the window. The image is trimmed so its bottom edge is
 * the tips of the claws; the flat cut under the paws sits 3.62% of the image
 * height above that, and lands exactly on the window's top outline. */
.ledge {
  position: absolute;
  right: 7%;
  bottom: 100%;
  z-index: 4;
  display: block;
  width: var(--ledge-w);
  transform: translateY(3.62%);
  pointer-events: none;
}
.ledge img { width: 100%; }

/* Control strip under the anvil: chapter tabs, then play and restart. */
.demo-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 24px;
}

.chapters { display: flex; gap: 6px; }
.chapters[hidden],
.demo-controls[hidden] { display: none; }

.chapter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px 6px 2px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  font-variation-settings: "FLAR" 60, "VOLM" 0;
  cursor: pointer;
}
.chapter:hover { color: var(--ink); }
.chapter.is-active { color: var(--ink); }
.chapter:focus-visible { outline-offset: 0; }

.chapter-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 13.5px;
  font-weight: 720;
  font-variation-settings: "FLAR" 100, "VOLM" 60;
}
.chapter.is-active .chapter-num {
  border-color: transparent;
  background: url("assets/marks/stamp.svg") center / 100% 100% no-repeat;
  color: var(--ink);
  transform: rotate(-6deg);
}

/* The progress stroke draws along an ochre underline. */
.chapter-progress {
  position: absolute;
  left: 2px;
  right: 12px;
  bottom: 0;
  height: 7px;
}
.chapter-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/marks/rule-ochre.svg") 0 0 / 100% 100% no-repeat;
  opacity: 0;
}
.chapter.is-active .chapter-progress::before { opacity: 0.3; }
.chapter-progress span {
  position: relative;
  display: block;
  height: 100%;
  background: url("assets/marks/rule-ochre.svg") 0 0 / 100% 100% no-repeat;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s linear;
}

.demo-controls { display: flex; flex: none; gap: 8px; align-items: center; }

.control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 620;
  cursor: pointer;
}
.control:hover { background: var(--oat); }
.control:active { transform: translateY(1px); }
.control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.control-play { min-width: 104px; padding-inline: 12px 16px; }
.control-play svg { fill: currentColor; stroke: none; }
.control-play .icon-pause { display: none; }
.control-play[data-state="playing"] .icon-play { display: none; }
.control-play[data-state="playing"] .icon-pause { display: block; }

/* Margin notes: slanted, ochre-arrowed, anchored to the window frame. */
.demo-caption,
.note {
  font-size: 15px;
  font-weight: 520;
  font-variation-settings: "FLAR" 60, "VOLM" 0, "slnt" -10;
}

.demo-caption {
  min-height: 3.2em;
  max-width: 72ch;
  margin-top: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* Cursor used by the scripted walkthrough. Hidden under reduced motion. */
.a-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 18px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.2s ease;
}
.a-cursor svg { width: 100%; height: 100%; fill: #f4f1ea; stroke: #141617; stroke-width: 1.2; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.a-cursor.is-on { opacity: 1; }
.a-cursor.is-click svg { transform: scale(0.86); transform-origin: 2px 2px; }

/* ---------------------------------------------------------- app window
 * The app's own dark theme values, unchanged, so the window reads as the app. */

.app {
  --a-bg: #202326;
  --a-fg: #e5e2db;
  --a-line: #35393c;
  --a-muted: #282c2f;
  --a-mfg: #989e9f;
  --a-dim: #6f7577;
  --a-side: #25292c;
  --a-tabbar: #222629;
  --a-head: #272b2e;
  --a-even: #23272a;
  --a-hover: #2b3033;
  --a-active: #39352f;
  --a-active-line: #c29a6b;
  --a-input: #2a2e31;
  --a-input-line: #414649;
  --a-pop: #292d30;
  --a-primary: #d9aa78;
  --a-accent: #e4bb8c;
  container-type: inline-size;
  position: relative;
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr);
  height: clamp(560px, 40vw + 80px, 640px);
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--a-bg);
  color: var(--a-fg);
  font: 13px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-variation-settings: normal;
  -webkit-font-smoothing: antialiased;
}
.app *:focus-visible { outline: 2px solid var(--a-accent); outline-offset: -2px; border-radius: 3px; }
.app button { font: inherit; color: inherit; }

.a-ico { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.a-ico-dim { color: var(--a-dim); }

.a-dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #7fb685; }
.a-dot.is-off { background: var(--a-dim); }

.a-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--a-line);
  background: #1c1f22;
}
.a-lights { display: flex; gap: 8px; }
.a-lights i { width: 12px; height: 12px; border-radius: 50%; background: #ec6a5e; }
.a-lights i:nth-child(2) { background: #f4bf4f; }
.a-lights i:nth-child(3) { background: #61c554; }
.a-title { font-weight: 600; font-size: 13.5px; }
.a-command {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(340px, 40%);
  height: 26px;
  margin-left: auto;
  padding: 0 8px;
  border: 1px solid var(--a-line);
  border-radius: 5px;
  background: var(--a-muted);
  color: var(--a-mfg);
  font-size: 12.5px;
}
.a-command span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app kbd { padding: 1px 5px; border: 1px solid var(--a-input-line); border-radius: 3px; font-family: inherit; font-size: 11px; color: var(--a-mfg); border-bottom-width: 1px; }

.a-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 248px;
  grid-template-rows: minmax(0, 1fr) 26px;
  min-height: 0;
}
.a-guard { grid-template-columns: 200px minmax(0, 1fr); }

/* Sidebar */
.a-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 10px 8px;
  border-right: 1px solid var(--a-line);
  background: var(--a-side);
  overflow: hidden;
}
.a-conn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--a-line);
  border-radius: 6px;
  background: #2a2e31;
}
.a-conn-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; background: #3e3830; color: var(--a-accent); }
.a-conn-text { display: grid; flex: 1; min-width: 0; }
.a-conn-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-conn-text small { display: flex; align-items: center; gap: 5px; color: var(--a-mfg); font-size: 11.5px; white-space: nowrap; }
.a-conn.is-prod { border-color: #6a5236; }
.a-conn.is-prod .a-conn-text small { color: var(--a-accent); }
.a-conn.is-prod .a-dot { background: var(--a-primary); }
.a-conn.is-staging .a-dot { background: #8fb3c9; }

.a-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  margin: 8px 0 6px;
  padding: 0 8px;
  border: 1px solid var(--a-line);
  border-radius: 5px;
  color: var(--a-mfg);
  font-size: 12.5px;
}
.a-search span { flex: 1; }
.a-tree-label { margin: 6px 6px 2px; color: var(--a-mfg); font-size: 11.5px; }
.a-tree { margin: 0; padding: 0; list-style: none; }
.a-tree li {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 27px;
  padding: 0 8px 0 14px;
  border-radius: 5px;
  color: #d4d1ca;
}
.a-tree li .a-ico { color: var(--a-mfg); width: 14px; height: 14px; }
.a-tree li.is-active { background: #40382f; color: var(--a-fg); box-shadow: inset 2px 0 var(--a-primary); }
.a-tree li.is-active .a-ico { color: var(--a-accent); }

.a-side-group { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--a-line); }
.a-side-head { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 6px; color: #d4d1ca; margin: 0; }
.a-side-head .a-ico { color: var(--a-mfg); }
.a-count { margin-left: auto; padding: 0 6px; border-radius: 8px; background: #3e3830; color: var(--a-accent); font-size: 11px; line-height: 17px; }
.a-presets { margin: 0; padding: 0 0 0 20px; list-style: none; }
.a-preset {
  display: block;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  color: #d4d1ca;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.a-preset:hover { background: var(--a-hover); color: var(--a-fg); }

/* Main column */
.a-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.a-tabs {
  display: flex;
  flex: none;
  align-items: stretch;
  height: 36px;
  border-bottom: 1px solid var(--a-line);
  background: var(--a-tabbar);
  overflow: hidden;
}
.a-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--a-line);
  background: transparent;
  color: var(--a-mfg);
  white-space: nowrap;
}
button.a-tab { cursor: pointer; }
button.a-tab:hover { color: var(--a-fg); background: var(--a-hover); }
.a-tab.is-active { background: var(--a-bg); color: var(--a-fg); box-shadow: inset 0 -2px var(--a-primary); }
.a-tab .a-ico { width: 14px; height: 14px; }
.a-tab-conn { padding: 1px 6px; border-radius: 3px; background: var(--a-muted); color: var(--a-mfg); font-size: 11px; }
.a-tab-conn.is-prod { background: #3e3830; color: var(--a-accent); }
.a-tab-add { display: grid; place-items: center; width: 36px; color: var(--a-mfg); }

.a-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 10px;
  border-bottom: 1px solid var(--a-line);
  min-width: 0;
}

.a-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 10px;
  border: 1px solid #3a3f42;
  border-radius: 4px;
  background: #2a2e31;
  color: var(--a-fg);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.08s ease;
}
.a-btn:hover { background: #363b3e; }
.a-btn .a-ico { width: 13px; height: 13px; }
.a-btn.is-primary { border-color: transparent; background: var(--a-primary); color: #211e1a; }
.a-btn.is-primary:hover { background: #e5ba8a; }
.a-btn.is-primary .a-ico { fill: currentColor; stroke: none; }
.a-btn.is-primary kbd { border-color: rgba(33, 30, 26, 0.35); color: rgba(33, 30, 26, 0.75); }
.a-btn.is-ghost { border-color: transparent; background: transparent; color: #d4d1ca; }
span.a-btn.is-ghost { cursor: default; }
.a-btn.is-ghost:hover { background: var(--a-hover); }
.a-btn.is-danger { border-color: #6b3a33; background: #43292500; background: #43292a; color: #f0b5a8; }
.a-btn.is-danger .a-ico { fill: currentColor; stroke: none; }
.a-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.a-btn.is-pressing { transform: translateY(1px); filter: brightness(1.12); }

.a-target { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--a-mfg); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-target.is-prod { color: var(--a-accent); }
.a-target.is-prod .a-dot { background: var(--a-primary); }

.a-preset-select { display: none; }
.a-preset-select select,
.a-fields select {
  height: 27px;
  padding: 0 6px;
  border: 1px solid var(--a-input-line);
  border-radius: 4px;
  background: var(--a-input);
  color: var(--a-fg);
  font: inherit;
  font-size: 12.5px;
}

.a-seg { display: inline-flex; flex: none; padding: 2px; border-radius: 5px; background: var(--a-muted); color: var(--a-mfg); font-size: 12.5px; }
.a-seg span { padding: 3px 10px; border-radius: 4px; }
.a-seg .is-on { background: #3e3830; color: var(--a-accent); }

.a-filter { display: flex; flex: 1 1 200px; align-items: center; gap: 6px; min-width: 110px; max-width: 280px; height: 27px; padding: 0 8px; border: 1px solid var(--a-input-line); border-radius: 4px; background: var(--a-input); color: var(--a-mfg); }
.a-filter input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--a-fg); font: inherit; font-size: 12.5px; outline: none; }
.a-filter:focus-within { border-color: var(--a-active-line); }
.a-filter .a-ico { width: 13px; height: 13px; }
.a-tools { display: inline-flex; gap: 12px; color: #d4d1ca; font-size: 12.5px; }
.a-tools span { display: inline-flex; align-items: center; gap: 5px; }
.a-tools .a-ico { width: 13px; height: 13px; color: var(--a-mfg); }
.a-pending { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.a-pending-none { display: inline-flex; align-items: center; gap: 6px; color: var(--a-mfg); font-size: 12px; white-space: nowrap; }

/* SQL editor */
.a-ed {
  display: flex;
  flex: none;
  height: 196px;
  min-height: 0;
  border-bottom: 1px solid var(--a-line);
  font: 12.5px/19px var(--mono);
}
.a-guard .a-ed { height: 150px; }
.a-ed-gutter { flex: none; width: 38px; padding: 9px 8px 9px 0; color: #5f6567; text-align: right; user-select: none; background: #1e2124; }
.a-ed-gutter span { display: block; }
.a-ed-scroll { flex: 1; min-width: 0; overflow: auto; }
.a-ed-stack { display: grid; min-width: 100%; width: max-content; min-height: 100%; }
.a-ed-code,
.a-ed-input {
  grid-area: 1 / 1;
  margin: 0;
  padding: 9px 14px;
  font: inherit;
  white-space: pre;
  tab-size: 2;
  letter-spacing: normal;
}
.a-ed-code { color: #d9d6cf; pointer-events: none; }
.a-ed-input {
  width: 100%;
  height: 100%;
  resize: none;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--a-primary);
  outline: none;
}
.a-ed-input::selection { background: rgba(124, 98, 72, 0.6); color: transparent; }
.a-ed.is-editable:focus-within { box-shadow: inset 0 0 0 1px var(--a-active-line); }

.t-k { color: #e4bb8c; }
.t-f { color: #f0d3a8; }
.t-s { color: #b5c98f; }
.t-n { color: #e8a183; }
.t-i { color: #a9c0c4; }
.t-p { color: #e4bb8c; font-weight: 700; }
.t-c { color: #7d8586; font-style: italic; }

.a-caret { display: inline-block; width: 2px; height: 15px; margin-left: 1px; vertical-align: -3px; background: var(--a-primary); animation: a-blink 1s steps(1) infinite; }
@keyframes a-blink { 50% { opacity: 0; } }

/* Results and grids */
.a-results { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.a-results-head { display: flex; flex: none; justify-content: space-between; gap: 12px; height: 30px; padding: 0 12px; align-items: center; border-bottom: 1px solid var(--a-line); color: var(--a-mfg); font-size: 12px; }
.a-results-head span:first-child { color: var(--a-fg); font-weight: 600; }
.a-grid-wrap { flex: 1; min-height: 0; overflow: auto; }

.a-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.a-grid th,
.a-grid td { padding: 0 12px; border-right: 1px solid #2e3235; border-bottom: 1px solid #2b2f32; text-align: left; white-space: nowrap; }
.a-grid th { position: sticky; top: 0; z-index: 1; height: 40px; background: var(--a-head); font-weight: 600; vertical-align: middle; }
.a-grid td { height: 29px; }
.a-grid tbody tr:nth-child(even) td { background: var(--a-even); }
.a-grid .a-rownum { width: 38px; padding: 0 8px; color: var(--a-dim); text-align: right; font-variant-numeric: tabular-nums; }
.a-col-btn { display: grid; width: 100%; height: 100%; padding: 4px 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.a-col-name { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.a-col-type { color: var(--a-dim); font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em; }
.a-sort-mark { color: var(--a-accent); font-size: 8px; }
.a-null { color: var(--a-dim); font-style: italic; }
.a-c-id,
.a-c-orders,
.a-c-spent,
.a-c-total_cents { font-variant-numeric: tabular-nums; }
.a-c-orders,
.a-c-spent,
.a-c-total_cents { text-align: right !important; }
.a-c-metadata { max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 11.5px; color: #c9c6bf; }
.a-c-email { color: #d4d1ca; }

.a-edit .a-grid td[data-cell] { cursor: default; }
.a-edit .a-grid tbody tr:hover td { background: var(--a-hover); }
.a-edit .a-grid tr.is-selected td { background: var(--a-active); }
.a-edit .a-grid tr.is-selected td:first-child { box-shadow: inset 2px 0 var(--a-active-line); }
.a-edit .a-grid td[data-cell]:focus-visible { outline: 2px solid var(--a-accent); outline-offset: -2px; border-radius: 0; }
.a-grid td[data-mark~="is-pending"] {
  background: rgba(217, 170, 120, 0.2) !important;
  box-shadow: inset 0 0 0 1px rgba(217, 170, 120, 0.7);
  color: #f4dcbc;
  font-weight: 600;
  position: relative;
}
.a-grid td[data-mark~="is-pending"]::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 7px 7px 0;
  border-color: transparent var(--a-primary) transparent transparent;
}
.a-grid td[data-mark~="is-saved"] { animation: a-saved 2.4s ease-out both; }
@keyframes a-saved {
  0% { background: rgba(127, 182, 133, 0.32); box-shadow: inset 0 0 0 1px rgba(127, 182, 133, 0.8); }
  100% { background: transparent; box-shadow: inset 0 0 0 1px transparent; }
}
.a-grid tr.is-deleting td { color: #c08c80; text-decoration: line-through; text-decoration-color: rgba(232, 131, 111, 0.6); background: rgba(232, 131, 111, 0.08) !important; }

.a-query .a-grid tbody tr { animation: a-row-in 0.35s ease-out both; }
.a-query .a-grid tbody tr:nth-child(2) { animation-delay: 0.03s; }
.a-query .a-grid tbody tr:nth-child(3) { animation-delay: 0.06s; }
.a-query .a-grid tbody tr:nth-child(4) { animation-delay: 0.09s; }
.a-query .a-grid tbody tr:nth-child(5) { animation-delay: 0.12s; }
.a-query .a-grid tbody tr:nth-child(6) { animation-delay: 0.15s; }
.a-query .a-grid tbody tr:nth-child(7) { animation-delay: 0.18s; }
.a-query .a-grid tbody tr:nth-child(8) { animation-delay: 0.21s; }
@keyframes a-row-in { from { opacity: 0; } to { opacity: 1; } }

.a-empty { display: flex; flex: 1; align-items: center; justify-content: center; gap: 10px; min-height: 120px; height: 100%; color: var(--a-mfg); font-size: 12.5px; text-align: center; padding: 0 16px; }
.a-progress { width: 90px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--a-primary), transparent) 0 0 / 50% 100% no-repeat, var(--a-muted); animation: a-progress 1s linear infinite; }
@keyframes a-progress { from { background-position: -50% 0, 0 0; } to { background-position: 150% 0, 0 0; } }

.a-pager { display: flex; flex: none; justify-content: space-between; align-items: center; height: 32px; padding: 0 12px; border-top: 1px solid var(--a-line); color: var(--a-mfg); font-size: 12px; }

.a-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px;
  padding: 12px 14px;
  border: 1px solid var(--a-line);
  border-radius: 6px;
  background: var(--a-muted);
  color: #d4d1ca;
  font-size: 12.5px;
  line-height: 1.45;
}
.a-banner .a-ico { margin-top: 1px; }
.a-banner.is-error { border-color: #6b3a33; background: #352523; color: #f2c4b9; }
.a-banner.is-error .a-ico { color: #e8836f; }
.a-banner.is-ok { border-color: #3d5340; background: #243028; color: #cfe3cd; }
.a-banner.is-ok .a-ico { color: #8fbf8a; }
.a-edit .a-banner { margin: 10px 10px 0; flex: none; }

/* Inspector and history */
.a-inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--a-line);
  background: var(--a-bg);
  overflow: auto;
}
.a-panel-head { flex: none; display: flex; align-items: center; height: 44px; padding: 0 14px; border-bottom: 1px solid var(--a-line); font-weight: 600; }
.a-panel-note { margin: 12px 14px 4px; color: var(--a-mfg); font-size: 12px; line-height: 1.4; }
.a-history ul { margin: 0; padding: 6px 8px; list-style: none; }
.a-history li { display: grid; gap: 4px; padding: 9px 8px; border-bottom: 1px solid #2b2f32; }
.a-history li code { overflow: hidden; color: #d9d6cf; font-family: var(--mono); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.a-history li span { display: flex; align-items: center; gap: 6px; color: var(--a-mfg); font-size: 11.5px; }
.a-history li.is-new { animation: a-new 1.6s ease-out both; }
@keyframes a-new { from { background: rgba(217, 170, 120, 0.16); } to { background: transparent; } }

.a-fields { display: grid; gap: 8px; padding: 12px 14px 14px; }
.a-field { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 8px; }
.a-field label { display: grid; color: #d4d1ca; font-size: 12px; line-height: 1.2; }
.a-field label small { color: var(--a-dim); font-size: 10px; letter-spacing: 0.02em; }
.a-field input,
.a-field select { width: 100%; min-width: 0; height: 27px; padding: 0 8px; border: 1px solid var(--a-input-line); border-radius: 4px; background: var(--a-input); color: var(--a-fg); font: inherit; font-size: 12.5px; }
.a-field input[readonly] { color: var(--a-mfg); background: transparent; }
.a-field input:focus,
.a-field select:focus { border-color: var(--a-active-line); outline: none; }
.a-field input::placeholder { color: var(--a-dim); font-style: italic; }
.a-field-actions { display: grid; gap: 6px; margin-top: 6px; }
.a-field-actions .a-btn { justify-content: center; width: 100%; }

/* Status bar */
.a-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0 12px;
  border-top: 1px solid var(--a-line);
  background: #1c1f22;
  color: var(--a-mfg);
  font-size: 11.5px;
  white-space: nowrap;
}
.a-status > span { display: inline-flex; align-items: center; gap: 6px; }
.a-status > span + span:not(.a-status-msg)::before { content: ""; width: 1px; height: 12px; margin-right: 8px; background: var(--a-line); }
.a-status .a-ico { width: 12px; height: 12px; }
.a-status-conn { color: #a6cfa9; }
.a-status-ro { color: var(--a-accent); }
.a-status-msg { margin-left: auto; overflow: hidden; text-overflow: ellipsis; color: #d4d1ca; }
.a-status-msg.is-error { color: #f2a796; }

/* Dialogs inside the window */
.a-layer { position: absolute; inset: 38px 0 0; z-index: 3; display: none; align-items: center; justify-content: center; padding: 16px; }
.a-layer.is-open { display: flex; }
.a-scrim { position: absolute; inset: 0; background: rgba(12, 13, 14, 0.58); }
.a-dlg {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: 100%;
  border: 1px solid #40464a;
  border-radius: 8px;
  background: var(--a-pop);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  animation: a-dlg-in 0.18s ease-out both;
}
.a-dlg-cell { width: min(440px, 100%); }
@keyframes a-dlg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.a-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.a-dlg-head h3 { font: 600 14.5px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; font-variation-settings: normal; letter-spacing: 0; }
.a-dlg-x { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 4px; background: transparent; color: var(--a-mfg); cursor: pointer; }
.a-dlg-x:hover { background: var(--a-hover); color: var(--a-fg); }
.a-dlg-body { display: grid; gap: 10px; padding: 6px 16px 14px; overflow: auto; color: #d4d1ca; font-size: 12.5px; line-height: 1.5; }
.a-dlg-sub { color: var(--a-mfg); font-size: 12px; }
.a-dlg-target { color: var(--a-primary); font-weight: 600; }
.a-dlg-sql {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--a-line);
  border-radius: 5px;
  background: #1e2124;
  color: #d9d6cf;
  font: 12px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 210px;
  overflow: auto;
}
.a-dlg-note { color: var(--a-mfg); font-size: 12px; }
.a-dlg-confirm { color: var(--a-fg); }
.a-dlg-input { width: 100%; height: 30px; padding: 0 9px; border: 1px solid var(--a-input-line); border-radius: 4px; background: var(--a-input); color: var(--a-fg); font: inherit; font-size: 13px; }
.a-dlg-input:focus { border-color: var(--a-active-line); outline: none; }
.a-dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--a-line); }

/* Narrower windows drop the sidebar, then the inspector. */
@container (max-width: 1040px) {
  .a-body { grid-template-columns: minmax(0, 1fr) 236px; }
  .a-guard { grid-template-columns: minmax(0, 1fr); }
  .a-side { display: none; }
  .a-preset-select { display: block; }
  .a-wide-only { display: none; }
}
@container (max-width: 1180px) {
  .a-wide-only { display: none; }
}
@container (max-width: 860px) {
  .a-mid-only { display: none; }
  .a-tools { display: none; }
}
@container (max-width: 700px) {
  .a-body,
  .a-guard { grid-template-columns: minmax(0, 1fr); }
  .a-inspector { display: none; }
  .a-command { display: none; }
  .a-seg { display: none; }
  .a-filter { max-width: none; }
  .a-status > span:nth-child(3),
  .a-status > .a-status-safe { display: none; }
}
@container (max-width: 520px) {
  .a-narrow-hide { display: none; }
  .a-target { display: none; }
  .a-btn kbd { display: none; }
  .a-ed { height: 176px; font-size: 11.5px; line-height: 17px; }
  .a-guard .a-ed { height: 128px; }
  .a-ed-gutter { width: 28px; }
  .a-ed-code,
  .a-ed-input { padding-inline: 10px; }
  /* Long first lines scroll; a short fade marks the edge instead of a cut glyph. */
  .a-ed-scroll { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent); }
  .a-status > span:nth-child(2) { display: none; }
  .a-tab { padding: 0 10px; }
  .a-tab-conn:not(.is-prod) { display: none; }
}

/* ------------------------------------------------------- margin notes */

.note {
  position: absolute;
  left: 28px;
  right: 0;
  margin: 0;
  color: var(--ink);
  line-height: 1.3;
  transform: rotate(-3deg);
  transform-origin: left center;
}
.note-sql { top: 96px; }
.note-ro { bottom: 120px; transform: rotate(2.5deg); }
.note svg {
  position: absolute;
  left: -24px;
  width: 22px;
  height: 30px;
  fill: none;
  stroke: var(--ochre);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.note-sql svg { top: 6px; }
.note-ro svg { bottom: 6px; }

/* ------------------------------------------------------ section scaffold */

.section { padding-block: clamp(96px, 11vw, 152px); }
.section-oat { background: var(--oat); }

.section-head { max-width: 760px; margin-bottom: clamp(44px, 5.5vw, 68px); }
.section-head h2,
.safety-intro h2,
.pricing-copy h2 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 680;
}
.section-head h2 { max-width: 18ch; }
.section-head p { margin-top: 20px; color: var(--ink-soft); max-width: 62ch; }

/* --------------------------------------------------------------- ledger */

.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 16px 48px;
  padding: 34px 0 40px;
  background: var(--rule) left top / 100% 8px no-repeat;
}
.ledger-row:last-child { background-image: var(--rule), var(--rule); background-position: left top, left bottom; background-size: 100% 8px, 100% 8px; }

.ledger-word {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 720;
  line-height: 0.98;
  font-variation-settings: "FLAR" 100, "VOLM" 60;
}
.ledger-note { margin-top: 12px; color: var(--ink-soft); font-size: 15px; }

.ledger-row ul {
  display: grid;
  gap: 12px;
  max-width: 64ch;
  margin: 0;
  padding: 6px 0 0;
  list-style: none;
}
.ledger-row li { position: relative; padding-left: 30px; }
.ledger-row li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 16px;
  height: 5px;
  background: url("assets/marks/rule-ochre.svg") 0 0 / 100% 100% no-repeat;
}

/* -------------------------------------------------------------- engines */

.matrix-scroll { overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.matrix-scroll:focus-visible { outline-offset: -2px; }
.matrix {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.4;
}
.matrix th,
.matrix td { padding: 17px 20px 17px 0; text-align: left; vertical-align: top; }
.matrix tbody tr { background: var(--rule) left bottom / 100% 8px no-repeat; }
.matrix thead tr { background: var(--rule-heavy) left bottom / 100% 10px no-repeat; }
.matrix thead th { padding-top: 0; padding-bottom: 20px; vertical-align: bottom; }
.engine-name { font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-variation-settings: "FLAR" 100, "VOLM" 40; }
.engine-and { font-weight: 450; color: var(--ink-soft); font-variation-settings: "FLAR" 0, "VOLM" 0; }
.matrix tbody th { width: 30%; font-weight: 600; }
.matrix td { width: 23.3%; color: var(--ink-soft); }
.matrix td code { font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.matrix td.yes { color: var(--ink); }
.matrix .mark {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 9px;
  vertical-align: -3px;
  background: url("assets/marks/tick.svg") center / contain no-repeat;
}
.matrix .mark-no { background-image: url("assets/marks/dash.svg"); }
.matrix tr.row-split { background-image: var(--rule-heavy), var(--rule); background-position: left top, left bottom; background-size: 100% 10px, 100% 8px; }
.matrix tr.row-split > * { padding-top: 22px; }
.engines-foot { margin-top: 30px; max-width: 68ch; color: var(--ink-soft); font-size: 15.5px; }

/* --------------------------------------------------------------- safety */

.safety-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px 88px;
  align-items: start;
}
.safety-intro h2 { max-width: 12ch; }
.safety-intro p { margin-top: 22px; color: var(--ink-soft); max-width: 42ch; }
.review-art { display: block; width: 340px; max-width: 100%; margin-top: 40px; }
.review-art img { width: 100%; }

.checks { margin: 0; padding: 0; list-style: none; }
.checks li {
  position: relative;
  padding: 30px 0 34px 74px;
  background: var(--rule) left top / 100% 8px no-repeat;
}
.checks li:first-child { background: none; padding-top: 4px; }
/* Each point gets a stamped tick. They are separate facts, not steps. */
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  width: 48px;
  height: 48px;
  background:
    /* tick.svg's path, in ink so it reads on the ochre stamp */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2323272a' d='M2.9 13.4c1.7-1 3.4.4 4.8 2.3.5.7 1 .7 1.4 0C12 10.6 15.6 6.4 20.4 3.1c.9-.6 1.7.3 1 1.1-4.2 4.3-7.4 8.8-10.1 14.1-.8 1.5-2.3 1.7-3.3.4-1.3-1.8-2.7-3.2-4.6-4.3-.7-.4-.9-.8-.5-1z'/%3E%3C/svg%3E") center / 50% no-repeat,
    url("assets/marks/stamp.svg") center / 100% 100% no-repeat;
  transform: rotate(-4deg);
}
.checks li:first-child::before { top: -4px; }
.checks li:nth-child(2)::before { transform: rotate(3deg); }
.checks li:nth-child(3)::before { transform: rotate(-2deg); }
.checks li:nth-child(4)::before { transform: rotate(5deg); }
.checks li:nth-child(5)::before { transform: rotate(-3deg); }
.checks li:nth-child(6)::before { transform: rotate(2deg); }
.checks h3 { font-size: 1.4rem; margin-bottom: 10px; }
.checks p { color: var(--ink-soft); max-width: 62ch; }

.snippet {
  margin: 18px 0 0;
  padding: 16px 18px;
  background: var(--ink);
  color: #ece6da;
  font: 13px/1.65 var(--mono);
  overflow-x: auto;
}
.snippet:focus-visible { outline-offset: 2px; }
.snippet-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.snip-sql,
.snip-key { color: #e4bb8c; }
.snip-msg { color: #b9b3a6; }

/* A short band with an ochre stroke down its left side. */
.local {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 16px 88px;
  margin-top: clamp(72px, 9vw, 120px);
}
.local > div {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  padding: 6px 0 8px 30px;
  background: url("assets/marks/rule-vertical.svg") left top / 6px 100% no-repeat;
}
.local h3 { font-size: 1.6rem; max-width: 14ch; }
.local p { color: var(--ink-soft); max-width: 62ch; }

/* -------------------------------------------------------------- pricing */

/* The numeral and the workshop badger stand on one ground rule. */
.pricing-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 32px 48px;
  padding-bottom: 6px;
  background: var(--rule-heavy) left bottom / 100% 10px no-repeat;
}
.price {
  display: flex;
  align-items: flex-start;
  margin: 0;
  color: var(--ink);
  font-size: clamp(8rem, 17vw, 14rem);
  font-weight: 760;
  /* ascent minus descent: the line box ends exactly on the baseline */
  line-height: 0.811;
  font-variation-settings: "FLAR" 100, "VOLM" 60;
}
.price-cur { margin: 0.06em 0.06em 0 0; font-size: 0.2em; font-weight: 680; line-height: 1; }
.price-num { display: block; }
.pricing-art {
  justify-self: end;
  display: block;
  width: min(580px, 100%);
  /* the anvil foot is 1.08% above the trimmed image's bottom edge */
  transform: translateY(1.08%);
}
.pricing-art img { width: 100%; }

.pricing-copy {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 32px 88px;
  margin-top: 48px;
}
.pricing-copy h2 { max-width: 14ch; }
.pricing-copy .pricing-lede { margin-top: 18px; color: var(--ink-soft); max-width: 50ch; }
.pricing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 30px; }
.pricing-actions p { color: var(--ink-soft); font-size: 15px; }

.terms { margin: 0; }
.terms div {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0 15px;
  background: var(--rule) left bottom / 100% 8px no-repeat;
}
.terms dt { color: var(--ink-soft); }
.terms dd { margin: 0; font-weight: 620; }
.pricing-contact { margin-top: 24px; color: var(--ink-soft); font-size: 15.5px; }

/* --------------------------------------------------------------- footer */

.site-footer { background: var(--ink); color: var(--paper); }
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  min-height: 96px;
  padding-block: 24px;
  color: #cfc8ba;
  font-size: 15px;
}
.footer-row nav { display: flex; gap: 26px; margin-left: auto; }
.footer-row nav a { color: var(--paper); }
.footer-row nav a:hover { color: var(--brass); }
.footer-row .wordmark { color: var(--paper); font-size: 16px; }
.footer-row .wordmark img { width: 24px; height: 24px; }
.site-footer :focus-visible { outline-color: var(--brass); }

/* --------------------------------------------------------------- dialog */

dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 32px 32px 28px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop { background: rgba(35, 39, 42, 0.55); }
dialog .dialog-mark { width: 44px; height: 44px; margin-bottom: 18px; }
dialog h2 { font-size: 1.75rem; margin-bottom: 12px; }
dialog p { color: var(--ink-soft); font-size: 16px; }
dialog p + p { margin-top: 10px; }
dialog #availability-description { color: var(--ink); font-weight: 560; }
dialog .button { margin-top: 24px; }
.dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; }
.dialog-close:hover { background: var(--oat); }
.dialog-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ------------------------------------------------------ privacy and 404 */

.page-main { padding-block: clamp(64px, 9vw, 112px) clamp(80px, 10vw, 136px); }
.prose { max-width: 680px; }
.prose h1 { font-size: clamp(2.6rem, 5vw, 3.8rem); font-weight: 720; font-variation-settings: "FLAR" 100, "VOLM" 60; }
.prose .prose-lede { margin-top: 20px; color: var(--ink); font-size: 1.2rem; }
.prose h2 { margin-top: 52px; padding-top: 26px; font-size: 1.5rem; background: url("assets/marks/rule-short.svg") left top / 72px 5px no-repeat; }
.prose p { margin-top: 14px; color: var(--ink-soft); }

.error-main .wrap { display: grid; justify-items: start; }
.error-art { display: block; width: 320px; max-width: 100%; margin-bottom: 36px; }
.error-art img { width: 100%; }
.error-main h1 { max-width: 14ch; font-size: clamp(2.6rem, 5vw, 3.8rem); font-weight: 720; font-variation-settings: "FLAR" 100, "VOLM" 60; }
.error-main p { margin-top: 18px; color: var(--ink-soft); max-width: 46ch; }
.error-main .button { margin-top: 30px; }

/* ----------------------------------------------------------- responsive */

@media (min-width: 1280px) {
  .hero { --notes: 136px; }
  .margin-notes { display: block; grid-area: 1 / 2; position: relative; }
}

@media (min-width: 861px) and (min-height: 860px) {
  .safety-intro { position: sticky; top: 32px; }
}

@media (max-width: 1039px) {
  .hero { --ledge-w: 250px; }
  .site-nav { gap: 22px; }
  .review-art { width: 280px; }
  .safety-layout,
  .local { column-gap: 56px; }
  .pricing-copy { column-gap: 56px; }
}

@media (max-width: 860px) {
  .hero { --ledge-w: 220px; }
  .hero-copy { max-width: 620px; }
  /* Stacked: the badger's whole head sits in clear space above the window. */
  .demo { margin-top: calc(var(--ledge-w) * 0.723 + 16px); }
  .safety-layout,
  .pricing-copy { grid-template-columns: minmax(0, 1fr); }
  .local > div { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .review-art { width: 260px; margin-inline: auto; }
  .pricing-art { width: min(440px, 100%); }
  .ledger-row { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 28px 0 32px; }
}

@media (max-width: 760px) {
  .site-nav { display: none; }
  .header-row > .button { margin-left: auto; }
}

@media (max-width: 700px) {
  .anvil-base { display: none; }
  .demo-rig::after { content: ""; grid-area: 2 / 1; height: 10px; margin-top: -2px; background: var(--ink); }
  .demo-bar { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 18px; }
  .chapters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .chapters[hidden] { display: none; }
  .chapter { align-items: flex-start; padding: 6px 4px 12px 0; gap: 8px; font-size: 15px; }
  .chapter-num { width: 26px; height: 26px; font-size: 13px; margin-top: -3px; }
  .chapter-progress { left: 0; right: 4px; }
  .demo-controls { justify-content: flex-start; }

  .matrix-scroll { overflow: visible; margin-inline: 0; padding-inline: 0; }
  .matrix { min-width: 0; }
  .matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .matrix,
  .matrix tbody,
  .matrix tr,
  .matrix th,
  .matrix td { display: block; width: auto; }
  .matrix tbody tr { padding: 20px 0 18px; }
  .matrix tbody tr:first-child { background-image: var(--rule-heavy), var(--rule); background-position: left top, left bottom; background-size: 100% 10px, 100% 8px; }
  .matrix tr.row-split > * { padding-top: 0; }
  .matrix th,
  .matrix td { padding: 0; }
  .matrix tbody th { width: auto; margin-bottom: 8px; font-size: 16.5px; }
  .matrix td { display: flex; align-items: baseline; width: auto; padding: 4px 0; font-size: 15px; }
  .matrix td::before { content: attr(data-label); flex: 0 0 9.5em; padding-right: 12px; color: var(--ink-soft); font-weight: 600; }
  .matrix td .mark { flex: none; align-self: center; margin-right: 8px; }
  .matrix td code { min-width: 0; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { --ledge-w: 172px; padding-top: 40px; }
  .hero-lede { font-size: 16.5px; margin-top: 22px; }
  .app { height: 600px; border-radius: 8px; }
  .header-row { min-height: 64px; gap: 16px; }
  .wordmark { font-size: 18px; }
  .wordmark img { width: 28px; height: 28px; }
  .review-art { width: 220px; }
  .checks li { padding-left: 62px; }
  .checks li::before { width: 42px; height: 42px; }
  .terms div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pricing-actions .button { width: 100%; }
  .pricing-stage { gap: 12px; }
  .price { font-size: 24vw; }
  .footer-row nav { margin-left: 0; }
  .error-art { width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .a-caret { animation: none; }
  .a-grid td[data-mark~="is-saved"] { animation: none; background: rgba(127, 182, 133, 0.2); }
  .a-cursor { display: none; }
}

/* High contrast: the drawn rules are images, so give every one a real border. */
@media (forced-colors: active) {
  .site-header { border-bottom: 1px solid CanvasText; }
  .ledger-row,
  .checks li,
  .matrix tbody tr,
  .terms div { border-top: 1px solid CanvasText; }
  .pricing-stage { border-bottom: 2px solid CanvasText; }
  .local > div { border-left: 3px solid CanvasText; }
  .chapter.is-active { outline: 2px solid Highlight; }
  .a-grid td[data-mark~="is-pending"] { outline: 2px solid Highlight; }
}
