/* ==========================================================================
   Compound Embers — stylesheet
   Everything on this site is styled from this one file.
   Change it here, it changes everywhere.

   The idea: this is an accounting statement, not a blog.
   - Paper is faded green-bar ledger stock, not white.
   - Prose is serif. Every figure, label, and total is mono. (Real statements
     split exactly this way.)
   - Color means what it means in accounting: green = credit, red = debit/risk.
   - The signature: the double rule. It's the mark an accountant puts under a
     final total, and here it underlines every section heading.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Paper & ink */
  --paper:      #F1F4EE;  /* faded green-bar ledger stock */
  --band:       #E4EADF;  /* the pale stripe on that paper */
  --ink:        #1A1F1B;  /* near-black, green cast — pen on statement */
  --ink-soft:   #59635B;  /* secondary text */
  --rule:       #C3CDC0;  /* hairline */

  /* Accounting semantics — these are not decoration */
  --credit:     #1E5B44;  /* ledger green: income, positive, links */
  --credit-lit: #2C7A5C;  /* hover */
  --debit:      #8E3227;  /* accounting red: risk, cost, warnings */

  /* Brand signature — the ember. Used once, in the wordmark. */
  --ember:      #C2410C;
  --ember-glow: rgba(194, 65, 12, 0.35);

  /* Type */
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale */
  --measure: 34rem;       /* ~68 characters — the readable line */
  --gutter: 1.5rem;
}

/* --- Reset ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  /* Real statements align their figures. So do we. */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

.wrap {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
}

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip:focus {
  position: fixed; top: 0.5rem; left: 0.5rem; z-index: 10;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.875rem; font-family: var(--mono); font-size: 0.8125rem;
}

/* Visible keyboard focus, everywhere, no exceptions */
:focus-visible {
  outline: 2px solid var(--credit);
  outline-offset: 2px;
}

/* --- Masthead ------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.25rem;
}

.wordmark {
  text-decoration: none;
  color: inherit;
  display: block;
}

.wordmark-name {
  display: block;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

/* The signature ember: a single glowing coal after the wordmark. */
.wordmark-name::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.4em;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 7px 1px var(--ember-glow);
  vertical-align: middle;
}

.wordmark-sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-top: 0.125rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav a:hover {
  color: var(--credit);
  border-bottom-color: var(--credit);
}

/* --- Post header ---------------------------------------------------------- */

.post { padding-block: 3rem 4rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--credit);
  margin: 0 0 0.75rem;
}

.post-head h1 {
  font-size: clamp(1.75rem, 1.3rem + 2.2vw, 2.5rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.deck {
  font-size: 1.125rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 1.75rem;
  text-wrap: pretty;
}

/* The statement header block: period, type, preparer.
   This is where the green-bar banding earns its keep — real ledger paper
   bands its line items, so we band ours, and nowhere else. */
.statement-meta {
  margin: 0 0 3rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.statement-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4375rem 0.625rem;
}

.statement-meta > div:nth-child(odd) { background: var(--band); }

.statement-meta dt {
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.6875rem;
}

.statement-meta dd { margin: 0; text-align: right; }

/* --- Prose ---------------------------------------------------------------- */

.prose > * + * { margin-top: 1.25rem; }

.prose p { margin: 0; text-wrap: pretty; }

/* THE SIGNATURE: the double rule.
   An accountant draws it under a final total. Here it closes every section. */
.prose h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 3.25rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px double var(--ink);
  text-wrap: balance;
}

.prose h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
}

.prose a {
  color: var(--credit);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.15s, color 0.15s;
}

.prose a:hover {
  color: var(--credit-lit);
  border-bottom-color: var(--credit-lit);
}

.prose strong { font-weight: 700; }

.prose ul, .prose ol {
  margin: 1.25rem 0;
  padding-left: 1.125rem;
}

.prose li { margin-bottom: 0.75rem; }

.prose li::marker { color: var(--credit); }

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.prose blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--credit);
  color: var(--ink-soft);
  font-style: italic;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--band);
  padding: 0.1em 0.35em;
}

/* Money and figures, wherever they appear inline */
.fig {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.credit { color: var(--credit); }
.debit  { color: var(--debit); }

/* Auto-generated inline links (from the AI linker).
   Dotted underline distinguishes them subtly from links you placed by hand. */
.prose .xlink {
  color: var(--credit);
  text-decoration: none;
  border-bottom: 1px dotted var(--credit);
}

.prose .xlink:hover {
  color: var(--credit-lit);
  border-bottom-style: solid;
}

/* Related filings — a schedule of related posts + the spine */
.related {
  margin-top: 3.5rem;
  padding-top: 0.5rem;
  border-top: 3px double var(--ink);
}

.related .eyebrow { margin-bottom: 0.875rem; }

.related .ledger .line-no { color: var(--credit); }

.related .line-date { text-transform: uppercase; letter-spacing: 0.04em; }

/* --- The "Full guides" line-item block ------------------------------------
   Styled as a schedule of holdings: mono, ruled, banded. */

.guides {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  background: var(--band);
  border-left: 3px solid var(--credit);
  padding: 0.875rem 1rem;
  margin: 2rem 0 !important;
}

.guides strong {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.375rem;
  font-weight: 600;
}

.guides a {
  border-bottom-color: var(--credit);
}

/* --- Risk callout — accounting red, used sparingly -------------------------- */

.risk {
  border-left: 3px solid var(--debit);
  background: rgba(142, 50, 39, 0.04);
  padding: 0.875rem 1rem;
  margin: 2rem 0 !important;
  font-size: 0.9375rem;
}

.risk strong { color: var(--debit); }

/* --- Email capture --------------------------------------------------------- */

.capture {
  margin-top: 3.5rem;
  padding: 1.75rem;
  background: var(--band);
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
}

.capture p { margin: 0 0 1rem; }

.capture-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.capture-form input {
  flex: 1 1 14rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.capture-form button {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--credit);
  background: var(--credit);
  color: var(--paper);
  cursor: pointer;
  transition: background 0.15s;
}

.capture-form button:hover { background: var(--credit-lit); }

.capture-fine {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-soft);
  margin: 0.75rem 0 0 !important;
}

/* --- Home page ------------------------------------------------------------- */

.home { padding-block: 3rem 4rem; }

.home-lede {
  font-size: 1.1875rem;
  line-height: 1.55;
  margin: 0 0 2.5rem;
  text-wrap: pretty;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 0.4375rem;
  border-bottom: 3px double var(--ink);
  margin: 3rem 0 0;
}

/* The course, set as a ledger: numbered line items, banded, figures right */
.ledger { list-style: none; margin: 0; padding: 0; }

.ledger li {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  padding: 0.75rem 0.625rem;
  border-bottom: 1px solid var(--rule);
}

.ledger li:nth-child(odd) { background: var(--band); }

.ledger .line-no {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--credit);
  flex: 0 0 1.75rem;
}

.ledger a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-weight: 600;
}

.ledger a:hover { border-bottom-color: var(--credit); color: var(--credit); }

.ledger .line-date {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* --- Footer ---------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding-block: 2rem 3rem;
}

.statement-note {
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  padding-left: 0.875rem;
  border-left: 2px solid var(--debit);
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-soft);
  margin: 0;
}

.colophon a { color: var(--ink-soft); }
.colophon a:hover { color: var(--credit); }

/* --- Preferences ----------------------------------------------------------- */

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

@media print {
  .masthead, .nav, .capture, .skip { display: none; }
  body { background: #fff; }
}
