/* Layout concept: a ledger page. Ruled lines, a margin rule, mono labels for entries, slab headings.
   Prairie green ink on a cool paper white, with one wheat-gold accent used for focus and highlights. */
:root {
  --bg: #F5F8F3;
  --surface: #FFFFFF;
  --ink: #16302A;
  --muted: #4B5E57;
  --rule: #CAD7CF;
  --accent: #1F6B52;
  --accent-ink: #FFFFFF;
  --gold: #D99A1A;
  --margin-line: #E7B9AE;
  --tint: #E8F0EA;
  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1B17; --surface: #15261F; --ink: #E6EFEA; --muted: #A2B4AB; --rule: #2B4238;
    --accent: #5FC29A; --accent-ink: #0F1B17; --gold: #E8B646; --margin-line: #5A3A33; --tint: #182A22;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1B17; --surface: #15261F; --ink: #E6EFEA; --muted: #A2B4AB; --rule: #2B4238;
  --accent: #5FC29A; --accent-ink: #0F1B17; --gold: #E8B646; --margin-line: #5A3A33; --tint: #182A22;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  padding-block: 1rem 3rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.preview-bar, .site-header, main, .site-footer { max-width: 64rem; margin-inline: auto; }
p, ul, ol, dl, h1, h2, h3 { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.mono { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.02em; }
.muted { color: var(--muted); }

/* header */
.preview-bar {
  font-family: var(--font-mono); font-size: 0.8rem; background: var(--tint); color: var(--ink);
  padding: 0.5rem 0.75rem; border: 1px dashed var(--muted); margin-bottom: 1rem;
}
.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 2rem; padding-block: 1rem 0.9rem; border-bottom: 2px solid var(--ink);
}
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand-the { font-weight: 500; font-style: italic; color: var(--muted); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; padding-block: 0.2rem; border-bottom: 2px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--rule); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--gold); }

/* type */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.5rem); font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
.eyebrow { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 38rem; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-weight: 700; font-size: 1.05rem; padding: 0.75rem 1.2rem; border: 2px solid var(--accent); border-radius: 3px;
}
.btn:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }

/* home hero */
main > section { margin-top: 3.5rem; }
.hero { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; margin-top: 2.5rem; }
.hero-copy { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.hero-copy h1 { max-width: 14ch; }
@media (min-width: 52rem) { .hero { grid-template-columns: 1.15fr 1fr; } }

/* signature: the ledger worksheet */
.ledger {
  min-width: 0; position: relative; background-color: var(--surface);
  background-image: repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px);
  border: 1px solid var(--ink); border-radius: 3px; padding: 36px 1.25rem 36px 3.5rem;
  box-shadow: 6px 6px 0 var(--tint);
}
.ledger::before { content: ""; position: absolute; top: 0; bottom: 0; left: 2.5rem; border-left: 2px solid var(--margin-line); }
.ledger-title { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; line-height: 36px; margin-top: -36px; color: var(--muted); }
.ledger dl > div { display: flex; align-items: flex-end; gap: 0.75rem; min-height: 72px; padding-bottom: 2px; }
.ledger dt { flex: 1; min-width: 0; line-height: 1.3; align-self: center; font-weight: 600; }
.ledger dd { width: 6.5rem; flex: none; border-bottom: 2px solid var(--ink); font-family: var(--font-mono); line-height: 1.6; color: var(--muted); margin: 0 0 14px; }
.ledger-note { line-height: 1.4; font-style: italic; color: var(--muted); padding-block: 14px 0; }

/* blocks */
.block { display: flex; flex-direction: column; gap: 1.25rem; }
.rows { border-top: 1px solid var(--ink); }
.row { display: grid; grid-template-columns: 1fr; gap: 0.25rem; padding-block: 1rem; border-bottom: 1px solid var(--rule); }
.row-label { font-family: var(--font-mono); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 500; }
@media (min-width: 40rem) { .row { grid-template-columns: 11rem 1fr; gap: 1.5rem; } }
.more { font-weight: 600; }
.who { list-style: none; padding: 0; display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); border-top: 1px solid var(--ink); }
.who li { padding: 0.9rem 1rem 0.9rem 0; border-bottom: 1px solid var(--rule); font-weight: 600; }

.post-list { list-style: none; padding: 0; border-top: 1px solid var(--ink); }
.post-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.25rem; padding-block: 0.9rem; border-bottom: 1px solid var(--rule); }
.post-list .mono { color: var(--muted); min-width: 10.5rem; }
.post-list.big li > div { flex: 1; min-width: min(100%, 16rem); }
.post-list.big a { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
.post-list.big p { margin-top: 0.25rem; }
.badge { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; border: 1px solid var(--muted); color: var(--muted); padding: 0.05rem 0.4rem; margin-left: 0.6rem; border-radius: 2px; white-space: nowrap; }

.cta { background: var(--tint); border: 1px solid var(--ink); border-radius: 3px; padding: 1.75rem 1.5rem; display: flex; flex-direction: column; gap: 0.9rem; }
.cta p { max-width: 40rem; }

/* prose pages and posts */
.prose { max-width: 42rem; margin-top: 2.5rem; }
.prose > * + * { margin-top: 1rem; }
.prose h1 { margin-bottom: 0.5rem; }
.prose h2 { margin-top: 2.25rem; }
.prose h3 { margin-top: 1.75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.35rem; }
.prose strong { font-weight: 700; }
.post-date { color: var(--muted); }
.draft-note { font-family: var(--font-mono); font-size: 0.85rem; border: 1px dashed var(--muted); background: var(--tint); padding: 0.5rem 0.75rem; }
.todo { background: var(--tint); color: var(--ink); border: 1px dashed var(--muted); padding: 0 0.3rem; font-family: var(--font-mono); font-size: 0.85rem; }
.back { padding-top: 1.5rem; border-top: 1px solid var(--rule); font-weight: 600; }
.page .post-list { max-width: none; }

/* footer */
.site-footer { margin-top: 4rem; padding-top: 1.25rem; border-top: 2px solid var(--ink); display: flex; flex-direction: column; gap: 0.4rem; }
.foot-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.foot-note { font-size: 0.92rem; color: var(--muted); max-width: 44rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
