/* ==========================================================
   Capital & Freedom  |  site.css
   Visual idea: a bank passbook. Ink-blue ledger, brass rules,
   mono numbers, plum for the things that matter.
   ========================================================== */

:root {
  --ink: #0E1A33;
  --ink-soft: #1E3059;
  --slate: #4A5875;
  --stone: #EDEFF3;
  --paper: #FFFFFF;
  --sand: #E8E3D7;
  --brass: #B8862B;
  --plum: #7A2E4E;

  --line: rgba(14, 26, 51, 0.14);
  --line-dark: rgba(232, 227, 215, 0.22);

  --display: "Newsreader", Georgia, serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --wrap: 1140px;
  --gap: clamp(56px, 8vw, 104px);
  --r: 3px;
}

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

html { scroll-behavior: smooth; }

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

img, svg { max-width: 100%; display: block; }
a { color: var(--plum); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 720px; }

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(38px, 6vw, 62px); }
h2 { font-size: clamp(29px, 3.9vw, 42px); }
h3 { font-size: clamp(21px, 2.4vw, 26px); }
h4 { font-size: 19px; }

.serif-em { font-style: italic; color: var(--plum); }
.on-dark .serif-em { color: var(--brass); }

p { margin: 0 0 1.1em; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-soft); line-height: 1.6; }
.small { font-size: 15px; color: var(--slate); }
.tiny { font-size: 13px; line-height: 1.6; color: var(--slate); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.on-dark .eyebrow::after { background: var(--line-dark); }

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

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

.band { padding: var(--gap) 0; }
.band-paper { background: var(--paper); }
.band-stone { background: var(--stone); }
.band-ink { background: var(--ink); color: var(--sand); }
.band-ink h1, .band-ink h2, .band-ink h3 { color: var(--paper); }
.band-ink p { color: rgba(232, 227, 215, 0.82); }
.band-ink a { color: var(--brass); }
.band-ink .small, .band-ink .tiny { color: rgba(232, 227, 215, 0.6); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

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

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(237, 239, 243, 0.92);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}
.head-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}
.brand {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand span { color: var(--brass); font-family: var(--mono); font-size: 13px; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--plum); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink);
  cursor: pointer;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  padding: 14px 26px;
  border-radius: var(--r);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}
.btn:hover { background: var(--plum); border-color: var(--plum); color: var(--paper); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.on-dark .btn { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.on-dark .btn:hover { background: var(--sand); border-color: var(--sand); }
.on-dark .btn-ghost { background: transparent; color: var(--sand); border-color: var(--line-dark); }
.on-dark .btn-ghost:hover { background: var(--sand); color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

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

.hero { padding: clamp(48px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.hero h1 { margin-bottom: 22px; }
.hero .lede { max-width: 46ch; }

.chart-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-dark);
  border-radius: var(--r);
  padding: 22px 22px 16px;
}
.chart-card figcaption { margin-top: 14px; }

.chart-line { fill: none; stroke-linecap: round; }
/* The line is drawn by default. The animation only reveals it,
   so if animation is blocked the chart still reads correctly. */
.draw { animation: draw 2.1s cubic-bezier(.4, 0, .2, 1) .35s backwards; }
@keyframes draw {
  from { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
  to { stroke-dasharray: 1400; stroke-dashoffset: 0; }
}

/* Visible by default. Only hidden once JS confirms it can reveal them,
   so no-JS visitors, crawlers and printers still see everything. */
.js .fade-up { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .fade-up.in { opacity: 1; transform: none; }

/* ---------- ledger rows (the repeating motif) ---------- */

.ledger { border-top: 1px solid var(--line); margin-top: 34px; }
.on-dark .ledger, .band-ink .ledger { border-color: var(--line-dark); }

.row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: clamp(16px, 3vw, 40px);
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.band-ink .row { border-color: var(--line-dark); }
.row-key {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  padding-top: 5px;
}
.row-body h3 { margin-bottom: 8px; }
.row-body p:last-child { margin-bottom: 0; }
.row-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
  margin-top: 10px;
  letter-spacing: 0.04em;
}
.band-ink .row-meta { color: rgba(232, 227, 215, 0.55); }

/* ---------- cards ---------- */

.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
}
.band-paper .card { background: var(--stone); }
.card h3 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }

.stat { font-family: var(--mono); font-size: clamp(26px, 3.4vw, 34px); color: var(--plum); letter-spacing: -0.02em; }
.band-ink .stat { color: var(--brass); }
.stat-label { font-size: 14px; color: var(--slate); margin-top: 6px; }
.band-ink .stat-label { color: rgba(232, 227, 215, 0.65); }

/* ---------- quote ---------- */

blockquote {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.4;
  color: var(--ink);
  border-left: 2px solid var(--brass);
  padding-left: 24px;
}
blockquote cite {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 16px;
}

/* ---------- forms ---------- */

.form { display: grid; gap: 14px; max-width: 480px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 7px;
}
.band-ink .field label { color: rgba(232, 227, 215, 0.7); }
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
}
.band-ink .field input, .band-ink .field select, .band-ink .field textarea {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-dark);
  color: var(--sand);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brass); outline: none; }
.hp { position: absolute; left: -9999px; }

/* ---------- prose (articles, policy pages) ---------- */

.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 1.2em; }
.prose li { margin-bottom: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); }
.prose td.num { font-variant-numeric: tabular-nums; }

.note {
  background: var(--sand);
  border-left: 2px solid var(--brass);
  padding: 18px 20px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 15px;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- article list ---------- */

.post-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: clamp(16px, 3vw, 36px);
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.post-row:hover h3 { color: var(--plum); }
.post-row time { font-family: var(--mono); font-size: 12px; color: var(--slate); letter-spacing: 0.05em; padding-top: 6px; }
.post-row h3 { margin-bottom: 6px; }
.post-row p { margin: 0; color: var(--slate); font-size: 15px; }

/* ---------- footer ---------- */

.site-foot { background: var(--ink); color: rgba(232, 227, 215, 0.72); padding: 64px 0 34px; font-size: 15px; }
.site-foot h4 { color: var(--paper); font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; }
.site-foot a { color: rgba(232, 227, 215, 0.86); text-decoration: none; }
.site-foot a:hover { color: var(--brass); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot-base { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line-dark); }
.disclaimer-strip { font-size: 13px; line-height: 1.7; color: rgba(232, 227, 215, 0.55); max-width: 80ch; }

/* ---------- misc ---------- */

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 12px;
  color: var(--slate);
}
.band-ink .pill { border-color: var(--line-dark); color: var(--brass); }

.price-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.price { font-family: var(--mono); font-size: 32px; color: var(--ink); letter-spacing: -0.02em; }
.price s { color: var(--slate); font-size: 18px; }

.checks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.checks li { padding-left: 26px; position: relative; font-size: 16px; }
.checks li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 12px; height: 1px;
  background: var(--brass);
}

details.qa { border-bottom: 1px solid var(--line); padding: 20px 0; }
details.qa summary {
  cursor: pointer;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.3;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; font-family: var(--mono); color: var(--brass); font-size: 20px; }
details.qa[open] summary::after { content: "\2013"; }
details.qa p { margin: 14px 0 0; color: var(--ink-soft); }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 16px; top: 12px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 22px 18px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 30px; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row-key { padding-top: 0; }
  .post-row { grid-template-columns: 1fr; gap: 6px; }
  .post-row time { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .draw { animation: none; stroke-dashoffset: 0; }
  .js .fade-up { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .site-head, .site-foot, .btn { display: none; }
  .js .fade-up { opacity: 1 !important; transform: none !important; }
  body { background: #fff; }
}
