:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --border: #d9e1ed;
  --border-strong: #c7d3e4;
  --text: #1b2230;
  --muted: #5d6677;
  --muted-strong: #445064;
  --accent: #2558bf;
  --accent-strong: #183e8d;
  --accent-soft: #e8f0ff;
  --shadow-soft: 0 12px 30px rgba(24, 42, 76, 0.06);
  --shadow-card: 0 18px 42px rgba(19, 33, 61, 0.08);
  --radius: 8px;
  --content-width: 1180px;
  --prose-width: 760px;
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f3f5f9 100%);
  color: var(--text);
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent);
}

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

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

.page-shell {
  padding: 2rem 0 4.5rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent-strong);
  color: #fff;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  z-index: 20;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.shell-header,
.shell-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.site-brand-wrap {
  max-width: 32rem;
}

.site-brand {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-tagline,
.footer-note,
.footer-links,
.hero-summary,
.section-intro,
.section-heading p,
.card-excerpt,
.article-summary,
.article-header-meta,
.article-body p,
.article-body li,
.article-body td,
.article-body th,
.article-related-list,
.breadcrumbs,
.quick-path-label,
.section-card p,
.section-card-link,
.section-count,
.panel-link,
.article-followup p,
.section-start-panel p {
  color: var(--muted);
}

.site-tagline,
.footer-note,
.card-excerpt,
.article-summary,
.section-intro,
.section-heading p,
.hero-summary,
.article-followup p,
.section-start-panel p {
  font-size: 1rem;
}

.site-tagline,
.footer-note {
  margin: 0.35rem 0 0;
}

.site-nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.site-nav a,
.footer-links a {
  text-decoration: none;
  color: var(--muted-strong);
}

.site-nav a:hover,
.footer-links a:hover {
  color: var(--accent-strong);
}

.footer-title,
.footer-heading,
.eyebrow,
.card-kicker,
.quick-path-label,
.section-count {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
}

.home-hero,
.section-hero,
.section-overview,
.home-library,
.section-library,
.article-shell {
  margin-bottom: 2.2rem;
}

.home-hero,
.section-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.95fr);
  gap: 1rem;
}

.hero-copy,
.hero-panel,
.section-hero-copy,
.section-start-panel,
.section-heading,
.article-header,
.article-aside-card,
.section-card,
.article-card,
.article-body,
.section-library-head,
.article-followup {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.hero-copy,
.hero-panel,
.section-hero-copy,
.section-start-panel,
.section-heading,
.article-header,
.article-aside-card,
.section-library-head,
.article-followup {
  padding: 1.6rem;
}

.hero-copy h1,
.section-hero-copy h1,
.article-header h1 {
  margin: 0.35rem 0 0.85rem;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  line-height: 1.08;
  max-width: 16ch;
}

.section-heading h2,
.section-library-head h2,
.hero-panel h2,
.section-start-panel h2,
.article-aside-card h2,
.article-followup h2 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.2;
}

.section-grid,
.article-grid {
  display: grid;
  gap: 1rem;
}

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

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

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

.quick-path-list,
.article-related-list,
.section-link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-path-list {
  display: grid;
  gap: 0.8rem;
}

.quick-path {
  display: block;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  text-decoration: none;
}

.quick-path strong {
  display: block;
  margin-top: 0.3rem;
  color: var(--text);
  line-height: 1.35;
}

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

.section-count {
  white-space: nowrap;
}

.section-card,
.article-card {
  padding: 1.2rem;
  box-shadow: var(--shadow-card);
}

.section-card h3,
.card-title {
  margin: 0.4rem 0 0.7rem;
  font-size: 1.22rem;
  line-height: 1.32;
}

.section-card h3 a,
.card-title a,
.section-card-link a,
.card-link,
.panel-link a {
  text-decoration: none;
}

.section-link-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.section-card-link,
.card-link-row,
.panel-link {
  margin: 1rem 0 0;
}

.card-link,
.panel-link a {
  font-weight: 600;
}

.article-card--feature {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.breadcrumbs {
  margin-bottom: 1rem;
  font-size: 0.94rem;
}

.breadcrumbs span {
  margin: 0 0.35rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--prose-width)) minmax(250px, 300px);
  gap: 1.25rem;
  align-items: start;
}

.article-header {
  margin-bottom: 1rem;
}

.article-main {
  min-width: 0;
}

.article-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.article-body {
  padding: 2rem 2.1rem;
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body > p:first-child {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--muted-strong);
  margin-bottom: 1.5rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  color: var(--text);
  line-height: 1.22;
}

.article-body h2 {
  margin-top: 2.7rem;
  margin-bottom: 0.9rem;
  font-size: 1.8rem;
}

.article-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

.article-body h4 {
  margin-top: 1.6rem;
  margin-bottom: 0.65rem;
  font-size: 1.08rem;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body table,
.article-body blockquote,
.article-body hr {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
}

.article-body li + li {
  margin-top: 0.45rem;
}

.article-body a {
  font-weight: 500;
}

.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.article-body tbody,
.article-body thead,
.article-body tr {
  width: 100%;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 0.85rem 0.9rem;
  text-align: left;
  vertical-align: top;
  min-width: 140px;
}

.article-body th {
  background: var(--accent-soft);
  color: var(--text);
}

.article-body blockquote {
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  color: var(--text);
}

.article-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.article-followup {
  margin-top: 1rem;
}

.article-aside {
  position: sticky;
  top: 1rem;
}

.article-related-list {
  display: grid;
  gap: 0.9rem;
}

.article-related-list li + li {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

@media (max-width: 1080px) {
  .home-hero,
  .section-hero,
  .article-layout,
  .article-grid--home,
  .article-grid--section,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .article-aside {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell,
  .page-shell {
    width: min(var(--content-width), calc(100% - 1rem));
  }

  .page-shell {
    padding: 1.35rem 0 3rem;
  }

  .shell-header,
  .shell-footer,
  .section-library-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-copy,
  .hero-panel,
  .section-hero-copy,
  .section-start-panel,
  .section-heading,
  .article-header,
  .article-aside-card,
  .section-library-head,
  .section-card,
  .article-card,
  .article-body,
  .article-followup {
    padding: 1.1rem;
  }

  .hero-copy h1,
  .section-hero-copy h1,
  .article-header h1 {
    max-width: none;
    font-size: clamp(1.9rem, 10vw, 2.6rem);
  }

  .article-body {
    padding: 1.2rem 1.1rem;
  }

  .article-body h2 {
    font-size: 1.55rem;
  }

  .article-body h3 {
    font-size: 1.22rem;
  }
}