/* Shared directory and concept-page presentation. */
:root {
  color-scheme: dark;
  --site-bg: #0f172a;
  --site-panel: #1e293b;
  --site-border: #334155;
  --site-text: #f1f5f9;
  --site-muted: #a6b4c8;
  --site-amber: #fbbf24;
  --site-cyan: #67e8f9;
  --site-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.site-page { margin: 0; background: var(--site-bg); color: var(--site-text); font-family: var(--site-font); line-height: 1.65; }
.site-page *, .site-nav *, .concept-hero *, .concept-footer * { box-sizing: border-box; }
.site-page a, .site-nav a, .concept-hero a, .concept-footer a { text-decoration: none; }
.site-page a { color: inherit; }
.site-page ::selection { background: #92400e; color: #fff; }
.site-page :focus-visible, .concept-page :focus-visible { outline: 2px solid var(--site-amber); outline-offset: 5px; }
.site-skip { position: absolute; top: -100px; left: 20px; z-index: 20; padding: 12px 20px; background: #fbbf24; color: #0f172a !important; border-radius: 8px; }
.site-skip:focus { top: 10px; }
.site-wrap { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.site-nav { width: min(1180px, calc(100% - 64px)); margin: 0 auto; padding: 25px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; font: 14px/1.5 var(--site-font); border-bottom: 1px solid var(--site-border); }
.site-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 780; letter-spacing: -1.3px; color: #f8fafc !important; }
.site-brand::before { content: ""; width: 32px; height: 32px; flex-shrink: 0; margin-right: 5px; border-radius: 7px; background: url("../images/knlp-logo.png") center / contain no-repeat; }
.site-nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 25px; }
.site-nav-links a { color: var(--site-muted); transition: color .18s; }
.site-nav-links a:hover, .site-nav-links a[aria-current] { color: #fbbf24; }
.site-hero { position: relative; padding: 86px 0 72px; }
.site-hero.split { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 24px; }
.site-hero.split h1 { font-size: clamp(42px, 5vw, 64px); }
.site-eyebrow { margin: 0 0 20px; color: #fbbf24; text-transform: uppercase; letter-spacing: .16em; font: 650 11px/1.6 var(--site-font); }
.site-page h1 { margin: 0 0 24px; max-width: 850px; font-size: clamp(42px, 5.5vw, 72px); line-height: 1.06; font-weight: 740; letter-spacing: -.055em; }
.site-gradient { background: linear-gradient(115deg, #fbbf24, #fb923c 55%, #f87171); background-clip: text; -webkit-background-clip: text; color: transparent; }
.site-lead { max-width: 600px; margin: 0; color: #b4c0d2; font-size: 18px; line-height: 1.8; }
.site-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.site-button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; padding: 11px 19px; border: 1px solid #475569; border-radius: 9px; font-size: 14px; font-weight: 600; transition: background .18s, border-color .18s; }
.site-button.primary { background: #fbbf24; border-color: #fbbf24; color: #0f172a; }
.site-button:hover { background: #334155; border-color: #94a3b8; }
.site-button.primary:hover { background: #fcd34d; border-color: #fcd34d; }
.site-art { position: relative; margin: 0 -20px 0 0; }
.site-art img { display: block; width: 100%; height: auto; border-radius: 30px; }
.site-section { padding: 48px 0 60px; border-top: 1px solid var(--site-border); scroll-margin-top: 20px; }
.site-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.site-section-head h2 { margin: 0; font-size: clamp(27px, 3.4vw, 36px); line-height: 1.2; letter-spacing: -.035em; }
.site-section-head p { max-width: 430px; margin: 0; font-size: 14px; color: var(--site-muted); }
.site-section-label { display: block; margin-bottom: 8px; color: var(--site-cyan); font: 600 10px/1.5 var(--site-font); letter-spacing: .17em; text-transform: uppercase; }
.site-section.research .site-section-label { color: #c4b5fd; }
.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.site-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 25px; border-radius: 16px; border: 1px solid #334155; background: linear-gradient(145deg, #1e293b, #182235); transition: border-color .2s, transform .2s, box-shadow .2s; }
.site-card:hover { border-color: #64748b; transform: translateY(-3px); box-shadow: 0 12px 30px -18px #020617; }
.site-card.featured { border-color: #73522b; background: radial-gradient(ellipse at top right, #43312355, transparent 75%), linear-gradient(145deg, #1e293b, #182235); }
.site-card.featured:hover { border-color: #f59e0b; }
.site-card .site-card-kicker { display: flex; align-items: center; gap: 8px; min-height: 20px; margin-bottom: 22px; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #a6b4c8; }
.site-card-kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #67e8f9; }
.research .site-card-kicker::before { background: #c4b5fd; }
.site-card.featured .site-card-kicker::before { background: #fbbf24; }
.site-card h3 { margin: 0 0 12px; font-size: 19px; line-height: 1.3; font-weight: 650; letter-spacing: -.02em; }
.site-card h3 a:hover { color: #fcd34d; }
.site-card h3 a::after { content: " ↗"; color: #718299; font-size: 15px; white-space: nowrap; }
.site-card p { margin: 0 0 22px; font-size: 14px; line-height: 1.75; color: #aebcd0; }
.site-stage { display: flex; align-items: flex-start; flex-direction: column; gap: 8px; margin: 2px 0 18px; color: #a6b4c8; font-size: 11px; }
.site-stage-badge { padding: 3px 9px; border: 1px solid #475569; border-radius: 999px; font-size: 11px; font-weight: 650; line-height: 1.5; }
.site-stage-badge.upstream { color: #fcd34d; border-color: #92400e; background: #78350f33; }
.site-stage-badge.design { color: #67e8f9; border-color: #155e75; background: #164e6333; }
.site-stage-badge.rfc { color: #fdba74; border-color: #9a3412; background: #7c2d1233; }
.site-stage-badge.tooling { color: #6ee7b7; border-color: #065f46; background: #064e3b33; }
.site-stage-badge.evaluation { color: #c4b5fd; border-color: #5b21b6; background: #4c1d9533; }
.site-stage-badge.parked { color: #cbd5e1; background: #33415555; }
.site-card .site-card-progress { margin-top: auto; padding: 0 0 0 12px; border-left: 2px solid #475569; font-size: 13px; }
.site-card-progress strong { display: block; margin-bottom: 4px; color: #e2e8f0; font-size: 12px; font-weight: 600; }
.site-card-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 16px; border-top: 1px solid #334155; font-size: 12px; }
.site-card-links a { color: #cbd5e1; }
.site-card-links a:hover { color: #fbbf24; text-decoration: underline; text-underline-offset: 4px; }
.site-status { display: inline-block; color: #fcd34d; font-size: 11px; font-weight: 600; }
.site-archive { margin-top: 24px; padding: 18px 24px; border: 1px solid #334155; border-radius: 12px; background: #111b2d; }
.site-archive summary { cursor: pointer; font-size: 14px; font-weight: 600; color: #cbd5e1; }
.site-link-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 24px; padding: 22px 0 4px; }
.site-link-list a { color: #aebcd0; font-size: 13px; }
.site-link-list a:hover { color: #fbbf24; }
.site-concepts { padding: 36px; border: 1px solid #475569; border-radius: 20px; background: radial-gradient(ellipse at top left, #92400e22, transparent 60%), #182235; }
.site-concepts .site-section-head { align-items: center; }
.site-concepts h2 { max-width: 480px; }
.site-concept-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.site-concept-links a { border-top: 1px solid #475569; padding-top: 16px; font-size: 14px; font-weight: 550; }
.site-concept-links a:hover { color: #fbbf24; }
.site-concept-links span { display: block; margin-bottom: 9px; font-size: 10px; font-weight: 500; letter-spacing: .08em; color: #94a3b8; text-transform: uppercase; }
.site-resources { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 36px 0; }
.site-resources h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.site-resources nav { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 13px; color: var(--site-muted); }
.site-resources a:hover { color: #fbbf24; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #334155; padding: 26px 0 40px; color: #94a3b8; font-size: 12px; }
.site-footer p { margin: 0; }
.site-footer a:hover { color: #fbbf24; }
.site-reading-path { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; font-size: 13px; color: #cbd5e1; }
.site-reading-path a { color: inherit; }
.site-reading-path span { color: #fbbf24; margin-right: 6px; }
.site-reading-path a:hover { color: #fbbf24; }
.site-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-topic-grid .site-card { padding: 32px; }
.site-topic-grid .site-card h2 { margin: 0 0 16px; font-size: 26px; letter-spacing: -.03em; }
.site-topic-grid .site-card h2 a:hover { color: #fbbf24; }
.site-question { font-size: 17px !important; color: #e2e8f0 !important; }

/* Keep each explainer's plots and controls, with one shared reading shell. */
.concept-page {
  --bg: #0f172a; --bg2: #1e293b; --bg3: #111b2d;
  --panel: #182235; --panel2: #1e293b; --surface: #182235;
  --card: #1e293b; --border: #334155; --border2: #475569;
  --text: #e2e8f0; --t1: #f1f5f9; --t2: #b0bed0; --t3: #94a3b8;
  --muted: #94a3b8; --muted2: #b0bed0;
  --accent: #fbbf24; --amber: #fbbf24; --cyan: #67e8f9;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: var(--site-font);
  margin: 0; background: #0f172a; color: #e2e8f0;
  font-family: var(--site-font); line-height: 1.65;
}
html:has(.concept-page) { font-size: 16px; scroll-behavior: smooth; }
html:has(.concept-correlation) { font-size: 20px; }
.concept-page .grain { display: none; }
.concept-hero { width: min(1180px, calc(100% - 64px)); margin: 0 auto 40px; padding: 58px 0 30px; border-bottom: 1px solid #334155; }
.concept-hero .site-eyebrow { margin-bottom: 18px; }
.concept-hero h1, .concept-hero h1 em { margin: 0 0 20px; max-width: 960px; font-family: var(--site-font); font-size: clamp(34px, 5vw, 60px); line-height: 1.1; letter-spacing: -.045em; font-style: normal; font-weight: 720; color: #f1f5f9; }
.concept-hero h1 em { color: #fbbf24; }
.concept-hero p { max-width: 790px; margin: 0; color: #b4c0d2; font-size: 17px; line-height: 1.85; }
.concept-hero .site-reading-path { margin-top: 25px; }
.concept-hero .site-reading-path a[aria-current] { color: #fbbf24; }
.concept-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 64px)); margin: 50px auto 0; padding: 24px 0 40px; border-top: 1px solid #334155; font: 14px/1.6 var(--site-font); }
.concept-footer a { color: #cbd5e1; }
.concept-footer a:hover { color: #fbbf24; }
.concept-page .page { max-width: 1180px; padding: 0 0 40px; }
.concept-page .box, .concept-page .panel, .concept-page .controls, .concept-page .step-box, .concept-page .r2-example, .concept-page .formula-box { border-radius: 12px; }
.concept-page .section { margin-bottom: 56px; }
.concept-page .section-num, .concept-page .box-label { font-size: 11px; letter-spacing: .1em; }
.concept-page .section-title { font-size: 26px; }
.concept-page .section-lead { max-width: 760px; font-size: 16px; }
.concept-page .edu-section { max-width: 1180px; margin: 0 auto 20px; padding: 26px 30px; border: 1px solid #334155; border-radius: 14px; background: #182235; }
.concept-page .edu-section.alt { background: #1e293b; }
.concept-page .prose { font: 15px/1.85 var(--site-font); max-width: 850px; }
.concept-page .sec-tag { font: 600 12px/1.6 var(--site-font); letter-spacing: .06em; }
.concept-page .step-title-sm { font-size: 14px; }
.concept-page .step-body-sm, .concept-page .formula-interp, .concept-page .r2-ex-desc { font: 13px/1.8 var(--site-font); }
.concept-page .f-note { font-size: 11px !important; }
.concept-page .step-num-lg, .concept-page .r2-val { font-family: var(--site-font); }
.concept-page .formula-box { font-size: 15px; }
.concept-page .interactive-layout { max-width: 1180px; margin: auto; height: auto; border: 1px solid #334155; border-radius: 14px; overflow: hidden; }
.concept-page .left-plots { min-width: 0; grid-template-rows: repeat(2, minmax(280px, 1fr)); }
.concept-page .plot-panel, .concept-page .canvas-wrap { min-height: 0; min-width: 0; }
.concept-page .canvas-wrap canvas { position: absolute; inset: 0; }
.concept-page .sidebar { min-width: 0; overflow-y: visible; }
.concept-page .concept-grid > * { min-width: 0; }
.concept-page .big-val { font-family: var(--site-font); font-size: clamp(28px, 3.4vw, 44px); font-weight: 650; }
.concept-page .panel-grid > *, .concept-page .controls > *, .concept-page .r2-layout > * { min-width: 0; }
.concept-page main { max-width: 1244px; }
.concept-page .concept-bandwidth-main { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.concept-page .controls { gap: 20px 28px; }
.concept-page .ctrl-group label { font: 12px/1.6 var(--site-font); letter-spacing: .02em; }
.concept-page .tag { border-radius: 999px; padding: 3px 10px; }
.concept-page input[type="range"] { accent-color: #fbbf24; }
.concept-page .header-badge { display: none; }
.concept-page .panel-title { font-family: var(--site-font); }
.concept-page table { display: block; max-width: 100%; overflow-x: auto; }
.concept-page .concept-bandwidth { max-width: 1180px; padding: 0 0 40px; }
.concept-page .text-gray-500, .concept-page .text-gray-600 { color: #94a3b8; }
@media (max-width: 900px) {
  .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-hero.split { grid-template-columns: 1fr; }
  .site-art { display: none; }
  .site-section-head { flex-direction: column; gap: 16px; align-items: flex-start; }
  .site-concepts .site-section-head { align-items: flex-start; }
  .site-concept-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .concept-page .page { width: calc(100% - 40px); }
  .concept-page .step-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .concept-page .step-arrow { display: none; }
  .concept-page .edu-section { width: calc(100% - 40px); }
  .concept-page .interactive-layout { width: calc(100% - 40px); grid-template-columns: minmax(0, 1fr); height: auto; }
  .concept-page .left-plots { height: 580px; border-right: 0; }
  .concept-page .rank-diagram { overflow-x: auto; padding-bottom: 12px; }
  .concept-page .r2-layout { flex-direction: column; }
}
@media (max-width: 600px) {
  .site-wrap, .site-nav, .concept-hero, .concept-footer { width: calc(100% - 36px); }
  .site-nav { padding: 20px 0; gap: 18px; align-items: flex-start; }
  .site-nav-links { gap: 7px 16px; justify-content: flex-end; font-size: 12px; }
  .site-brand { font-size: 23px; }
  .site-hero { padding: 54px 0; }
  .site-lead { font-size: 16px; }
  .site-section { padding: 36px 0 42px; }
  .site-grid, .site-topic-grid { grid-template-columns: 1fr; }
  .site-card, .site-topic-grid .site-card { padding: 24px; }
  .site-card .site-card-kicker { margin-bottom: 15px; }
  .site-link-list { grid-template-columns: 1fr 1fr; }
  .site-concepts { padding: 25px; }
  .site-concept-links { gap: 22px 16px; }
  .site-footer { flex-direction: column; gap: 8px; }
  .concept-hero { padding-top: 40px; margin-bottom: 24px; }
  .concept-hero p { font-size: 15px; }
  .concept-hero .site-reading-path { gap: 10px 16px; font-size: 12px; }
  .concept-page .edu-section { padding: 22px 18px; width: calc(100% - 28px); }
  .concept-page .step-strip { grid-template-columns: 1fr; }
  .concept-page .formula-box { max-width: 100%; overflow-x: auto; }
  .concept-page .controls { grid-template-columns: 1fr; padding: 20px; }
  .concept-page .controls > .ctrl-group { grid-column: auto !important; }
  .concept-page .two-ceilings { grid-template-columns: 1fr; }
  .concept-page .concept-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .concept-page .sd-result { grid-template-columns: 1fr; }
  .concept-page .reuse-grid { grid-template-columns: 1fr; }
  .concept-page .comparison-arrow { min-height: 50px; transform: rotate(90deg); }
  .concept-page .concept-bandwidth-main { width: calc(100% - 36px); }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.concept-page) { scroll-behavior: auto; }
  .site-card, .site-button { transition: none; }
  .site-card:hover { transform: none; }
}
