/* =========================================================
   RUM & Core Web Vitals — Main Stylesheet
   ========================================================= */

/* ----- Custom Properties ----- */
:root {
  --blue:        #2563EB;
  --blue-dark:   #1E40AF;
  --blue-light:  #EFF6FF;
  --blue-mid:    #BFDBFE;
  --cyan:        #0891B2;
  --cyan-light:  #ECFEFF;
  --amber:       #D97706;
  --amber-light: #FFFBEB;
  --green:       #059669;
  --green-light: #ECFDF5;
  --red:         #DC2626;
  --red-light:   #FEF2F2;
  --yellow:      #CA8A04;
  --yellow-light:#FEFCE8;

  --bg:          #F8FAFC;
  --bg-alt:      #F1F5F9;
  --white:       #FFFFFF;
  --text:        #0F172A;
  --text-md:     #334155;
  --text-sm:     #64748B;
  --border:      #E2E8F0;
  --border-dark: #CBD5E1;

  --header-h:    64px;
  --max-w:       1440px;
  --content-w:   860px;
  --r:           8px;
  --r-lg:        14px;
  --r-xl:        20px;

  --shadow-sm:   0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.05);
  --shadow-md:   0 4px 16px rgba(15,23,42,.09), 0 2px 6px rgba(15,23,42,.06);
  --shadow-lg:   0 10px 40px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.08);

  --t:           0.18s ease;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:   'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--t);
}
a:hover { color: var(--blue-dark); }

/* Anchor offset for sticky header */
h1, h2, h3, h4, h5, h6 {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--t);
}
.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  transition: color var(--t);
}
.logo:hover .logo-text { color: var(--blue); }
.logo-dot { color: var(--blue); }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--text-md);
  text-decoration: none;
  transition: background var(--t), color var(--t);
}
.nav-link svg { opacity: 0.6; transition: opacity var(--t); }
.nav-link:hover {
  background: var(--bg-alt);
  color: var(--nav-color, var(--blue));
}
.nav-link:hover svg, .nav-link.active svg { opacity: 1; }
.nav-link.active {
  background: color-mix(in srgb, var(--nav-color, var(--blue)) 12%, transparent);
  color: var(--nav-color, var(--blue));
  font-weight: 650;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  border-radius: var(--r);
  transition: background var(--t);
}
.nav-toggle:hover { background: var(--bg-alt); }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-md);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----- Hero ----- */
.hero {
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 50%, #ECFEFF 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--blue-mid);
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.hero-title-accent {
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-md);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.25rem;
  background: var(--cta-bg, var(--blue-light));
  color: var(--cta-color, var(--blue));
  border: 1.5px solid color-mix(in srgb, var(--cta-color, var(--blue)) 20%, transparent);
  border-radius: 10px;
  font-size: 0.925rem;
  font-weight: 650;
  text-decoration: none;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--cta-color, var(--blue)) 25%, transparent);
  background: color-mix(in srgb, var(--cta-bg, var(--blue-light)) 80%, white);
  color: var(--cta-color, var(--blue));
}
.hero-cta-icon { flex-shrink: 0; }
.cta-arrow { opacity: 0.6; transition: transform var(--t), opacity var(--t); }
.hero-cta:hover .cta-arrow { transform: translateX(3px); opacity: 1; }

/* Hero visual */
.hero-visual {
  flex-shrink: 0;
}
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 280px;
}
.metric-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
}
.metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sm);
}
.metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.metric-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  align-self: flex-start;
}
.metric-badge.good    { background: var(--green-light); color: var(--green); }
.metric-badge.needs   { background: var(--yellow-light); color: var(--yellow); }
.metric-badge.stat    { background: var(--blue-light); color: var(--blue); }
.metric-card--good .metric-value  { color: var(--green); }
.metric-card--needs .metric-value { color: var(--yellow); }
.metric-card--stat .metric-value  { color: var(--blue); }

/* ----- About Section ----- */
.about-section {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.about-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.about-text {
  font-size: 1.05rem;
  color: var(--text-md);
  line-height: 1.75;
  max-width: 860px;
}
.about-text strong { color: var(--text); }

/* ----- Sections Grid ----- */
.sections-grid-section {
  background: var(--bg);
  padding: 4rem 0;
}
.sections-grid-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}
.sections-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.section-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
  position: relative;
  overflow: hidden;
}
.section-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--card-color, var(--blue));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.section-card-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.section-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-card-title {
  font-size: 1.1rem;
  font-weight: 750;
  color: var(--text);
  line-height: 1.3;
  margin-top: 0.25rem;
}
.section-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t);
}
.section-card-title a:hover { color: var(--card-color, var(--blue)); }

.section-card-desc {
  font-size: 0.9rem;
  color: var(--text-sm);
  line-height: 1.65;
}

.section-card-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.section-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-md);
  padding: 0.3rem 0;
  text-decoration: none;
  transition: color var(--t);
}
.section-link svg { opacity: 0.5; flex-shrink: 0; transition: opacity var(--t), transform var(--t); }
.section-link:hover { color: var(--card-color, var(--blue)); }
.section-link:hover svg { opacity: 1; transform: translateX(3px); }
.section-link--more { color: var(--card-color, var(--blue)); font-weight: 600; }

.section-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  margin-top: auto;
  transition: gap var(--t);
}
.section-card-cta:hover { gap: 0.7rem; }
.section-card-cta svg { transition: transform var(--t); }
.section-card-cta:hover svg { transform: translateX(4px); }

/* ----- Metrics Callout ----- */
.metrics-callout {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4rem 0;
}
.metrics-callout-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}
.metrics-callout-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.metrics-callout-sub {
  color: var(--text-sm);
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

/* ----- Tables ----- */
.table-wrap, .metrics-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

table, .metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--white);
}
th {
  background: var(--bg-alt);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-sm);
  padding: 0.8rem 1.1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-md);
  line-height: 1.5;
}
td strong { color: var(--text); font-weight: 700; }
td span { font-size: 0.78rem; color: var(--text-sm); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

.good-col  { color: var(--green) !important; font-weight: 700 !important; text-align: center; }
.needs-col { color: var(--yellow) !important; font-weight: 700 !important; text-align: center; }
.poor-col  { color: var(--red) !important; font-weight: 700 !important; text-align: center; }
th.good-col, th.needs-col, th.poor-col { color: var(--text-sm) !important; font-weight: 700 !important; }

/* ----- Footer ----- */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
}
.logo--footer .logo-text { color: white; }
.logo--footer:hover .logo-text { color: var(--blue-mid); }
.footer-tagline {
  margin-top: 0.85rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.5);
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.footer-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}
.footer-section ul { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.footer-section a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color var(--t);
}
.footer-section a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

/* ----- Breadcrumbs ----- */
.breadcrumbs {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.breadcrumbs-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.7rem 2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.crumb {
  font-size: 0.8rem;
  color: var(--text-sm);
  text-decoration: none;
  transition: color var(--t);
}
a.crumb:hover { color: var(--blue); }
.crumb--current { color: var(--text-md); font-weight: 550; }
.crumb-sep { color: var(--border-dark); flex-shrink: 0; }

/* ----- Page Layout ----- */
.page-wrapper {
  min-height: 60vh;
}
.content-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* ----- Article Content ----- */
.article-content {
  min-width: 0;
  max-width: var(--content-w);
}

.article-content h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.article-content h1 + p {
  font-size: 1.05rem;
  color: var(--text-md);
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  margin: 2.5rem 0 0.85rem;
  line-height: 1.2;
}
.article-content h3 {
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--text);
  margin: 2rem 0 0.65rem;
  line-height: 1.3;
}
.article-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-md);
  margin: 1.5rem 0 0.5rem;
}

.article-content p {
  margin-bottom: 1.1rem;
  color: var(--text-md);
  font-size: 1rem;
  line-height: 1.75;
}

.article-content ul, .article-content ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.article-content li {
  color: var(--text-md);
  font-size: 0.975rem;
  line-height: 1.65;
}
.article-content li > ul, .article-content li > ol {
  margin-top: 0.4rem;
  margin-bottom: 0.25rem;
}

.article-content strong { color: var(--text); font-weight: 700; }
.article-content em { color: var(--text-md); }

.article-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--blue) 30%, transparent);
  text-underline-offset: 3px;
  transition: color var(--t), text-decoration-color var(--t);
}
.article-content a:hover {
  color: var(--blue-dark);
  text-decoration-color: var(--blue-dark);
}

/* Inline code */
.article-content :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-alt);
  color: var(--blue-dark);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Tables in article — wrapping handled server-side by Eleventy transform */
.article-content .table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}
.article-content .table-wrap table {
  margin: 0;
  border: none;
  box-shadow: none;
  border-radius: 0;
  width: 100%;
  display: table;
}

/* Blockquotes */
.article-content blockquote {
  border-left: 4px solid var(--blue);
  background: var(--blue-light);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0 var(--r) var(--r) 0;
}
.article-content blockquote p { color: var(--blue-dark); margin: 0; }

/* Horizontal rule */
.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ----- Code Blocks ----- */
.article-content pre,
pre[class*="language-"] {
  background: #F1F5F9;
  border-radius: var(--r-lg);
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
  margin: 1.5rem 0;
  position: relative;
  border: 1px solid #CBD5E1;
  box-shadow: var(--shadow-sm);
  color: #1E293B;
}

pre[class*="language-"] code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  border: none;
  color: #1E293B;
}

/* Prism token colors — light theme */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata          { color: #94A3B8; font-style: italic; }
.token.punctuation    { color: #64748B; }
.token.namespace      { opacity: 0.7; }
.token.property,
.token.tag            { color: #0891B2; }
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted        { color: #D97706; }
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted       { color: #059669; }
.token.operator,
.token.entity,
.token.url            { color: #475569; }
.token.atrule,
.token.attr-value,
.token.keyword        { color: #2563EB; font-weight: 600; }
.token.function,
.token.class-name     { color: #7C3AED; }
.token.regex,
.token.important,
.token.variable       { color: #D97706; }
/* Plain text / preformatted (no language class) */
pre:not([class]) code { color: #334155; }

/* Copy button — light theme */
.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.9);
  border: 1px solid #CBD5E1;
  color: #64748B;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: background var(--t), color var(--t), border-color var(--t), box-shadow var(--t);
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.copy-btn:hover {
  background: var(--white);
  color: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(37,99,235,0.15);
}
.copy-btn.copied {
  background: var(--green-light);
  border-color: #6EE7B7;
  color: var(--green);
}
.copy-btn svg { flex-shrink: 0; }

/* ----- Task List Checkboxes ----- */
.article-content .contains-task-list {
  list-style: none;
  margin-left: 0;
}
.article-content .task-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.35rem 0;
}
.article-content .task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-dark);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.2em;
  position: relative;
  transition: background var(--t), border-color var(--t);
}
.article-content .task-list-item input[type="checkbox"]:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.article-content .task-list-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l3 3 5-6' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.article-content .task-list-item input[type="checkbox"]:hover:not(:checked) {
  border-color: var(--blue);
}

/* ----- FAQ Accordions ----- */
.faq-accordion {
  list-style: none;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-details {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--white);
  overflow: hidden;
  transition: box-shadow var(--t);
}
.faq-details[open] {
  box-shadow: var(--shadow-sm);
}
.faq-details[open] .faq-question {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: background var(--t);
  user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::marker { display: none; content: ''; }
.faq-question:hover { background: var(--bg-alt); }
.faq-question::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l5 5 5-5' stroke='%2364748B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.faq-details[open] .faq-question::after {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 1rem 1.25rem;
  font-size: 0.925rem;
  color: var(--text-md);
  line-height: 1.7;
}

/* ----- Sidebar ----- */
.content-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sidebar-subnav {
  list-style: none;
  margin: 0.2rem 0 0.4rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
}

.sidebar-link {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  color: var(--text-sm);
  border-radius: 6px;
  text-decoration: none;
  line-height: 1.4;
  transition: background var(--t), color var(--t);
}
.sidebar-link--sub { font-size: 0.78rem; }
.sidebar-link:hover {
  background: color-mix(in srgb, var(--link-color, var(--blue)) 10%, transparent);
  color: var(--link-color, var(--blue));
}
.sidebar-link--active {
  background: color-mix(in srgb, var(--link-color, var(--blue)) 12%, transparent);
  color: var(--link-color, var(--blue));
  font-weight: 650;
}

.sidebar-sections { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-section-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--r);
  border-left: 3px solid var(--section-color, var(--blue));
  background: var(--section-bg, var(--blue-light));
  text-decoration: none;
  transition: transform var(--t), box-shadow var(--t);
}
.sidebar-section-link:hover { transform: translateX(3px); box-shadow: var(--shadow-sm); }
.sidebar-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--section-color, var(--blue));
}
.sidebar-section-desc {
  font-size: 0.72rem;
  color: var(--text-sm);
  line-height: 1.4;
}
.sidebar-widget--sections .sidebar-title { color: var(--text-sm); }

/* ----- Anchor links from markdown-it-anchor (headerLink mode) ----- */
/* headerLink() wraps the entire heading text in <a class="header-anchor">
   — must be fully visible, styled like normal heading text */
.article-content .header-anchor {
  color: inherit;
  text-decoration: none;
  display: block;
}
.article-content .header-anchor:hover {
  color: var(--blue);
  text-decoration: none;
}
/* Show a subtle # symbol after headings on hover */
.article-content h2 .header-anchor::after,
.article-content h3 .header-anchor::after,
.article-content h4 .header-anchor::after {
  content: ' #';
  font-size: 0.7em;
  font-weight: 400;
  color: var(--border-dark);
  opacity: 0;
  transition: opacity var(--t);
  vertical-align: middle;
}
.article-content h2:hover .header-anchor::after,
.article-content h3:hover .header-anchor::after,
.article-content h4:hover .header-anchor::after {
  opacity: 1;
}

/* ----- Responsive ----- */
@media (max-width: 1100px) {
  .sections-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-nav { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem;
  }
  .hero-visual { display: none; }
  .content-layout {
    grid-template-columns: 1fr;
    padding: 1.5rem 1.25rem 3rem;
  }
  .content-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .site-nav.open { display: flex; }
  .nav-link { width: 100%; }

  .header-inner { padding: 0 1.25rem; }

  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-ctas { flex-direction: column; }
  .hero-cta { justify-content: space-between; }

  .about-inner { padding: 2rem 1.25rem; }
  .sections-grid { grid-template-columns: 1fr; }
  .sections-grid-inner { padding: 0 1.25rem; }
  .sections-grid-section { padding: 2.5rem 0; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 1.25rem; }
  .footer-nav { grid-template-columns: 1fr 1fr; gap: 1.5rem; }

  .breadcrumbs-inner { padding: 0.6rem 1.25rem; }

  .metrics-callout-inner { padding: 0 1.25rem; }
  .metrics-callout { padding: 2.5rem 0; }
}

@media (max-width: 480px) {
  .footer-nav { grid-template-columns: 1fr; }
  .hero-cta { font-size: 0.85rem; }
  .metrics-grid { width: 100%; }
  .hero-visual { display: block; }
  .hero-inner { padding: 2.5rem 1.25rem; grid-template-columns: 1fr; }
}

