/* ============================================
   CREDLED — design tokens
   Concept: the working ledger of an operator.
   Paper, ink, one deep signal color. Numbers set
   in a mono face because in this world, the
   numbers are the argument.
   ============================================ */

:root {
  --paper: #f4f2ec;
  --paper-dim: #ece9e0;
  --ink: #16191e;
  --ink-soft: #4a4a45;
  --ink-faint: #8a887d;
  --rule: #d8d4c6;
  --signal: #2f5233;
  --signal-soft: #46683f;
  --signal-tint: #e7ebe2;
  --gold: #a8722f;
  --gold-soft: #c68d47;
  --gold-tint: #f2e4cd;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;

  --measure: 42rem;
  --measure-wide: 56rem;
}

/* faint ledger-rule texture, used behind hero sections only */
.textured {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27px,
    rgba(22, 25, 30, 0.045) 28px
  );
}

@media (prefers-color-scheme: dark) {
  /* Intentionally not offering a dark theme yet —
     ledgers are read on paper. Keep light, always. */
}

* { box-sizing: border-box; }

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

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

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

a {
  color: var(--signal);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--signal-soft); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.1em; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap--wide {
  max-width: 60rem;
}

header.site {
  border-bottom: 1px solid var(--rule);
  border-top: 4px solid var(--signal);
  background: var(--paper);
}

.site-nav {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.35rem 1.5rem 1.3rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.55rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark span { color: var(--signal); }
.wordmark::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--gold-soft);
  border-radius: 50%;
  margin-left: 0.4rem;
  transform: translateY(-0.6rem);
}

.site-nav nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.site-nav nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.site-nav nav a:hover,
.site-nav nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--signal);
}

footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 5rem;
}
.site-footer-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.site-footer-inner a { color: var(--ink-soft); }

/* ---------- hero / home ---------- */

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

.hero {
  padding: 4rem 0 0;
}

.hero-text { max-width: 34rem; }

.hero-kicker {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--gold);
  margin-bottom: 0.9rem;
  display: block;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  max-width: 18ch;
  letter-spacing: -0.015em;
}

.hero .lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}


.ledger-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 2.75rem;
  background: var(--ink);
}
.ledger-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  border-left: 1px solid rgba(244, 242, 236, 0.15);
}
.ledger-item:first-child { border-left: none; }
.ledger-item .num {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}
.ledger-item .label {
  font-size: 0.8rem;
  color: rgba(244, 242, 236, 0.7);
}
@media (max-width: 40rem) {
  .ledger-strip { flex-direction: column; }
  .ledger-item { border-left: none; border-top: 1px solid rgba(244,242,236,0.15); }
  .ledger-item:first-child { border-top: none; }
}

/* ---------- content sections ---------- */

section.block {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--rule);
}
section.block:last-of-type { border-bottom: none; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-head h2 { font-size: 1.4rem; margin: 0; display: flex; align-items: center; gap: 0.65rem; }
.section-head h2::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 3px;
  background: var(--gold-soft);
}
.section-head .see-all {
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------- post list ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-item {
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.post-item:first-child { border-top: none; }
.post-item .kind {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--signal);
  background: var(--signal-tint);
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  min-width: 4.4rem;
  text-align: center;
}
.post-item[data-type="note"] .kind {
  color: var(--gold);
  background: var(--gold-tint);
}
.post-item[data-type="data"] .kind {
  color: var(--ink);
  background: var(--paper-dim);
}
.post-item a.title {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  flex: 1 1 16rem;
}
.post-item a.title:hover { color: var(--signal); }
.post-item .date {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- filter tabs (writing page) ---------- */

.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.filters button {
  font-family: var(--sans);
  font-size: 0.88rem;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 0.4rem 0.85rem;
  border-radius: 2px;
  cursor: pointer;
}
.filters button.active {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--paper);
}

/* ---------- empty state ---------- */

.empty-state {
  padding: 2.25rem 1.5rem;
  border: 1px dashed var(--rule);
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.empty-state strong { color: var(--ink); }

/* ---------- about page ---------- */

.byline-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
.byline-card .mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--signal);
  border: 1px solid var(--signal);
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.disclosure {
  font-size: 0.9rem;
  color: var(--ink-faint);
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--signal);
  background: var(--signal-tint);
}

/* ---------- tools / calculator ---------- */

.tool-card {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--signal);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  background: #fdfcf9;
}
.tool-card h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.tool-card .tool-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.slider-row {
  margin-bottom: 1.4rem;
}
.slider-row label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.slider-row label .val {
  font-family: var(--mono);
  color: var(--ink);
  font-weight: 600;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--signal);
}

.calc-output {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 1.5rem;
}
.calc-output .cell {
  background: var(--paper);
  padding: 1rem 0.9rem;
}
.calc-output .cell .k {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}
.calc-output .cell .v {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 30rem) {
  .calc-output { grid-template-columns: 1fr; }
}

.tool-note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 1rem;
}

/* ---------- contact ---------- */

form.contact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 30rem;
}
form.contact label {
  font-size: 0.88rem;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 0.35rem;
}
form.contact input,
form.contact textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  border-radius: 2px;
}
form.contact textarea { min-height: 8rem; resize: vertical; }
form.contact button {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 0.95rem;
  background: var(--signal);
  color: var(--paper);
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 2px;
  cursor: pointer;
}
form.contact button:hover { background: var(--signal-soft); }

/* ---------- signup (silent capture) ---------- */

.signup {
  border: 1px solid var(--rule);
  padding: 1.5rem 1.75rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
.signup p { margin: 0; max-width: 28rem; color: var(--ink-soft); font-size: 0.95rem; }
.signup form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.signup input[type="email"] {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  min-width: 15rem;
}
.signup button {
  font-family: var(--sans);
  font-size: 0.9rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  cursor: pointer;
}
.signup button:hover { background: var(--signal); }

/* ---------- generic ---------- */

.prose h2 { font-size: 1.3rem; margin-top: 2rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose { max-width: var(--measure); }

.tag-list { color: var(--ink-faint); font-size: 0.85rem; }
