:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0d1b2d;
  --panel-2: #12243a;
  --line: #1d334c;
  --text: #f4f7fb;
  --body: #c4d0df;
  --muted: #8fa2b8;
  --accent: #7fd6ff;
  --cpp: #6aaaf5;
  --java: #f2737a;
  --py: #f5c84c;
  --rust: #f09456;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.65; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #b8e9ff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: .1em .35em; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lang-cpp { color: var(--cpp); }
.lang-java { color: var(--java); }
.lang-py { color: var(--py); }
.lang-rust { color: var(--rust); }

/* Masthead */
.masthead { width: min(1100px, calc(100% - 48px)); margin-inline: auto; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { color: var(--accent); text-decoration: none; font-weight: 750; letter-spacing: .11em; font-size: .9rem; }
.masthead nav { display: flex; gap: 22px; flex-wrap: wrap; }
.masthead nav a { color: #aebed1; text-decoration: none; font-size: .85rem; font-weight: 600; }
.masthead nav a:hover, .masthead nav a:focus-visible { color: var(--accent); }

/* Article frame */
main { width: min(1100px, calc(100% - 48px)); margin-inline: auto; padding: 72px 0 80px; }
article > section { max-width: 860px; margin: 0 auto; padding-top: 64px; }
article > section > p { color: var(--body); max-width: 70ch; }
.hero { max-width: 860px; margin: 0 auto; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-weight: 750; letter-spacing: .13em; font-size: .75rem; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.4rem, 6.4vw, 4.6rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 800; }
.lede { margin: 26px 0 0; color: var(--body); font-size: clamp(1.1rem, 2vw, 1.28rem); line-height: 1.6; max-width: 66ch; }
.byline { margin: 22px 0 0; color: var(--muted); font-size: .9rem; }
.section-title { margin: 0 0 18px; font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.2; letter-spacing: -.025em; }
.note { color: var(--muted); font-size: .9rem; }

/* Video poster */
.video-block { max-width: 860px; }
.video-poster { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); text-decoration: none; }
.video-poster img { display: block; width: 100%; height: auto; }
.video-poster::after { content: ""; position: absolute; left: 50%; top: 74%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: rgba(127, 214, 255, .95); box-shadow: 0 8px 30px rgba(0, 0, 0, .45); transition: transform .2s; }
.video-poster::before { content: ""; position: absolute; left: 50%; top: 74%; z-index: 1; margin: -16px 0 0 -9px; border-style: solid; border-width: 16px 0 16px 27px; border-color: transparent transparent transparent var(--bg); }
.video-poster:hover::after, .video-poster:focus-visible::after { transform: scale(1.08); }
.play-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 20px; background: rgba(7, 17, 31, .88); color: var(--text); font-weight: 700; font-size: 1rem; }
.video-poster:hover .play-label, .video-poster:focus-visible .play-label { color: var(--accent); }
.caption { color: var(--muted); font-size: .9rem; margin-top: 12px; }

/* Cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 10px; padding: 22px 24px 20px; }
.card-cpp { --c: var(--cpp); }
.card-java { --c: var(--java); }
.card-py { --c: var(--py); }
.card-rust { --c: var(--rust); }
.card p { margin: 0 0 12px; color: var(--body); }
.card .card-name { margin: 0; color: var(--c); font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.card .card-hook { color: var(--text); font-weight: 700; margin-bottom: 10px; }
.card .trade { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: .95rem; }
.card .trade strong { color: var(--text); }

/* Pipelines */
.pipelines { list-style: none; padding: 0; margin: 26px 0 28px; display: grid; gap: 12px; }
.pipe { display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; padding: 14px 16px; }
.pipe-cpp { --c: var(--cpp); }
.pipe-java { --c: var(--java); }
.pipe-py { --c: var(--py); }
.pipe-rust { --c: var(--rust); }
.pipe-name { color: var(--c); font-weight: 800; font-size: 1.1rem; }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; padding-left: 0; }
.steps span { color: var(--text); font-size: .93rem; font-weight: 600; background: var(--panel-2); border-radius: 6px; padding: 5px 10px; }
.steps span + span { position: relative; margin-left: 28px; }
.steps span + span::before { content: "→"; position: absolute; left: -21px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 400; font-size: 1.05rem; }

/* Comparison table */
.compare { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.5; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 12px 12px; border-bottom: 1px solid var(--line); }
.compare thead th { font-size: 1.05rem; font-weight: 800; border-bottom: 2px solid var(--line); }
.compare tbody th { color: var(--muted); font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; width: 15%; }
.compare td { color: var(--body); }
#compare > p { max-width: none; }

/* Code */
.code-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 24px 0; }
.code { margin: 0; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 8px; overflow: hidden; min-width: 0; }
.code-cpp { --c: var(--cpp); }
.code-java { --c: var(--java); }
.code-py { --c: var(--py); }
.code-rust { --c: var(--rust); }
.code figcaption { padding: 10px 16px 0; color: var(--c); font-weight: 800; font-size: .95rem; }
.code pre { margin: 0; padding: 10px 16px 16px; overflow-x: auto; }
.code pre code { background: none; padding: 0; font-size: .82rem; line-height: 1.6; color: #dbe5f1; white-space: pre; }

/* Security */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.stat { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; color: var(--body); font-size: .97rem; }
.stat-num { display: block; color: var(--accent); font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 6px; }
.callout { margin: 26px 0 0; background: #10263a; border: 1px solid #2a4c6c; border-left: 4px solid var(--accent); border-radius: 8px; padding: 4px 20px; }
.callout p { color: var(--body); }
.callout strong { color: var(--text); }

/* Choose */
.choose { list-style: none; margin: 0 0 8px; padding: 0; }
.choose li { color: var(--body); padding: 14px 0; border-top: 1px solid var(--line); }
.choose li:last-child { border-bottom: 1px solid var(--line); }
.choose-lang { font-weight: 800; margin-right: 4px; }

/* Glossary */
.glossary { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.glossary div { padding: 12px 0; border-top: 1px solid var(--line); }
.glossary dt { font-weight: 700; color: var(--text); }
.glossary dd { margin: 2px 0 0; color: var(--body); font-size: .95rem; }

/* Transcript and sources */
.transcript { border-left: 3px solid var(--line); padding-left: 18px; }
.transcript p { margin: 0 0 8px; color: var(--body); }
.sources ol { padding-left: 22px; }
.sources li { color: var(--body); font-size: .92rem; margin-bottom: 8px; overflow-wrap: anywhere; }

/* Watch page */
.watch { max-width: 1000px; }
.watch-title { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 28px; }
.player { margin: 0; }
.player img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #111d23; }
.player figcaption { color: var(--muted); font-size: .92rem; margin-top: 12px; }
.watch-transcript { max-width: 760px; padding-top: 48px; }
.back { font-weight: 700; }

/* Footer */
.site-footer { width: min(1100px, calc(100% - 48px)); margin-inline: auto; display: flex; justify-content: space-between; gap: 16px; padding: 32px 0; border-top: 1px solid var(--line); color: #8799ae; font-size: .85rem; }

@media (max-width: 860px) {
  /* Stack comparison table into per-feature cards */
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: 100%; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare tr { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; padding: 4px 16px 8px; }
  .compare tbody th { width: 100%; padding: 12px 0 6px; border-bottom: 1px solid var(--line); color: var(--accent); }
  .compare td { position: relative; padding: 8px 0 8px 86px; border-bottom: 0; }
  .compare td::before { content: attr(data-label); position: absolute; left: 0; top: 8px; font-weight: 800; }
  .compare td:nth-of-type(1)::before { color: var(--cpp); }
  .compare td:nth-of-type(2)::before { color: var(--java); }
  .compare td:nth-of-type(3)::before { color: var(--py); }
  .compare td:nth-of-type(4)::before { color: var(--rust); }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  main { padding-top: 44px; }
  .masthead { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 14px 0; }
  .masthead nav { gap: 16px; }
  article > section { padding-top: 48px; }
  .cards, .code-grid, .stats, .glossary { grid-template-columns: 1fr; }
  .pipe { grid-template-columns: 1fr; gap: 8px; }
  .video-poster::after { width: 60px; height: 60px; margin: -30px 0 0 -30px; top: 74%; }
  .video-poster::before { top: 74%; margin: -11px 0 0 -6px; border-width: 11px 0 11px 19px; }
  .play-label { position: static; display: block; font-size: .95rem; }
  .code pre code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; }
  .site-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
