:root {
  color-scheme: light dark;
  --bg: #EDEEE9;
  --surface: #FFFFFF;
  --ink: #22201C;
  --ink-soft: #5B5850;
  --accent: #8A5A32;
  --accent-soft: #EFE4D6;
  --line: #D8D6CC;
  --safe: #4B6358;
  --safe-bg: #E6EBE6;
  --shadow: 0 1px 0 rgba(34,32,28,0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161512;
    --surface: #1E1D19;
    --ink: #EDEAE2;
    --ink-soft: #A8A399;
    --accent: #D3A46E;
    --accent-soft: #362B1E;
    --line: #38362F;
    --safe: #8FB19E;
    --safe-bg: #1F2A24;
    --shadow: 0 1px 0 rgba(0,0,0,0.4);
  }
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.mono {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav .brand {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav .links {
  display: flex;
  gap: 22px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav .links a { color: var(--ink-soft); text-decoration: none; }
.nav .links a:hover { color: var(--ink); }
.nav .links a[aria-current="page"] { color: var(--accent); }

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

h1 {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

h2 {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
}

.lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 14px 0 0;
}

/* ---- masthead (legal docs) ---- */
header.masthead {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 22px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-stamp {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: right;
  line-height: 1.5;
}
.meta-stamp strong { color: var(--ink); font-weight: 600; }

/* ---- spec sheet ---- */
.spec-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  margin: 36px 0 48px;
  overflow: hidden;
}
.spec-sheet__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}
.spec-sheet__head span {
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .spec-grid { grid-template-columns: 1fr; } }
.spec-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.spec-grid .spec-row:nth-child(odd) { border-right: 1px solid var(--line); }
.spec-row:nth-last-child(-n+2) { border-bottom: none; }
.spec-row .k { font-family: "Archivo", sans-serif; font-weight: 600; font-size: 14.5px; }
.spec-row .v {
  font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 600;
  color: var(--safe); background: var(--safe-bg); padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
}

/* ---- numbered sections (legal docs) ---- */
section.doc-section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px 24px;
}
section.doc-section:first-of-type { border-top: none; }
@media (max-width: 560px) { section.doc-section { grid-template-columns: 1fr; gap: 6px; } }
.section-no { font-family: "IBM Plex Mono", monospace; font-size: 13px; color: var(--ink-soft); padding-top: 3px; }
section.doc-section h2 { grid-column: 2; font-size: 20px; margin: 0 0 6px; text-wrap: balance; }
@media (max-width: 560px) {
  section.doc-section h2 { grid-column: 1; }
  section.doc-section > p, section.doc-section > ul { grid-column: 1 !important; }
}
section.doc-section > p, section.doc-section > ul { grid-column: 2; margin: 0 0 10px; max-width: 62ch; }
section.doc-section > p:last-child, section.doc-section > ul:last-child { margin-bottom: 0; }
ul { padding-left: 1.1em; }
li { margin-bottom: 6px; }

/* ---- product page ---- */
.attrs {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 22px 0 0;
}
.attrs span {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 600;
  color: var(--safe); background: var(--safe-bg); padding: 5px 11px; border-radius: 999px;
}

.feature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin: 40px 0;
}
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--surface);
  padding: 22px 22px 24px;
}
.feature .section-no { display: block; margin-bottom: 10px; }
.feature h3 { font-family: "Archivo", sans-serif; font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 15px; max-width: 40ch; }

.usecases {
  display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 40px;
}
.usecases span {
  font-family: "Archivo", sans-serif; font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  color: var(--ink-soft);
}

.teasers { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0 0; }
.teaser {
  background: var(--surface);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 20px; text-decoration: none; color: var(--ink);
}
.teaser:hover { background: var(--accent-soft); }
.teaser .t-title { font-family: "Archivo", sans-serif; font-weight: 600; font-size: 15.5px; }
.teaser .t-desc { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.teaser .arrow { font-family: "IBM Plex Mono", monospace; color: var(--accent); flex-shrink: 0; }

/* ---- FAQ (support page) ---- */
.faq { margin: 36px 0; border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.faq summary {
  font-family: "Archivo", sans-serif; font-weight: 600; font-size: 16px;
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: "IBM Plex Mono", monospace; color: var(--accent); flex-shrink: 0;
}
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin: 12px 0 0; color: var(--ink-soft); max-width: 62ch; }

/* ---- footer ---- */
footer.site-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
footer.site-footer .contact { font-family: "IBM Plex Mono", monospace; font-size: 14px; }
footer.site-footer .contact a { color: var(--ink); font-weight: 600; }
footer.site-footer .tag { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--ink-soft); letter-spacing: 0.05em; }

@media (prefers-reduced-motion: no-preference) {
  section.doc-section, .spec-sheet, .feature { animation: rise 0.4s ease-out backwards; }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
