/* Silk design system: near-black monochrome, hairline depth, mono numerals.
   No gradients, no glow. The home page carries its own inline copy of the
   tokens; subpages and blog pages read them from here. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #070708;
  --surface: #101011;
  --line: #232323;
  --text: #e7e7e3;
  --text-dim: #8f9089;
  --faint: #56564f;
  --accent: #e7e7e3;
  --up: #3fb26f;
  --down: #d05656;
  --radius: 2px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: var(--text);
}

.num,
time,
.readout {
  font-variant-numeric: tabular-nums;
}

/* Full-bleed sticky header, matching the home page's chrome exactly:
   same wordmark scale, same mono links, same edge padding. */
.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 3.2vw;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.wordmark {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--text);
  text-decoration: none;
}
.nav nav {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.nav nav a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.nav nav a:hover {
  color: var(--text);
  text-decoration: none;
  border-bottom-color: var(--text);
}
.nav nav a.app {
  color: var(--text);
  border-bottom-color: var(--line);
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.page-wide {
  max-width: 1400px;
}

/* Landing hero: asymmetric, copy left, readout right. */
.hero {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 48px;
  align-items: start;
  padding: 48px 0 72px;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 18ch;
}
.hero .sub {
  color: var(--text-dim);
  margin-top: 20px;
  max-width: 52ch;
}
.hero .disclaimer {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 16px;
  max-width: 52ch;
}
.cta {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--mono);
  color: var(--text);
  border: 1px solid var(--text);
  padding: 12px 20px;
  border-radius: var(--radius);
  text-decoration: none;
}
.cta:hover {
  text-decoration: none;
  background: var(--text);
  color: var(--bg);
}
.cta-secondary {
  display: inline-block;
  margin-top: 28px;
  margin-left: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: var(--radius);
}
.cta-secondary:hover {
  text-decoration: none;
  border-color: var(--text-dim);
}

/* Instrument readout: hairlines + monospace, no chrome. */
.readout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
  padding: 20px;
}
.readout .label {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.14em;
}
.readout .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.readout .row:last-child {
  border-bottom: 0;
}
.readout .big {
  font-size: 34px;
  color: var(--text);
}
.readout .accent {
  color: var(--accent);
}
.readout .up {
  color: var(--up);
}
.readout .down {
  color: var(--down);
}
.readout .note {
  color: var(--text-dim);
  font-size: 11px;
  padding-top: 10px;
}

section.block {
  border-top: 1px solid var(--line);
  padding: 56px 0;
}
section.block h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
}
.cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.cols h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.cols p {
  color: var(--text-dim);
  font-size: 15px;
}
.step {
  border-left: 2px solid var(--line);
  padding-left: 16px;
}

.plans-copy {
  max-width: 780px;
  color: var(--text-dim);
  font-size: 15px;
}

.faq dt {
  font-weight: 600;
  margin-top: 20px;
}
.faq dd {
  color: var(--text-dim);
  margin-top: 6px;
  max-width: 70ch;
}

.footer {
  border-top: 1px solid var(--line);
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
  color: var(--text-dim);
  font-size: 13px;
}
.footer a {
  color: var(--text-dim);
}

/* Blog */
.post,
.post-list {
  max-width: 720px;
}
.post h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
}
.byline {
  color: var(--text-dim);
  font-size: 14px;
  margin: 12px 0 32px;
}
.post h2 {
  font-size: 22px;
  margin: 32px 0 12px;
}
.post p,
.post li {
  margin-bottom: 14px;
  color: var(--text);
}
.post code {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 14px;
}
.post pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 14px;
}
.post pre code {
  border: 0;
  background: transparent;
  padding: 0;
}
.post blockquote {
  border-left: 2px solid var(--line);
  padding-left: 16px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.post table {
  border-collapse: collapse;
  margin-bottom: 14px;
}
.post th,
.post td {
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 15px;
}

/* Landing latest-posts section (LATEST_POSTS landing token) */
.latest-posts {
  list-style: none;
  max-width: 720px;
  margin-bottom: 20px;
}
.latest-posts-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.latest-posts-item time {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 13px;
  padding-top: 3px;
  grid-row: span 2;
}
.latest-posts-item p {
  color: var(--text-dim);
  font-size: 15px;
  margin-top: 4px;
  grid-column: 2;
}

.rss-note {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 8px;
}

/* /_admin/ landing-preview index */
.admin-group-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 36px;
}
.admin-list {
  list-style: none;
  margin-top: 24px;
  max-width: 400px;
}
.admin-list li {
  border-bottom: 1px solid var(--line);
}
.admin-list a {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 0;
  text-decoration: none;
  color: var(--text-dim);
}
.admin-list a:hover {
  color: var(--text);
}

.post-list {
  list-style: none;
  margin-top: 24px;
}
.post-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.post-list time {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 13px;
  padding-top: 3px;
}
.post-list p {
  color: var(--text-dim);
  font-size: 15px;
  margin-top: 4px;
}

/* Subpages (content/pages/*.html fragments wrapped by the shell) */
.doc {
  max-width: 760px;
}
.doc h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  margin-bottom: 12px;
}
.doc h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 44px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.doc h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 6px;
}
.doc p,
.doc li {
  color: var(--text-dim);
  margin-bottom: 12px;
  max-width: 70ch;
}
.doc li {
  margin-left: 20px;
  margin-bottom: 6px;
}
.doc strong {
  color: var(--text);
  font-weight: 600;
}
.doc code {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1px 5px;
  font-size: 14px;
  color: var(--text);
}
.doc table {
  border-collapse: collapse;
  margin: 14px 0;
  width: 100%;
}
.doc th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.doc th,
.doc td {
  border-bottom: 1px solid var(--line);
  padding: 10px 16px 10px 0;
  font-size: 15px;
  vertical-align: top;
}
.doc td:first-child {
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
  color: var(--text);
}

/* Reference sections: prose beside a code rail (Stripe pattern, static). */
.sec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 44px;
  border-top: 1px solid var(--line);
  padding: 44px 0;
  scroll-margin-top: 80px;
}
.sec:first-of-type {
  border-top: 0;
  padding-top: 8px;
}
.sec-prose h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
/* The whole code column sticks as one unit; two panels scroll together
   instead of the first sliding over the second. */
.sec-code {
  min-width: 0;
  position: sticky;
  top: 84px;
  align-self: start;
}
.sec-code .panel + .panel {
  margin-top: 16px;
}

/* Code panel: dark surface, title bar with verb chip and copy button. */
.panel {
  background: #0b0b0c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 16px;
}
.doc .panel {
  margin-top: 14px;
}
.panel-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.panel-bar .p-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex: 1;
}
.chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--text-dim);
  border-radius: var(--radius);
  padding: 2px 7px;
  color: var(--text);
  white-space: nowrap;
}
.copy-btn {
  font-family: var(--mono);
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  padding: 3px 9px;
  cursor: pointer;
}
.copy-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.panel pre {
  padding: 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.panel pre i {
  font-style: normal;
  color: var(--text-dim);
}
.panel pre .ps {
  color: var(--text-dim);
  user-select: none;
}

/* Client switcher tabs (choice persists via localStorage). */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: 14px 0 18px;
}
.tab {
  font-family: var(--mono);
  font-size: 13px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 8px 12px;
  cursor: pointer;
}
.tab:hover {
  color: var(--text);
}
.tab.on {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* Legacy labeled snippet (kept for simple single blocks). */
.snippet {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 14px 0 20px;
}
.snippet .snip-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.snippet pre {
  padding: 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
}

/* Docs: sticky section nav + prose */
.docs-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 48px;
}
.docs-nav {
  position: sticky;
  top: 84px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.docs-grid .doc {
  max-width: none;
  min-width: 0;
}
.sec-prose {
  min-width: 0;
  max-width: 660px;
}
/* Group headings recede behind the links: faint ink, ruled, wider tracking. */
.docs-nav-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin: 16px 0 2px;
}
.docs-nav-label:first-child {
  margin-top: 6px;
  border-top: 0;
  padding-top: 0;
}
.docs-nav a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
}
.docs-nav a:hover {
  color: var(--text);
}
.doc h2 {
  scroll-margin-top: 24px;
}

/* Pricing */
.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0 8px;
}
.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.plan.pro {
  border-color: var(--text-dim);
}
.plan h2 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-top: 0;
  padding-top: 0;
  margin: 0;
}
.plan .price {
  font-family: var(--mono);
  font-size: 30px;
  color: var(--text);
  margin: 12px 0 6px;
}
.plan .per {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}
.plan-for {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 8px;
}
/* Five discrete level blocks, cool slate to hot amber - the brand ramp. */
.ramp {
  display: flex;
  gap: 3px;
  margin: 0 0 14px;
}
.ramp i {
  width: 26px;
  height: 4px;
  display: inline-block;
}
.ramp i:nth-child(1) {
  background: #aebfd2;
}
.ramp i:nth-child(2) {
  background: #bcc6c9;
}
.ramp i:nth-child(3) {
  background: #e7e7e3;
}
.ramp i:nth-child(4) {
  background: #d9ae84;
}
.ramp i:nth-child(5) {
  background: #d98a66;
}
/* The free card carries the same strip in hairline grey so both cards
   share one vertical rhythm; only Pro earns the color. */
.ramp-off i:nth-child(n) {
  background: var(--line);
}

/* Plan comparison matrix */
.matrix {
  margin: 32px 0 8px;
}
.doc table.matrix th {
  padding-top: 0;
}
.doc table.matrix td:first-child {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}
.doc table.matrix td {
  color: var(--text);
}
.plan ul {
  list-style: none;
  margin: 14px 0 6px;
}
.plan li {
  color: var(--text-dim);
  font-size: 15px;
  border-top: 1px solid var(--line);
  padding: 9px 0;
  margin: 0;
}
.plan .cta,
.plan .cta-secondary {
  margin-top: auto;
  margin-left: 0;
}

/* Questions: open FAQ + side rail */
.questions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
}
.q-rail {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.q-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.q-block p {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 8px;
}
.q-block p:last-child {
  margin-bottom: 0;
}
.q-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.q-rail .subscribe {
  flex-direction: column;
  margin-bottom: 0;
}
.q-rail .subscribe input[type="email"] {
  min-width: 0;
  width: 100%;
}

/* Email subscribe (posts to the external list service) */
.subscribe {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 8px;
}
.subscribe input[type="email"] {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 11px 14px;
  min-width: 260px;
}
.subscribe input[type="email"]:focus {
  outline: none;
  border-color: var(--text-dim);
}
.subscribe button {
  background: transparent;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 11px 18px;
  cursor: pointer;
}
.subscribe button:hover {
  background: var(--text);
  color: var(--bg);
}

@media (max-width: 1120px) {
  .sec {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sec-code {
    position: static;
  }
}

@media (max-width: 800px) {
  .hero,
  .cols,
  .plans,
  .docs-grid,
  .questions-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 34px;
  }
  .docs-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: baseline;
  }
  .docs-nav-label,
  .docs-nav-label:first-child {
    margin: 0;
    width: 100%;
  }
  .q-rail {
    position: static;
  }
}
