:root {
  --field: #d6e0e7;
  --ink: #13202c;
  --muted: #4d6270;
  --line: #90a8b6;
  --cut: #c45a12;
  --cut-soft: #e8c4a8;
  --node: #1a4a66;
  --paper: #f4f7f9;
  --mint: #2c6b5c;
  --dump: #8a6a62;
  --shadow: 0 18px 40px rgba(19, 32, 44, 0.08);
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(26, 74, 102, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(26, 74, 102, 0.06) 1px, transparent 1px),
    var(--field);
  background-size: 28px 28px, 28px 28px, auto;
  font-family: var(--display);
  font-optical-sizing: auto;
  line-height: 1.5;
}

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

a:hover {
  color: var(--cut);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.wrap {
  width: min(1080px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
}

.wordmark {
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}

.wordmark span {
  color: var(--cut);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
}

nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--cut);
}

.lede {
  padding: 2rem 0 0.25rem;
}

.lede p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 48ch;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.75rem 0 0.5rem;
  align-items: stretch;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cut);
  margin: 0 0 0.75rem;
}

h1,
h2,
h3 {
  letter-spacing: -0.04em;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  margin: 0 0 1rem;
}


.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.btn:hover {
  background: var(--cut);
  border-color: var(--cut);
  color: var(--paper);
}

.split {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-height: 280px;
}

.split header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.split.dump header {
  color: var(--dump);
}

.split.pack header {
  color: var(--mint);
}

.tok {
  font-variant-numeric: tabular-nums;
}

.wall,
.nodes {
  padding: 0.85rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.55;
}

.wall {
  color: #9aa8b0;
  overflow: hidden;
  position: relative;
  max-height: 220px;
}

.wall::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4rem;
  background: linear-gradient(transparent, var(--paper));
}

.wall b {
  color: var(--dump);
  font-weight: 500;
}

.nodes {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.node {
  border: 1px solid var(--node);
  padding: 0.55rem 0.7rem;
  background: #e7eef2;
}

.node strong {
  display: block;
  color: var(--node);
  font-size: 0.78rem;
}

.node span {
  color: var(--muted);
}

.edge {
  width: 2px;
  height: 10px;
  background: var(--cut);
  margin-left: 1.1rem;
}

.split footer {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.55rem 0.9rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
}

.pack footer {
  color: var(--cut);
}

section {
  margin: 3.5rem 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title h2 {
  margin: 0;
  font-size: 1.7rem;
}

.section-title p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.comments {
  background: var(--ink);
  color: #d5e0e6;
  padding: 1.25rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.92rem;
  box-shadow: var(--shadow);
}

.comments .cmt {
  color: #7ec9b0;
}

.comments .key {
  color: #f0b56a;
}

.comments .fn {
  color: #e8eef2;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem;
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.ratio {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--cut);
  margin-top: 0.7rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 0.85rem;
}

tr.win td.num {
  color: var(--mint);
  font-weight: 600;
}

.install {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

pre {
  margin: 0;
  background: var(--ink);
  color: #e6eef2;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.note {
  font-size: 0.92rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

article {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  box-shadow: var(--shadow);
  margin: 1.5rem 0 3rem;
  scroll-margin-top: 1.25rem;
}

article h1,
article > h2:first-of-type {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin-top: 0;
}

article h2:not(:first-of-type),
article h3 {
  margin-top: 2.2rem;
  font-size: 1.45rem;
}

article p,
article li {
  max-width: 68ch;
}

article code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: #e7eef2;
  padding: 0.1em 0.35em;
}

.meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 840px) {
  .hero,
  .install,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .lede p {
    max-width: none;
  }

  .site-header,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

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