/* =============================================================
   THE LEDGER — styles.css · v3 "premium fintech dashboard"
   Space Grotesk + Inter + IBM Plex Mono
   ============================================================= */

:root {
  --ink: #0a1628;
  --ink-2: #0e1d36;
  --ink-3: #14274a;
  --body: #3b4a63;
  --muted: #66748c;
  --line: #e3e9f2;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --brand: #059669;
  --brand-dark: #047857;
  --brand-soft: #d8f5e8;
  --accent: #a3e635;
  --sky: #38bdf8;
  --sky-soft: #dcf1fc;
  --gold: #f59e0b;
  --gold-soft: #fdeed3;
  --rose: #fb7185;
  --violet: #8b5cf6;
  --violet-soft: #ece6fd;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.05), 0 6px 16px rgba(10, 22, 40, 0.06);
  --shadow-md: 0 2px 6px rgba(10, 22, 40, 0.06), 0 18px 40px rgba(10, 22, 40, 0.11);
  --shadow-lg: 0 12px 28px rgba(10, 22, 40, 0.14), 0 36px 90px rgba(10, 22, 40, 0.20);
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  --wrap: 1200px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.045rem;
  line-height: 1.72;
  color: var(--body);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 0.55em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.8vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1.05em; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.container { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }

::selection { background: var(--accent); color: var(--ink); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* gradient headline helper */
.grad-text {
  background: linear-gradient(92deg, #a3e635 0%, #34d399 55%, #38bdf8 110%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- reading progress ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 120;
}

/* ---------- header / nav ---------- */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(10, 22, 40, 0.07);
}
.masthead-inner { display: flex; align-items: center; gap: 1.4rem; min-height: 72px; }
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--ink); letter-spacing: -0.02em; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .logo-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  box-shadow: 0 4px 12px rgba(10, 22, 40, 0.28);
  display: grid; place-items: center; flex: none;
}
.brand .logo-mark svg { width: 20px; height: 20px; }
.brand .tld { color: var(--brand); }

.mainnav { margin-left: auto; }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.3rem; align-items: center; }
.mainnav a {
  display: inline-block; padding: 0.52rem 0.9rem; border-radius: 999px;
  color: var(--body); font-weight: 500; font-size: 0.96rem;
}
.mainnav a:hover { background: rgba(10, 22, 40, 0.06); color: var(--ink); text-decoration: none; }
.mainnav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.nav-cta { flex: none; }
.nav-toggle {
  display: none; margin-left: auto;
  background: var(--ink); color: #fff; border: 0; border-radius: 11px;
  font: 600 0.95rem var(--font-body); padding: 0.6rem 0.95rem; cursor: pointer;
}
@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; }
  .nav-cta { display: none; }
  .mainnav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none; padding: 0.6rem 1rem 1rem;
  }
  .mainnav.is-open { display: block; }
  .mainnav ul { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .mainnav a { display: block; padding: 0.8rem 0.95rem; border-radius: 12px; font-size: 1.06rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  background: linear-gradient(135deg, #10b981 0%, var(--brand-dark) 100%);
  color: #fff; font: 600 1.02rem var(--font-body);
  padding: 0.92rem 1.7rem; border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 8px 22px rgba(5, 150, 105, 0.38), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn::after { content: "→"; font-weight: 700; transition: transform 0.18s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(5, 150, 105, 0.46), inset 0 1px 0 rgba(255,255,255,0.25); text-decoration: none; filter: brightness(1.05); }
.btn:hover::after { transform: translateX(3px); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1.5px solid rgba(10, 22, 40, 0.24); box-shadow: none;
}
.btn-ghost::after { content: none; }
.btn-ghost:hover { background: rgba(10, 22, 40, 0.05); box-shadow: none; color: var(--ink); }
.btn-sm { padding: 0.6rem 1.2rem; font-size: 0.93rem; }
.btn-sm::after { content: none; }
.on-dark .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.38); }
.on-dark .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  background: #ffffff;
  color: var(--body);
  overflow: clip;
  border-bottom: 1px solid var(--line);
}
.hero-blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
  pointer-events: none; will-change: transform;
}
.hb-1 { width: 560px; height: 560px; left: -160px; top: -220px; background: radial-gradient(circle, #6ee7b7 0%, transparent 68%); animation: drift 16s ease-in-out infinite alternate; }
.hb-2 { width: 520px; height: 520px; right: -140px; top: -180px; background: radial-gradient(circle, #7dd3fc 0%, transparent 68%); animation: drift 20s ease-in-out infinite alternate-reverse; }
.hb-3 { width: 460px; height: 460px; left: 40%; bottom: -300px; background: radial-gradient(circle, #c4b5fd 0%, transparent 68%); animation: drift 24s ease-in-out infinite alternate; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(60px, 40px, 0) scale(1.12); }
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(10,22,40,0.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(10,22,40,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(1000px 640px at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(1000px 640px at 50% 0%, #000 0%, transparent 78%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.02fr 0.98fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(3.2rem, 7vw, 5.6rem) 0 clamp(3.4rem, 7vw, 5.6rem);
}
.hero h1 { color: var(--ink); margin-bottom: 0.5em; }
.hero .lede { font-size: clamp(1.1rem, 1.9vw, 1.26rem); line-height: 1.65; color: var(--muted); max-width: 34rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--brand-soft); border: 1px solid rgba(5, 150, 105, 0.25);
  color: var(--brand-dark); font: 600 0.86rem var(--font-body);
  padding: 0.45rem 1rem; border-radius: 999px; margin-bottom: 1.4rem;
  letter-spacing: 0.02em;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px rgba(5,150,105,0.5); animation: pulse 2s ease-out infinite; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.8rem; }
.hero-trust {
  display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2rem;
  font-size: 0.92rem; color: var(--muted);
}
.hero-trust span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-trust svg { width: 17px; height: 17px; flex: none; }

/* hero: fake app dashboard (light card) */
.hero-visual { position: relative; }
.dash {
  position: relative; z-index: 1;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: clip;
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.dash-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.dash-bar i { width: 11px; height: 11px; border-radius: 50%; }
.dash-bar i:nth-child(1) { background: #fb7185; }
.dash-bar i:nth-child(2) { background: #fbbf24; }
.dash-bar i:nth-child(3) { background: #34d399; }
.dash-bar span {
  margin-left: 0.6rem; font: 500 0.8rem var(--font-mono); color: var(--muted);
  background: #eef2f8; border-radius: 8px; padding: 0.25rem 0.8rem;
}
.dash-body { padding: 1.3rem 1.4rem 1.5rem; }
.dash-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-bottom: 1.2rem; }
.kpi {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 14px; padding: 0.85rem 1rem;
}
.kpi .k { font: 500 0.76rem var(--font-body); color: var(--muted); margin: 0 0 0.15rem; }
.kpi .v { font: 600 1.45rem var(--font-mono); color: var(--ink); margin: 0; letter-spacing: -0.02em; }
.kpi .v small { font-size: 0.6em; color: var(--muted); }
.kpi .up { color: var(--brand-dark); font: 600 0.78rem var(--font-body); }
.kpi .down { color: var(--rose); font: 600 0.78rem var(--font-body); }
.dash-chart { margin: 0.4rem 0 1rem; }
.dash-split { display: flex; align-items: center; gap: 1.1rem; }
.dash-split .legend { font-size: 0.85rem; line-height: 2; color: var(--body); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.5rem; }
.legend .pct { font-family: var(--font-mono); color: var(--ink); }

.gc-chip {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 600 0.9rem var(--font-body);
  border-radius: 999px; padding: 0.6rem 1.05rem;
  box-shadow: var(--shadow-md);
  animation: floaty 6s ease-in-out infinite;
}
.gc-chip.save { bottom: -18px; left: -14px; background: #eafcee; border: 1px solid rgba(5,150,105,0.3); color: var(--brand-dark); animation-delay: 1.2s; }
.gc-chip.rate { top: -16px; right: -10px; background: var(--sky-soft); border: 1px solid rgba(2,132,199,0.3); color: #0284c7; animation-delay: 0.5s; }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; margin-top: 0.5rem; }
  .gc-chip.save { left: 0; }
  .gc-chip.rate { right: 0; }
}

/* ---------- ad slots ---------- */
.ad-slot {
  display: grid; place-items: center;
  border: 1.5px dashed rgba(10, 22, 40, 0.15);
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, rgba(10,22,40,0.02) 0 12px, transparent 12px 24px);
  color: var(--muted); font: 500 0.74rem var(--font-body);
  letter-spacing: 0.14em; text-transform: uppercase;
  margin: 1.7rem 0;
}
.ad-slot::before { content: "Advertisement"; padding: 0.4rem; }
.ad-leaderboard { min-height: 100px; }
.ad-incontent { min-height: 260px; }
.ad-footer { min-height: 110px; }
.ad-sidebar { min-height: 600px; margin: 0; position: sticky; top: 96px; }

/* ---------- sections ---------- */
.section { padding: clamp(3.2rem, 7vw, 5.6rem) 0; }
.section-tint {
  background: radial-gradient(800px 400px at 10% 0%, rgba(16, 185, 129, 0.07), transparent 60%),
              radial-gradient(700px 380px at 95% 100%, rgba(56, 189, 248, 0.08), transparent 60%);
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: clamp(1.2rem, 2.4vw, 1.8rem);
}
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; white-space: nowrap; }
.section-sub { color: var(--muted); max-width: 48rem; margin: 0 0 2.4rem; font-size: 1.08rem; }
.kicker {
  font: 700 0.8rem var(--font-body); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand-dark); margin: 0 0 0.7rem;
}
.rule { border: 0; height: 1px; background: var(--line); margin: 0; }

/* ---------- tool cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 1020px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } }

.tool-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex; flex-direction: column;
  overflow: clip;
}
.tool-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--tc, linear-gradient(90deg, var(--brand), var(--accent)));
}
.tc-emerald { --tc: linear-gradient(90deg, #059669, #a3e635); }
.tc-sky { --tc: linear-gradient(90deg, #0284c7, #7dd3fc); }
.tc-violet { --tc: linear-gradient(90deg, #6d28d9, #c4b5fd); }
.tc-gold { --tc: linear-gradient(90deg, #b45309, #fcd34d); }
.tool-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.tool-icon {
  width: 58px; height: 58px; border-radius: 16px;
  display: grid; place-items: center; margin-bottom: 1.15rem;
}
.tool-icon svg { width: 29px; height: 29px; }
.ti-emerald { background: var(--brand-soft); color: #047857; }
.ti-sky { background: var(--sky-soft); color: #0284c7; }
.ti-violet { background: var(--violet-soft); color: #6d28d9; }
.ti-gold { background: var(--gold-soft); color: #b45309; }
.tool-card h3 { margin-bottom: 0.45rem; font-size: 1.18rem; }
.tool-card h3 a { color: var(--ink); }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tool-card h3 a:hover { text-decoration: none; }
.tool-card p { font-size: 0.95rem; color: var(--muted); line-height: 1.6; margin-bottom: 1.15rem; }
.tool-num { display: none; }
.tool-go {
  margin-top: auto; font: 600 0.94rem var(--font-body); color: var(--brand-dark);
  display: inline-flex; align-items: center; gap: 0.35rem;
  transition: gap 0.18s ease;
}
.tool-card:hover .tool-go { gap: 0.7rem; }

/* ---------- how it works steps ---------- */
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .step-grid { grid-template-columns: 1fr; } }
.step {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.9rem 1.6rem 1.6rem; box-shadow: var(--shadow-sm);
}
.step-num {
  position: absolute; top: -18px; left: 1.4rem;
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font: 700 1.05rem var(--font-display); color: #fff;
  box-shadow: var(--shadow-sm);
}
.step:nth-child(1) .step-num { background: linear-gradient(135deg, #10b981, #047857); }
.step:nth-child(2) .step-num { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.step:nth-child(3) .step-num { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.step h3 { margin-top: 0.4rem; font-size: 1.15rem; }
.step p { font-size: 0.96rem; color: var(--muted); margin: 0; }

/* ---------- comparison chart ---------- */
.compare-card {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(1.6rem, 4vw, 3rem);
  align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.8rem); box-shadow: var(--shadow-md);
}
@media (max-width: 900px) { .compare-card { grid-template-columns: 1fr; } }
.compare-card h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
.compare-card .big-saving {
  font: 600 clamp(2rem, 4vw, 2.8rem) var(--font-mono); color: var(--brand-dark);
  letter-spacing: -0.02em;
}
.bars { display: grid; gap: 1.1rem; }
.bar-row .bar-label { display: flex; justify-content: space-between; font: 600 0.9rem var(--font-body); color: var(--ink); margin-bottom: 0.4rem; }
.bar-row .bar-label .val { font-family: var(--font-mono); }
.bar-track { height: 26px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: clip; }
.bar-fill { height: 100%; border-radius: 999px; width: var(--w, 50%); transition: width 1s ease; }
.bf-rose { background: linear-gradient(90deg, #fb7185, #f43f5e); }
.bf-emerald { background: linear-gradient(90deg, #34d399, #059669); }
.bar-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }

/* ---------- numbers strip ---------- */
.numbers {
  position: relative; overflow: clip;
  background: #ffffff;
  color: var(--body);
  padding: clamp(2.8rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.numbers::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 15% 0%, rgba(16, 185, 129, 0.06), transparent 60%),
              radial-gradient(600px 300px at 85% 100%, rgba(56, 189, 248, 0.06), transparent 60%);
}
.numbers .container { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
@media (max-width: 900px) { .numbers .container { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .numbers .container { grid-template-columns: 1fr; text-align: center; } }
.num {
  font: 600 clamp(2.2rem, 4.2vw, 3.1rem) var(--font-mono);
  color: var(--brand-dark); letter-spacing: -0.02em; line-height: 1.1;
}
.num-label { margin-top: 0.45rem; font-size: 0.94rem; color: var(--muted); }

/* ---------- guide previews ---------- */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .article-grid { grid-template-columns: 1fr; } }
.preview {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 0 1.5rem; overflow: clip;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.preview:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.preview-art { height: 150px; display: block; width: 100%; }
.preview .kicker { margin: 1.15rem 1.5rem 0.45rem; }
.preview h3 { font-size: 1.16rem; margin: 0 1.5rem 0.55rem; line-height: 1.3; }
.preview h3 a { color: var(--ink); }
.preview h3 a::after { content: ""; position: absolute; inset: 0; }
.preview h3 a:hover { text-decoration: none; }
.preview p { margin: 0 1.5rem 0.6rem; font-size: 0.95rem; color: var(--muted); line-height: 1.6; }
.preview .byline { margin: 0 1.5rem; font: 600 0.83rem var(--font-body); color: var(--brand-dark); }

/* ---------- CALCULATOR pages ---------- */
.article-hero { padding-top: clamp(2rem, 4vw, 3rem); }
.article-hero h1 { margin-bottom: 0.35em; font-size: clamp(2.1rem, 4.6vw, 3.1rem); }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center;
  color: var(--muted); font-size: 0.92rem;
}
.page-icon {
  width: 62px; height: 62px; border-radius: 18px;
  display: grid; place-items: center; margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.page-icon svg { width: 31px; height: 31px; }

.calc {
  display: grid; grid-template-columns: 1.04fr 0.96fr; gap: 1.4rem;
  align-items: start;
}
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }

.calc form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem 1.6rem;
  box-shadow: var(--shadow-sm);
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.4rem; }
@media (max-width: 520px) { .calc-grid { grid-template-columns: 1fr; } }

.field label {
  display: block; font: 600 0.87rem var(--font-body); color: var(--ink);
  margin-bottom: 0.42rem;
}
.field input[type="text"], .field select {
  width: 100%; padding: 0.75rem 0.9rem;
  font: 600 1.05rem var(--font-mono); color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input[type="text"]:focus, .field select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15);
}
.field .hint { font-size: 0.8rem; color: var(--muted); margin: 0.35rem 0 0; line-height: 1.45; }

.field input[type="range"] {
  width: 100%; margin: 0.6rem 0 0; appearance: none; -webkit-appearance: none;
  height: 7px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-soft), var(--line));
  cursor: pointer;
}
.field input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 4px solid var(--brand);
  box-shadow: 0 2px 8px rgba(10, 22, 40, 0.3);
}
.field input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 4px solid var(--brand);
  box-shadow: 0 2px 8px rgba(10, 22, 40, 0.3);
}

.live-note {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font: 500 0.87rem var(--font-body); color: var(--muted); margin: 1.3rem 0 0;
}
.live-note .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* results card (light, brand-tinted) */
.calc-results {
  position: sticky; top: 96px;
  background: linear-gradient(160deg, #f2fbf6 0%, #eef8fd 100%);
  border: 1.5px solid rgba(5, 150, 105, 0.18);
  color: var(--body);
  border-radius: var(--radius); padding: 1.8rem 1.7rem;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 860px) { .calc-results { position: static; } }
.result-label {
  font: 600 0.78rem var(--font-body); letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 0.35rem;
}
.result-value {
  font: 600 clamp(2.4rem, 4.8vw, 3.2rem) var(--font-mono);
  color: var(--ink); margin: 0; letter-spacing: -0.02em; line-height: 1.08;
}
.result-value.is-bad { color: #e11d48; font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.35; font-family: var(--font-body); font-weight: 700; }

.donut-wrap { display: flex; align-items: center; gap: 1.4rem; margin: 1.5rem 0 0.4rem; min-height: 132px; }
.donut-wrap svg { flex: none; filter: drop-shadow(0 6px 14px rgba(10,22,40,0.12)); }
.donut-legend { font-size: 0.9rem; line-height: 2.05; color: var(--body); }
.donut-legend .pct { font-family: var(--font-mono); color: var(--ink); font-weight: 600; }

.result-rows { margin-top: 1.15rem; border-top: 1px solid rgba(10, 22, 40, 0.1); }
.result-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.65rem 0; border-bottom: 1px dashed rgba(10, 22, 40, 0.1);
  font-size: 0.94rem;
}
.result-row .k { color: var(--muted); }
.result-row .v { font-family: var(--font-mono); font-weight: 600; color: var(--ink); white-space: nowrap; }

/* ---------- article layout & sidebar ---------- */
.article-layout { display: block; }
@media (min-width: 1024px) {
  .article-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.4rem;
    align-items: start;
  }
  .article-sidebar { position: sticky; top: 96px; }
}
@media (max-width: 1023px) { .article-sidebar { display: none; } }

/* ---------- prose ---------- */
.prose { max-width: 46rem; margin-top: 2.8rem; }
.prose h2 { font-size: clamp(1.5rem, 2.7vw, 1.9rem); margin-top: 2.2em; }
.prose h2::before {
  content: ""; display: block; width: 48px; height: 5px; border-radius: 5px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  margin-bottom: 0.9rem;
}
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.dropcap::first-letter {
  font-family: var(--font-display); font-weight: 700;
  font-size: 3.4em; line-height: 0.85; color: var(--brand-dark);
  float: left; padding: 0.06em 0.12em 0 0;
}
.pullquote {
  margin: 2.1rem 0; padding: 1.5rem 1.7rem;
  background: linear-gradient(135deg, var(--brand-soft), #eafcf3);
  border-left: 6px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-display); font-size: 1.24rem; line-height: 1.45;
  color: var(--ink); font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.pullquote cite { display: block; margin-top: 0.7rem; font: 600 0.84rem var(--font-body); color: var(--brand-dark); font-style: normal; }
.note {
  background: var(--gold-soft); border: 1px solid #f3dfb3; border-radius: var(--radius-sm);
  padding: 1.05rem 1.25rem; font-size: 0.96rem; margin: 1.5rem 0;
}

/* tables */
.prose table {
  width: 100%; border-collapse: collapse; margin: 1.6rem 0;
  font-size: 0.95rem; background: var(--surface);
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.prose th {
  background: var(--ink); color: #fff; text-align: left;
  font: 600 0.86rem var(--font-body); padding: 0.8rem 1rem;
}
.prose td { padding: 0.75rem 1rem; border-top: 1px solid var(--line); }
.prose tbody tr:nth-child(even) { background: #f8fafc; }
.prose td:not(:first-child) { font-family: var(--font-mono); font-size: 0.89rem; }

/* FAQ */
.faq { margin: 1rem 0 0; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 0.7rem; overflow: clip;
  transition: border-color 0.15s ease;
}
.faq details[open] { border-color: rgba(5, 150, 105, 0.4); box-shadow: var(--shadow-sm); }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.05rem 1.25rem;
  font: 600 1.01rem var(--font-body); color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 700; transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p, .faq details > div { padding: 0 1.25rem 1.15rem; margin: 0; font-size: 0.97rem; }

/* related links */
.related {
  margin: 2.8rem 0 1rem; padding: 1.6rem 1.7rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.related h2, .related h3 { font-size: 1.16rem; margin-bottom: 0.85rem; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { padding: 0.48rem 0; border-bottom: 1px dashed var(--line); }
.related li:last-child { border-bottom: 0; }
.related a { font-weight: 600; }
.related a::before { content: "→ "; color: var(--brand); }

/* ---------- subscribe band ---------- */
.subscribe {
  position: relative; overflow: clip;
  background: linear-gradient(135deg, #eafcf1 0%, #eaf7fd 100%);
  color: var(--body); text-align: center;
  padding: clamp(3.2rem, 6vw, 4.8rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.subscribe h2 { color: var(--ink); }
.subscribe h2 em { font-style: normal; color: var(--brand-dark); }
.subscribe p { max-width: 40rem; margin: 0 auto 1.5rem; color: var(--muted); }
.subscribe-form { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; max-width: 500px; margin: 0 auto; }
.subscribe-form input {
  flex: 1 1 240px; padding: 0.85rem 1.15rem;
  font: 500 1rem var(--font-body); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
}
.subscribe-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(5,150,105,0.14); }
.form-msg { margin-top: 0.9rem; color: var(--brand-dark); font-weight: 600; min-height: 1.4em; }

/* ---------- footer ---------- */
.footer { background: #f8fafc; color: var(--muted); padding: clamp(2.8rem, 5vw, 3.8rem) 0 1.6rem; font-size: 0.95rem; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.brand-foot { font-family: var(--font-display); font-weight: 700; font-size: 1.28rem; color: var(--ink); margin: 0; }
.footer h4 { color: var(--ink); font: 600 0.82rem var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.9rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 0.32rem 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--brand-dark); }
.footer-legal {
  margin-top: 2.4rem; padding-top: 1.3rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem;
  font-size: 0.85rem;
}

/* ---------- reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.75s ease, transform 0.75s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .tool-card, .preview { transition: none; }
  .live-note .pulse, .hero-badge .dot { animation: none; }
  .dash, .gc-chip { animation: none; }
  .hero-blob { animation: none; }
  .bar-fill { transition: none; }
}

/* wrappers */
.result-primary { margin: 0; }
.num-cell { position: relative; }

.calc-disclaimer {
  grid-column: 1 / -1;
  font-size: 0.8rem; color: var(--muted); line-height: 1.55;
  margin: 0.4rem 0 0;
}
