:root {
  --hub-bg: #f7f6f2;
  --hub-surface: #ffffff;
  --hub-soft: #f0f4f4;
  --hub-text: #172033;
  --hub-muted: #5f6878;
  --hub-border: #d8dcd9;
  --hub-accent: #2563eb;
  --hub-accent-dark: #1d4ed8;
  --hub-button: #2563eb;
  --hub-button-hover: #1d4ed8;
  --hub-teal: #087f9b;
  --hub-shadow: 0 18px 55px rgba(51, 65, 85, 0.10), 0 2px 7px rgba(51, 65, 85, 0.05);
  --hub-footer-bg: rgba(241, 242, 239, 0.95);
  --hub-footer-text: #5f6878;
}

html[data-theme="dark"],
html.dark {
  --hub-bg: #0f172a;
  --hub-surface: #0f1b30;
  --hub-soft: #14223a;
  --hub-text: #f8fafc;
  --hub-muted: #aeb8c8;
  --hub-border: #334155;
  --hub-accent: #60a5fa;
  --hub-accent-dark: #3b82f6;
  --hub-teal: #22d3ee;
  --hub-shadow: 0 20px 58px rgba(0, 0, 0, 0.24);
  --hub-footer-bg: #0f172a;
  --hub-footer-text: #94a3b8;
}

.hub-page { background: var(--hub-bg); color: var(--hub-text); }
.hub-shell { width: min(calc(100% - 2rem), 72rem); margin-inline: auto; }
.hub-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--hub-border); background: color-mix(in srgb, var(--hub-bg) 91%, transparent); backdrop-filter: blur(15px); }
.hub-header-inner { display: flex; min-height: 4.75rem; align-items: center; justify-content: space-between; gap: 1rem; }
.hub-nav { display: flex; align-items: center; gap: 1rem; }
.hub-nav a { color: var(--hub-muted); font-size: .9rem; font-weight: 750; }
.hub-nav a:hover, .hub-nav a[aria-current="page"] { color: var(--hub-accent); }
.hub-action { border-radius: .65rem; background: var(--hub-button); color: #fff !important; padding: .65rem .95rem; }
.hub-action:hover { background: var(--hub-button-hover); }
.hub-hero { padding: 5.8rem 0 4.6rem; background: radial-gradient(circle at 82% 20%, rgba(37,99,235,.14), transparent 26rem), linear-gradient(180deg, var(--hub-soft), var(--hub-bg)); }
.hub-kicker { margin: 0 0 .8rem; color: var(--hub-accent); font-size: .76rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.hub-hero h1 { max-width: 18ch; margin: 0; font-size: calc(3rem - 1pt); font-weight: 800; line-height: 1.18; letter-spacing: normal; }
.hub-lead { max-width: 46rem; margin: 1.25rem 0 0; color: var(--hub-muted); font-size: 1.12rem; line-height: 1.75; }
.hub-principles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; margin-top: 2.2rem; }
.hub-principles div { border: 1px solid var(--hub-border); border-radius: .9rem; background: color-mix(in srgb, var(--hub-surface) 88%, transparent); padding: 1rem; }
.hub-principles strong { display: block; }
.hub-principles span { display: block; margin-top: .25rem; color: var(--hub-muted); font-size: .86rem; line-height: 1.5; }
.hub-section { padding: 4.8rem 0; }
.hub-section-heading { max-width: 44rem; margin-bottom: 2rem; }
.hub-section h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.03em; }
.hub-section-heading p:last-child { color: var(--hub-muted); line-height: 1.7; }
.hub-filters { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: 1.5rem; }
.hub-filter { border: 1px solid var(--hub-border); border-radius: 999px; background: var(--hub-surface); color: var(--hub-text); padding: .55rem .9rem; font-weight: 750; }
.hub-filter[aria-pressed="true"] { border-color: var(--hub-accent); background: var(--hub-accent); color: #fff; }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.15rem; }
.hub-card { display: flex; min-height: 100%; flex-direction: column; border: 1px solid var(--hub-border); border-radius: 1.1rem; background: var(--hub-surface); padding: 1.35rem; box-shadow: 0 12px 34px rgba(28,48,80,.06); }
.hub-card[hidden] { display: none; }
.hub-category { color: var(--hub-teal); font-size: .72rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.hub-card h3 { margin: .7rem 0 0; font-size: 1.3rem; line-height: 1.25; }
.hub-card p { color: var(--hub-muted); line-height: 1.65; }
.hub-card-meta { margin-top: auto; border-top: 1px solid var(--hub-border); padding-top: 1rem; color: var(--hub-muted); font-size: .8rem; }
.hub-card-link { display: inline-flex; margin-top: 1rem; color: var(--hub-accent); font-weight: 800; }
.hub-card-link:hover { text-decoration: underline; }
.hub-standard { background: var(--hub-surface); }
.hub-standard-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.hub-standard-grid div { border-left: 3px solid var(--hub-accent); padding-left: 1rem; }
.hub-standard-grid p { color: var(--hub-muted); line-height: 1.65; }

.article-hero { padding: 4.8rem 0 3.5rem; background: linear-gradient(180deg, var(--hub-soft), var(--hub-bg)); }
.article-breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; color: var(--hub-muted); font-size: .88rem; }
.article-breadcrumbs a { color: var(--hub-accent); font-weight: 700; }
.article-hero h1 { max-width: 22ch; margin: 1.2rem 0 0; font-size: calc(3rem - 1pt); font-weight: 800; line-height: 1.18; letter-spacing: normal; }
.article-deck { max-width: 48rem; color: var(--hub-muted); font-size: 1.15rem; line-height: 1.75; }
.article-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin-top: 1.3rem; color: var(--hub-muted); font-size: .86rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 3.5rem; align-items: start; padding: 4rem 0 5rem; }
.article-body { min-width: 0; font-size: 1.03rem; line-height: 1.82; }
.article-body h2 { scroll-margin-top: 6rem; margin: 2.8rem 0 .8rem; font-size: 1.8rem; line-height: 1.2; letter-spacing: -.025em; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin: 2rem 0 .6rem; font-size: 1.25rem; }
.article-body p, .article-body li { color: color-mix(in srgb, var(--hub-text) 82%, var(--hub-muted)); }
.article-body ul, .article-body ol { padding-left: 1.35rem; }
.article-body li + li { margin-top: .55rem; }
.article-callout { margin: 1.6rem 0; border: 1px solid color-mix(in srgb, var(--hub-accent) 36%, var(--hub-border)); border-radius: 1rem; background: color-mix(in srgb, var(--hub-accent) 7%, var(--hub-surface)); padding: 1.2rem 1.3rem; }
.article-callout strong { display: block; color: var(--hub-text); }
.article-callout p { margin-bottom: 0; }
.article-safety { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 8%, var(--hub-surface)); }
.confidence-ladder { display: grid; gap: .75rem; margin: 1.5rem 0; }
.confidence-ladder div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; border: 1px solid var(--hub-border); border-radius: .8rem; background: var(--hub-surface); padding: 1rem; }
.confidence-ladder strong { color: var(--hub-accent); }
.article-toc { position: sticky; top: 6rem; border: 1px solid var(--hub-border); border-radius: 1rem; background: var(--hub-surface); padding: 1.15rem; }
.article-toc strong { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.article-toc a { display: block; margin-top: .7rem; color: var(--hub-muted); font-size: .9rem; line-height: 1.4; }
.article-toc a:hover { color: var(--hub-accent); }
.article-sources { margin-top: 3rem; border-top: 1px solid var(--hub-border); padding-top: 1.5rem; }
.article-sources a { color: var(--hub-accent); text-decoration: underline; text-underline-offset: 2px; }
.article-next { margin-top: 3rem; border-radius: 1rem; background: var(--hub-soft); padding: 1.4rem; }
.article-next a { color: var(--hub-accent); font-weight: 800; }
.article-cta { margin-top: 2.5rem; border: 1px solid color-mix(in srgb, var(--hub-accent) 32%, var(--hub-border)); border-radius: 1.15rem; background: linear-gradient(135deg, color-mix(in srgb, var(--hub-accent) 10%, var(--hub-surface)), var(--hub-surface)); padding: 1.6rem; }
.article-cta h2 { margin: 0; font-size: 1.55rem; }
.article-cta p { max-width: 42rem; margin: .65rem 0 1.15rem; }
.article-cta-action { display: inline-flex; align-items: center; justify-content: center; border-radius: .7rem; background: var(--hub-button); color: #fff !important; padding: .78rem 1.15rem; font-weight: 800; text-decoration: none !important; }
.article-cta-action:hover { background: var(--hub-button-hover); }
.hub-footer { border-top: 1px solid var(--hub-border); background: var(--hub-footer-bg); color: var(--hub-footer-text); padding: 2rem 0; }
.hub-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .86rem; }
.hub-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.hub-footer a:hover { color: var(--hub-accent); }

@media (max-width: 850px) {
  .hub-grid, .hub-principles, .hub-standard-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { position: static; order: -1; }
  .hub-nav a:not(.hub-action) { display: none; }
}

@media (max-width: 520px) {
  .hub-shell { width: min(calc(100% - 1.25rem), 72rem); }
  .hub-hero, .article-hero { padding-top: 3.8rem; }
  .hub-hero h1, .article-hero h1 { font-size: 2.25rem; }
  .confidence-ladder div { grid-template-columns: 1fr; gap: .25rem; }
}
