*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #64748b;
  --border: #e8ecf1;
  --border-subtle: #eef1f5;
  --border-list: #e2e8f0;
  --link: #2353a2;
  --link-footer: #93c5fd;

  --accent: #2353a2;
  --accent-dark: #1a4080;
  --accent-green: #0a8d4c;
  --footer-bg: #ffffff;
  --footer-text: #64748b;
  --logo-dark: #1a1a2e;
  --logo-muted: #4765ad;

  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.04);
  --shadow: 0 4px 24px rgba(26, 26, 46, 0.06);
  --shadow-hover: 0 8px 32px rgba(26, 26, 46, 0.1);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --max-width: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

/* Header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
  padding: 1rem 0;
  position: relative;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 0 1 auto;
  text-decoration: none;
  color: var(--logo-dark);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.3px;
}

.navbar-brand:hover {
  text-decoration: none;
  color: var(--logo-dark);
}

.logo-mark,
.navbar-logo {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
}

.logo-tld {
  font-weight: 500;
  color: var(--logo-muted);
}

.navbar-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.navbar-toggle:hover {
  background: var(--bg-subtle);
}

.navbar-toggle-icon {
  position: relative;
  display: block;
  width: 1.25rem;
  height: 1rem;
}

.navbar-toggle-icon::before,
.navbar-toggle-icon::after,
.navbar-toggle-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.navbar-toggle-bar {
  top: 50%;
  transform: translateY(-50%);
}

.navbar-toggle-icon::before {
  content: "";
  top: 0;
}

.navbar-toggle-icon::after {
  content: "";
  bottom: 0;
}

.navbar-toggle.is-open .navbar-toggle-bar {
  opacity: 0;
}

.navbar-toggle.is-open .navbar-toggle-icon::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.navbar-toggle.is-open .navbar-toggle-icon::after {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

.navbar-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.navbar-menu li {
  display: flex;
  align-items: center;
}

.navbar-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

.navbar-menu a:hover {
  color: var(--text);
  background: var(--bg-subtle);
  text-decoration: none;
}

.navbar-menu a[aria-current="page"] {
  color: var(--accent);
  background: rgba(35, 83, 162, 0.08);
  font-weight: 600;
  text-decoration: none;
}

@media screen and (max-width: 768px) {
  .navbar {
    padding: 0.75rem 0;
  }

  .navbar-brand {
    gap: 0.5rem;
    max-width: calc(100% - 3.5rem);
    font-size: 1.125rem;
  }

  .navbar-toggle {
    display: inline-flex;
  }

  .navbar-actions {
    position: static;
  }

  .navbar-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    background: var(--surface);
    padding: 0.75rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    gap: 0.25rem;
  }

  .navbar-menu.active {
    display: flex;
  }

  .navbar-menu a {
    justify-content: center;
    width: 100%;
    min-height: 2.75rem;
    border-radius: var(--radius-sm);
  }
}

/* Hero */

.hero {
  padding: 4.5rem 0 3.5rem;
  background: var(--bg);
  text-align: center;
}

.hero .container {
  max-width: 44rem;
}

.hero h1 {
  margin: 0 auto 1.25rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 22ch;
}

.lead {
  margin: 0 auto 2rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 46ch;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Sections */

section {
  padding-block: 4rem;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-intro {
  margin: 0 0 2rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 52ch;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header h2 {
  margin-bottom: 0.5rem;
}

.section-header .section-intro {
  margin-bottom: 0;
}

/* Resources */

.resources {
  background: var(--bg-subtle);
}

/* Cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card p {
  margin: 0;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.card-link {
  margin-top: 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent);
}

.card:hover .card-link {
  text-decoration: underline;
}

.card-muted {
  opacity: 0.85;
  cursor: default;
  background: var(--bg-subtle);
}

.card-muted:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
}

.card-badge {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface);
  border-radius: 999px;
  color: var(--text-muted);
  align-self: flex-start;
}

.card-featured {
  background: var(--surface);
  border-color: rgba(35, 83, 162, 0.15);
  box-shadow: var(--shadow);
}

/* Topics / features */

.topics {
  background: var(--bg);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-card {
  padding: 1.5rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  transition: background 0.15s;
}

.feature-card:hover {
  background: #f0f2f5;
}

.feature-card strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

.feature-card strong a {
  color: var(--text);
  text-decoration: none;
}

.feature-card strong a:hover {
  color: var(--accent);
  text-decoration: none;
}

.feature-card span {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Legacy topic-list (fallback) */

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.topic-list li {
  padding: 1.5rem;
  background: var(--bg-subtle);
  border: none;
  border-radius: var(--radius-lg);
}

.topic-list strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-weight: 600;
}

.topic-list strong a {
  color: var(--text);
  text-decoration: none;
}

.topic-list strong a:hover {
  color: var(--accent);
  text-decoration: none;
}

.topic-list span {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Brands */

.brands {
  background: var(--bg-subtle);
}

.brand-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.brand-grid a {
  padding: 0.55rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.brand-grid a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

/* CTA */

.cta {
  padding-bottom: 5rem;
}

.cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  color: var(--text);
}

.cta-inner h2 {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 700;
}

.cta-inner p {
  margin: 0;
  color: var(--text-muted);
  max-width: 42ch;
  line-height: 1.7;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
  letter-spacing: 0;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(35, 83, 162, 0.25);
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(35, 83, 162, 0.3);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
  text-decoration: none;
}

/* Page templates */

.page-hero {
  padding: 3rem 0 1.5rem;
  background: var(--bg);
}

.page-hero h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.page-content {
  padding-bottom: 4rem;
}

.prose {
  max-width: 62ch;
}

.prose p,
.prose ul {
  color: var(--text-muted);
  line-height: 1.7;
}

.prose h2 {
  margin-top: 2.5rem;
  color: var(--text);
  font-weight: 700;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose a {
  color: var(--link);
}

.prose-wide {
  max-width: 48rem;
}

.page-intro {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 48rem;
  font-size: 1.05rem;
}

.prose h3 {
  margin-top: 1.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.checklist-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border: none;
  border-radius: var(--radius);
}

.btn-text {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-text:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hub-link {
  font-size: 0.9rem;
  font-weight: 500;
}

.checklist {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.checklist li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  color: var(--text);
  line-height: 1.55;
  cursor: pointer;
  transition: background 0.12s;
}

.checklist label:hover {
  background: var(--bg-subtle);
}

.checklist input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.checklist label:has(input:checked) {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(100, 116, 139, 0.5);
}

.ratio-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.ratio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.ratio-table th,
.ratio-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.ratio-table tr:last-child td {
  border-bottom: none;
}

.ratio-table th {
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 600;
}

.ratio-table td {
  color: var(--text-muted);
  background: var(--surface);
}

.calc-steps {
  color: var(--text-muted);
  padding-left: 1.25rem;
}

.calc-steps li {
  margin-bottom: 0.4rem;
}

.disclaimer {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-subtle);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Footer */

.site-footer {
  margin-top: 0;
  padding: 3rem 0 2rem;
  background: var(--footer-bg);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--footer-text);
  line-height: 1.65;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem 3rem;
  padding-bottom: 2rem;
}

.footer-logo {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.footer-tagline {
  margin: 0;
  max-width: 26ch;
  color: var(--text-muted);
}

.footer-heading {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}

.footer-links a:hover {
  color: var(--link);
  text-decoration: none;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-bottom p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer-bottom a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--link);
}

@media screen and (max-width: 768px) {
  section {
    padding-block: 3rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .cta-inner {
    padding: 1.75rem;
    text-align: center;
    justify-content: center;
  }

  .cta-inner p {
    margin-inline: auto;
  }

  .cta-actions {
    justify-content: center;
    width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}
