:root {
  --brand: #1E40AF;
  --brand-dark: #1E3A8A;
  --brand-light: #EFF6FF;
  --brand-accent: #3B82F6;
  --text: #0F172A;
  --text-muted: #475569;
  --text-soft: #64748B;
  --border: #E2E8F0;
  --border-soft: #F1F5F9;
  --bg: #FFFFFF;
  --bg-soft: #F8FAFC;
  --bg-muted: #F1F5F9;
  --success: #059669;
  --success-bg: #ECFDF5;
  --warning: #D97706;
  --danger: #DC2626;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
  --max: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 { line-height: 1.25; color: var(--text); font-weight: 700; }
h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.875rem; letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p { color: var(--text-muted); }
.lead { font-size: 1.125rem; color: var(--text-muted); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(10px);
  background: rgba(255,255,255,0.92);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}
.nav-main {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav-main a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
}
.nav-main a:hover {
  color: var(--brand);
  background: var(--brand-light);
  text-decoration: none;
}
.mobile-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--text); }

@media (max-width: 900px) {
  .mobile-toggle { display: block; }
  .nav-main {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .nav-main.open { display: flex; }
  .nav-main a { padding: 0.75rem 0.5rem; border-radius: 6px; }
}

/* Hero */
.hero {
  padding: 4.5rem 0 3.5rem;
  background: linear-gradient(180deg, var(--brand-light) 0%, #ffffff 100%);
  position: relative;
}
.hero h1 { max-width: 840px; margin-bottom: 1rem; }
.hero .lead { max-width: 720px; margin-bottom: 2rem; }
.hero-ctas { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--border); }
.btn-secondary:hover { background: var(--brand-light); color: var(--brand-dark); border-color: var(--brand-accent); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--brand); padding: 0.5rem 0; }
.btn-ghost:hover { color: var(--brand-dark); text-decoration: none; }
.btn-ghost::after { content: ' →'; }

/* Sections */
.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-head { margin-bottom: 2rem; }
.section-head h2 { margin-bottom: 0.5rem; }
.section-head p { color: var(--text-muted); font-size: 1.0625rem; max-width: 720px; }
.section-soft { background: var(--bg-soft); }

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.cat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.15s ease;
  display: block;
  color: inherit;
}
.cat-card:hover {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.cat-card .cat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.375rem;
}
.cat-card h3 { margin-bottom: 0.5rem; color: var(--text); }
.cat-card p { font-size: 0.9375rem; margin: 0; }
.cat-card .cat-more { margin-top: 1rem; color: var(--brand); font-size: 0.875rem; font-weight: 600; }

/* Resource grid */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.res-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
  color: inherit;
  text-decoration: none;
}
.res-card:hover {
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}
.res-type {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
  background: var(--brand-light);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  align-self: flex-start;
}
.res-card h4 { margin-bottom: 0.5rem; color: var(--text); }
.res-card p { font-size: 0.9375rem; margin: 0; color: var(--text-muted); }
.res-card .res-cat { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--text-soft); }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-soft);
  padding: 1rem 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { margin: 0 0.5rem; color: var(--border); }

/* Content page */
.content-page { padding: 1rem 0 4rem; }
.content-page h1 { margin-bottom: 1rem; }
.content-page .lead { margin-bottom: 2rem; }
.content-page h2 { margin: 2.5rem 0 1rem; }
.content-page h3 { margin: 2rem 0 0.75rem; }
.content-page p { margin-bottom: 1rem; }
.content-page ul, .content-page ol { margin: 0 0 1rem 1.5rem; color: var(--text-muted); }
.content-page li { margin-bottom: 0.375rem; }
.content-page strong { color: var(--text); }

/* Summary box */
.summary-box {
  background: var(--brand-light);
  border-left: 4px solid var(--brand);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.summary-box h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand); margin-bottom: 0.5rem; }
.summary-box p { color: var(--text); margin: 0; }

/* Calculator */
.calc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.field { display: flex; flex-direction: column; }
.field label { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.375rem; }
.field small { color: var(--text-soft); font-size: 0.8125rem; margin-top: 0.25rem; }
.field input, .field select, .field textarea {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.calc-result {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}
.calc-result .result-label { font-size: 0.875rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.calc-result .result-value { font-size: 2.25rem; font-weight: 800; color: var(--brand); margin-top: 0.25rem; letter-spacing: -0.02em; }
.calc-result .result-note { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.9375rem; }
.calc-multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.calc-multi .sub-result { background: #fff; border: 1px solid var(--border-soft); border-radius: 8px; padding: 1rem; }
.calc-multi .sub-result .result-label { font-size: 0.75rem; }
.calc-multi .sub-result .result-value { font-size: 1.5rem; }

/* Checklist blocks */
.checklist-block {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1rem 0;
}
.checklist-block h3 { font-size: 1.125rem; margin-bottom: 0.75rem; color: var(--text); }
.checklist-block ul { list-style: none; margin: 0; padding: 0; }
.checklist-block li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0;
  color: var(--text);
}
.checklist-block li::before {
  content: "☐";
  color: var(--brand);
  font-weight: 700;
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1.4;
}

/* Comparison table */
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.9375rem;
}
.cmp-table th, .cmp-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.cmp-table th { background: var(--bg-soft); font-weight: 700; color: var(--text); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; }
.cmp-table tr:last-child td { border-bottom: none; }
.cmp-table tr:hover td { background: var(--bg-soft); }

/* FAQ */
.faq { margin: 2rem 0; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.625rem;
  background: #fff;
}
.faq details[open] { border-color: var(--brand-accent); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.25rem; font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 0.625rem; margin-bottom: 0; }

/* Related resources */
.related-section {
  background: var(--bg-soft);
  padding: 2.5rem 0;
  margin-top: 3rem;
}
.related-section h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }

/* CTA block */
.cta-block {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 2.5rem 0;
}
.cta-block h3 { color: #fff; margin-bottom: 0.5rem; }
.cta-block p { color: rgba(255,255,255,0.85); margin-bottom: 1.25rem; }
.cta-block .btn { background: #fff; color: var(--brand); }
.cta-block .btn:hover { background: var(--brand-light); }

/* Share buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.share-buttons .share-label { font-weight: 600; color: var(--text); margin-right: 0.25rem; }
.share-buttons a, .share-buttons button {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.share-buttons a:hover, .share-buttons button:hover {
  border-color: var(--brand-accent);
  background: var(--brand-light);
  text-decoration: none;
}

/* Placeholder slot */
.placeholder-slot {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.8125rem;
  margin: 1.5rem 0;
  background: var(--bg-soft);
}

/* TOC */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
}
.toc h3 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); margin-bottom: 0.625rem; }
.toc ol { list-style: decimal inside; margin: 0; padding: 0; }
.toc li { margin-bottom: 0.25rem; color: var(--text-muted); }
.toc a { color: var(--brand); }

/* Footer */
.site-footer {
  background: var(--text);
  color: #CBD5E1;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(auto-fit, minmax(160px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.site-footer h4 { color: #fff; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.site-footer a { color: #CBD5E1; font-size: 0.9375rem; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer .footer-brand { color: #fff; font-weight: 700; font-size: 1.125rem; display: block; margin-bottom: 0.75rem; }
.site-footer .footer-about { color: #94A3B8; font-size: 0.9375rem; max-width: 420px; }
.site-footer .footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.25rem;
  color: #94A3B8;
  font-size: 0.875rem;
  text-align: center;
}

/* Responsive */
@media (max-width: 720px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .section { padding: 2.5rem 0; }
  .calc { padding: 1.25rem; }
  .calc-result .result-value { font-size: 1.75rem; }
}

/* ─── Newsletter signup ─────────────────────────────────────────────────── */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.signup-honey { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }

.signup-block {
  max-width: 560px; margin: 2.5rem auto 0; padding: 1.75rem;
  background: var(--brand-light); border: 1px solid #DBEAFE; border-radius: 14px;
}
.signup-heading { margin: 0 0 0.5rem; font-size: 1.25rem; color: var(--brand-dark); }
.signup-sub { margin: 0 0 1.25rem; color: #475569; font-size: 0.95rem; }
.signup-form { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: stretch; }
.signup-field { flex: 1 1 240px; min-width: 0; display: block; }
.signup-field input {
  width: 100%; padding: 0.75rem 0.875rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.signup-field input:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.signup-form .btn { flex: 0 0 auto; padding: 0.75rem 1.25rem; font-weight: 600; }
.signup-msg { flex-basis: 100%; font-size: 0.9rem; min-height: 1.25rem; margin-top: 0.25rem; display: none; }
.signup-msg.ok  { display: block; color: #065F46; }
.signup-msg.err { display: block; color: #B91C1C; }

/* Site-wide footer variant */
.footer-signup {
  background: #111827; color: #E5E7EB; padding: 2.25rem 0; border-top: 1px solid #1F2937;
}
.footer-signup .signup-block-footer {
  max-width: 720px; margin: 0 auto; padding: 0 1.5rem; background: none; border: 0; border-radius: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; justify-content: space-between;
}
.signup-heading-footer { font-size: 1.05rem; font-weight: 600; color: #F9FAFB; flex: 1 1 260px; }
.footer-signup .signup-form { flex: 1 1 340px; }
.footer-signup .signup-field input { background: #F9FAFB; }
.footer-signup .signup-msg.ok  { color: #A7F3D0; }
.footer-signup .signup-msg.err { color: #FCA5A5; }

@media (max-width: 560px) {
  .signup-form { flex-direction: column; }
  .signup-form .btn { width: 100%; }
  .footer-signup .signup-block-footer { flex-direction: column; align-items: stretch; }
  .signup-heading-footer { text-align: center; }
}
