/* CrunchFigure — shared stylesheet
   Bright, modern fintech look: white space, soft rounded cards, gentle shadows,
   a fresh emerald accent, and light mint result cards with monospace figures. */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --surface: #F5F8F7;
  --surface-2: #EFF5F2;
  --card: #FFFFFF;
  --ink: #15242C;
  --ink-soft: #5C6B72;
  --ink-faint: #93A0A6;
  --line: #E8EDEF;
  --line-strong: #D7DFE2;
  --brand: #0EA47A;
  --brand-deep: #0A7E5E;
  --brand-bright: #12C28F;
  --brand-wash: #E7F8F1;
  --brand-wash-2: #F1FBF7;
  --gold: #C58A2E;
  --positive: #0EA47A;
  --negative: #E0654F;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,40,34,.04), 0 2px 6px rgba(16,40,34,.05);
  --shadow: 0 6px 16px rgba(16,40,34,.06), 0 16px 40px rgba(16,40,34,.05);
  --shadow-brand: 0 10px 30px rgba(14,164,122,.18);
}

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

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

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

a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.24rem;
  color: var(--ink);
  letter-spacing: -.02em;
  display: flex; align-items: center; gap: 10px;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(145deg, var(--brand-bright), var(--brand-deep));
  display: inline-grid; place-items: center;
  color: #fff; font-family: var(--mono); font-size: .82rem; font-weight: 600;
  box-shadow: var(--shadow-brand);
}
.nav { display: flex; gap: 26px; align-items: center; }
.nav a {
  color: var(--ink-soft); font-size: .94rem; font-weight: 500;
}
.nav a:hover { color: var(--brand-deep); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; align-items: stretch;
    background: var(--card); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
    box-shadow: var(--shadow);
  }
  .nav.open { max-height: 320px; }
  .nav a { padding: 15px 22px; border-top: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
.hero { padding: 76px 0 48px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -160px; right: -120px;
  width: 540px; height: 540px; border-radius: 50%;
  background: radial-gradient(circle, rgba(18,194,143,.16), rgba(14,164,122,0) 68%);
  z-index: 0; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; bottom: -200px; left: -140px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(18,194,143,.08), rgba(14,164,122,0) 70%);
  z-index: 0; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow {
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--brand-deep);
  background: var(--brand-wash); display: inline-block;
  padding: 6px 13px; border-radius: 100px; margin: 0 0 20px;
}
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.1rem, 5.2vw, 3.4rem); line-height: 1.06;
  letter-spacing: -.03em; margin: 0 0 20px; max-width: 17ch; color: var(--ink);
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--brand-bright), var(--brand-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  font-size: 1.15rem; color: var(--ink-soft); max-width: 56ch; margin: 0 0 28px;
}

/* ---------- Section label ---------- */
.section-label {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Tool grid ---------- */
.tool-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
  margin: 0 0 60px;
}
@media (max-width: 680px) { .tool-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: block; box-shadow: var(--shadow-sm);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.tool-card:hover {
  text-decoration: none; border-color: rgba(14,164,122,.35);
  transform: translateY(-3px); box-shadow: var(--shadow);
}
.tool-card .tag {
  font-family: var(--mono); font-size: .72rem; color: var(--brand-deep);
  background: var(--brand-wash); padding: 4px 10px; border-radius: 100px;
  display: inline-block; margin-bottom: 16px;
}
.tool-card h3 {
  font-family: var(--display); font-weight: 600; font-size: 1.26rem;
  margin: 0 0 9px; color: var(--ink); letter-spacing: -.015em;
}
.tool-card p { margin: 0; color: var(--ink-soft); font-size: .96rem; }
.tool-card .go {
  margin-top: 18px; font-family: var(--mono); font-size: .82rem;
  color: var(--brand-deep); font-weight: 500;
}

/* ---------- Calculator page ---------- */
.tool-head { padding: 52px 0 8px; }
.tool-head .crumb {
  font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); margin-bottom: 18px;
}
.tool-head h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -.025em; margin: 0 0 14px; max-width: 22ch;
}
.tool-head p.lead { font-size: 1.06rem; color: var(--ink-soft); max-width: 60ch; margin: 0; }

.calc {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin: 30px 0 0; box-shadow: var(--shadow);
}
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }

.calc-inputs { padding: 32px; }

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block; font-size: .89rem; font-weight: 500; color: var(--ink);
  margin-bottom: 8px;
}
.field .hint { font-weight: 400; color: var(--ink-faint); font-size: .82rem; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .adorn {
  position: absolute; font-family: var(--mono); color: var(--ink-faint); font-size: .9rem;
}
.input-wrap .adorn.pre { left: 13px; }
.input-wrap .adorn.post { right: 13px; }
.field input[type="number"], .field input[type="text"], .field input[type="date"],
.field input[type="month"], .field select {
  width: 100%; font-family: var(--mono); font-size: .98rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 13px; transition: border-color .15s, box-shadow .15s;
}
.field input.pad-pre { padding-left: 27px; }
.field input.pad-post { padding-right: 40px; }
.field input:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }

.calc-btn {
  width: 100%; margin-top: 26px; font-family: var(--display); font-weight: 600;
  font-size: 1rem; color: #fff; border: 0; border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--brand-bright), var(--brand));
  padding: 14px; cursor: pointer; box-shadow: var(--shadow-brand);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.calc-btn:hover { transform: translateY(-1px); filter: brightness(1.03); box-shadow: 0 14px 34px rgba(14,164,122,.26); }

/* Result readout — now a bright mint card (the signature) */
.calc-result {
  padding: 32px; color: var(--ink);
  background: linear-gradient(165deg, var(--brand-wash-2) 0%, var(--brand-wash) 100%);
  border-left: 1px solid var(--line);
  position: relative;
}
@media (max-width: 760px) { .calc-result { border-left: 0; border-top: 1px solid var(--line); } }
.calc-result::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand-bright), var(--brand-deep));
}
.calc-result .result-label {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--brand-deep); margin: 0 0 8px;
}
.calc-result .result-figure {
  font-family: var(--mono); font-weight: 600; font-size: clamp(2rem, 5.4vw, 2.8rem);
  line-height: 1.08; color: var(--brand-deep); margin: 0 0 5px; letter-spacing: -.02em;
}
.calc-result .result-figure.positive { color: var(--brand); }
.calc-result .result-sub { font-size: .92rem; color: var(--ink-soft); margin: 0 0 24px; }
.result-divider { height: 1px; background: rgba(10,126,94,.14); margin: 20px 0; }
.result-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0; font-size: .91rem; gap: 16px;
}
.result-line .k { color: var(--ink-soft); }
.result-line .v { font-family: var(--mono); color: var(--ink); font-weight: 600; white-space: nowrap; }
.result-note {
  margin-top: 20px; font-size: .82rem; color: var(--ink-faint); line-height: 1.55;
}
.result-empty { color: var(--ink-faint); font-size: .92rem; }

/* ---------- Prose / content ---------- */
.prose { max-width: 720px; margin: 56px auto 0; }
.prose h2 {
  font-family: var(--display); font-weight: 600; font-size: 1.55rem; letter-spacing: -.02em;
  margin: 44px 0 16px; color: var(--ink);
}
.prose h3 {
  font-family: var(--display); font-weight: 600; font-size: 1.16rem;
  margin: 30px 0 10px; color: var(--ink);
}
.prose p { margin: 0 0 17px; color: #2C3940; }
.prose ul, .prose ol { margin: 0 0 17px; padding-left: 22px; color: #2C3940; }
.prose li { margin-bottom: 9px; }
.prose code {
  font-family: var(--mono); font-size: .88em; background: var(--surface-2);
  padding: 2px 6px; border-radius: 5px; color: var(--brand-deep);
}
.prose .formula {
  font-family: var(--mono); font-size: .92rem;
  background: var(--brand-wash-2);
  border: 1px solid var(--brand-wash); border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 0 0 17px; color: var(--ink);
  overflow-x: auto; line-height: 1.7;
}
.faq-item { border-top: 1px solid var(--line); padding: 20px 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 8px; font-size: 1.06rem; font-family: var(--display); font-weight: 600; }
.faq-item p { margin: 0; color: var(--ink-soft); }

.disclaimer-box {
  background: #FBF6EC; border: 1px solid #ECDFC4; border-radius: var(--radius-sm);
  padding: 17px 19px; margin: 30px 0; font-size: .88rem; color: #6B5A33; line-height: 1.6;
}
.disclaimer-box strong { color: #5A4A26; }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 40px auto; max-width: 728px; min-height: 96px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  color: var(--ink-faint); font-family: var(--mono); font-size: .75rem;
  text-align: center; line-height: 1.6;
}
.ad-slot.in-content { max-width: 720px; }

/* ---------- Related ---------- */
.related { margin: 64px 0 0; }
.related .tool-grid { margin-bottom: 0; }

/* ---------- Footer (light) ---------- */
.site-footer {
  margin-top: 80px; background: var(--surface); color: var(--ink-soft);
  border-top: 1px solid var(--line); padding: 56px 0 36px;
}
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
@media (max-width: 680px) { .site-footer .wrap { grid-template-columns: 1fr; gap: 28px; } }
.site-footer .brand-f {
  font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 1.15rem; margin-bottom: 12px;
}
.site-footer p { font-size: .9rem; margin: 0 0 8px; max-width: 42ch; color: var(--ink-soft); }
.site-footer h4 {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 16px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--ink-soft); font-size: .92rem; }
.site-footer a:hover { color: var(--brand-deep); }
.footer-base {
  border-top: 1px solid var(--line); margin-top: 40px; padding-top: 22px;
  font-size: .82rem; color: var(--ink-faint);
}

/* ---------- Generic page (legal/about) ---------- */
.page-narrow { max-width: 760px; margin: 0 auto; padding: 56px 0 0; }
.page-narrow h1 {
  font-family: var(--display); font-weight: 700; font-size: 2.1rem; letter-spacing: -.025em;
  margin: 0 0 8px;
}
.page-narrow .updated { font-family: var(--mono); font-size: .82rem; color: var(--ink-faint); margin: 0 0 30px; }

/* ---------- Button row (Calculate + Reset) ---------- */
.btn-row { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.btn-row .calc-btn { margin-top: 0; }
.btn-row .calc-btn.primary { flex: 1 1 200px; }
.calc-btn.secondary {
  flex: 0 0 auto;
  background: var(--card); color: var(--brand-deep);
  border: 1px solid var(--line-strong); box-shadow: none;
}
.calc-btn.secondary:hover {
  background: var(--brand-wash); filter: none; transform: none;
  box-shadow: none; border-color: rgba(14,164,122,.4);
}
