:root {
  --bg: #f5f9ff;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --line: #d6e3f5;
  --line-strong: #b8cae3;
  --text: #10233f;
  --muted: #5d6f86;
  --blue: #0047ab;
  --blue-deep: #0c2f6c;
  --green: #00c853;
  --green-deep: #099548;
  --green-soft: rgba(0, 200, 83, 0.12);
  --blue-soft: rgba(0, 71, 171, 0.09);
  --shadow: 0 24px 60px rgba(15, 35, 63, 0.11);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-width: 1260px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1520;
    --surface: #162032;
    --surface-soft: #1a2840;
    --line: #243550;
    --line-strong: #2f4468;
    --text: #d8e8f8;
    --muted: #7a9ab8;
    --blue: #5b9cf6;
    --blue-deep: #a0c4ff;
    --green: #22d96a;
    --green-deep: #3ee87c;
    --green-soft: rgba(34, 217, 106, 0.14);
    --blue-soft: rgba(91, 156, 246, 0.12);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  }

  body {
    background:
      radial-gradient(circle at top right, rgba(34, 217, 106, 0.06), transparent 26%),
      radial-gradient(circle at top left, rgba(91, 156, 246, 0.06), transparent 24%),
      linear-gradient(180deg, #0d1520 0%, #0b1219 100%);
  }

  .site-header {
    background: rgba(13, 21, 32, 0.92);
    border-bottom-color: rgba(91, 156, 246, 0.1);
  }

  .site-footer__inner {
    background: linear-gradient(180deg, #0f2050 0%, #091530 100%);
  }

  .panel,
  .card,
  .tool-panel,
  .sidebar-card,
  .result-card,
  .resource-card,
  .metric-card,
  .countdown-card {
    background: var(--surface);
    border-color: var(--line);
  }

  .hero-panel {
    background:
      linear-gradient(135deg, rgba(91, 156, 246, 0.1), rgba(34, 217, 106, 0.08)),
      var(--surface);
  }

  .ad-slot {
    border-color: var(--line-strong);
    background: var(--surface-soft);
  }

  .nav-toggle {
    background: var(--surface);
    border-color: var(--line-strong);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(0, 200, 83, 0.08), transparent 26%),
    radial-gradient(circle at top left, rgba(0, 71, 171, 0.08), transparent 24%),
    linear-gradient(180deg, #f6faff 0%, #eff5fc 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

.shell,
.site-header__inner,
.site-footer__inner {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 71, 171, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  color: var(--blue-deep);
}

.brand__mark {
  width: 42px;
  height: 42px;
}

.brand__text {
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.brand__text span {
  color: var(--green-deep);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--blue-deep);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

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

.top-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 250px;
}

.top-search input,
.sidebar-search input,
.tool-panel input,
.tool-panel select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.82rem 1rem;
  color: var(--text);
}

.top-search input:focus,
.sidebar-search input:focus,
.tool-panel input:focus,
.tool-panel select:focus {
  outline: 2px solid rgba(0, 71, 171, 0.18);
  border-color: rgba(0, 71, 171, 0.3);
}

.search-button,
.button,
.button-ghost,
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-button,
.button,
.tool-button {
  background: linear-gradient(135deg, var(--green) 0%, #0ab765 100%);
  color: white;
  box-shadow: 0 14px 32px rgba(0, 200, 83, 0.24);
}

.button,
.button-ghost,
.tool-button {
  padding: 0.92rem 1.25rem;
  font-weight: 800;
}

.search-button {
  width: 44px;
  height: 44px;
  flex: none;
}

.button-ghost {
  color: var(--blue);
  background: white;
  border-color: var(--line);
}

.button:hover,
.button-ghost:hover,
.search-button:hover,
.tool-button:hover {
  transform: translateY(-1px);
}

.header-cta {
  flex: none;
}

.section {
  padding: 1.4rem 0 3rem;
}

.hero {
  padding: 1.5rem 0 2.2rem;
}

.panel,
.card,
.sidebar-card,
.ad-slot,
.tool-panel,
.article-shell,
.result-card,
.resource-card,
.metric-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.banner-ad,
.bottom-ad {
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, #f8fbff 0%, #fefefe 100%);
}

.ad-slot {
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed var(--line-strong);
  background: var(--surface-soft);
  padding: 1rem;
}

.ad-slot:empty {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(0, 71, 171, 0.03) 6px,
    rgba(0, 71, 171, 0.03) 12px
  );
}

.ad-slot--banner {
  min-height: 120px;
}

.ad-slot--sidebar {
  min-height: 600px;
  position: sticky;
  top: 110px;
}

.ad-slot--inline {
  min-height: 120px;
  margin: 1.6rem 0;
}

.ad-slot--bottom {
  min-height: 140px;
}

.hero-panel {
  overflow: hidden;
  position: relative;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(0, 71, 171, 0.08), rgba(0, 200, 83, 0.09)),
    linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.15fr);
  gap: 2rem;
  align-items: center;
  padding: 2.25rem;
  position: relative;
}

.hero-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 200, 83, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 83, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(135deg, transparent 48%, black 100%);
  pointer-events: none;
}

.hero-visual {
  background: linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 71, 171, 0.08);
  color: var(--blue);
  font-weight: 800;
  font-size: 0.9rem;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(2.6rem, 4.8vw, 4.8rem);
  line-height: 0.96;
  margin-top: 1rem;
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.05;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.15;
}

.lede,
.section-intro,
.meta-line,
.card p,
.sidebar-card p,
.article-prose p,
.article-prose li,
.article-prose td,
.article-prose th,
.metric-card p,
.result-card p,
.footer-copy,
.tool-note,
.resource-card p {
  color: var(--muted);
}

.lede {
  margin-top: 1rem;
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 58ch;
}

.hero-actions,
.mini-links,
.cta-row,
.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.4rem;
}

.checklist-inline {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.checklist-inline div,
.meta-chip,
.topic-pills li,
.resource-badge {
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.countdown-card {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 16px 35px rgba(0, 71, 171, 0.11);
}

.countdown-card strong {
  display: block;
  font-size: 1.6rem;
  color: var(--blue-deep);
  margin-top: 0.2rem;
}

.page-grid,
.category-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.4rem;
}

.main-stack,
.sidebar-stack,
.article-stack,
.tool-results,
.article-prose,
.resource-list,
.search-results {
  display: grid;
  gap: 1rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cards-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.resource-card,
.metric-card,
.sidebar-card,
.tool-panel,
.result-card {
  padding: 1.25rem;
}

.card {
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 71, 171, 0.08), transparent 65%);
}

.card-tag,
.card-time,
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
  font-size: 0.82rem;
}

.card-tag {
  color: var(--green-deep);
  background: var(--green-soft);
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
}

.card h3,
.resource-card h3,
.metric-card h3 {
  margin-top: 0.9rem;
}

.card p,
.resource-card p,
.metric-card p {
  line-height: 1.65;
  margin: 0.8rem 0 0;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  font-weight: 800;
  color: var(--blue);
}

.sidebar-card h3 {
  font-size: 1rem;
}

.sidebar-list,
.footer-links,
.link-list,
.resource-list-simple,
.bullet-list,
.topic-pills {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.sidebar-list,
.link-list,
.resource-list-simple,
.bullet-list {
  display: grid;
  gap: 0.7rem;
}

.sidebar-list a,
.link-list a,
.resource-list-simple a {
  color: var(--muted);
}

.sidebar-list a:hover,
.link-list a:hover,
.resource-list-simple a:hover,
.inline-links a:hover {
  color: var(--blue);
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.metric-row,
.resource-grid,
.tool-grid {
  display: grid;
  gap: 1rem;
}

.metric-row,
.tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card strong,
.result-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 0.45rem;
  color: var(--blue-deep);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.93rem;
}

.breadcrumbs a:hover {
  color: var(--blue);
}

.article-shell,
.tool-shell {
  padding: 1.4rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.25rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.meta-chip {
  color: var(--blue-deep);
}

.article-prose {
  line-height: 1.75;
  font-size: 1.02rem;
}

.article-prose h2,
.article-prose h3 {
  margin-top: 1.5rem;
}

.article-prose ul,
.article-prose ol {
  padding-left: 1.3rem;
  margin: 0;
}

.article-prose table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-top: 0.7rem;
}

.article-prose th,
.article-prose td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: white;
}

.article-prose tr:last-child td {
  border-bottom: 0;
}

.callout {
  padding: 1.15rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 71, 171, 0.08), rgba(0, 200, 83, 0.09));
  border: 1px solid var(--line);
}

.disclaimer-box {
  padding: 1rem;
  border-radius: 16px;
  background: #fdf7eb;
  border: 1px solid #f0d8ab;
  color: #7b5a1b;
  font-weight: 700;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.8fr);
  gap: 1rem;
}

.tool-panel form,
.sidebar-search {
  display: grid;
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.38rem;
}

.field label {
  font-weight: 800;
  color: var(--blue-deep);
}

.tool-results {
  align-content: start;
}

.result-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.result-card .result-label {
  color: var(--muted);
  font-weight: 700;
}

.article-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.site-footer {
  margin-top: 3rem;
  padding: 0 0 2.25rem;
}

.site-footer__inner {
  background: linear-gradient(180deg, #0b48aa 0%, #0a3d8a 100%);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.3fr 1fr;
  gap: 1.3rem;
}

.site-footer h3 {
  color: white;
  font-size: 1rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.84);
}

.site-footer a:hover {
  color: white;
}

.footer-copy {
  margin-top: 0.8rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
}

.footer-legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.72);
}

.muted-link {
  color: var(--muted);
  font-weight: 700;
}

.muted-link:hover {
  color: var(--blue);
}

.empty-state {
  text-align: center;
  padding: 2rem;
}

@media (max-width: 1120px) {
  .hero-grid,
  .page-grid,
  .category-grid,
  .article-layout,
  .tool-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .ad-slot--sidebar {
    position: static;
    min-height: 280px;
  }
}

@media (max-width: 920px) {
  .site-header__inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.75rem 0;
    gap: 0.75rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.25rem;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--line);
  }

  .nav.nav--open {
    display: flex;
  }

  .nav a {
    padding: 0.6rem 0.25rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .top-search {
    order: 3;
    width: 100%;
    min-width: 0;
  }

  .header-cta {
    display: none;
  }

  .top-search,
  .hero-actions,
  .mini-links,
  .cta-row,
  .inline-links,
  .article-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .cards-grid,
  .cards-grid--three,
  .metric-row,
  .resource-grid,
  .tool-grid,
  .article-cards {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .shell,
  .site-header__inner,
  .site-footer__inner {
    width: min(calc(100% - 1rem), var(--content-width));
  }

  .hero-grid {
    padding: 1.2rem;
  }

  .banner-ad,
  .bottom-ad,
  .site-footer__inner {
    padding: 1rem;
  }

  .button,
  .button-ghost,
  .tool-button,
  .search-button {
    width: 100%;
  }

  .search-button {
    height: 48px;
  }
}
