/* ============================================================
   NewTaxTools — "Ledger" identity v2
   Deep navy structure · azure brand (matches favicon/og-image)
   · amber reserved for money moments
   Warm paper canvas · form-panel results · ledger-ruled hero
   Display: Cabinet Grotesk · Body: Satoshi (Fontshare)
   Drop-in replacement: same class names, zero HTML changes.
   ============================================================ */

:root {
  /* Brand — anchored to existing favicon (#1a1a2e / #4fc3f7) */
  --navy: #16233a;           /* headings, buttons, structure */
  --navy-mid: #1f3352;
  --navy-deep: #0e1626;      /* footer, result panel */
  --azure: #1899dd;          /* brand blue, interactive states */
  --azure-bright: #4fc3f7;   /* favicon blue, dark-bg accents */
  --azure-pale: #e8f5fc;     /* tints, hovers, badges */

  /* Money accent — used sparingly, only where dollars appear */
  --amber: #f2b32b;
  --amber-deep: #c98a0b;     /* amber-on-light text (AA safe) */
  --amber-soft: #fdf3d7;     /* highlighter sweep, chips */

  /* Links */
  --blue: #0f62c0;
  --blue-dark: #0a4a96;

  /* Neutrals — warm paper, not sterile white */
  --ink: #1c2635;
  --ink-soft: #45536a;
  --muted: #6d7889;
  --border: #e7e4dc;
  --border-strong: #cfcabd;
  --bg: #fcfbf7;             /* warm paper canvas */
  --bg-card: #ffffff;
  --bg-soft: #f5f3ec;

  /* Effects */
  --radius: 14px;
  --radius-sm: 9px;
  --pill: 999px;
  --shadow-sm: 0 1px 3px rgba(22,35,58,0.07);
  --shadow-md: 0 10px 28px rgba(22,35,58,0.12);
  --ring: 0 0 0 4px rgba(24,153,221,0.22);

  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', system-ui, -apple-system, sans-serif;

  --maxw: 1080px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Header ---------- */
header {
  background: rgba(252,251,247,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
/* Logo mark: navy tile with azure notch — echoes the favicon */
.logo::before {
  content: "";
  width: 24px; height: 24px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--azure-bright) 0 38%, transparent 38%),
    var(--navy);
  flex: 0 0 auto;
}
.logo span { color: var(--azure); }
nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: var(--pill);
  transition: background 0.16s, color 0.16s;
}
nav a:hover { background: var(--azure-pale); color: var(--navy); }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 36px 22px 72px; }

/* ---------- Hero ---------- */
/* Signature: faint ledger rules, like accounting paper */
.hero {
  text-align: left;
  padding: 50px 0 34px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 30px,
      rgba(22,35,58,0.045) 30px 31px
    );
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--amber-soft);
  border: 1px solid #f0dfae;
  padding: 6px 14px;
  border-radius: var(--pill);
  margin-bottom: 22px;
}
.hero .eyebrow::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber-deep);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.4vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--navy);
  max-width: 21ch;
  margin: 0 0 18px;
}
/* Money highlighter sweep — amber, the "dollar" moment */
.hero h1 .hl {
  background: linear-gradient(transparent 58%, var(--amber) 58%, var(--amber) 92%, transparent 92%);
  color: var(--navy);
  padding: 0 3px;
}
.hero .subtitle {
  font-size: 1.16rem;
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 0 0 28px;
}
.hero-cta { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.trust-row {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  margin-top: 28px; color: var(--muted); font-size: 0.9rem; font-weight: 700;
}
.trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.trust-row span::before {
  content: "✓"; color: var(--navy); font-weight: 800;
  background: var(--amber); width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.68rem;
}

/* ---------- Headings ---------- */
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 12px;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 40px 0 14px;
  line-height: 1.2;
}
h3 { font-size: 1.1rem; font-weight: 800; color: var(--navy); margin: 22px 0 8px; letter-spacing: -0.01em; }
p { margin-bottom: 14px; color: var(--ink-soft); }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

.section-head { margin: 48px 0 6px; }
.section-head h2 {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--amber);
}
.section-head p { color: var(--muted); font-size: 1.02rem; margin: 6px 0 0; }

.subtitle { color: var(--ink-soft); font-size: 1.08rem; margin-bottom: 24px; max-width: 68ch; }

/* ---------- Tool box (calculators) ---------- */
/* Form-panel look: azure top rule, like an official schedule */
.tool-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--azure);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--navy);
  margin: 16px 0 6px;
}
input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--azure);
  box-shadow: var(--ring);
}
textarea { min-height: 84px; resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > div { flex: 1; min-width: 200px; }

/* ---------- Buttons ---------- */
button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  border: 2px solid var(--navy);
  padding: 13px 30px;
  font-size: 1rem;
  font-weight: 800;
  border-radius: var(--pill);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-body);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
button.btn:hover, a.btn:hover {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
}
button.btn:active, a.btn:active { transform: scale(0.985); }
button.btn:focus-visible, a.btn:focus-visible { outline: none; box-shadow: var(--ring); }
button.btn-secondary, a.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
button.btn-secondary:hover, a.btn-secondary:hover {
  background: var(--azure-pale);
  color: var(--navy);
  border-color: var(--navy);
}
.cta-strip { margin: 4px 0 30px; }
.cta-strip .btn { text-decoration: none; }

/* ---------- Result ---------- */
/* Signature element: the answer panel. Navy form-card,
   amber dollar figure — the moment the tool pays off. */
.result {
  background: var(--navy-deep);
  border: 1px solid var(--navy-deep);
  border-left: 5px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-top: 24px;
  white-space: pre-wrap;
  display: none;
  color: #c4cedd;
}
.result.show { display: block; animation: pop 0.26s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result .big {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--amber);
  display: block;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.result a { color: var(--azure-bright); }

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
  display: block;
  position: relative;
}
.card:hover {
  border-color: var(--azure);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card:focus-visible { outline: none; box-shadow: var(--ring); }
.card h3 { margin-top: 14px; font-size: 1.14rem; color: var(--navy); }
.card:hover h3 { color: var(--azure); }
.card p { font-size: 0.94rem; color: var(--muted); margin-bottom: 0; line-height: 1.55; }

/* Icon chips */
.icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--azure-pale);
}
.icon.finance { background: var(--azure-pale); }
.icon.memorial { background: var(--bg-soft); }

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 4px 12px;
  border-radius: var(--pill);
  margin-top: 14px;
}
.badge.finance { background: var(--amber-soft); color: #7a5a08; }
.badge.memorial { background: var(--bg-soft); color: var(--ink-soft); }

/* ---------- Related tools ---------- */
.related-tools {
  margin: 56px 0 12px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}
.related-tools h2 { margin: 0 0 4px; }
.related-tools .card { padding: 20px; }

/* ---------- Ad slots ---------- */
.ad-slot { max-width: var(--maxw); margin: 22px auto; padding: 0 22px; text-align: center; }
.ad-slot .ad-placeholder {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 26px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-soft);
}

/* ---------- Tables ---------- */
/* Official-schedule look: navy header band */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.94rem;
  margin: 18px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th {
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
}
table.data td { color: var(--ink-soft); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--azure-pale); }

/* ---------- Misc ---------- */
ul.msg-list { list-style: none; }
ul.msg-list li {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 15px 18px; margin-bottom: 10px;
}
ul.msg-list li:hover { border-color: var(--azure); box-shadow: var(--shadow-sm); }
.copy-hint { font-size: 0.8rem; color: var(--muted); }

main ul, main ol { margin: 0 0 14px 22px; color: var(--ink-soft); }
main li { margin-bottom: 6px; }

.disclaimer {
  font-size: 0.86rem; color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 16px 18px; margin-top: 36px;
}

.sitemap-list { line-height: 2; margin: 8px 0 28px 22px; }
.sitemap-list a { color: var(--blue); font-weight: 700; text-decoration: none; }
.sitemap-list a:hover { color: var(--blue-dark); text-decoration: underline; }

/* Content prose links */
main p a, main li a, main td a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
main p a:hover, main li a:hover, main td a:hover {
  color: var(--blue-dark);
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
}

/* ---------- Footer ---------- */
footer {
  background: var(--navy-deep);
  color: #9fb0c6;
  padding: 46px 22px;
  font-size: 0.9rem;
  margin-top: 24px;
  border-top: 4px solid var(--amber);
}
footer .nav-inner { display: block; min-height: 0; }
footer strong { color: #fff; font-family: var(--font-display); letter-spacing: -0.01em; font-size: 1.05rem; }
footer a { color: var(--azure-bright); text-decoration: none; font-weight: 700; }
footer a:hover { color: #fff; text-decoration: underline; }
footer p { color: #9fb0c6; margin-bottom: 8px; }

/* ---------- Accessibility ---------- */
a:focus-visible, nav a:focus-visible { outline: 2px solid var(--azure); outline-offset: 2px; border-radius: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  nav { margin-left: 0; width: 100%; }
  .hero { padding: 34px 0 22px; }
  .hero h1 { font-size: clamp(1.95rem, 8vw, 2.5rem); }
  .row > div { min-width: 100%; }
  button.btn, a.btn { width: 100%; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { width: 100%; }
}

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