/* RELAYKIT layout, components, motion. Consumes tokens.css only. */

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: 400;
}
img,
svg,
video {
  max-width: 100%;
  height: auto;
}
:focus-visible {
  /* square ring: the focus indicator is a block cursor, like everything here */
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 0;
}
[id] {
  /* anchored jumps land clear of the sticky header */
  scroll-margin-top: 4.75rem;
}
::selection {
  background: var(--phosphor-bright);
  color: var(--carbon);
}
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--s-4);
  z-index: var(--z-skip);
  background: var(--carbon);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-1);
}
.skip-link:focus {
  top: var(--s-4);
}

/* ---------- text roles ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
}
.mono--muted {
  color: var(--muted);
}
.mono--accent {
  color: var(--accent);
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
}
.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  flex: none;
}
h1,
h2,
h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-5);
  text-wrap: balance;
}
.h-display {
  font-size: var(--t-display);
  line-height: var(--lh-tight);
}
h1 {
  font-size: var(--t-h1);
}
h2 {
  font-size: var(--t-h2);
}
h3 {
  font-size: var(--t-h3);
}
.lead {
  font-size: var(--t-lead);
  max-width: var(--measure);
  color: var(--fg);
}
.body-copy {
  max-width: var(--measure);
  color: var(--muted);
}
.accent-word {
  color: var(--accent);
}
a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: var(--accent);
}
code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-2);
  padding: 0.1em 0.35em;
  border-radius: var(--r-1);
  border: 1px solid var(--line);
}
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 0.1rem 0.45rem;
  color: var(--muted);
  vertical-align: middle;
}
.chip--sample {
  border-style: dashed;
}

/* ---------- layout primitives ---------- */
.wrap {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--edge);
}
.section {
  padding-block: var(--section-pad);
  position: relative;
}
.section--tight {
  padding-block: calc(var(--section-pad) * 0.55);
}
.section + .section {
  border-top: 1px solid var(--line);
}
.section-head {
  margin-bottom: var(--s-7);
}
.section-head .kicker {
  margin-bottom: var(--s-4);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: 3.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.brand .tld {
  color: var(--accent);
}
.header-right {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.site-nav {
  display: flex;
  gap: var(--s-5);
}
.site-nav a {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  text-decoration: none;
  color: var(--muted);
  padding-block: var(--s-2);
}
.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--fg);
}
.menu-btn {
  display: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--carbon);
  background: var(--carbon);
  color: var(--paper);
  padding: 0.65rem 1.1rem;
  border-radius: var(--r-1);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out);
}
.btn:hover {
  background: var(--phosphor-deep);
  border-color: var(--phosphor-deep);
  color: var(--white);
}
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  background: var(--bg-2);
  border-color: var(--fg);
  color: var(--fg);
}
[data-theme="carbon"] .btn {
  background: var(--phosphor-bright);
  border-color: var(--phosphor-bright);
  color: var(--carbon);
}
[data-theme="carbon"] .btn:hover {
  background: var(--paper);
  border-color: var(--paper);
}
[data-theme="carbon"] .btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--fg);
}
.btn .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: currentColor;
  animation: caret-blink 1.1s steps(1) infinite;
}

/* ---------- menu overlay ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: var(--bg);
  color: var(--fg);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--s-6) var(--edge) var(--s-8);
}
.menu-overlay.is-open {
  display: flex;
}
.menu-close {
  align-self: flex-end;
  font-family: var(--font-mono);
  font-size: var(--t-small);
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--fg);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-1);
  cursor: pointer;
}
.menu-overlay nav {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.menu-overlay nav a {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 600;
  text-decoration: none;
}
.menu-overlay nav a .mono {
  color: var(--accent);
  margin-right: var(--s-3);
}

/* ---------- terminal frame (family signature card) ---------- */
.term {
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: var(--r-2);
  border: 1px solid var(--carbon-3);
  box-shadow: var(--shadow-term);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--t-code);
  line-height: var(--lh-code);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.5rem 0.9rem;
  background: var(--carbon-2);
  border-bottom: 1px solid var(--carbon-3);
  color: #8b9287;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.term-bar::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--phosphor-bright);
  box-shadow: 15px 0 0 #8b9287, 30px 0 0 #4a504a;
  margin-right: 24px;
  flex: none;
}
.term-body {
  padding: var(--s-4) var(--s-5);
  overflow-x: auto;
}
.term .p {
  color: var(--phosphor-bright);
}
.term .c {
  color: #79817a;
}
.term .y {
  color: #d8c97b;
}
.term .w {
  color: #f1f3ee;
}
.term .ok {
  color: var(--phosphor-bright);
}

/* ---------- hero ---------- */
#relaykit-01 {
  padding-block: calc(var(--section-pad) * 0.85);
}
#relaykit-01 .hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(var(--s-6), 4vw, var(--s-9));
  align-items: center;
}
#relaykit-01 .hero-kickers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
#relaykit-01 h1 {
  margin-bottom: var(--s-5);
}
#relaykit-01 .lead {
  margin-bottom: var(--s-6);
}
#relaykit-01 .hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}
#relaykit-01 .hero-readout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  padding: 0;
  margin: 0;
  list-style: none;
}
#relaykit-01 .hero-readout li {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
#relaykit-01 .hero-readout li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 600;
}
/* the streaming delivery log */
#relaykit-01 .term-body {
  height: 21.5em;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
#relaykit-01 .t-line {
  white-space: nowrap;
  overflow: hidden;
  min-height: 1.7em;
}
/* typing choreography: only when JS confirmed + motion allowed.
   Resting state (no-JS, reduced motion) is the complete log. */
@media (prefers-reduced-motion: no-preference) {
  html.js #relaykit-01 .t-line[style*="--n"] {
    width: calc(var(--n) * 1ch);
    animation: type-line 0.9s steps(24, end) both;
    animation-delay: calc(var(--i) * 0.55s);
  }
}
@keyframes type-line {
  from {
    width: 0;
  }
}
#relaykit-01 .t-caret::after {
  content: "";
  display: inline-block;
  width: 0.6ch;
  height: 1.05em;
  background: var(--phosphor-bright);
  vertical-align: text-bottom;
  margin-left: 0.2ch;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #relaykit-01 .t-caret::after,
  .btn .cursor {
    animation: none;
  }
}

/* ---------- 02 logo wall ---------- */
#relaykit-02 .logo-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gutter);
  align-items: center;
}
#relaykit-02 .logo-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-2);
}
#relaykit-02 .wall-note {
  margin-top: var(--s-4);
}

/* ---------- 03 problem mirror ---------- */
#relaykit-03 .mirror {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
}
#relaykit-03 .mirror-col {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-6);
}
#relaykit-03 .mirror-col.after {
  background: var(--carbon);
  color: #e9ece6;
  border-color: var(--carbon);
}
#relaykit-03 .mirror-col h3 {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
#relaykit-03 .mirror-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-4);
}
#relaykit-03 .mirror-col li {
  padding-left: 1.6rem;
  position: relative;
  color: var(--muted);
}
#relaykit-03 .mirror-col.after li {
  color: #c4cabf;
}
#relaykit-03 .mirror-col li::before {
  font-family: var(--font-mono);
  position: absolute;
  left: 0;
  top: 0.1em;
}
#relaykit-03 .before li::before {
  content: "✕";
  color: #a4442e;
}
#relaykit-03 .after li::before {
  content: "✓";
  color: var(--phosphor-bright);
}

/* ---------- 04 feature trio ---------- */
#relaykit-04 .grid-3 article h3 {
  margin: var(--s-5) 0 var(--s-3);
}
#relaykit-04 .grid-3 article p {
  color: var(--muted);
  margin: 0;
}

/* ---------- themed sections paint their flipped ground ---------- */
.section[data-theme] {
  background: var(--bg);
  color: var(--fg);
}

/* ---------- 05 how it works ---------- */
#relaykit-05 .steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
#relaykit-05 .steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  counter-reset: step;
}
#relaykit-05 .step {
  border-top: 2px solid var(--carbon);
  padding-top: var(--s-5);
}
#relaykit-05 .step .step-no {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  color: var(--accent);
  display: block;
  margin-bottom: var(--s-3);
}
#relaykit-05 .step h3 {
  margin-bottom: var(--s-3);
}
#relaykit-05 .step p {
  color: var(--muted);
  margin: 0 0 var(--s-4);
}
#relaykit-05 .step .term {
  font-size: 0.75rem;
}

/* ---------- 06 stats ---------- */
#relaykit-06 .stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
}
#relaykit-06 .stat b {
  display: block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
#relaykit-06 .stat b .unit {
  font-size: 0.5em;
  color: var(--accent);
  margin-left: 0.1em;
}
#relaykit-06 .stat > span {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 07 pricing ---------- */
.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 0.25rem;
  font-family: var(--font-mono);
  font-size: var(--t-small);
}
.billing-toggle button {
  font: inherit;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.billing-toggle button[aria-pressed="true"] {
  background: var(--carbon);
  color: var(--paper);
}
.billing-toggle .save-pill {
  font-size: 0.6875rem;
  color: var(--accent);
  padding-right: 0.6rem;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
  margin-top: var(--s-7);
  align-items: stretch;
}
.plan {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  background: var(--bg);
}
.plan.featured {
  border: 2px solid var(--phosphor-deep);
  box-shadow: var(--shadow-term);
  position: relative;
}
.plan.featured .flag {
  position: absolute;
  top: -0.8rem;
  left: var(--s-6);
  background: var(--phosphor-deep);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: var(--r-1);
}
.plan h3 {
  margin: 0;
}
.plan .plan-for {
  color: var(--muted);
  font-size: var(--t-small);
  margin: 0;
}
.plan .price-line {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.plan .price-line .per {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}
/* digit roll: JS swaps each digit column; rest state is plain text */
.price-num {
  display: inline-flex;
  overflow: hidden;
  height: 1em;
  line-height: 1;
}
.price-num .digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
}
.price-num .digit-track {
  display: block;
  transition: transform var(--dur-3) var(--ease-inout);
}
.price-num .digit-track span {
  display: block;
  height: 1em;
}
@media (prefers-reduced-motion: reduce) {
  .price-num .digit-track {
    transition: none;
  }
}
.plan ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-3);
  color: var(--muted);
  font-size: var(--t-small);
  flex-grow: 1;
}
.plan ul li {
  padding-left: 1.4rem;
  position: relative;
}
.plan ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}
.plan .risk {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: var(--s-3);
  margin: 0;
}
.pricing-note {
  margin-top: var(--s-5);
  color: var(--muted);
  font-size: var(--t-small);
}

/* ---------- 08 integrations ---------- */
.int-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
}
.int-cell {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.int-cell::before {
  content: ">";
  color: var(--accent);
  font-weight: 600;
}

/* ---------- 09 query log: each question is a record, not a stacked panel ----
   A record is two tracks wide. Track one is a sequence rail that runs the
   whole height of the record, ordinal at the top, hairline down the side;
   track two carries the command line and, under it, the stdout indented
   into the same track the way a shell prints output beneath the line that
   ran it. The question is typed at a $ prompt and its state rides inline
   right after the last word, so a record reads left to right on one line
   instead of sending the eye out to a right-hand chip. The state word only
   renders when JS is there to change it. The frame sits on carbon, so
   tokens flip wholesale via data-theme="carbon". */
.qlog {
  max-width: 56rem;
  border: 1px solid var(--carbon-3);
  border-radius: var(--r-2);
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow-term);
  overflow: hidden;
}
.qlog-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.qlog-rec {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: start;
}
.qlog-rec + .qlog-rec {
  border-top: 1px solid var(--line);
}
.qlog-seq {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: stretch;
  border-right: 1px solid var(--line);
  padding: 1.15rem var(--s-3) var(--s-4) var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  color: var(--accent);
}
.qlog-ask {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: inherit;
}
.qlog-cmd {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55em;
  text-align: left;
  background: none;
  border: 0;
  padding: var(--s-4) clamp(var(--s-4), 3vw, var(--s-6));
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: var(--lh-heading);
  color: var(--fg);
  cursor: pointer;
}
html.js .qlog-cmd {
  transition: background var(--dur-1) var(--ease-out);
}
.qlog-cmd:hover {
  background: var(--bg-2);
}
.qlog-tick {
  flex: none;
  font-weight: 400;
  color: var(--accent);
}
/* the question keeps the prompt company on the first line: a small basis
   lets it share the line and wrap inside itself instead of dropping whole */
.qlog-say {
  flex: 1 1 6ch;
  min-width: 0;
}
.qlog-flag {
  display: none;
  margin-left: 0.6em;
  white-space: nowrap;
  font-weight: 400;
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  color: var(--muted);
}
html.js .qlog-flag {
  display: inline;
}
.qlog-flag::after {
  content: "[read]";
}
.qlog-cmd[aria-expanded="true"] .qlog-flag {
  color: var(--accent);
}
.qlog-cmd[aria-expanded="true"] .qlog-flag::after {
  content: "[close]";
}
.qlog-out {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  background: var(--bg-2);
  border-top: 1px dashed var(--line);
}
.qlog-out .body-copy {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin: 0;
  padding: var(--s-4) clamp(var(--s-4), 3vw, var(--s-6)) var(--s-5);
  font-size: var(--t-small);
}
.qlog-out .body-copy::before {
  content: ">";
  flex: none;
  font-family: var(--font-mono);
  color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  html.js .qlog-cmd {
    transition: none;
  }
}
@media (max-width: 40rem) {
  .qlog-rec {
    grid-template-columns: 2.6rem minmax(0, 1fr);
  }
  .qlog-seq {
    padding: 1.05rem var(--s-2) var(--s-4) var(--s-3);
  }
  .qlog-cmd {
    font-size: var(--t-body);
  }
}

/* ---------- 10 changelog strip ---------- */
.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  max-width: 52rem;
}
.log-list li {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: var(--s-5);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--line);
}
.log-list time {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 0.2rem;
}
.log-list .log-title {
  font-family: var(--font-mono);
  font-weight: 600;
}
.log-list p {
  margin: var(--s-1) 0 0;
  color: var(--muted);
  font-size: var(--t-small);
}

/* ---------- 11 CTA band + key form ---------- */
#relaykit-11 .cta-grid,
.cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(var(--s-6), 4vw, var(--s-9));
  align-items: center;
}

/* ---------- forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.field label {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
}
[data-theme="carbon"] .field label {
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  font: inherit;
  font-family: var(--font-mono);
  font-size: var(--t-small);
  color: var(--fg);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 0.7rem 0.9rem;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.field.is-invalid input,
.field.is-invalid select {
  border-color: #a4442e;
}
.field-err {
  color: #c0503a;
  font-size: var(--t-small);
}
[data-theme="carbon"] .field-err {
  color: #ff9b85;
}
.form-errors {
  border: 1px solid #a4442e;
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
}
.form-errors h3 {
  font-size: var(--t-small);
  margin-bottom: var(--s-2);
}
.form-errors ul {
  margin: 0;
  padding-left: 1.2rem;
}
.form-status {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  margin-top: var(--s-4);
  min-height: 1.4em;
}
/* no-JS route: stays visible whenever the .js gate is absent, which covers
   scripts off and main.js failing to load */
.nojs-route {
  display: block;
  border: 1px dashed var(--accent);
  border-radius: var(--r-1);
  padding: var(--s-4);
  margin: 0 0 var(--s-5);
  font-size: var(--t-small);
  color: var(--fg);
}
html.js .nojs-route {
  display: none;
}
/* draft disclosure: only true when the script that writes the draft is running */
.form-note {
  display: none;
  font-size: var(--t-small);
  color: var(--muted);
  margin: var(--s-5) 0 var(--s-4);
  max-width: var(--measure);
}
html.js .form-note {
  display: block;
}
.form-fallback {
  margin-top: var(--s-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-4);
}
.form-fallback textarea {
  width: 100%;
  min-height: 8rem;
  font-family: var(--font-mono);
  font-size: var(--t-small);
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3);
}
.form-fallback .fallback-actions {
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-3);
  flex-wrap: wrap;
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s-8) var(--s-6);
  background: var(--carbon);
  color: #c4cabf;
}
.site-footer a {
  color: inherit;
}
.site-footer .foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gutter);
  margin-bottom: var(--s-7);
}
.site-footer .foot-brand {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: #e9ece6;
}
.site-footer .foot-brand .tld {
  color: var(--phosphor-bright);
}
.site-footer p {
  font-size: var(--t-small);
  max-width: 26rem;
}
.site-footer h2 {
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: #8b9287;
  font-weight: 400;
  margin-bottom: var(--s-4);
}
.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--t-small);
}
.site-footer .foot-legal {
  border-top: 1px solid rgba(233, 236, 230, 0.14);
  padding-top: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.06em;
  color: #8b9287;
}

/* ---------- interior banner ---------- */
.banner {
  background: var(--carbon);
  color: #e9ece6;
  padding-block: calc(var(--section-pad) * 0.55);
  border-bottom: 1px solid var(--carbon-3);
}
.banner .crumbs {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: #8b9287;
  margin-bottom: var(--s-4);
}
.banner .crumbs a {
  color: inherit;
  text-decoration-color: rgba(233, 236, 230, 0.4);
}
.banner .crumbs .sep {
  margin-inline: var(--s-2);
  color: var(--phosphor-bright);
}
.banner h1 {
  margin-bottom: var(--s-3);
}
.banner .lead {
  color: #c4cabf;
  margin: 0;
}

/* ---------- comparison table (pricing page) ---------- */
.compare-scroll {
  overflow-x: auto;
}
.compare {
  width: 100%;
  min-width: 44rem;
  border-collapse: collapse;
  font-size: var(--t-small);
}
.compare th,
.compare td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
}
.compare thead th {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
}
.compare thead th.feat-col {
  color: var(--accent);
}
.compare td {
  color: var(--muted);
}
.compare td .yes {
  color: var(--accent);
  font-family: var(--font-mono);
}
.compare td .no {
  color: var(--line-strong);
  font-family: var(--font-mono);
}

/* ---------- command palette: cmd+k quick nav ---------- */
.palette-btn {
  display: none;
}
html.js .palette-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  padding: 0.35rem 0.6rem;
  border-radius: var(--r-1);
  cursor: pointer;
}
.palette-btn kbd {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
}
.palette-btn:hover {
  color: var(--fg);
  border-color: var(--fg);
}
.palette {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: rgba(26, 29, 26, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(14vh, 7rem) var(--edge) var(--s-6);
}
.palette[hidden] {
  display: none;
}
.palette .palette-panel {
  width: min(34rem, 100%);
}
.palette .term-bar {
  gap: var(--s-4);
}
.palette .palette-close {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--carbon-3);
  color: #8b9287;
  padding: 0.1rem 0.5rem;
  border-radius: var(--r-1);
  cursor: pointer;
}
.palette .palette-close:hover {
  color: var(--phosphor-bright);
  border-color: var(--phosphor-bright);
}
.palette input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: var(--t-small);
  background: var(--carbon-2);
  color: #f1f3ee;
  border: 0;
  border-bottom: 1px solid var(--carbon-3);
  padding: 0.8rem 0.95rem;
}
.palette input:focus-visible {
  outline: 2px solid var(--phosphor-bright);
  outline-offset: -2px;
}
.palette [role="listbox"] {
  list-style: none;
  margin: 0;
  padding: var(--s-2) 0;
  max-height: min(50vh, 19rem);
  overflow-y: auto;
}
.palette [role="option"] {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  padding: 0.55rem 0.95rem;
  text-decoration: none;
  color: var(--term-fg);
  font-size: var(--t-small);
}
.palette [role="option"] .where {
  color: #79817a;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: none;
}
.palette [role="option"].is-active,
.palette [role="option"]:hover {
  background: var(--carbon-2);
  color: #ffffff;
  box-shadow: inset 2px 0 0 var(--phosphor-bright);
}
.palette-empty {
  margin: 0;
  padding: 0.55rem 0.95rem;
  color: #79817a;
  font-size: var(--t-small);
}
.palette-hint {
  margin: 0;
  padding: 0.5rem 0.95rem;
  border-top: 1px solid var(--carbon-3);
  color: #79817a;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- interactive quickstart config ---------- */
html:not(.js) .qs-config {
  display: none;
}
.qs-config {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-6);
  align-items: flex-end;
  margin-bottom: var(--s-7);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
}
.qs-config .qs-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.qs-config label {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
}
.qs-config input {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--fg);
  padding: 0.5rem 0.7rem;
  width: 13rem;
  max-width: 100%;
}
.qs-config .qs-note {
  margin: 0;
  flex-basis: 100%;
  order: -1;
}
.term-copy {
  display: none;
}
html.js .term-copy {
  display: inline-block;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--carbon-3);
  color: #8b9287;
  padding: 0.1rem 0.5rem;
  border-radius: var(--r-1);
  cursor: pointer;
}
html.js .term-copy:hover {
  color: var(--phosphor-bright);
  border-color: var(--phosphor-bright);
}

/* ---------- status page ---------- */
.status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--t-h3);
  margin: 0 0 var(--s-3);
}
.status-line .status-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  flex: none;
}
.status-line .mono {
  font-weight: 400;
  color: var(--muted);
}
.uptime-row {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line);
}
.uptime-row:first-of-type {
  border-top: 1px solid var(--line);
}
.uptime-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-3);
}
.uptime-head .up-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--t-small);
}
.uptime-head .up-pct {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
}
.uptime-bars {
  display: flex;
  gap: 1px;
  height: 2.1rem;
}
.uptime-bars i {
  flex: 1 1 0;
  min-width: 0;
  background: var(--accent);
  opacity: 0.82;
}
.uptime-bars i.deg {
  background: #a07714;
  opacity: 1;
}
.uptime-bars i.out {
  background: #a4442e;
  opacity: 1;
}
.uptime-scale {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.uptime-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  margin: var(--s-5) 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--track-mono);
  text-transform: uppercase;
  color: var(--muted);
}
.uptime-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.uptime-legend .swatch {
  width: 9px;
  height: 9px;
  flex: none;
}
.uptime-legend .swatch.ok { background: var(--accent); }
.uptime-legend .swatch.deg { background: #a07714; }
.uptime-legend .swatch.out { background: #a4442e; }

/* ---------- deliberate offset head: one per page ---------- */
.head-offset {
  margin-left: clamp(0rem, 12vw, 9rem);
  padding-left: var(--s-5);
  border-left: 2px solid var(--accent);
}

/* ---------- reveal motion ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
}
html.js .reveal[data-delay="1"] {
  transition-delay: 110ms;
}
html.js .reveal[data-delay="2"] {
  transition-delay: 220ms;
}
html.js .reveal[data-delay="3"] {
  transition-delay: 330ms;
}
html.js .reveal.is-inview {
  opacity: 1;
  transform: none;
}

/* ---------- styleguide page ---------- */
.sg-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--gutter);
}
.sg-swatch {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  overflow: hidden;
}
.sg-swatch .sw {
  height: 4.5rem;
}
.sg-swatch figcaption {
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
}
.sg-block {
  margin-bottom: var(--s-8);
}

/* ---------- error page ---------- */
.error-page {
  min-height: 72vh;
  display: grid;
  place-items: center;
  text-align: left;
}
.error-page .term {
  width: min(34rem, 100%);
}
.error-actions {
  display: flex;
  gap: var(--s-4);
  margin-top: var(--s-5);
  flex-wrap: wrap;
}

/* ---------- responsive ---------- */
@media (max-width: 62rem) {
  #relaykit-01 .hero-grid,
  #relaykit-11 .cta-grid,
  .cta-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .plan-grid,
  #relaykit-05 .steps,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  #relaykit-06 .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--s-6);
  }
  #relaykit-02 .logo-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #relaykit-03 .mirror {
    grid-template-columns: minmax(0, 1fr);
  }
  .int-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .site-footer .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 46rem) {
  .site-nav,
  .site-header .header-cta {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
    font-family: var(--font-mono);
    font-size: var(--t-small);
    background: none;
    border: 1px solid var(--line-strong);
    color: var(--fg);
    padding: var(--s-2) var(--s-4);
    border-radius: var(--r-1);
    cursor: pointer;
  }
  #relaykit-02 .logo-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .int-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .log-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-1);
  }
  .site-footer .foot-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* 320px handsets: the keyboard hint is dead weight on a touch screen and it
   was the last 58px pushing the header past the viewport */
@media (max-width: 22.5rem) {
  .site-header .wrap,
  .header-right {
    gap: var(--s-3);
  }
  .palette-btn kbd {
    display: none;
  }
}

/* ---------- preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn,
  .digit-track {
    transition: none;
  }
}

/* ---------- print: pricing table and changelog on paper for real ---------- */
@media print {
  .skip-link,
  .site-header .header-cta,
  .menu-btn,
  .palette-btn,
  .palette,
  .menu-overlay,
  .term-copy,
  .qs-config,
  .btn .cursor {
    display: none !important;
  }
  .section {
    padding-block: 1.25rem;
  }
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .term {
    box-shadow: none;
    border: 1px solid #999;
  }
  .site-footer {
    background: none;
    color: inherit;
  }
  .site-footer .foot-grid {
    display: none;
  }
  a {
    text-decoration: none;
  }
}
