:root {
  color-scheme: dark;
  --bg: #05080d;
  --surface: #0b121c;
  --surface-2: #101b29;
  --surface-3: #132234;
  --border: #1c2d40;
  --border-strong: #31506b;
  --text: #edf6ff;
  --muted: #91a4b9;
  --cyan: #45d9ff;
  --blue: #5f8fff;
  --green: #45e5aa;
  --violet: #af91ff;
  --amber: #ffc06b;
  --red: #ff758c;
  --shadow: 0 24px 70px rgba(0,0,0,.34);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 86px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 55% -12%, rgba(69,217,255,.1), transparent 34rem),
    radial-gradient(circle at 100% 50%, rgba(175,145,255,.07), transparent 34rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
a { color: inherit; }
button { font: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }

.knowledge-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(250px,1fr) auto minmax(250px,1fr);
  align-items: center;
  gap: 22px;
  padding: 10px 18px;
  background: rgba(5,8,13,.94);
  border-bottom: 1px solid rgba(69,217,255,.2);
  box-shadow: 0 10px 32px rgba(0,0,0,.28);
  backdrop-filter: blur(20px);
}
.knowledge-brand { justify-self: start; display: flex; align-items: center; gap: 13px; min-width: 246px; color: inherit; text-decoration: none; border-radius: 13px; }
.knowledge-brand-mark { position: relative; width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; border: 1px solid rgba(69,217,255,.58); border-radius: 15px; background: radial-gradient(circle at 35% 25%, rgba(69,217,255,.3), transparent 48%), linear-gradient(145deg, #102b3c, #091521); box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 0 28px rgba(69,217,255,.16); }
.knowledge-brand-mark::after { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(69,217,255,.13); border-radius: 10px; }
.knowledge-brand-name { font-size: 14px; font-weight: 850; letter-spacing: .13em; line-height: 1.1; }
.knowledge-brand-sub { margin-top: 5px; color: var(--cyan); font-size: 9px; font-weight: 750; letter-spacing: .24em; line-height: 1; }
.knowledge-topbar-title { min-width: 0; justify-self: end; text-align: right; }
.knowledge-topbar-title strong { display: block; font-size: 16px; line-height: 1.2; }
.knowledge-topbar-title span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.topbar-links { justify-self: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.topbar-links a { padding: 8px 11px; border: 1px solid transparent; border-radius: 8px; color: #a6b6c8; text-decoration: none; font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.topbar-links a:hover { color: var(--text); border-color: var(--border); background: rgba(69,217,255,.05); }
.topbar-links a.active { color: var(--cyan); border-color: rgba(69,217,255,.25); background: rgba(69,217,255,.08); }

.knowledge-shell { width: min(1460px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 70px; }
.knowledge-hero { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(340px,.65fr); gap: 20px; align-items: stretch; }
.hero-copy, .hero-visual, .knowledge-card { border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(155deg, rgba(14,24,36,.95), rgba(7,13,21,.96)); box-shadow: var(--shadow); }
.hero-copy { padding: clamp(25px,4vw,54px); }
.eyebrow { color: var(--cyan); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.hero-copy h1 { max-width: 850px; margin: 10px 0 0; font-size: clamp(32px,4.2vw,58px); line-height: 1.05; letter-spacing: -.035em; }
.hero-copy p { max-width: 820px; margin: 18px 0 0; color: #b2c2d2; font-size: 16px; line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.hero-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 9px; color: #dce9f5; text-decoration: none; font-size: 11px; font-weight: 800; }
.hero-actions a.primary { color: #031117; border-color: transparent; background: linear-gradient(135deg, var(--cyan), #8eeaff); }
.hero-visual { min-height: 330px; display: grid; grid-template-rows: auto minmax(0,1fr); padding: 20px; overflow: hidden; }
.visual-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: #c8d7e6; font-size: 12px; font-weight: 750; }
.visual-title span { color: var(--green); font: 10px "JetBrains Mono", monospace; }
.knowledge-chart { width: 100%; height: 270px; margin-top: 12px; border: 1px solid #1c3044; border-radius: 12px; background: #060c13; }

.topic-nav { position: sticky; top: 72px; z-index: 25; display: flex; gap: 7px; margin: 20px 0; padding: 9px; overflow-x: auto; border: 1px solid var(--border); border-radius: 13px; background: rgba(7,13,21,.94); backdrop-filter: blur(14px); scrollbar-width: thin; }
.topic-nav a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px 7px 7px; border-radius: 9px; color: #91a4b8; text-decoration: none; font-size: 11px; font-weight: 750; }
.topic-nav a:hover { color: var(--text); background: rgba(69,217,255,.05); }
.topic-nav a.active { color: #031117; background: var(--cyan); }
.topic-icon { min-width: 27px; height: 27px; display: inline-grid; place-items: center; border: 1px solid rgba(69,217,255,.19); border-radius: 7px; color: var(--cyan); background: rgba(69,217,255,.07); font: 8px "JetBrains Mono", monospace; }
.topic-nav a.active .topic-icon { color: #031117; border-color: rgba(3,17,23,.2); background: rgba(3,17,23,.1); }

.knowledge-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 16px; }
.knowledge-card { grid-column: span 6; padding: 24px; box-shadow: 0 16px 46px rgba(0,0,0,.2); }
.knowledge-card.wide { grid-column: 1 / -1; }
.knowledge-card.third { grid-column: span 4; }
.knowledge-card h2 { margin: 7px 0 0; font-size: 23px; line-height: 1.2; }
.knowledge-card h3 { margin: 20px 0 8px; font-size: 15px; }
.knowledge-card p { margin: 11px 0 0; color: #acbdce; }
.knowledge-card ul, .knowledge-card ol { margin: 15px 0 0; padding-left: 20px; color: #adbdcd; }
.knowledge-card li + li { margin-top: 7px; }
.knowledge-card strong { color: #eff7ff; }
.card-kicker { color: var(--cyan); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }

.formula { margin-top: 16px; padding: 14px 16px; overflow-x: auto; border: 1px solid #29445c; border-radius: 10px; background: #070e17; color: #dfeaf5; font: 13px/1.6 "JetBrains Mono", ui-monospace, monospace; }
.formula b { color: var(--cyan); }
.fact-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 18px; }
.fact { padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: rgba(7,13,21,.72); }
.fact b { display: block; color: var(--cyan); font: 15px "JetBrains Mono", monospace; }
.fact span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.flow { display: grid; grid-template-columns: repeat(6,1fr); gap: 8px; margin-top: 20px; }
.flow-step { position: relative; min-height: 92px; padding: 13px 12px; border: 1px solid var(--border); border-radius: 10px; background: #080f18; }
.flow-step:not(:last-child)::after { content: "→"; position: absolute; right: -10px; top: 34px; z-index: 2; color: var(--cyan); font-weight: 900; }
.flow-step b { display: block; color: var(--cyan); font-size: 10px; letter-spacing: .07em; }
.flow-step span { display: block; margin-top: 7px; color: #a7b8c9; font-size: 11px; line-height: 1.35; }

.component-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 18px; }
.component { min-height: 160px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #080f18; }
.component-symbol { height: 46px; display: flex; align-items: center; gap: 7px; color: var(--cyan); font: 20px "JetBrains Mono", monospace; }
.component-symbol .wire { height: 2px; flex: 1; background: #4c6c89; }
.component h3 { margin: 8px 0 0; font-size: 14px; }
.component p { margin-top: 7px; font-size: 12px; line-height: 1.55; }

.comparison { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 12px; }
.comparison th, .comparison td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.comparison th { color: #9eb1c4; font-size: 10px; letter-spacing: .04em; }
.comparison td { color: #c4d2df; }
.comparison td:first-child { color: var(--text); font-weight: 750; }

.callout { margin-top: 17px; padding: 14px 16px; border: 1px solid rgba(255,192,107,.25); border-radius: 11px; background: rgba(255,192,107,.055); color: #d9c5a5; font-size: 12px; }
.callout strong { color: var(--amber); }
.callout.good { border-color: rgba(69,229,170,.22); background: rgba(69,229,170,.045); color: #add6c5; }
.callout.good strong { color: var(--green); }

.knowledge-footer { margin-top: 24px; padding: 20px 4px 0; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--border); }
.knowledge-footer a { color: var(--cyan); text-decoration: none; }

@media (max-width: 1100px) {
  .knowledge-topbar { grid-template-columns: auto minmax(0,1fr); grid-template-areas: "brand title" "nav nav"; }
  .knowledge-brand { grid-area: brand; }
  .knowledge-topbar-title { grid-area: title; }
  .topbar-links { grid-area: nav; justify-self: center; }
  .knowledge-hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 310px; }
  .knowledge-card.third { grid-column: span 6; }
  .flow { grid-template-columns: repeat(3,1fr); }
  .flow-step:nth-child(3)::after { display: none; }
}

@media (max-width: 720px) {
  .knowledge-topbar { gap: 10px; padding: 9px 12px; }
  .knowledge-brand { min-width: 0; }
  .knowledge-brand-copy { display: none; }
  .topbar-links a { padding: 7px 8px; font-size: 9px; }
  .knowledge-shell { width: min(100% - 20px, 1460px); padding-top: 14px; }
  .hero-copy { padding: 24px 20px; }
  .hero-copy h1 { font-size: 35px; }
  .hero-copy p { font-size: 14px; }
  .hero-visual { padding: 13px; }
  .topic-nav { top: 70px; margin: 12px 0; }
  .knowledge-card, .knowledge-card.third { grid-column: 1 / -1; padding: 19px; }
  .flow, .component-grid, .fact-row { grid-template-columns: 1fr; }
  .flow-step::after { display: none; }
  .knowledge-footer { flex-direction: column; }
}
