/* Shared styles for the content pages. index.html keeps its own inline styles.
   Night bluestone hero, limestone daylight body: the homepage's night-to-dawn, continued. */
:root {
  --sans:
    "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --mono:
    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --night: #0a1014;
  --night-2: #121c21;
  --night-3: #1a262c;
  --night-line: #2e3e46;
  --on-night: #e5ecef;
  --on-night-2: #a9b8be;
  --on-night-3: #7f8f96;
  --stone: #e6e4de;
  --stone-2: #f2f0eb;
  --stone-line: #cdc8be;
  --ink: #1f272b;
  --ink-2: #48535a;
  --copper: #ce6f42;
  --copper-hi: #e3854f;
  --copper-ink: #9a4a24;
  --on-copper: #160c06;
  --payments: #9e83c0;
  --platform: #6d9cbe;
  --data: #dca544;
  --mobile: #88b065;
  --bad: #e0735a;
  --bad-ink: #a63d26;
  --good-ink: #4f7b36;
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1160px;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--night);
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--stone);
  font: 400 18px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--copper-ink);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 3px;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
p,
ul,
ol,
dl,
figure {
  margin: 0;
}
p + p {
  margin-top: 14px;
}
strong {
  font-weight: 600;
}
code {
  font: 500 0.86em var(--mono);
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Chrome ---- */
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  background: var(--night-2);
  color: var(--on-night);
  padding: 8px 12px;
}
.top {
  background: var(--night);
  color: var(--on-night);
  padding-top: env(safe-area-inset-top, 0px);
}
.top .in {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  min-height: 72px;
  padding: 10px var(--gutter);
  box-sizing: content-box;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  color: inherit;
}
.mark {
  width: 24px;
  height: 24px;
  flex: none;
}
.top nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.top nav a {
  color: var(--on-night-2);
  text-decoration: none;
  font-size: 15px;
}
.top nav a:hover,
.top nav a[aria-current="page"] {
  color: var(--on-night);
}
.top nav a[aria-current="page"] {
  box-shadow: 0 2px 0 var(--copper);
}
.top .btn {
  margin-left: auto;
  padding: 12px 22px;
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--copper);
  color: var(--on-copper);
  font: 600 16px/1 var(--sans);
  padding: 17px 32px;
  border: 0;
  border-radius: 7px;
  clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
}
.btn:hover {
  background: var(--copper-hi);
  color: var(--on-copper);
}
.btn:focus-visible {
  outline: 2px solid var(--on-copper);
  outline-offset: -6px;
}
.quiet {
  color: inherit;
  font-weight: 500;
}

/* ---- Hero: night ---- */
.hero {
  background: var(--night);
  color: var(--on-night);
  padding: clamp(28px, 6vh, 72px) var(--gutter) clamp(56px, 10vh, 112px);
}
.hero .in {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero .in.solo {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
  margin-left: max(0px, calc((100% - var(--max)) / 2));
}
.hero .lede {
  margin-top: 22px;
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.5;
  color: var(--on-night-2);
  max-width: 42ch;
}
.hero .row {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
}
.hero .row .quiet {
  color: var(--on-night-2);
}
.hero .row .quiet:hover {
  color: var(--on-night);
}
.crumbs {
  margin-bottom: 28px;
  font-size: 14px;
  color: var(--on-night-3);
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  opacity: 0.6;
}
.crumbs a {
  color: var(--on-night-3);
}
.crumbs a:hover {
  color: var(--on-night);
}

/* ---- Body: limestone ---- */
.band {
  padding: clamp(64px, 11vh, 120px) var(--gutter);
}
.band + .band {
  padding-top: 0;
}
.band > .in {
  max-width: var(--max);
  margin: 0 auto;
}
.intro {
  max-width: 720px;
}
.intro p {
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 19px;
  max-width: 60ch;
}

/* A claim beside its proof. Every second one flips. */
.claim {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.claim + .claim {
  margin-top: clamp(72px, 12vh, 128px);
}
.claim.flip > :first-child {
  order: 2;
}
.claim.flip {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.claim .text > p,
.claim .text > ul {
  margin-top: 16px;
  color: var(--ink-2);
  max-width: 52ch;
}
.claim .text h2 + p {
  margin-top: 20px;
}
.claim .text ul {
  padding-left: 1.1em;
}
.claim .text li + li {
  margin-top: 8px;
}
.claim .text li::marker {
  color: var(--copper);
}

.shot {
  position: relative;
}
.shot .frame {
  border-radius: 10px;
  overflow: hidden;
  background: var(--night-2);
  border: 1px solid #0003;
  box-shadow: 0 24px 60px -24px rgba(22, 34, 40, 0.55);
}
.shot .bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: var(--night);
}
.shot .bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--night-line);
}
.shot img {
  display: block;
  width: 100%;
}
.shot figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-2);
}
.hero .shot figcaption {
  color: var(--on-night-3);
}

/* Facts laid out as a definition list, two columns */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 30px clamp(28px, 4vw, 56px);
  margin-top: 40px;
}
.facts div {
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}
.facts dt {
  font-weight: 600;
  font-size: 18px;
}
.facts dd {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 16px;
}

/* Capability status table (homepage) */
table.status {
  min-width: 680px;
}
table.status caption {
  text-align: left;
  padding: 0 0 14px;
  font-size: 14px;
  color: var(--ink-2);
}
table.status tbody th {
  font-weight: 600;
  font-size: 15px;
}
table.status td {
  font-size: 15px;
  color: var(--ink-2);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--stone-2);
  border: 1px solid var(--stone-line);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
}
.pill.a {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--stone-2);
}
.pill.n {
  background: transparent;
  font-weight: 400;
  color: var(--ink-2);
}
.pill.p {
  border-style: dashed;
  border-color: var(--copper-ink);
  color: var(--copper-ink);
}

/* On a phone each row stacks: name, label, meaning. No sideways scroll. */
@media (max-width: 600px) {
  table.status {
    min-width: 0;
  }
  table.status thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  table.status tbody tr {
    display: grid;
    gap: 8px;
    justify-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--stone-line);
  }
  table.status tbody th,
  table.status tbody td {
    display: block;
    padding: 0;
    border: 0;
  }
}

/* Comparison tables */
.table-scroll {
  overflow-x: auto;
  margin-top: 36px;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 620px;
  font-size: 16px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stone-line);
}
thead th {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-2);
  border-bottom: 2px solid var(--ink);
}
tbody th {
  font-weight: 500;
}
/* The Obelisk column is a raised slab */
th.us,
td.us {
  background: var(--night);
  color: var(--on-night);
  border-bottom-color: var(--night-line);
}
/* Links on the night surfaces */
.hero .lede a,
td.us a {
  color: var(--copper);
}
.hero .lede a:hover,
td.us a:hover {
  color: var(--on-night);
}
thead th.us {
  color: var(--on-night);
  border-bottom: 2px solid var(--copper);
  border-radius: 8px 8px 0 0;
}
tbody tr:last-child td.us {
  border-radius: 0 0 8px 8px;
  border-bottom: 0;
}
.yes {
  font-weight: 500;
}
td.us.yes::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 10px;
  margin-right: 8px;
  background: var(--copper);
  clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
}
td.no {
  color: var(--bad-ink);
}
.source {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-2);
}

.pick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin-top: 36px;
}
.pick section {
  padding-top: 16px;
  border-top: 2px solid var(--stone-line);
}
.pick section.ours {
  border-top-color: var(--copper);
}
.pick ul {
  margin-top: 12px;
  padding-left: 1.1em;
  color: var(--ink-2);
}
.pick li + li {
  margin-top: 6px;
}

details {
  border-top: 1px solid var(--stone-line);
  padding: 18px 0;
}
details:last-of-type {
  border-bottom: 1px solid var(--stone-line);
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 19px;
}
details p {
  margin-top: 10px;
  color: var(--ink-2);
  max-width: 64ch;
}
.faq {
  max-width: 780px;
  margin-top: 28px;
}

/* Long-form reading (Obelisk and C4) */
.prose {
  max-width: 700px;
}
.prose h2 {
  margin-top: 72px;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose h3 {
  margin-top: 36px;
}
.prose p,
.prose ul,
.prose ol {
  margin-top: 16px;
  color: var(--ink-2);
}
.prose ul,
.prose ol {
  padding-left: 1.1em;
}
.prose pre {
  margin: 20px 0 0;
  padding: 16px 18px;
  overflow-x: auto;
  font: 500 14px/1.7 var(--mono);
  color: var(--on-night-2);
  background: var(--night);
  border-radius: 9px;
}
.prose pre code {
  font: inherit;
}
.prose .table-scroll {
  margin-top: 24px;
}
.prose li + li {
  margin-top: 8px;
}
.prose li::marker {
  color: var(--copper);
}
.prose strong {
  color: var(--ink);
}

/* ---- Closing call to action: back to night ---- */
.close {
  background: var(--night);
  color: var(--on-night);
  padding: clamp(72px, 13vh, 140px) var(--gutter);
}
.close .in {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px clamp(32px, 6vw, 96px);
  align-items: end;
}
.close h2 {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.close p {
  color: var(--on-night-2);
  font-size: 18px;
  max-width: 44ch;
}
.close .row {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
}
.close .addr {
  color: var(--on-night-2);
  font-size: 15px;
}

.foot {
  background: var(--night);
  color: var(--on-night-3);
  border-top: 1px solid var(--night-line);
  padding: 36px var(--gutter) calc(36px + env(safe-area-inset-bottom, 0px));
  font-size: 14px;
}
.foot .in {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 28px;
  max-width: var(--max);
  margin: 0 auto;
}
.foot .brand {
  color: var(--on-night);
}
.foot p {
  margin-top: 8px;
}
.foot .legal {
  max-width: var(--max);
  margin: 28px auto 0;
}
.foot h2 {
  font-size: 14px;
  letter-spacing: 0;
  margin: 0 0 10px;
  color: var(--on-night);
}
.foot ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.foot li + li {
  margin-top: 6px;
}
.foot a {
  color: var(--on-night-3);
  text-decoration: none;
}
.foot a:hover {
  color: var(--on-night);
}

/* ---- Demos (driven by site.js) ---- */
.demo {
  background: var(--night-2);
  border: 1px solid var(--night-line);
  border-radius: 14px;
  padding: clamp(16px, 2.4vw, 24px);
  color: var(--on-night);
  box-shadow: 0 30px 80px -30px #000;
}
/* site.js fills the demos after first paint. In the hero that pushed the page
   down, so reserve about the filled height (measured at 360-1280px).
   ponytail: fixed numbers; re-measure if a hero demo's content changes. */
.hero [data-demo="impact"] {
  min-height: 328px;
}
.hero [data-demo="rename"] {
  min-height: 492px;
}
@media (max-width: 480px) {
  .hero [data-demo="rename"] {
    min-height: 590px;
  }
}
.band .demo {
  box-shadow: 0 30px 70px -30px rgba(10, 16, 20, 0.7);
}
.demo-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-night-2);
  margin-bottom: 14px;
}
.demo-note {
  margin-top: 14px;
  font-size: 15px;
  color: var(--on-night-2);
  min-height: 1.6em;
}
.demo-note b {
  color: var(--on-night);
  font-weight: 600;
}
.demo input[type="text"] {
  font: 500 16px var(--mono);
  color: var(--on-night);
  background: var(--night);
  width: 100%;
  border: 1px solid var(--night-line);
  border-radius: 7px;
  padding: 11px 12px;
}
.demo input[type="text"]:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 1px;
}
.demo label {
  font-size: 14px;
  font-weight: 600;
}
/* A demo drawing never shrinks a label below 11px: its min-width is viewBox
   width x 11 / smallest font, and a narrower screen scrolls it sideways
   (task 722). contain stops that min-width from widening the page. */
.demo .scroll {
  overflow-x: auto;
  contain: inline-size;
}

/* Segmented switch built from real radio buttons */
.seg {
  display: inline-flex;
  border: 1px solid var(--night-line);
  border-radius: 8px;
  padding: 3px;
  margin: 0;
  gap: 2px;
  background: var(--night);
}
.seg legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.seg label {
  position: relative;
  font: 600 14px var(--sans);
  color: var(--on-night-2);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.seg label:has(input:checked) {
  background: var(--night-3);
  color: var(--on-night);
  box-shadow: inset 0 -2px 0 var(--copper);
}
.seg label:has(input:focus-visible) {
  outline: 2px solid var(--copper);
  outline-offset: 1px;
}

/* Rename demo */
.rn-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: end;
}
.rn-controls label[for] {
  grid-column: 1 / -1;
}
.copies {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}
.copy {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--night-3);
  border-left: 3px solid var(--team);
  transition: background-color 0.5s;
}
.copy .where {
  font-size: 13.5px;
  color: var(--on-night-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.copy .mini {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0;
  font: 500 13.5px var(--mono);
  min-width: 0;
}
.copy .box {
  padding: 6px 10px;
  border: 1px solid var(--night-line);
  border-radius: 5px;
  background: var(--night-2);
  white-space: nowrap;
}
.copy .db {
  border-color: var(--team);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.copy .line {
  flex: 0 0 34px;
  height: 1px;
  background: var(--on-night-3);
  position: relative;
}
.copy .line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border: 4.5px solid transparent;
  border-left: 6px solid var(--on-night-3);
  border-right: 0;
}
.copy .state {
  grid-row: 1;
  grid-column: 2;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  color: var(--mobile);
  background: #88b0651f;
  white-space: nowrap;
}
.copy.stale .state {
  color: var(--bad);
  background: #e0735a22;
}
.copy.stale .db {
  text-decoration: line-through;
  text-decoration-color: var(--bad);
  color: var(--on-night-2);
}
.copy.flash {
  background: #ce6f4238;
  transition: none;
}

/* Simulation toy */
.sim svg {
  display: block;
  width: 100%;
  min-width: 574px; /* 600 x 11 / 11.5 */
  height: auto;
}
.sim .node rect {
  fill: var(--night-3);
  stroke: var(--night-line);
  stroke-width: 1.5;
}
.sim .node text {
  fill: var(--on-night);
  font: 600 13px var(--sans);
}
.sim .node .sub {
  fill: var(--on-night-3);
  font: 500 11.5px var(--mono);
}
.sim .wire {
  stroke: var(--night-line);
  stroke-width: 2;
  fill: none;
}
.sim .pg rect.body {
  transition: stroke 0.3s;
}
.sim .pg.hot rect.body {
  stroke: var(--bad);
}
.sim .replica {
  transition: opacity 0.3s;
}
.sim-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 20px;
  align-items: center;
  margin-top: 10px;
}
.sim-controls .rate {
  display: grid;
  gap: 6px;
}
.sim-controls .rate span {
  font: 500 14px var(--mono);
  color: var(--on-night-2);
}
.sim-controls input[type="range"] {
  width: 100%;
  accent-color: var(--copper);
}
.check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--copper);
  margin: 0;
}
.sim-out {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.sim-out div {
  background: var(--night);
  border-radius: 8px;
  padding: 10px 12px;
}
.sim-out dt {
  font-size: 12.5px;
  color: var(--on-night-3);
}
.sim-out dd {
  margin: 2px 0 0;
  font: 600 20px var(--sans);
  letter-spacing: -0.02em;
}
.sim-out .bad {
  color: var(--bad);
}
.trace {
  margin-top: 12px;
  font: 500 12.5px/1.5 var(--mono);
  color: var(--on-night-2);
  background: var(--night);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 3.2em;
}
.trace b {
  color: var(--bad);
  font-weight: 600;
}
.trace .ok {
  color: var(--mobile);
}

/* C4 folders: diagram folders and model tree above a zooming canvas */
.c4-pick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.c4-tree {
  background: var(--night);
  border: 1px solid var(--night-line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}
.c4-tree > p {
  margin: 0 0 6px;
  font: 600 11.5px var(--mono);
  color: var(--on-night-3);
}
.c4-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.c4-tree ul ul {
  margin-left: 7px;
  padding-left: 9px;
  border-left: 1px solid var(--night-line);
}
.c4-tree .fold {
  display: inline-block;
  padding: 2px 0;
  font: 500 13px var(--mono);
  color: var(--on-night-3);
}
.c4-tree button,
.c4-tree .obj {
  display: inline-block;
  margin: 1px 0;
  padding: 2px 8px;
  border-radius: 6px;
}
.c4-tree button {
  font: 600 14px var(--sans);
  color: var(--on-night-2);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.c4-tree button:hover {
  color: var(--on-night);
}
.c4-tree button[aria-pressed="true"] {
  color: var(--on-copper);
  background: var(--copper);
}
.c4-tree .obj {
  color: var(--on-night-3);
  transition:
    background-color 0.3s,
    color 0.3s;
}
.c4-tree .obj.on {
  color: var(--on-night);
  font-weight: 600;
  background: rgba(206, 111, 66, 0.22);
  box-shadow: inset 0 0 0 1px var(--copper);
}
.c4 svg {
  display: block;
  width: 100%;
  min-width: 490px; /* the widest zoom: 800 x 11 / 18, 530 x 11 / 12 */
  height: auto;
  background: var(--night);
  border-radius: 9px;
}
.c4 .sys rect,
.c4 .ctr rect,
.c4 .cmp rect {
  fill: var(--night-3);
  stroke: var(--on-night-3);
}
.c4 .ctr rect {
  fill: var(--night-2);
}
/* Borders stay 1px at every zoom level */
.c4 rect {
  vector-effect: non-scaling-stroke;
  stroke-width: 1px;
}
.c4 rect.frame {
  fill: none;
  stroke: var(--platform);
  stroke-dasharray: 6 4;
  stroke-width: 1.5px;
}
.c4 text {
  fill: var(--on-night);
  font-family: var(--sans);
  font-weight: 600;
}
.c4 .dim {
  fill: var(--on-night-3);
  font-weight: 500;
}
.c4 .edge {
  stroke: var(--on-night-3);
  fill: none;
}
.c4 .lvl {
  transition: opacity 0.5s;
}
.c4-caption {
  margin-top: 14px;
  min-height: 3.2em;
  font-size: 15.5px;
  color: var(--on-night-2);
}
.c4-caption b {
  color: var(--on-night);
}

/* Terminal (self-hosting hero) */
.term {
  background: #05090b;
  border: 1px solid var(--night-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px #000;
}
.term .bar {
  display: flex;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--night-line);
}
.term .bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--night-line);
}
.term pre {
  margin: 0;
  padding: 18px 20px 22px;
  overflow-x: auto;
  font: 500 14px/1.75 var(--mono);
  color: var(--on-night-2);
}
.term .p {
  color: var(--copper-hi);
}
.term .c {
  color: var(--on-night);
}
.term .ok {
  color: var(--mobile);
}
.term .dim {
  color: var(--on-night-3);
}

@media (max-width: 860px) {
  .hero .in,
  .claim,
  .close .in {
    grid-template-columns: minmax(0, 1fr);
  }
  .claim.flip {
    grid-template-columns: minmax(0, 1fr);
  }
  .claim.flip > :first-child {
    order: 0;
  }
  .top .btn {
    margin-left: 0;
  }
  .sim-out dd {
    font-size: 17px;
  }
}
@media (max-width: 480px) {
  .rn-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .sim-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .copy,
  .c4 .lvl,
  .c4-tree .obj,
  .sim .pg rect.body,
  .sim .replica {
    transition: none;
  }
}

/* Impact demo */
.impact svg {
  display: block;
  width: 100%;
  min-width: 502px; /* 616 x 11 / 13.5 */
  height: auto;
}
.imp-node {
  cursor: pointer;
  outline: none;
}
.imp-node rect:first-child {
  fill: var(--night-3);
  stroke: var(--night-line);
  stroke-width: 1.5;
  transition:
    fill 0.3s,
    stroke 0.3s,
    opacity 0.3s;
}
.imp-node text {
  fill: var(--on-night);
  font: 600 14px var(--sans);
  transition: opacity 0.3s;
}
.imp-node .hop {
  fill: var(--on-night-3);
  font: 500 13.5px var(--sans);
}
.imp-node:hover rect:first-child,
.imp-node:focus-visible rect:first-child {
  stroke: var(--on-night-3);
}
.imp-node:focus-visible rect:first-child {
  stroke: var(--copper);
  stroke-width: 2;
}
.imp-node.failed rect:first-child {
  fill: #3a1d17;
  stroke: var(--bad);
}
.imp-node.failed .hop {
  fill: var(--bad);
}
.imp-node.hit rect:first-child {
  fill: #2e2415;
  stroke: var(--data);
}
.imp-node.hit .hop {
  fill: var(--data);
}
.imp-node.dim {
  opacity: 0.45;
}
.imp-edge {
  stroke: var(--night-line);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.3s;
}
.imp-edge.hit {
  stroke: var(--data);
  stroke-width: 2;
}
@media (prefers-reduced-motion: reduce) {
  .imp-node rect:first-child,
  .imp-node text,
  .imp-edge {
    transition: none;
  }
}

/* ---- Contact form (contact.astro, posted to src/worker.ts) ---- */
.contact {
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 22px 28px;
}
.contact .wide,
.contact .form-error {
  grid-column: 1 / -1;
}
.contact label {
  font-size: 15px;
  font-weight: 600;
}
.contact .opt {
  font-weight: 400;
  color: var(--ink-2);
}
.contact input,
.contact select,
.contact textarea {
  width: 100%;
  font: 400 17px/1.4 var(--sans);
  color: var(--ink);
  background: var(--stone-2);
  border: 1px solid var(--stone-line);
  border-radius: 7px;
  padding: 12px 14px;
  margin-top: 8px;
  display: block;
}
.contact textarea {
  resize: vertical;
}
.contact input:focus-visible,
.contact select:focus-visible,
.contact textarea:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 1px;
}
.contact .row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
}
.contact .addr {
  color: var(--ink-2);
  font-size: 15px;
}
.form-error {
  padding: 14px 18px;
  border-left: 4px solid var(--bad-ink);
  background: var(--stone-2);
  color: var(--bad-ink);
  font-weight: 600;
}
.form-error[hidden] {
  display: none;
}
