/* ============================================
   Transformed Accounting — Design Tokens
   Palette: ink black, warm cream, gold ledger accent
   Type: Playfair Display (display serif) + Inter (body) + IBM Plex Mono (figures)
   Signature: the "ledger rule" — a thin gold double-underline borrowed
   from the accountant's own habit of double-underlining a final total.
   ============================================ */

:root {
  --ink: #0b0b0c;
  --ink-soft: #17161a;
  --cream: #f6f2e9;
  --cream-deep: #ede5d2;
  --gold: #c8a24a;
  --gold-light: #f3d999;
  --gold-deep: #8a6b2a;
  --maroon: #5c1a24;
  --text: #201d1a;
  --text-soft: #6b6153;
  --text-on-ink: #f2f0ea;

  --font-display: "Playfair Display", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --max-width: 1180px;
  --radius: 2px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

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

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; color: var(--text); }
.lede { font-size: 1.15rem; color: var(--text-soft); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Ledger rule signature ---------- */
.ledger-rule {
  width: 72px;
  height: 10px;
  margin: 18px 0 28px;
  border-bottom: 3px solid var(--gold);
  position: relative;
}
.ledger-rule::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 72px;
  height: 1px;
  background: var(--gold);
}
.ledger-rule.center { margin-left: auto; margin-right: auto; }
.ledger-rule.on-ink { border-color: var(--gold-light); }
.ledger-rule.on-ink::after { background: var(--gold-light); }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(200,162,74,0.25);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img { height: 44px; width: auto; }
.brand-text {
  font-family: var(--font-display);
  color: var(--text-on-ink);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  line-height: 1.1;
}
.brand-text span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-top: 2px;
}

nav.main-nav { display: flex; align-items: center; gap: 28px; }
nav.main-nav a {
  color: var(--text-on-ink);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  position: relative;
  padding: 4px 0;
}
nav.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
nav.main-nav a:hover::after,
nav.main-nav a.active::after { transform: scaleX(1); }
nav.main-nav a.active { color: var(--gold-light); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  width: 40px; height: 36px;
  cursor: pointer;
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { border-color: var(--gold); color: var(--gold-light); background: transparent; }
.btn-outline:hover { background: rgba(200,162,74,0.12); }
.btn-outline-dark { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline-dark:hover { background: rgba(11,11,12,0.06); }

/* ---------- Hero ---------- */
.hero {
  background: var(--ink);
  color: var(--text-on-ink);
  padding: 90px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero .container { position: relative; z-index: 2; max-width: 760px; }
.hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--gold-light);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 { color: var(--text-on-ink); }
.hero p.lede { color: #d9d3c4; }
.hero-actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }

.hero-bars {
  position: absolute;
  right: -40px; bottom: -20px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  opacity: 0.5;
  z-index: 1;
}
.hero-bars span {
  display: block;
  width: 22px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-deep));
}

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-alt { background: var(--cream-deep); }
.section-ink { background: var(--ink); color: var(--text-on-ink); }
.section-ink h2, .section-ink h3 { color: var(--text-on-ink); }
.section-ink p { color: #d9d3c4; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

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

.card {
  background: #fff;
  border: 1px solid rgba(11,11,12,0.08);
  padding: 32px 28px;
  border-radius: var(--radius);
}
.card .num {
  font-family: var(--font-mono);
  color: var(--gold-deep);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}
.card h3 { margin-top: 10px; }
.card a.card-link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--maroon);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}

.stat-strip {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  border-top: 1px solid rgba(200,162,74,0.3);
  border-bottom: 1px solid rgba(200,162,74,0.3);
  padding: 32px 0;
}
.stat { font-family: var(--font-mono); }
.stat .val { font-size: 1.8rem; color: var(--gold-light); display: block; }
.stat .label { font-size: 0.78rem; letter-spacing: 0.08em; color: #b9b2a0; text-transform: uppercase; }

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid rgba(11,11,12,0.12);
  padding: 22px 0;
}
.faq-item summary {
  font-family: var(--font-display);
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-body);
  color: var(--gold-deep);
  font-size: 1.4rem;
  margin-left: 16px;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .answer { margin-top: 14px; color: var(--text-soft); max-width: 720px; }

/* ---------- Blog ---------- */
.post-list { display: grid; gap: 24px; }
.post-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(11,11,12,0.1);
}
.post-card .date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}
.post-card h3 a { text-decoration: none; color: var(--ink); }
.post-card h3 a:hover { color: var(--maroon); }

article.post-body h2 { margin-top: 1.4em; }
article.post-body { max-width: 720px; }
article.post-body p, article.post-body li { color: var(--text); }
article.post-body blockquote {
  border-left: 3px solid var(--gold);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  color: var(--text-soft);
  font-style: italic;
}

/* ---------- Forms ---------- */
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(11,11,12,0.2);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.form-note {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 6px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #b9b2a0;
  padding: 56px 0 28px;
}
.site-footer h4 { color: var(--text-on-ink); font-family: var(--font-body); font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; }
.site-footer a { color: #d9d3c4; text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--gold-light); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(200,162,74,0.2);
  padding-top: 20px;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: #857c68;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stat-strip { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .nav-toggle { display: block; }
  nav.main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 18px;
    display: none;
    border-bottom: 1px solid rgba(200,162,74,0.25);
  }
  nav.main-nav.open { display: flex; }
  .post-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

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

:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
