:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0c1a2e;
  --muted: #55627a;
  --border: #d8deea;
  --navy: #021f44;
  --line: #03477f;
  --blue: #0189fb;
  --teal: #01b7cc;
  --accent: #0a6fd6;
  --on-accent: #ffffff;
  --code-bg: #081931;
  --code-text: #d7e3f7;
  --compute: #c2571a;
  --data: #7b3fc4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1220;
    --surface: #111c2e;
    --text: #e6ecf6;
    --muted: #9aa8c0;
    --border: #25344d;
    --line: #5f93d6;
    --accent: #4da3ff;
    --on-accent: #06121f;
    --code-bg: #060d18;
    --compute: #f0935a;
    --data: #b68cf0;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

/* ---------- Header ---------- */

.top,
main > section,
.foot {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
}

.top nav a:not(.button) {
  color: var(--muted);
  text-decoration: none;
}

.top nav a:not(.button):hover {
  color: var(--text);
}

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

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  filter: brightness(1.08);
}

.button.small {
  padding: 7px 14px;
}

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

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

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

/* ---------- Hero ---------- */

.hero {
  display: grid;
  gap: 48px;
  justify-items: center;
  padding: 56px 0 72px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  letter-spacing: -0.02em;
}

.lead {
  margin-top: 20px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 36em;
  margin-inline: auto;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  margin-top: 30px;
}

.platforms {
  margin-top: 30px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-art {
  width: min(860px, 100%);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.sketch {
  width: 100%;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sketch .box {
  fill: none;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.sketch .account {
  stroke: var(--muted);
}

.sketch .network,
.sketch .subnet {
  stroke: var(--blue);
}

.sketch .subnet {
  fill: color-mix(in srgb, var(--blue) 7%, transparent);
}

.sketch .label {
  font: 600 9px system-ui, sans-serif;
  letter-spacing: 0.08em;
  fill: var(--muted);
}

.sketch .wire {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
}

.sketch .node {
  fill: var(--surface);
  stroke-width: 2;
}

.sketch .n-net {
  stroke: var(--blue);
}

.sketch .n-compute {
  stroke: var(--compute);
}

.sketch .n-data {
  stroke: var(--data);
}

.becomes {
  font-size: 28px;
  color: var(--teal);
}

.code {
  margin: 0;
  padding: 16px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-text);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.code .c {
  color: #7f93b3;
}

.code .k {
  color: #5cc8ff;
}

.code .s {
  color: #7fe0c3;
}

/* ---------- Sections ---------- */

.band {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.band h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.steps h3,
.grid h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.steps p,
.grid p,
.who p {
  color: var(--muted);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.steps li:nth-child(2) .step-number {
  background: var(--blue);
}

.steps li:nth-child(3) .step-number {
  background: var(--teal);
  color: var(--navy);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid article {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.who {
  text-align: center;
}

.who p {
  max-width: 44em;
  margin: 0 auto 28px;
  font-size: 1.1rem;
}

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

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

/* The navy parts of the logo vanish on a dark page, so give it a light plate there. */
@media (prefers-color-scheme: dark) {
  .brand img,
  .foot img {
    padding: 3px;
    border-radius: 6px;
    background: #e6ecf6;
  }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .hero {
    gap: 36px;
    padding: 32px 0 56px;
  }

  .code {
    font-size: 11px;
  }

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

  .band {
    padding: 48px 0;
  }
}

@media (max-width: 560px) {
  .top nav a:not(.button) {
    display: none;
  }

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

  .becomes {
    justify-self: center;
    transform: rotate(90deg);
  }

  .code {
    overflow-x: auto;
  }
}

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

/* Keep the brand and the button side by side on a phone. */
@media (max-width: 560px) {
  .top {
    gap: 8px;
  }

  .brand {
    gap: 8px;
    font-size: 15px;
  }

  .button.small {
    padding: 6px 10px;
    font-size: 14px;
  }
}

/* ---------- The architecture is code too ---------- */

.as-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.as-code h2 {
  margin-bottom: 16px;
}

.as-code .lead {
  margin-top: 0;
  margin-inline: 0;
}

.points {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.points li {
  padding-left: 16px;
  border-left: 3px solid var(--teal);
}

.points h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.points p {
  color: var(--muted);
}

.as-code-art {
  display: grid;
  gap: 18px;
}

.file {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--border);
}

.file figcaption {
  padding: 8px 16px;
  font: 600 12px ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color: #9fb2d1;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.file .code {
  border-radius: 0;
  overflow-x: auto;
}

.diff span {
  display: block;
}

.diff .ctx {
  color: #7f93b3;
}

.diff .add {
  color: #8ff0b8;
  background: rgb(46 160 67 / 0.2);
}

.diff .del {
  color: #ffb1ad;
  background: rgb(248 81 73 / 0.2);
}

.review {
  padding: 8px 16px 10px;
  font-size: 13px;
  color: #8ff0b8;
  border-top: 1px solid rgb(255 255 255 / 0.08);
}

.review::before {
  content: "\2713  ";
}

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

/* Each diff line is its own block, so the line breaks between them must not add blank rows. */
.diff {
  white-space: normal;
}

.diff span {
  white-space: pre;
  padding-inline: 4px;
}
