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

:root {
  --forest:    #0D1F0F;
  --moss:      #4A7C59;
  --moss-lt:   #6BA87A;
  --gold:      #C9A84C;
  --gold-lt:   #DDB95A;
  --parchment: #F2ECD8;
  --bark:      #1E3320;
  --leaf:      #2D5C3A;
  --mist:      #F7F9F7;
  --ink:       #1A1A1A;
  --border:    rgba(74,124,89,0.28);
  --panel:     rgba(30,51,32,0.45);
  --green-accent: #3E9A5C;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--forest);
  color: var(--parchment);
  min-height: 100vh;
}

a { color: inherit; }

/* ── PROGRESS BAR ── */
.reading-progress-track {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: rgba(74,124,89,0.2); z-index: 200;
}
.reading-progress-fill {
  height: 100%; width: 0%; background: var(--gold);
  transition: width 0.1s linear;
}

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 3rem;
  background: rgba(13,31,15,0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 900;
  color: var(--parchment); text-decoration: none; letter-spacing: -0.02em;
}
.nav-logo span { color: var(--gold); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  color: rgba(242,236,216,0.7); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
}
.nav-links a:hover { color: var(--parchment); }
.nav-cta {
  background: var(--gold); color: var(--forest) !important;
  padding: 0.55rem 1.25rem; border-radius: 4px; font-weight: 600 !important;
}
.nav-cta:hover { background: var(--gold-lt); }

/* ── ARTICLE SHELL ── */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }

.category-pill {
  display: inline-block;
  font-family: 'DM Mono', monospace; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.3);
  border-radius: 2rem; padding: 0.3rem 0.9rem; margin-bottom: 1.25rem;
}

h1.article-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem); font-weight: 900; line-height: 1.15;
  letter-spacing: -0.02em; color: var(--parchment); margin-bottom: 1.25rem;
}

.article-meta {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-family: 'DM Mono', monospace; font-size: 0.75rem; color: rgba(242,236,216,0.5);
  padding-bottom: 1.75rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--border);
}
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(242,236,216,0.3); }
.article-byline strong { color: rgba(242,236,216,0.75); font-weight: 600; }

/* ── TABLE OF CONTENTS ── */
.toc-box {
  background: var(--bark); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.5rem 1.75rem; margin-bottom: 2.5rem;
}
.toc-title {
  font-family: 'DM Mono', monospace; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--moss-lt); margin-bottom: 0.9rem;
}
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.toc-list a {
  font-size: 0.88rem; color: rgba(242,236,216,0.65); text-decoration: none;
  transition: color 0.15s; display: inline-flex; align-items: center; gap: 0.5rem;
}
.toc-list a::before { content: '—'; color: rgba(242,236,216,0.25); }
.toc-list a:hover, .toc-list a.active { color: var(--gold); }
.toc-list a.active::before { color: var(--gold); }

/* ── ARTICLE BODY TYPOGRAPHY ── */
.article-body { font-size: 1.02rem; line-height: 1.85; color: rgba(242,236,216,0.85); }
.article-body h2 {
  font-family: 'Playfair Display', serif; font-size: 1.55rem; font-weight: 900;
  color: var(--parchment); letter-spacing: -0.01em; margin: 2.5rem 0 1rem; scroll-margin-top: 5rem;
}
.article-body h3 {
  font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700;
  color: var(--parchment); margin: 1.75rem 0 0.75rem; scroll-margin-top: 5rem;
}
.article-body p { margin-bottom: 1.25rem; }
.article-body strong { color: var(--parchment); font-weight: 700; }
.article-body em { color: var(--gold-lt); font-style: italic; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; }
.article-body li { line-height: 1.75; }
.article-body a.inline-link { color: var(--gold-lt); text-decoration: underline; text-decoration-color: rgba(201,168,76,0.4); }
.article-body a.inline-link:hover { text-decoration-color: var(--gold-lt); }
.article-body blockquote {
  border-left: 3px solid var(--gold); padding: 0.25rem 0 0.25rem 1.25rem; margin: 1.75rem 0;
  font-family: 'Playfair Display', serif; font-size: 1.15rem; font-style: italic; color: var(--parchment);
}
.article-body blockquote cite {
  display: block; font-family: 'Inter', sans-serif; font-style: normal; font-size: 0.8rem;
  color: var(--moss-lt); margin-top: 0.6rem;
}
.stat-callout {
  background: rgba(201,168,76,0.08); border: 1px solid rgba(201,168,76,0.3); border-radius: 10px;
  padding: 1.1rem 1.4rem; margin: 1.75rem 0; font-size: 0.95rem; line-height: 1.7;
}

/* ── SHARE ROW ── */
.share-row { display: flex; align-items: center; gap: 0.6rem; margin: 2rem 0; flex-wrap: wrap; }
.share-label { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(242,236,216,0.4); margin-right: 0.4rem; }
.share-btn {
  background: rgba(242,236,216,0.06); border: 1px solid var(--border); color: rgba(242,236,216,0.75);
  padding: 0.5rem 0.9rem; border-radius: 6px; font-size: 0.8rem; cursor: pointer; text-decoration: none;
  transition: all 0.15s; font-family: 'Inter', sans-serif;
}
.share-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── CALCULATOR WIDGET ── */
.calc-widget {
  background: var(--bark); border: 1px solid rgba(201,168,76,0.35); border-radius: 16px;
  padding: 2rem; margin: 2.5rem 0; scroll-margin-top: 5rem;
}
.calc-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.6rem;
}
.calc-title {
  font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 900; margin-bottom: 1.5rem;
}
.calc-inputs { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 1.75rem; }
.calc-input-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.calc-input-row label { font-size: 0.85rem; color: rgba(242,236,216,0.7); min-width: 150px; }
.calc-input-row input[type=range] { flex: 1; min-width: 140px; accent-color: var(--gold); height: 4px; cursor: pointer; }
.calc-val { font-family: 'DM Mono', monospace; font-size: 0.9rem; color: var(--gold); min-width: 5.5ch; text-align: right; }

.calc-results { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.75rem; }
.calc-bar-row { display: flex; align-items: center; gap: 0.75rem; }
.calc-bar-name { font-size: 0.78rem; color: rgba(242,236,216,0.6); min-width: 150px; font-weight: 500; }
.calc-bar-track { flex: 1; height: 30px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; position: relative; }
.calc-bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 0.6rem; transition: width 0.4s ease; min-width: 2px; }
.calc-bar-fill.freeroot { background: var(--gold); }
.calc-bar-fill.kdp { background: var(--moss); }
.calc-bar-fill.trad { background: #3a4a3c; }
.calc-bar-amt { font-family: 'DM Mono', monospace; font-size: 0.78rem; font-weight: 600; color: var(--forest); white-space: nowrap; }
.calc-bar-amt.dark { color: rgba(242,236,216,0.5); position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); }

.calc-gap {
  text-align: center; padding: 1.25rem; background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3); border-radius: 10px; margin-bottom: 1.5rem;
}
.calc-gap-label { font-size: 0.8rem; color: rgba(242,236,216,0.6); margin-bottom: 0.4rem; }
.calc-gap-num { font-family: 'Playfair Display', serif; font-size: 2.1rem; font-weight: 900; color: var(--gold); letter-spacing: -0.02em; }

.calc-cta-btn {
  display: block; text-align: center; width: 100%;
  background: var(--green-accent); color: #fff; padding: 0.95rem 1.5rem;
  border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.95rem;
  transition: all 0.2s; border: none; cursor: pointer; font-family: 'Inter', sans-serif;
}
.calc-cta-btn:hover { background: #339352; transform: translateY(-1px); }

/* ── CTA SECTION ── */
.cta-box {
  background: var(--forest); border: 2px solid var(--gold); border-radius: 16px;
  padding: 2.75rem 2rem; margin: 3rem 0 2.5rem; text-align: center;
  background-image: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,168,76,0.1) 0%, transparent 70%);
}
.cta-box h2 {
  font-family: 'Playfair Display', serif; font-size: 1.65rem; font-weight: 900;
  margin-bottom: 0.75rem; letter-spacing: -0.01em;
}
.cta-box p { font-size: 0.95rem; color: rgba(242,236,216,0.7); max-width: 46ch; margin: 0 auto 1.5rem; line-height: 1.7; }
.cta-actions { display: flex; align-items: center; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }
.cta-btn-primary {
  background: var(--gold); color: var(--forest); padding: 0.85rem 1.75rem; border-radius: 8px;
  text-decoration: none; font-weight: 700; font-size: 0.92rem; transition: all 0.2s;
}
.cta-btn-primary:hover { background: var(--gold-lt); }
.cta-btn-secondary { color: rgba(242,236,216,0.7); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.cta-btn-secondary:hover { color: var(--parchment); }

/* ── RELATED ARTICLES ── */
.related-section { margin-top: 2.5rem; }
.related-title {
  font-family: 'DM Mono', monospace; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--moss-lt); margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.related-card {
  background: var(--bark); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem;
  text-decoration: none; transition: border-color 0.2s, transform 0.2s; display: flex; flex-direction: column;
}
.related-card:hover { border-color: rgba(201,168,76,0.5); transform: translateY(-2px); }
.related-card-cat { font-family: 'DM Mono', monospace; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--moss-lt); margin-bottom: 0.5rem; }
.related-card-title { font-family: 'Playfair Display', serif; font-size: 0.98rem; font-weight: 700; color: var(--parchment); line-height: 1.35; }

/* ── FOOTER ── */
footer {
  background: #060f07; padding: 2.5rem 3rem; display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem; border-top: 1px solid var(--border);
}
.footer-logo { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 900; }
.footer-logo span { color: var(--gold); }
footer p { font-size: 0.75rem; color: rgba(242,236,216,0.35); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.75rem; color: rgba(242,236,216,0.4); text-decoration: none; }
.footer-links a:hover { color: var(--parchment); }

/* ── BLOG INDEX GRID ── */
.blog-header { padding: 4rem 3rem 2.5rem; text-align: center; }
.blog-header .section-eyebrow {
  font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem; display: flex; align-items: center; justify-content: center; gap: 0.6rem;
}
.blog-header .section-eyebrow::before, .blog-header .section-eyebrow::after { content: ''; width: 1.5rem; height: 1px; background: var(--gold); }
.blog-header h1 { font-family: 'Playfair Display', serif; font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.blog-header p { font-size: 0.95rem; color: rgba(242,236,216,0.62); max-width: 56ch; margin: 0 auto; line-height: 1.7; }

.blog-grid-wrap { max-width: 1100px; margin: 0 auto; padding: 0 3rem 5rem; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.75rem; }
.blog-card {
  background: var(--bark); border: 1px solid var(--border); border-radius: 14px; padding: 1.75rem;
  display: flex; flex-direction: column; text-decoration: none; transition: border-color 0.2s, transform 0.2s;
}
.blog-card:hover { border-color: rgba(201,168,76,0.5); transform: translateY(-3px); }
.blog-card-title {
  font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700; color: var(--parchment);
  line-height: 1.35; margin-bottom: 0.75rem;
}
.blog-card-desc { font-size: 0.85rem; color: rgba(242,236,216,0.55); line-height: 1.65; margin-bottom: 1.25rem; flex: 1; }
.blog-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.blog-card-time { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: rgba(242,236,216,0.4); }
.blog-card-link { color: var(--gold); font-size: 0.85rem; font-weight: 700; }

@media (max-width: 860px) {
  .related-grid { grid-template-columns: 1fr; }
  .calc-input-row label { min-width: 100%; }
}
@media (max-width: 768px) {
  nav { padding: 1rem 1.25rem; }
  .nav-links { gap: 0.75rem; }
  .nav-links a:not(.nav-cta) { display: none; }
  .article-wrap { padding: 2rem 1.25rem 4rem; }
  .blog-header { padding: 3rem 1.25rem 2rem; }
  .blog-grid-wrap { padding: 0 1.25rem 4rem; }
  .cta-box { padding: 2rem 1.25rem; }
  footer { flex-direction: column; align-items: flex-start; }
}
