/* diligent.style: civic ledger. A kept record, not a dashboard. */

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

:root {
  --paper: #f4f1ea;
  --ink: #14161a;
  --muted: #4a4f57;
  --accent: #843710;
  --on-accent: #f4f1ea;
  --rule: #c9c3b4;
  --rule-strong: #7a7466;
  --st-pass: #1d5c3a;
  --st-fail: #8a1f1f;
  --st-review: #6e4a00;

  --font-text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --s7: 96px;

  --measure: 72ch;
  --wide: 1100px;
  --gutter: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161a;
    --ink: #f4f1ea;
    --muted: #b8bcc4;
    --accent: #e0996a;
    --on-accent: #14161a;
    --rule: #3a3e45;
    --rule-strong: #8a8f98;
    --st-pass: #7fcf9f;
    --st-fail: #e8a0a0;
    --st-review: #e2b34f;
  }
}
:root[data-theme="dark"] {
  --paper: #14161a;
  --ink: #f4f1ea;
  --muted: #b8bcc4;
  --accent: #e0996a;
  --on-accent: #14161a;
  --rule: #3a3e45;
  --rule-strong: #8a8f98;
  --st-pass: #7fcf9f;
  --st-fail: #e8a0a0;
  --st-review: #e2b34f;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness 120ms ease;
}
a:hover {
  text-decoration-thickness: 2px;
}

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

.skip-link {
  position: absolute;
  left: var(--s1);
  top: -100px;
  z-index: 10;
  padding: var(--s1) var(--s2);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
}
.skip-link:focus {
  top: var(--s1);
}

.wrap {
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  padding-block: var(--s2);
}
.wordmark {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  padding-block: var(--s1);
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding-block: var(--s1);
  color: var(--ink);
}
.site-nav a[aria-current="page"] {
  text-decoration-thickness: 3px;
  text-decoration-color: var(--accent);
}

/* ---------- sections ---------- */
main > section,
.page-head {
  border-bottom: 1px solid var(--rule);
  padding-block: var(--s6);
}
main > section:last-child {
  border-bottom: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--s2);
  text-wrap: balance;
}
h1 {
  font-size: clamp(2rem, 5.2vw, 3.25rem);
  letter-spacing: -0.01em;
  max-width: 22ch;
}
h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  max-width: 34ch;
}
h3 {
  font-size: 1.125rem;
}

p {
  margin: 0 0 var(--s2);
  max-width: var(--measure);
}
.lede {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink);
}
.muted {
  color: var(--muted);
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
:not(pre) > code {
  overflow-wrap: anywhere;
}

/* ---------- hero ---------- */
.hero {
  padding-block: var(--s7) var(--s6);
}
.hero .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin-block: var(--s4) var(--s3);
}

.copy-pill {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
}
.copy-pill code {
  display: block;
  padding: var(--s1) var(--s2);
  align-self: center;
  min-width: 0;
  color: var(--ink);
  font-size: 0.95rem;
}
.copy-pill button.copy {
  flex: none;
  min-width: 5.5rem;
  min-height: 44px;
  padding: var(--s1) var(--s2);
  border: 0;
  border-left: 1px solid var(--rule-strong);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.copy-pill button.copy:hover {
  filter: brightness(1.12);
}
.copy-pill button.copy:focus-visible {
  outline-offset: -3px;
  outline-color: var(--paper);
}
[hidden] {
  display: none !important;
}

.text-link {
  display: inline-block;
  padding-block: var(--s1);
  font-weight: 600;
}

.status-line {
  display: block;
  margin: 0;
  max-width: none;
  padding: var(--s1) var(--s2);
  border: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink);
}
.status-line span {
  white-space: nowrap;
}
.status-line .sep {
  color: var(--muted);
  padding-inline: 0.4em;
}

/* ---------- tables ---------- */
.table-wrap {
  max-width: var(--wide);
  overflow-x: auto;
  margin-block: var(--s3);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.975rem;
}
th[scope="row"] code {
  white-space: nowrap;
}
caption {
  caption-side: top;
  text-align: left;
  padding-bottom: var(--s1);
  font-weight: 600;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--s1) var(--s2) var(--s1) 0;
  border-top: 1px solid var(--rule);
}
thead th {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 1px solid var(--rule);
}
tbody th {
  font-weight: 400;
}
.ledger,
.ledger td,
.ledger th {
  font-family: var(--font-mono);
  font-size: 0.925rem;
}
.ledger td:last-child {
  font-family: var(--font-text);
  font-size: 0.975rem;
}
.ledger th[scope="row"] {
  white-space: nowrap;
  font-weight: 400;
}
.st-pass {
  color: var(--st-pass);
}
.st-fail {
  color: var(--st-fail);
}
.st-review {
  color: var(--st-review);
}
.st-pass,
.st-fail,
.st-review {
  font-weight: 400;
}
.ledger-note {
  max-width: var(--measure);
  color: var(--muted);
}

/* ---------- phase chain ---------- */
.chain {
  list-style: none;
  margin: var(--s4) 0 var(--s3);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
}
.chain li {
  padding: var(--s2);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}
.chain .cmd {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink);
}
.chain .cmd::after {
  content: " \2192";
  color: var(--muted);
}
.chain li:last-child .cmd::after {
  content: "";
}
.chain .art {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- boxes ---------- */
.grid {
  display: grid;
  gap: var(--s3);
  margin-top: var(--s4);
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.box {
  border: 1px solid var(--rule-strong);
  padding: var(--s3);
}
.box h3 {
  margin-bottom: var(--s1);
}
.box p {
  margin: 0;
  color: var(--ink);
}
.col {
  border-top: 1px solid var(--ink);
  padding-top: var(--s2);
}
.col p {
  margin: 0;
}

/* ---------- code ---------- */
pre {
  margin: var(--s3) 0;
  padding: var(--s2);
  border: 1px solid var(--rule-strong);
  overflow-x: auto;
  line-height: 1.55;
  max-width: var(--wide);
}
pre code {
  font-size: 0.875rem;
}

/* ---------- prose pages ---------- */
.prose {
  padding-block: var(--s5) var(--s7);
}
.prose h2 {
  margin-top: var(--s6);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
}
.prose h2:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
.prose ul,
.prose ol {
  max-width: var(--measure);
  padding-left: 1.25rem;
}
.prose li {
  margin-bottom: var(--s1);
}
.page-head {
  padding-block: var(--s6) var(--s4);
}
.release {
  padding-block: var(--s4);
  border-top: 1px solid var(--rule);
}
.release:first-of-type {
  border-top: 0;
}
.release h2 {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--ink);
  padding-block: var(--s5);
  font-size: 0.975rem;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  list-style: none;
  margin: 0 0 var(--s3);
  padding: 0;
}
.site-footer a {
  display: inline-block;
  padding-block: var(--s1);
}
.site-footer p {
  margin-bottom: var(--s1);
}

@media (pointer: coarse) {
  a.text-link,
  .site-nav a,
  .site-footer a,
  .wordmark {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
  }
  .copy-pill button.copy {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (max-width: 600px) {
  main > section,
  .page-head {
    padding-block: var(--s5);
  }
  .hero {
    padding-block: var(--s5);
  }
  .status-line span {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.mt {
  margin-top: var(--s2);
}
