/* stats.camp public pages — Swiss: white, Helvetica-flavored, one ember accent,
   strict black rules, square corners. Shared by / and /compatibility. */

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --paper-2: #f4f4f2;
  --rule: #d6d5d2;
  --ember: #e8412a;
  --muted: #6b6b69;
  --font-sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0efec;
    --paper: #121110;
    --paper-2: #1a1918;
    --rule: #33322f;
    --muted: #a3a29e;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--ink);
  text-decoration-color: var(--ember);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

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

/* ── Header ──────────────────────────────────────────────────────────── */

.site-header {
  border-bottom: 2px solid var(--ink);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.055em;
  text-decoration: none;
}

.brand-dot {
  color: var(--ember);
  margin: 0 0.015em;
}

.brand:hover {
  color: var(--ink);
}

.brand:hover .brand-dot {
  color: var(--ink);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-header nav a {
  text-decoration: none;
  font-weight: 500;
}

.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--ember);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.nav-launch {
  border: 2px solid var(--ink);
  padding: 0.35rem 0.9rem;
}

.nav-launch:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid var(--ink);
}

.btn-primary {
  background: var(--ember);
  border-color: var(--ember);
  color: #ffffff;
}

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

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

.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  padding: 3.5rem 0 3rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.hero h1::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 0.45rem;
  background: var(--ember);
  margin-bottom: 1.4rem;
}

.hero .lede {
  margin: 0 0 1.8rem;
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 44ch;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.independence-note {
  max-width: 62ch;
  font-size: 0.82rem;
}

.independence-note {
  margin: 0;
  color: var(--muted);
}

.hero .terminal {
  margin-top: 2.8rem;
}

/* ── Terminal (real do-file output) ──────────────────────────────────── */

.terminal {
  border: 2px solid var(--ink);
  background: var(--paper);
  min-width: 0;
  max-width: 47rem;
  margin: 0;
}

.terminal-caption {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 2px solid var(--ink);
  padding: 0.45rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.terminal-caption .filename {
  color: var(--muted);
  text-transform: none;
}

.terminal-body {
  padding: 0.9rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
}

.terminal .cmd {
  margin: 0 0 0.8rem;
  color: var(--ink);
  font-weight: 600;
}

.terminal .cmd .kw {
  color: var(--ember);
}

/* Engine output — markup as produced by the stats.camp engine
   (regenerate with stats_core's CommandOutput::to_html). */

.reg-output .reg-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

table.reg-stats {
  border-collapse: collapse;
  margin-bottom: 0.9rem;
}

table.reg-stats td {
  padding: 0 0.5ch;
}

table.reg-stats td.k {
  color: var(--muted);
  padding-left: 2ch;
}

table.reg-stats td.k:first-child {
  padding-left: 0;
}

table.reg-stats td.v {
  color: var(--ink);
}

table.reg-coef {
  border-collapse: collapse;
  border: 1px solid var(--rule);
}

table.reg-coef th,
table.reg-coef td {
  padding: 0.35rem 0.7rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: left;
  white-space: nowrap;
}

table.reg-coef th:last-child,
table.reg-coef td:last-child {
  border-right: none;
}

table.reg-coef tbody tr:last-child td {
  border-bottom: none;
}

table.reg-coef thead th {
  background: var(--paper-2);
  color: var(--muted);
  font-weight: 500;
}

table.reg-coef .r {
  text-align: right;
}

.reg-output .var-label {
  display: block;
  font-weight: 500;
  line-height: 1.2;
}

.reg-output .var-name {
  display: block;
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.2;
  margin-top: 1px;
}

.reg-output .var-only {
  display: block;
  line-height: 1.2;
}

.terminal-note {
  border-top: 1px solid var(--rule);
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}

.output-details {
  margin-top: 0.7rem;
}

.output-details summary {
  width: fit-content;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--ember);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.output-details summary:hover {
  color: var(--ember);
}

.reg-coef-continuation {
  margin-top: 0.7rem;
}

.dataset-note,
.alternative-note {
  max-width: 62ch;
  font-size: 0.85rem;
}

.dataset-note {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.alternative-note {
  margin: 0.85rem 0 0;
}

/* ── Sections ────────────────────────────────────────────────────────── */

main section {
  border-top: 2px solid var(--ink);
  padding: 2.6rem 0 2.8rem;
}

main h2 {
  margin: 0 0 1.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

main h2 + p {
  margin-top: 0;
}

main section > p {
  max-width: 62ch;
}

/* Command grid: features named by their actual commands */

.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.6rem 2.5rem;
  margin: 0;
}

.cmd-grid dt {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
}

.cmd-grid dt::before {
  content: ". ";
  color: var(--ember);
  font-weight: 700;
}

.cmd-grid dd {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Audience columns */

.audience {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
}

.audience h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

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

/* Privacy page */

.privacy-copy,
.privacy-page section > p,
.privacy-page section > ul {
  max-width: 62ch;
}

.privacy-copy p {
  margin: 0 0 1rem;
}

.privacy-copy p:last-child {
  margin-bottom: 0;
}

.privacy-page .updated {
  margin-bottom: 1.6rem;
}

.privacy-page section ul {
  padding-left: 1.25rem;
}

.privacy-page section li {
  margin-bottom: 0.45rem;
}

/* FAQ */

.faq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem 2rem;
  margin: 0;
}

.faq div {
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
}

.faq dt {
  font-weight: 700;
}

.faq dd {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.guide-grid li {
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 1rem 0.75rem 0;
}

.guide-grid a {
  font-weight: 600;
}

/* Final conversion prompt */

main section.signup-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  padding: 2.8rem 0 0;
}

.signup-cta h2 {
  margin-bottom: 0.7rem;
}

.signup-cta .signup-cta-title {
  margin: 0;
  max-width: 28ch;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.signup-cta p:last-child {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.signup-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* ── Compatibility table ─────────────────────────────────────────────── */

main h1 {
  margin: 2.6rem 0 0.4rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

main h1::before {
  content: "";
  display: block;
  width: 3.5rem;
  height: 0.45rem;
  background: var(--ember);
  margin-bottom: 1.2rem;
}

.updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0;
}

.counts {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.table-scroll {
  overflow-x: auto;
}

table.compat {
  border-collapse: collapse;
  width: 100%;
  min-width: 42rem;
  table-layout: fixed;
  font-size: 0.92rem;
}

table.compat th:nth-child(1) {
  width: 14%;
}

table.compat th:nth-child(2) {
  width: 14%;
}

table.compat th:nth-child(3) {
  width: 20%;
}

table.compat th {
  text-align: left;
  border-bottom: 2px solid var(--ink);
  padding: 0.45rem 1rem 0.45rem 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

table.compat td {
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 1rem 0.5rem 0;
  vertical-align: top;
}

table.compat td:last-child {
  color: var(--muted);
}

.status {
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.45em;
  background: currentcolor;
}

.status-supported {
  color: #0f7a47;
}

.status-partial {
  color: #b45309;
}

.status-planned {
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  .status-supported {
    color: #4fbf83;
  }

  .status-partial {
    color: #e0964a;
  }
}

.cta {
  margin: 2.5rem 0;
}

/* ── Focused guide and command pages ───────────────────────────────── */

.content-page {
  max-width: 58rem;
}

.breadcrumbs {
  display: flex;
  gap: 0.55rem;
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.breadcrumbs span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-page h1 {
  max-width: 22ch;
}

.page-lede {
  max-width: 58ch;
  margin: 0.8rem 0 1.5rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.content-page > .independence-note {
  margin-bottom: 2.8rem;
}

.content-page section {
  padding: 2.2rem 0 2.4rem;
}

.content-page section > h2 {
  margin-bottom: 1rem;
}

.content-page section > p,
.content-page section > ul,
.content-page section > ol,
.content-page section > pre {
  max-width: 68ch;
}

.content-page section > p:last-child,
.content-page section > ul:last-child,
.content-page section > ol:last-child {
  margin-bottom: 0;
}

.code-example {
  overflow-x: auto;
  margin: 1.1rem 0;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  tab-size: 2;
}

.code-example code {
  font-size: inherit;
}

.steps,
.check-list {
  padding-left: 1.35rem;
}

.steps li,
.check-list li {
  margin-bottom: 0.45rem;
  padding-left: 0.25rem;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.7rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-links li {
  border-top: 1px solid var(--rule);
  padding-top: 0.7rem;
}

.content-page section.guide-cta {
  border: 2px solid var(--ink);
  margin-top: 2.8rem;
  padding: 1.4rem;
}

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

/* ── Footer ──────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 2px solid var(--ink);
  margin-top: 3rem;
  background: var(--paper-2);
}

.site-footer .wrap {
  padding-top: 1.6rem;
  padding-bottom: 2rem;
}

.site-footer p {
  margin: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 52rem) {
  .hero {
    padding-top: 2.2rem;
  }

  main section.signup-cta {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .signup-cta-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 34rem) {
  .site-header nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .hero-actions .btn,
  .signup-cta-actions .btn,
  .guide-actions .btn {
    width: 100%;
    text-align: center;
  }
}
