/* Hallmark · macrostructure: Workbench (leans Bento Grid) · genre: modern-minimal · tone: technical, calm · anchor hue: 220 (petrol)
 * theme: studied-DNA (source: image — FuseBase homepage) · paper oklch(100% 0 0) · ink oklch(26% 0.05 220) · accent oklch(87% 0.07 190) mint
 * fonts: Inter (display + body) · JetBrains Mono (code) · Caveat (hand notes, petrol band only) · studied: yes · DNA-source: image (public reference)
 * hero: H2 split 6/6, right = real screens clipped by the fold · nav: N1b + ⌘K palette · footer: Ft3 index columns
 * features: F1 bento of screens (7/5 · 5/7 · 7/5) · local-run callout · petrol band with process fan · F3 spec · guarantees bento · C petrol panel
 * motion: trace type-in once · CTA hover lift · one-shot reveal
 * Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4
 */

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--space-md));
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.022em;
  overflow-wrap: anywhere;
  min-width: 0;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

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

code {
  font-size: 0.875em;
  color: var(--color-ink);
}

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

.sprite {
  position: absolute;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: max(var(--page-gutter), env(safe-area-inset-left));
}

.skip {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: var(--z-modal);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-petrol);
  color: var(--color-on-petrol);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

.skip:focus-visible {
  transform: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 2.875rem;
  padding: 0 var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out),
    color var(--dur-short) var(--ease-out),
    transform var(--dur-short) var(--ease-out);
}

.btn--sm {
  min-height: 2.5rem;
  padding: 0 var(--space-md);
  font-size: var(--text-sm);
}

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

.btn--outline {
  border-color: var(--color-rule-2);
  background: var(--color-paper);
  color: var(--color-ink);
}

.btn--mint {
  background: var(--color-mint);
  color: var(--color-petrol-deep);
}

.btn--ghost {
  border-color: var(--color-on-petrol-muted);
  color: var(--color-on-petrol);
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover {
    background: var(--color-petrol-hover);
    transform: translateY(-1.5px);
  }

  .btn--mint:hover {
    background: var(--color-mint-hover);
    transform: translateY(-1.5px);
  }

  .btn--outline:hover {
    border-color: var(--color-petrol);
  }

  .btn--ghost:hover {
    border-color: var(--color-mint);
    color: var(--color-mint);
  }
}

.btn:active {
  transform: translateY(0);
  transition-duration: 60ms;
}

.btn:disabled,
.btn[aria-disabled="true"],
.kbd-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.closing .btn:focus-visible,
.band :focus-visible {
  outline-color: var(--color-focus-on-petrol);
}

/* Copy button — label swap is the feedback, no toast */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  flex: none;
  min-height: 2.25rem;
  padding: 0 var(--space-sm);
  border: var(--rule-1);
  border-radius: var(--radius-sm);
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color var(--dur-micro) var(--ease-out),
    color var(--dur-micro) var(--ease-out);
}

.copy-btn:hover,
.copy-btn[data-state="copied"] {
  border-color: var(--color-teal);
  color: var(--color-teal);
}

.copy-btn:active {
  transform: translateY(1px);
}

.copy-btn__done {
  display: none;
}

.copy-btn[data-state="copied"] .copy-btn__idle {
  display: none;
}

.copy-btn[data-state="copied"] .copy-btn__done {
  display: block;
}

.copy-btn[data-state="error"] {
  border-color: var(--color-bad);
  color: var(--color-bad);
}

.copy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.copy-btn--petrol {
  border: var(--rule-petrol);
  background: transparent;
  color: var(--color-on-petrol-muted);
}

.copy-btn--petrol:hover,
.copy-btn--petrol[data-state="copied"] {
  border-color: var(--color-mint);
  color: var(--color-mint);
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 2.75rem;
  color: var(--color-petrol);
  text-decoration: none;
}

.brand__mark {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.brand__word {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand--on-petrol {
  color: var(--color-on-petrol);
}

/* ---------- Nav · N1b ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid transparent;
  background: var(--color-paper);
  transition:
    background-color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out);
}

.nav.is-scrolled {
  border-bottom-color: var(--color-rule);
  background: var(--color-nav-frost);
  backdrop-filter: saturate(1.4) blur(12px);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  height: var(--nav-h);
}

.nav__center {
  display: none;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 var(--space-sm);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out);
}

.nav__link:hover,
.nav__link[aria-current] {
  color: var(--color-ink);
}

.nav__link[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--color-teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5em;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav__docs {
  display: none;
}

.kbd-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 2.5rem;
  padding: 0 var(--space-sm);
  border: var(--rule-1);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  transition:
    border-color var(--dur-micro) var(--ease-out),
    color var(--dur-micro) var(--ease-out);
}

.kbd-trigger:hover {
  border-color: var(--color-rule-2);
  color: var(--color-ink);
}

.kbd-trigger:active {
  transform: translateY(1px);
}

.kbd-trigger__kbd {
  display: none;
  font-size: var(--text-xs);
}

@media (max-width: 26rem) {
  .nav__right .btn--primary span {
    display: none;
  }

  .nav__right .btn--primary {
    width: 2.5rem;
    padding: 0;
  }
}

@media (min-width: 40rem) {
  .kbd-trigger__kbd {
    display: inline;
  }

  .nav__docs {
    display: inline-flex;
  }
}

@media (min-width: 62rem) {
  .nav__center {
    display: flex;
    gap: var(--space-2xs);
  }
}

/* ---------- Shared section heads ---------- */
.head {
  display: grid;
  gap: var(--space-sm);
  max-width: 40rem;
  margin-bottom: var(--space-xl);
}

.head__title {
  font-size: var(--text-h2);
  line-height: 1.1;
}

.head__lede {
  max-width: 36rem;
  color: var(--color-muted);
  font-size: var(--text-md);
  line-height: 1.55;
}

.head--center {
  justify-items: center;
  margin-inline: auto;
  text-align: center;
}

.head--split {
  max-width: none;
}

@media (min-width: 60rem) {
  .head {
    margin-bottom: var(--space-2xl);
  }

  .head--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: var(--space-2xl);
  }
}

/* ---------- Hero · H2 split ---------- */
.hero {
  position: relative;
  overflow: clip;
  background: linear-gradient(105deg, var(--color-paper) 38%, var(--color-teal-wash) 100%);
  border-bottom: var(--rule-1);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl);
  padding-top: var(--space-2xl);
}

.hero__copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: start;
  gap: var(--space-lg);
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-3xs) var(--space-sm) var(--space-3xs) var(--space-3xs);
  border: var(--rule-1);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
}

.badge__tag {
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-petrol);
  color: var(--color-on-petrol);
  font-size: var(--text-xs);
  font-weight: 600;
}

.hero__title {
  max-width: 13ch;
  font-size: var(--text-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero__lede {
  max-width: 34rem;
  color: var(--color-ink-2);
  font-size: var(--text-md);
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.clone {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  max-width: 34rem;
  padding-top: var(--space-lg);
  border-top: var(--rule-1);
}

.clone__cmd {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collage — two columns of real screens, clipped by the hero's own edges */
.collage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-md);
  height: 22rem;
  margin-inline: calc(var(--page-gutter) * -0.5);
  overflow: hidden;
}

.collage__col {
  display: grid;
  align-content: start;
  gap: var(--space-md);
  min-width: 0;
}

.collage__col--low {
  padding-top: var(--space-2xl);
}

.collage img {
  width: 100%;
  border: var(--rule-1);
  border-radius: var(--radius-md);
  background: var(--color-paper);
  box-shadow: 0 18px 40px -24px var(--color-shadow-strong);
}

@media (min-width: 60rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-2xl);
    min-height: min(46rem, calc(100dvh - var(--nav-h)));
    padding-top: 0;
  }

  .hero__copy {
    padding-block: var(--space-3xl);
  }

  .collage {
    position: relative;
    height: auto;
    margin: 0;
    margin-right: calc(var(--page-gutter) * -1);
  }

  .collage__col {
    position: absolute;
    top: calc(var(--space-2xl) * -1);
    width: calc(50% - var(--space-md) / 2);
  }

  .collage__col--low {
    top: var(--space-xl);
    right: 0;
    padding-top: 0;
  }
}

/* ---------- Petrol strip · providers ---------- */
.strip {
  background: var(--color-petrol);
  color: var(--color-on-petrol);
}

.strip__inner {
  display: grid;
  gap: var(--space-sm);
  padding-block: var(--space-lg);
}

.strip__label {
  color: var(--color-on-petrol-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.strip__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-xl);
}

.strip__list li {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

@media (min-width: 60rem) {
  .strip__inner {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2xl);
  }

  .strip__list {
    justify-content: space-between;
  }
}

/* ---------- Features · bento of screens ---------- */
.features {
  padding-block: var(--space-3xl);
}

.bento {
  display: grid;
  gap: var(--space-md);
}

.tile {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-lg);
  min-width: 0;
  overflow: hidden;
  padding: var(--space-lg) 0 0 var(--space-lg);
  border: var(--rule-1);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.tile__text {
  display: grid;
  gap: var(--space-xs);
  max-width: 30rem;
  padding-right: var(--space-lg);
  color: var(--color-muted);
}

.tile__title {
  font-size: var(--text-lg);
  line-height: 1.25;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.chips li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-3xs) var(--space-sm) var(--space-3xs) var(--space-xs);
  border: var(--rule-1);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
}

.chips li::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--color-teal);
}

.chips .chip--ok::before {
  background: var(--color-ok);
}

.chips .chip--warn::before {
  background: var(--color-warn);
}

.chips .chip--bad::before {
  background: var(--color-bad);
}

.chips code {
  font-size: 1em;
}

/* The screen runs off the tile's bottom and right edges */
.tile__shot {
  min-height: 0;
  height: 15rem;
  overflow: hidden;
  border: var(--rule-1);
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: var(--radius-md);
  background: var(--color-paper);
  box-shadow: 0 12px 32px -20px var(--color-shadow-strong);
}

.tile__shot img {
  width: max(100%, 34rem);
  max-width: none;
}

@media (min-width: 60rem) {
  .bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .tile {
    padding: var(--space-xl) 0 0 var(--space-xl);
  }

  .tile__text {
    padding-right: var(--space-xl);
  }

  .tile--7 {
    grid-column: span 7;
  }

  .tile--5 {
    grid-column: span 5;
  }

  .tile__shot {
    height: 19rem;
  }

  .tile--5 .tile__shot img {
    width: max(100%, 30rem);
  }
}

/* Local-run callout */
.local {
  display: grid;
  gap: var(--space-xl);
  margin-top: var(--space-md);
  padding: var(--space-lg);
  border: var(--rule-1);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.local__copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--space-md);
  color: var(--color-muted);
}

.local__title {
  font-size: var(--text-lg);
  line-height: 1.25;
}

.local__code {
  display: grid;
  gap: var(--space-md);
  min-width: 0;
}

.code {
  overflow: hidden;
  border: var(--rule-1);
  border-radius: var(--radius-md);
  background: var(--color-paper);
}

.code__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-md);
  border-bottom: var(--rule-1);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.code__body {
  margin: 0;
  padding: var(--space-md);
  overflow-x: auto;
  color: var(--color-ink);
  font-size: var(--text-sm);
  line-height: 1.8;
}

.code__body code {
  font-size: 1em;
}

.ticks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.ticks li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.ticks .icon {
  color: var(--color-teal);
}

@media (min-width: 60rem) {
  .local {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-2xl);
    padding: var(--space-xl);
  }
}

/* ---------- Petrol band · self-host ---------- */
.band {
  padding-block: var(--space-3xl);
  background: var(--color-petrol);
  color: var(--color-on-petrol-muted);
}

.head--on-petrol .head__title {
  color: var(--color-on-petrol);
}

.head--on-petrol .head__lede {
  color: var(--color-on-petrol-muted);
}

.band code {
  color: var(--color-on-petrol);
}

.fan {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.proc {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-xs);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--color-paper);
  color: var(--color-muted);
  box-shadow: 0 30px 60px -30px var(--color-shadow-strong);
}

.proc code {
  color: var(--color-ink);
}

.proc__type {
  color: var(--color-teal);
  font-size: var(--text-sm);
}

.proc__type code {
  color: inherit;
}

.proc__name {
  font-family: var(--font-mono);
  font-size: var(--text-h2);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.proc__scale {
  margin-top: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: var(--rule-1);
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Hand annotations — Caveat, mint, only here */
.note {
  display: none;
  align-items: flex-end;
  gap: var(--space-2xs);
  position: absolute;
  top: -3.5rem;
  color: var(--color-mint);
  font-family: var(--font-hand);
  font-size: 1.625rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.note svg {
  width: 3.25rem;
  height: 2.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note--left {
  left: var(--space-md);
}

.note--right {
  right: var(--space-md);
}

@media (min-width: 60rem) {
  .fan {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    max-width: 64rem;
    margin: var(--space-3xl) auto var(--space-2xl);
  }

  .proc {
    padding: var(--space-xl);
  }

  .proc--web {
    margin-right: calc(var(--space-lg) * -1);
    transform: rotate(-3deg) translateY(var(--space-lg));
  }

  .proc--queue {
    z-index: var(--z-raised);
    box-shadow: 0 40px 80px -30px var(--color-shadow-strong);
  }

  .proc--scheduler {
    margin-left: calc(var(--space-lg) * -1);
    transform: rotate(3deg) translateY(var(--space-lg));
  }

  .note {
    display: inline-flex;
  }

  .note--left {
    left: calc(var(--space-xl) * -1);
  }

  .note--right {
    right: calc(var(--space-xl) * -1);
  }
}

.term {
  max-width: 52rem;
  margin: 0 auto;
  overflow: hidden;
  border: var(--rule-petrol);
  border-radius: var(--radius-md);
  background: var(--color-petrol-deep);
}

.term__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-md);
  border-bottom: var(--rule-petrol);
  color: var(--color-on-petrol-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.term__body {
  margin: 0;
  padding: var(--space-md);
  overflow-x: auto;
  color: var(--color-on-petrol);
  font-size: var(--text-sm);
  line-height: 1.75;
}

.term__body code {
  font-size: 1em;
}

.term__note {
  padding: var(--space-sm) var(--space-md);
  border-top: var(--rule-petrol);
  font-size: var(--text-sm);
}

.t-dim {
  color: var(--color-on-petrol-muted);
}

/* ---------- Comparison · F3 ---------- */
.compare {
  padding-block: var(--space-3xl);
}

.spec {
  overflow: hidden;
  border: var(--rule-1);
  border-radius: var(--radius-lg);
}

.spec__row {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-lg);
  border-top: var(--rule-1);
}

.spec__row--head {
  display: none;
}

.spec__key {
  color: var(--color-ink);
  font-weight: 600;
}

.spec__us {
  color: var(--color-ink-2);
}

.spec__them {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.spec__them::before {
  content: "Mautic — ";
  font-weight: 600;
}

.spec__row:first-of-type,
.spec__row--head + .spec__row {
  border-top: 0;
}

@media (min-width: 60rem) {
  .spec__row {
    grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 4fr);
    gap: var(--space-xl);
    padding: var(--space-lg) var(--space-xl);
  }

  .spec__row--head {
    display: grid;
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .spec__row--head + .spec__row {
    border-top: var(--rule-1);
  }

  .spec__row--head span:nth-child(2) {
    color: var(--color-petrol);
  }

  .spec__them::before {
    content: none;
  }
}

/* ---------- Guarantees · second bento ---------- */
.guarantees {
  padding-block: var(--space-3xl);
  border-top: var(--rule-1);
}

.rules {
  display: grid;
  gap: var(--space-md);
}

.rule {
  display: grid;
  align-content: start;
  gap: var(--space-xs);
  min-width: 0;
  padding: var(--space-lg);
  border: var(--rule-1);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-muted);
}

.rule__key {
  justify-self: start;
  margin-bottom: var(--space-xs);
  padding: var(--space-3xs) var(--space-xs);
  border-radius: var(--radius-sm);
  background: var(--color-teal-wash);
  color: var(--color-teal);
  font-size: var(--text-sm);
}

.rule__key code {
  color: inherit;
}

.rule__title {
  font-size: var(--text-md);
  line-height: 1.3;
}

.rule--anchor {
  background: var(--color-paper);
}

.trace {
  margin: var(--space-md) 0 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-petrol);
}

.trace__body {
  margin: 0;
  padding: var(--space-md);
  overflow-x: auto;
  color: var(--color-on-petrol);
  font-size: var(--text-xs);
  line-height: 1.85;
}

.trace__body code {
  color: inherit;
  font-size: 1em;
}

.trace__foot {
  padding: var(--space-xs) var(--space-md);
  border-top: var(--rule-petrol);
  color: var(--color-on-petrol-muted);
  font-size: var(--text-xs);
}

.t-prompt,
.t-job {
  color: var(--color-mint);
}

.t-key {
  color: var(--color-on-petrol-muted);
}

.t-str {
  color: var(--color-on-petrol);
}

.t-ok {
  color: var(--color-mint);
  font-weight: 500;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.2em;
  background: var(--color-mint);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (min-width: 40rem) {
  .rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rule--anchor,
  .rule--wide {
    grid-column: span 2;
  }

  .trace__body {
    font-size: var(--text-sm);
  }
}

@media (min-width: 62rem) {
  .rules {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rule--anchor {
    grid-row: span 2;
  }
}

/* ---------- Stack · chip rows ---------- */
.stack {
  padding-block: var(--space-3xl);
  background: var(--color-surface);
  border-top: var(--rule-1);
}

.stack__title {
  font-size: var(--text-lg);
  line-height: 1.25;
}

.stack .head {
  margin-bottom: var(--space-xl);
}

.stack__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  max-width: 56rem;
  margin-inline: auto;
}

.stack__list li {
  padding: var(--space-xs) var(--space-md);
  border: var(--rule-1);
  border-radius: var(--radius-md);
  background: var(--color-paper);
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 6px 16px -12px var(--color-shadow-strong);
}

/* ---------- Closing · petrol panel ---------- */
.closing {
  padding-block: var(--space-3xl);
}

.closing__panel {
  display: grid;
  justify-items: center;
  gap: var(--space-lg);
  padding: var(--space-2xl) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--color-petrol);
  color: var(--color-on-petrol-muted);
  text-align: center;
}

.closing__title {
  max-width: 18ch;
  color: var(--color-on-petrol);
  font-size: var(--text-h2);
  line-height: 1.1;
}

.closing__panel p {
  max-width: 34rem;
}

.closing__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
}

@media (min-width: 60rem) {
  .closing__panel {
    padding: var(--space-4xl) var(--space-2xl);
  }
}

/* ---------- Footer · Ft3 ---------- */
.foot {
  padding-block: var(--space-3xl) var(--space-xl);
  background: var(--color-petrol-deep);
  color: var(--color-on-petrol-muted);
  font-size: var(--text-sm);
}

.foot__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl) var(--space-lg);
}

.foot__mast {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--space-xs);
  grid-column: 1 / -1;
}

.foot__col {
  display: grid;
  align-content: start;
  justify-items: start;
}

.foot__label {
  margin-bottom: var(--space-xs);
  color: var(--color-on-petrol-muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.foot__col a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  color: var(--color-on-petrol);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out);
}

.foot__col a:hover {
  color: var(--color-mint);
}

.foot :focus-visible {
  outline-color: var(--color-focus-on-petrol);
}

.foot__legal {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: var(--rule-petrol);
  font-size: var(--text-xs);
}

@media (min-width: 60rem) {
  .foot__grid {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  }

  .foot__mast {
    grid-column: auto;
  }
}

/* ---------- ⌘K palette ---------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 12dvh var(--space-md) var(--space-md);
}

.palette[hidden] {
  display: none;
}

.palette__scrim {
  position: absolute;
  inset: 0;
  background: var(--color-scrim);
}

.palette__panel {
  position: relative;
  width: 100%;
  max-width: 34rem;
  overflow: hidden;
  border: var(--rule-2);
  border-radius: var(--radius-md);
  background: var(--color-paper);
  box-shadow: 0 24px 48px -24px var(--color-scrim);
}

.palette__search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
  border-bottom: var(--rule-1);
  color: var(--color-muted);
}

.palette__input {
  flex: 1;
  min-width: 0;
  height: 3.25rem;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  outline: none;
}

.palette__input::placeholder {
  color: var(--color-muted);
}

.palette__esc {
  font-size: var(--text-xs);
}

.palette__list {
  max-height: min(24rem, 60dvh);
  padding: var(--space-xs);
  overflow-y: auto;
}

.palette__group {
  padding: var(--space-sm) var(--space-sm) var(--space-2xs);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.palette__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 2.75rem;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  cursor: pointer;
}

.palette__item .icon {
  color: var(--color-muted);
}

.palette__item[aria-selected="true"] {
  background: var(--color-teal-wash);
  color: var(--color-ink);
}

.palette__item[aria-selected="true"] .icon {
  color: var(--color-teal);
}

.palette__empty {
  padding: var(--space-lg) var(--space-md);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

/* ---------- Reveal (one-shot) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    translate: 0 10px;
    transition:
      opacity var(--dur-long) var(--ease-out),
      translate var(--dur-long) var(--ease-out);
  }

  .js .reveal.is-in {
    opacity: 1;
    translate: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .caret {
    animation: none;
  }
}
