@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400&family=Source+Sans+3:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap");

:root {
  --ink: #0b0b0a;
  --ink-2: #12110f;
  --cream: #f4f0e6;
  --cream-2: #e8e2d4;
  --gold: #e6a23c;
  --gold-dim: #9a6410;
  --line: #2a2824;
  --line-2: #3a3428;
  --mute: #b9b3a6;
  --mute-2: #8d877b;
  --panel: #141310;
  --panel-2: #1a1814;
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, "Palatino Linotype",
    Charter, Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas,
    monospace;
  --measure: 38rem;
  --page: 72rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--cream);
}
body {
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  position: relative;
}

.pin-field,
body::before {
  pointer-events: none;
  position: fixed;
  inset: -6rem -8rem auto auto;
  width: min(48vw, 26rem);
  height: min(48vw, 26rem);
  opacity: 0.16;
  background: url("/pin.svg") no-repeat center / contain;
  z-index: 0;
  content: "";
}
.wrap, footer.antics { position: relative; z-index: 1; }

a { color: var(--cream); text-underline-offset: 0.18em; }
a:hover { color: var(--gold); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--ink);
  padding: 0.5rem 0.8rem; z-index: 20;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

.wrap { width: min(var(--page), calc(100% - 2.5rem)); margin: 0 auto; }
.wrap.narrow { width: min(44rem, calc(100% - 2.5rem)); }
main { flex: 1; }

nav.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0 1rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
nav.top .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
nav.top .brand img { width: 26px; height: 26px; }
nav.top ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.25rem;
  font-size: 0.95rem;
  color: var(--mute);
}
nav.top a { color: inherit; text-decoration: none; }
nav.top a:hover,
nav.top a[aria-current="page"] { color: var(--gold); }
nav.top .nav-search input[type="search"] {
  width: 11rem;
  max-width: 36vw;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--cream);
  font: 0.92rem/1.3 var(--sans);
  padding: 0.32rem 0.6rem;
}
nav.top .nav-search input[type="search"]:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3, h1.title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--cream);
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 0.4rem; line-height: 1.08; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin: 2.2rem 0 0.55rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.4rem; }
p, li { color: var(--mute); }
p.lead {
  font-size: 1.2rem;
  line-height: 1.5;
  max-width: 36rem;
  color: var(--cream-2);
}
code, pre { font-family: var(--mono); }
code { font-size: 0.9em; color: var(--cream); }
pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.95rem 1.05rem;
  overflow-x: auto;
  color: var(--cream);
  font-size: 0.86rem;
  line-height: 1.55;
}

.kicker {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0.7rem 1.2rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { color: var(--ink); filter: brightness(1.06); }
.btn-ghost {
  border: 1px solid var(--line-2);
  color: var(--cream);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.site-search { margin: 0 0 1.4rem; }
.site-search input[type="search"] {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--cream);
  font: 1.05rem/1.4 var(--sans);
  padding: 0.7rem 0.85rem;
}
.site-search input[type="search"]:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.search-hits { display: grid; gap: 0.55rem; }
.search-hit {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
}
.search-hit:hover { border-color: var(--gold-dim); color: inherit; }
.search-hit strong { font-family: var(--serif); font-size: 1.15rem; color: var(--cream); }
.search-hit span { color: var(--mute); font-size: 0.92rem; }

.install {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  text-align: left;
}
.install header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--mute-2);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.install header button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  font: 0.75rem/1 var(--sans);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.install header button:hover { color: var(--gold); border-color: var(--gold); }
.install pre { margin: 0; border: 0; border-radius: 0; }
.quiet {
  color: var(--mute-2);
  font-size: 0.88rem;
  margin: 0.8rem 0 0;
}

/* Landing — field journal */
.landing { padding: 0 0 5rem; }
.hero-journal {
  padding: 4.2rem 0 1.4rem;
  max-width: 40rem;
}
.hero-journal h1 { max-width: 22ch; }
.hero-journal .lead {
  margin: 0 0 1.6rem;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  color: var(--cream);
}
.hero-journal .rule {
  width: 5.5rem;
  height: 2px;
  background: var(--gold);
  margin: 0.85rem 0 1.15rem;
  border: 0;
}
.hero-journal .install { margin: 1.6rem 0 0; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.plate {
  margin: 2.4rem 0 0;
  padding: 0;
  border: 0;
}
.plate figcaption {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--mute);
  margin: 0 0 0.7rem;
}
.plate figcaption span {
  color: var(--gold);
  font-variant-numeric: lining-nums;
  letter-spacing: 0.06em;
  margin-right: 0.55rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.term {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  text-align: left;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.term-title {
  color: var(--mute-2);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.term-tabs { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.2rem; }
.term-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: 0.72rem/1 var(--mono);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}
.term-tabs button[aria-selected="true"],
.term-tabs button:hover {
  color: var(--gold);
  background: rgba(230, 162, 60, 0.1);
}
.term-body {
  margin: 0;
  padding: 1.1rem 1.15rem 1.25rem;
  font: 0.84rem/1.6 var(--mono);
  min-height: 0;
  white-space: pre-wrap;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.term-body .p { color: var(--gold); }
.term-body .ok { color: var(--gold); }
.term-body .dim { color: var(--mute); }
.term-body .caret {
  display: inline-block;
  width: 0.55ch;
  background: var(--gold);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.band {
  border-top: 1px solid var(--line);
  padding: 2.6rem 0;
}
.band h2 { margin-top: 0; }
.loop {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin: 1.4rem 0 0;
}
.loop article {
  padding: 0 0.2rem 0 0;
}
.loop .n {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.45rem;
}
.loop h3 {
  font-size: 1.45rem;
  margin: 0 0 0.4rem;
}
.loop p { margin: 0; }
.loop code { color: var(--gold); }

.measure-plate { margin-top: 2.8rem; }
.measure {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.6rem 2.2rem;
  align-items: baseline;
  padding: 1.4rem 0 0.2rem;
  border-top: 1px solid var(--line);
}
.measure .fig {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 7vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--gold);
  line-height: 0.9;
}
.measure .fig span {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 0.45rem;
  font-family: var(--sans);
  font-weight: 600;
}
.measure p { margin: 0; max-width: 36rem; }

.crate-index {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.crate-index li { border-bottom: 1px solid var(--line); }
.island-fig {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--ink);
}
.crate-index a {
  display: grid;
  grid-template-columns: 2.4rem 11rem 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 0.1rem;
  text-decoration: none;
  color: inherit;
}
.crate-index img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 6px;
}
.crate-index strong {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--cream);
  font-weight: 600;
}
.crate-index span { color: var(--mute); }
.crate-index em {
  font-style: normal;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.crate-index a:hover strong { color: var(--gold); }

/* Docs */
.page { padding: 2.6rem 0 4rem; }
.page header.intro { margin-bottom: 1.6rem; max-width: 40rem; }
.page header.intro h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0 0 1.8rem;
  padding: 0 0 0.9rem;
  border-bottom: 1px solid var(--line);
  list-style: none;
  font-size: 0.92rem;
  color: var(--mute);
}
.subnav a { color: inherit; text-decoration: none; }
.subnav a:hover,
.subnav a[aria-current="page"] { color: var(--gold); }

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.docs-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.3rem 1.25rem 1.15rem;
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  min-height: 10rem;
}
.docs-card:hover { border-color: var(--gold-dim); color: inherit; }
.docs-card h2 { margin: 0 0 0.4rem; font-size: 1.45rem; }
.docs-card p { margin: 0; flex: 1; }

table { width: 100%; border-collapse: collapse; margin: 1.1rem 0; }
th, td {
  text-align: left;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--gold); font-size: 0.85rem; font-weight: 600; }
td:first-child { white-space: nowrap; }

.cmd-list { list-style: none; margin: 1rem 0; padding: 0; }
.cmd-list li {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}
.cmd-list code { color: var(--gold); }
.cmd-list p { margin: 0.25rem 0 0; }

.walk {
  display: grid;
  gap: 1.6rem;
  margin: 1.6rem 0 0;
}
.walk section h2 {
  font-size: 1.35rem;
  margin: 0 0 0.45rem;
}
.walk pre { margin: 0.7rem 0 0; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.6rem 0 0;
}
.links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  text-decoration: none;
  font-size: 0.92rem;
}

footer.antics {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 1.25rem 1rem 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
  color: var(--mute);
  font-size: 0.88rem;
}
footer.antics a { color: inherit; }
footer.antics span { display: inline-flex; align-items: center; gap: 0.35em; }

.field-map {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.field-map li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--mute);
}
.field-map li:last-child { border-bottom: 0; }
.field-map .name {
  color: var(--cream);
  font-family: var(--serif);
  font-weight: 600;
}
.field-map .not {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  grid-column: 1 / -1;
  padding: 0.15rem 0 0;
}

.hb-notes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}
.hb-note {
  display: grid;
  gap: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.15rem 1.05rem;
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  min-height: 8.5rem;
}
.hb-note:hover { border-color: var(--gold-dim); color: inherit; }
.hb-note strong {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}
.hb-note p { margin: 0; }
.hb-back {
  display: inline-block;
  margin: 0 0 1.2rem;
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 880px) {
  .hero-journal { padding: 2.6rem 0 1rem; }
  .loop,
  .measure { grid-template-columns: 1fr; }
  .crate-index a { grid-template-columns: 1fr; gap: 0.2rem; }
  .term-body { min-height: 0; }
  body::before { width: 64vw; height: 64vw; opacity: 0.12; }
}
@media (max-width: 720px) {
  .docs-grid, .hb-notes { grid-template-columns: 1fr; }
  .field-map li { grid-template-columns: 1fr; gap: 0.2rem; }
  td:first-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .term-body .caret { animation: none; }
}

#preamble, #content, #postamble {
  width: min(44rem, calc(100% - 2.5rem));
  margin-left: auto;
  margin-right: auto;
}
#postamble { margin-top: 2rem; }
h1.title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}
#content p { line-height: 1.65; }
.ef-D, .ef-vp { color: inherit; background: transparent; }
#content dl { margin: 1rem 0; }
#content dt { color: var(--cream); font-family: var(--serif); font-weight: 600; }
#content dd { color: var(--mute); margin: 0 0 0.6rem 0; }
.org-src-container, pre.src {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  overflow: auto;
}
