:root {
  --bg: #f4f7fb;
  --bg-grad-a: #eef3fb;
  --bg-grad-b: #f6f4ff;
  --card: #ffffff;
  --ink: #0f1b33;
  --muted: #65728c;
  --faint: #8a96ac;
  --line: #e7ecf4;
  --line-soft: #eef2f8;

  --brand: #0b8a5b;
  --brand-2: #0aa06a;
  --brand-dark: #066a45;
  --brand-soft: #e8f7f0;

  /* breakdown palette */
  --c-takehome: #0bb273;
  --c-pretax: #14b8c4;
  --c-federal: #5b6ef5;
  --c-fica: #f5a524;
  --c-state: #f25f8a;

  --shadow-sm: 0 1px 2px rgba(15, 27, 51, .04), 0 2px 8px rgba(15, 27, 51, .05);
  --shadow-lg: 0 8px 30px rgba(15, 27, 51, .09), 0 2px 8px rgba(15, 27, 51, .05);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 15% -10%, var(--bg-grad-a), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, var(--bg-grad-b), transparent 55%);
  background-attachment: fixed;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid var(--line);
}
.site-header > div {
  max-width: 880px; margin: 0 auto; padding: 13px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand .coin {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-2), var(--brand-dark));
  display: inline-grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(11, 138, 91, .4);
}
.site-header nav a { margin-left: 18px; color: var(--muted); font-weight: 600; font-size: 14px; }
.site-header nav a:hover { color: var(--brand-dark); text-decoration: none; }

/* ---------- layout ---------- */
main { max-width: 880px; margin: 0 auto; padding: 0 20px 56px; }
.hero { padding: 40px 0 8px; text-align: center; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 12px; }
.hero .lede { max-width: 560px; margin: 0 auto 8px; }
h2 { font-size: 23px; letter-spacing: -.02em; margin: 40px 0 12px; }
.lede { color: var(--muted); font-size: 18px; margin: 0 0 20px; }

.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 16px 0 26px; color: var(--faint); font-size: 13px; font-weight: 500; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust span::before { content: "✓"; color: var(--brand); font-weight: 800; }

.note { background: #fff8ec; border: 1px solid #ffe6b8; padding: 11px 14px; border-radius: 12px; font-size: 14px; color: #8a6500; }
.fineprint { color: var(--faint); font-size: 13px; }
section > p, section > ul { color: #33415c; }
ul { padding-left: 20px; } li { margin: 4px 0; }

/* ---------- calculator card ---------- */
.calc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-lg); text-align: left; max-width: 620px; margin: 0 auto;
}
.field { display: flex; flex-direction: column; margin-bottom: 15px; flex: 1; min-width: 0; }
.row { display: flex; gap: 14px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
input, select {
  font: inherit; font-size: 16px; padding: 12px 13px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fcfdff; color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover { border-color: #d4dcea; }
input:focus, select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-soft); background: #fff; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2365728c' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix span { position: absolute; left: 13px; color: var(--faint); font-weight: 600; pointer-events: none; }
.input-prefix input { padding-left: 26px; font-variant-numeric: tabular-nums; }

/* ---------- results ---------- */
.results { margin-top: 20px; }
.headline {
  background: linear-gradient(135deg, var(--brand-soft), #f0fbf6);
  border: 1px solid #cdeede; border-radius: 14px; padding: 18px 20px; margin-bottom: 18px;
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px;
}
.headline .label { font-size: 13px; color: var(--brand-dark); font-weight: 700; }
.headline .amount { font-size: clamp(32px, 7vw, 44px); font-weight: 800; letter-spacing: -.03em; color: var(--brand-dark); font-variant-numeric: tabular-nums; line-height: 1; }
.headline .sub { width: 100%; color: var(--brand-dark); opacity: .8; font-size: 13px; font-weight: 600; }

.bar { display: flex; height: 16px; border-radius: 10px; overflow: hidden; margin: 4px 0 16px; box-shadow: inset 0 0 0 1px rgba(15,27,51,.04); }
.bar .seg { height: 100%; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.seg-takehome { background: var(--c-takehome); }
.seg-pretax { background: var(--c-pretax); }
.seg-federal { background: var(--c-federal); }
.seg-fica { background: var(--c-fica); }
.seg-state { background: var(--c-state); }

.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.legend li { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; }
.legend li:last-child { border-bottom: 0; }
.legend .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.legend .name { color: #38465f; }
.legend .val { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend li.total { margin-top: 4px; border-top: 1.5px solid var(--line); border-bottom: 0; font-weight: 700; padding-top: 13px; }
.legend li.total .val { color: var(--ink); }
.legend li.rate .val { color: var(--brand-dark); }
.dot-takehome { background: var(--c-takehome); } .dot-pretax { background: var(--c-pretax); }
.dot-federal { background: var(--c-federal); } .dot-fica { background: var(--c-fica); } .dot-state { background: var(--c-state); }
.dot-flat { background: var(--faint); }

/* ---------- tables ---------- */
.data-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14.5px; }
.data-table th, .data-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.data-table th { color: var(--muted); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
.data-table td:last-child, .data-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr:hover td { background: #fafbfe; }
.data-table tr.total td { font-weight: 800; border-top: 2px solid var(--line); }
.card-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px; box-shadow: var(--shadow-sm); }

/* ---------- state grid ---------- */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; margin-top: 12px; }
.state-grid a { padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .12s, border-color .12s, background .12s; }
.state-grid a:hover { border-color: var(--brand-2); background: var(--brand-soft); transform: translateY(-1px); text-decoration: none; }
.state-grid a.current { background: linear-gradient(145deg, var(--brand-2), var(--brand-dark)); color: #fff; border-color: transparent; }

/* ---------- ads ---------- */
.ad-slot { margin: 28px 0; min-height: 96px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 14px; color: #b6c0d0; font-size: 12px; background: rgba(255,255,255,.5); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }
.site-footer > div { max-width: 880px; margin: 0 auto; padding: 26px 20px 44px; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 0 0 10px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; }
.footer-nav a { color: var(--brand-dark); font-weight: 600; }

/* ---------- prose (About / Methodology / Privacy) ---------- */
.prose { max-width: 720px; margin: 8px auto 0; }
.prose h1 { margin-bottom: 14px; }
.prose .lede { font-size: 18px; }
.prose h2 { font-size: 21px; margin: 30px 0 8px; }
.prose p { margin: 0 0 14px; color: #33415c; }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 6px 0; color: #33415c; }
.prose a { color: var(--brand-dark); text-decoration: underline; }

@media (max-width: 540px) {
  .row { flex-direction: column; gap: 0; }
  .calc-card { padding: 18px; }
  .hero { padding: 28px 0 4px; }
  h2 { font-size: 20px; }
}
