/* 401kTaxLaws.com — shares HealthCurve's design system: Rubik, navy/forest-green, light canvas */

:root {
  --canvas: #f7f8f5;
  --surface: #ffffff;
  --surface-muted: #eef3f0;
  --border: #c9d3cd;
  --text: #17211d;
  --text-muted: #526059;
  --text-faint: #7d8a84;
  --navy: #113f73;
  --green: #174c3c;
  --green-hover: #0e3a2d;
  --orange: #f67800;
  --error: #9f2d20;
  --radius-sm: 0.4rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --max: 46rem;
  --max-wide: 67.5rem;
}

* { box-sizing: border-box; }

html { background: var(--canvas); }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .wordmark, th, strong {
  font-family: "Rubik", sans-serif;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

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

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--green); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 12px; top: 12px; }

a { color: var(--green); text-underline-offset: 0.2em; }
a:hover { color: var(--green-hover); }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 4px 20px;
  padding: 26px 24px 14px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 26px; font-weight: 700; text-decoration: none; color: var(--navy);
  letter-spacing: -0.01em;
}
.wordmark.small { font-size: 18px; margin: 0 0 8px; }
.wordmark .logo-icon { display: block; flex: 0 0 auto; }
.wordmark .wm-accent { color: var(--green); }
.wordmark .wm-dot { color: var(--text-faint); font-weight: 500; font-size: 0.62em; }
.tagline {
  margin: 0; color: var(--text-muted); font-size: 14.5px; font-weight: 400;
}
.site-nav {
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}
.nav-inner {
  display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 12px 24px;
}
.site-nav a {
  color: var(--text-muted); text-decoration: none; font-size: 14.5px; font-weight: 600;
  white-space: nowrap; border-bottom: 2px solid transparent; padding-bottom: 2px;
}
.site-nav a:hover, .site-nav a.active { color: var(--green); border-color: var(--green); }

/* Home page hero + cards */
.hero {
  padding: 46px 0 12px;
}
.hero h1 {
  font-size: 40px; max-width: 760px; margin: 0 0 18px; letter-spacing: -0.02em; color: var(--navy);
}
.hero .dek {
  max-width: 640px; font-size: 19px; color: var(--text-muted); margin: 0 0 8px; font-weight: 400;
}
.hero .fine {
  font-size: 13.5px; color: var(--text-faint); max-width: 640px;
}

.topic-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin: 30px 0 50px;
}
@media (max-width: 860px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .topic-grid { grid-template-columns: 1fr; } }

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 0.3rem solid var(--navy);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.topic-card:hover { border-left-color: var(--green); box-shadow: 0 0.35rem 1.2rem rgb(23 76 60 / 0.1); }
.topic-card .num {
  font-family: "Rubik", sans-serif; color: var(--text-faint); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.topic-card h2 {
  margin: 6px 0 8px; font-size: 19px; color: var(--text);
}
.topic-card p { margin: 0; color: var(--text-muted); font-size: 15px; }

.section-label {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 12.5px;
  color: var(--green); font-weight: 700; margin: 44px 0 4px;
}

.callout-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 0.35rem solid var(--navy);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin: 36px 0;
}
.callout-box h2 { margin-top: 0; font-size: 19px; }
.callout-box ul { margin-bottom: 0; }

/* Article layout */
.page { padding: 32px 0 70px; max-width: var(--max-wide); }
article { max-width: var(--max); }

.crumbs { margin-bottom: 18px; }
.crumbs ol { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; font-size: 13.5px; color: var(--text-faint); flex-wrap: wrap;}
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--text-faint); }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.article-head h1 { font-size: 32px; margin: 0 0 12px; color: var(--navy); letter-spacing: -0.01em; }
.article-head .dek { font-size: 18px; color: var(--text-muted); margin: 0 0 10px; font-weight: 400; }
.reviewed { font-size: 13px; color: var(--text-faint); border-top: 1px solid var(--border); padding-top: 10px; margin: 16px 0 0; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 0.35rem solid var(--navy);
  border-radius: var(--radius-lg);
  padding: 16px 22px 18px;
  margin: 26px 0 34px;
  max-width: 420px;
}
.toc-label { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); font-weight: 700; }
.toc ol { margin: 0; padding-left: 20px; font-size: 14.5px; }
.toc li { margin: 4px 0; }
.toc a { text-decoration: none; color: var(--text-muted); }
.toc a:hover { color: var(--green); text-decoration: underline; }

.prose h2 { font-size: 24px; margin: 40px 0 14px; padding-top: 6px; border-top: 1px solid var(--border); color: var(--navy); }
.prose h2:first-child { border-top: none; padding-top: 0; }
.prose h3 { font-size: 18px; margin: 26px 0 10px; color: var(--green); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 26px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--text); font-weight: 600; }

.key-take {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 0.35rem solid var(--orange);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 22px 0 28px;
}
.key-take p { margin: 0; }
.key-take .label { display:block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--orange); font-weight: 700; margin-bottom: 6px;}

.tax-table-scroll {
  overflow-x: auto;
  margin: 12px 0 26px;
  border: 1px solid var(--border);
  border-left: 0.35rem solid var(--navy);
  border-radius: var(--radius-md);
  background: var(--surface);
}
table.tax-table {
  width: 100%; border-collapse: collapse; font-size: 15.5px;
}
table.tax-table caption {
  caption-side: bottom; text-align: left; font-size: 13.5px; color: var(--text-muted);
  padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); font-weight: 400;
}
table.tax-table th, table.tax-table td {
  border-bottom: 1px solid var(--border); padding: 10px 14px; text-align: left; vertical-align: top;
}
table.tax-table thead th { background: var(--surface-muted); }
table.tax-table tbody tr:last-child > * { border-bottom: 0; }
table.tax-table tbody tr:hover { background: var(--surface-muted); }

.faq-item { border-top: 1px solid var(--border); padding: 18px 0; }
.faq-item:first-of-type { border-top: none; }
.faq-item h2 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }

.related {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border);
}
.related h2 { font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); margin: 0 0 10px; }
.related ul { margin: 0; padding-left: 20px; }
.related li { margin: 6px 0; }

/* Footer */
.site-footer { background: var(--surface-muted); border-top: 1px solid var(--border); margin-top: 60px; }
.footer-inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 26px;
  padding: 44px 24px 30px; font-size: 14.5px;
}
@media (max-width: 860px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-inner { grid-template-columns: 1fr; } }
.fcol h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--green); margin: 0 0 10px; }
.fcol ul { list-style: none; margin: 0; padding: 0; }
.fcol li { margin: 6px 0; }
.fcol a { color: var(--text-muted); text-decoration: none; }
.fcol a:hover { text-decoration: underline; color: var(--green); }
.fcol-brand p { color: var(--text-muted); font-size: 14px; }

.legal-strip {
  border-top: 1px solid var(--border);
  padding: 16px 24px 34px;
  font-size: 12px;
  color: var(--text-faint);
}
.legal-strip p { margin: 4px 0; max-width: 900px; }
.legal-strip .fine-print { font-size: 11px; line-height: 1.5; color: #97a19b; max-width: 820px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .header-inner { padding: 20px 20px 12px; }
  .wordmark { font-size: 22px; }
  .hero { padding: 28px 0 4px; }
  .hero h1 { font-size: 28px; }
  .hero .dek { font-size: 16.5px; }
  .article-head h1 { font-size: 25px; }
  .article-head .dek { font-size: 16.5px; }
  .prose h2 { font-size: 20px; }
  table.tax-table { font-size: 14px; }
  table.tax-table th, table.tax-table td { padding: 8px 10px; }
}
