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

html, body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #fff;
  color: #0d0d0d;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

:root {
  --navy: #2B3A8E;
  --navy-soft: rgba(43, 58, 142, 0.08);
  --navy-mid: rgba(43, 58, 142, 0.16);
  --ink: #0d0d0d;
  --muted: #555;
  --muted-2: #666;
  --panel: #f8f9fc;
  --border: rgba(43, 58, 142, 0.07);
  --border-strong: rgba(43, 58, 142, 0.18);
  --teal: #0d9488;
  --amber: #d97706;
  --rose: #e11d48;
  --shadow: 0 12px 32px rgba(43, 58, 142, 0.08);
  --radius: 18px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem clamp(1.5rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--navy-soft);
}

.nav-home {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.nav-home:hover { opacity: 0.78; }

.nav-home img {
  height: clamp(32px, 4vw, 42px);
  width: auto;
}

.nav-home .nav-tag {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.55;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.55rem, 1.5vw, 1.4rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #444;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--navy);
}

.nav-links a[aria-current="page"] {
  position: relative;
  font-weight: 700;
}

.nav-links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

.page-hero {
  position: relative;
  padding: clamp(4rem, 9vw, 6.5rem) clamp(1.5rem, 5vw, 4rem) clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.55;
  margin-bottom: 1.1rem;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--ink);
  margin-bottom: 1.2rem;
}

.page-hero h1 em {
  font-style: normal;
  color: var(--navy);
  font-weight: 800;
}

.page-hero .lead {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1.2rem;
  letter-spacing: -0.01em;
}

.page-hero .subhead {
  font-size: clamp(0.93rem, 1.3vw, 1.05rem);
  line-height: 1.8;
  color: var(--muted);
  max-width: 58ch;
  margin: 0 auto;
}

.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem);
}

.section-alt { background: var(--panel); }

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.section h2 em {
  font-style: normal;
  color: var(--navy);
}

.section .lede {
  font-size: 0.96rem;
  line-height: 1.8;
  color: var(--muted);
  max-width: 60ch;
}

.section-eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.5;
  margin-bottom: 0.8rem;
  display: block;
}

.btn-solid,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.btn-solid {
  background: var(--navy);
  color: #fff;
}

.btn-solid:hover {
  opacity: 0.87;
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--navy);
  border: 1.5px solid rgba(43, 58, 142, 0.2);
}

.btn-ghost:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}

.ilink {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(43, 58, 142, 0.3);
  text-underline-offset: 3px;
}

.ilink:hover { text-decoration-color: var(--navy); }

.hero-search {
  max-width: 760px;
  margin: 1.8rem auto 0;
  display: grid;
  gap: 0.9rem;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: #fff;
  box-shadow: 0 8px 24px rgba(43, 58, 142, 0.05);
}

.search-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0.8rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
}

.search-shell input::placeholder { color: #888; }

.search-shell button {
  border: 0;
  cursor: pointer;
}

.quick-grid,
.menu,
.mode-grid,
.feature-grid,
.related-grid,
.section-grid,
.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.menu a,
.card,
.search-card,
.related-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.6rem 1.5rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.menu a::before,
.card::before,
.search-card::before,
.related-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy), rgba(43, 58, 142, 0.12));
}

.menu a:hover,
.card:hover,
.search-card:hover,
.related-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.label,
.card-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.6;
}

.title,
.card-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.desc,
.card-desc,
.search-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted-2);
}

.arrow,
.card-link {
  margin-top: auto;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
}

.mode-grid .card,
.feature-grid .card,
.quick-grid .card {
  min-height: 100%;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.36rem 0.7rem;
  border-radius: 999px;
  background: rgba(43, 58, 142, 0.07);
  color: var(--navy);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-neutral {
  background: #f2f4fb;
  color: #5160a9;
}

.badge-good {
  background: rgba(13, 148, 136, 0.09);
  color: var(--teal);
}

.badge-warn {
  background: rgba(217, 119, 6, 0.09);
  color: var(--amber);
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.1rem;
}

.callout {
  padding: 1.35rem 1.4rem;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.callout strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.callout p,
.callout li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

.callout ul,
.callout ol {
  padding-left: 1.2rem;
  margin-top: 0.6rem;
}

.article-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
}

.crumbs {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem clamp(1.5rem, 5vw, 4rem) 0;
  color: #777;
  font-size: 0.76rem;
  font-weight: 600;
}

.crumbs a {
  color: var(--navy);
}

.article-head {
  margin-bottom: 2rem;
}

.article-head .summary {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
  max-width: 62ch;
  margin-top: 1rem;
}

.article-body {
  display: grid;
  gap: 1.6rem;
}

.article-body section,
.search-panel {
  padding: 1.5rem 1.5rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
}

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
  color: var(--ink);
}

.article-body h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.55rem;
  color: var(--ink);
}

.article-body p,
.article-body li {
  font-size: 0.95rem;
  line-height: 1.82;
  color: var(--muted);
}

.article-body ul,
.article-body ol {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}

.article-body .small-note {
  font-size: 0.82rem;
  color: #777;
}

.article-body .subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.article-body .mini {
  padding: 1rem 1rem 1.05rem;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.article-body .mini strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.86rem;
  font-weight: 800;
}

.section-links {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.section-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: var(--panel);
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 700;
}

.search-intro {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem) 1.2rem;
}

.search-empty {
  padding: 1.3rem 1.4rem;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.foot {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 5vw, 4rem) clamp(3rem, 6vw, 4rem);
  border-top: 1px solid var(--navy-soft);
  text-align: center;
  color: #666;
  font-size: 0.83rem;
  line-height: 1.7;
}

.foot a {
  color: var(--navy);
  font-weight: 600;
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav {
    gap: 0.6rem;
    padding: 0.85rem 1rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-links a {
    font-size: 0.72rem;
    color: var(--navy);
    font-weight: 700;
  }

  .nav-home .nav-tag { display: none; }

  .search-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .search-shell .btn-solid {
    justify-content: center;
    width: 100%;
  }
}
