:root {
  color-scheme: light;
  --bg: #ffffff;
  --paper: #ffffff;
  --tint: #f5f7fa;
  --tint-2: #eef3fa;
  --line: #dfe3e8;
  --ink: #16181d;
  --body: #2c3038;
  --muted: #5d636d;
  --accent: #1d5fb4;
  --accent-ink: #164a8c;
  --warn: #8a4b0f;
  --sans: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Noto Serif", "DejaVu Serif", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 44rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--body); font-family: var(--sans); font-size: 17px; line-height: 1.65; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
a:visited { color: #3d4f8f; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
code { font-family: var(--mono); font-size: .88em; background: var(--tint); padding: .08em .32em; border-radius: 4px; }
sup { line-height: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; color: #fff; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--line); background: #fff; }
.masthead-inner { width: min(1120px, calc(100% - 40px)); margin-inline: auto; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .14em; font-size: 13px; color: var(--ink); text-decoration: none; }
.brand:visited { color: var(--ink); }
.brand span { color: var(--accent); }
.masthead nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.masthead nav a { color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--accent); text-decoration: underline; }

/* Title block */
.titleblock { background: var(--tint); border-bottom: 1px solid var(--line); }
.titleblock-inner { width: min(1120px, calc(100% - 40px)); margin-inline: auto; padding: 56px 0 44px; }
.kicker { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 14px; }
h1 { font-family: var(--serif); color: var(--ink); font-weight: 600; font-size: clamp(2rem, 4.2vw, 3.05rem); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 18px; max-width: 22ch; }
.dek { font-size: clamp(1.08rem, 1.7vw, 1.28rem); line-height: 1.5; color: var(--body); max-width: 46rem; margin: 0 0 24px; }
.meta { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.meta strong { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; padding: 10px 16px; border-radius: 6px; font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid var(--accent); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:visited { color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-secondary { background: #fff; color: var(--accent); }
.btn-secondary:visited { color: var(--accent); }

/* Layout */
.layout { width: min(1120px, calc(100% - 40px)); margin-inline: auto; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding: 44px 0 72px; }
.toc { position: sticky; top: 20px; align-self: start; font-size: 14px; line-height: 1.45; }
.toc p { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0 5px 14px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.content { max-width: var(--measure); min-width: 0; }

/* Typography */
h2 { font-family: var(--serif); color: var(--ink); font-size: 1.75rem; line-height: 1.25; font-weight: 600; margin: 3.2rem 0 1rem; padding-top: .4rem; scroll-margin-top: 16px; }
h2 .num { color: var(--accent); font-family: var(--sans); font-size: .62em; font-weight: 600; letter-spacing: .06em; display: block; margin-bottom: .2rem; }
h3 { color: var(--ink); font-size: 1.12rem; line-height: 1.35; margin: 2.1rem 0 .6rem; font-weight: 650; scroll-margin-top: 16px; }
p { margin: 0 0 1.05rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1.15rem; }
li { margin: .35rem 0; }
strong { color: var(--ink); }
.content > section:first-child h2 { margin-top: 0; }
.lead-in { font-size: 1.08rem; }

/* TL;DR */
.tldr { border: 1px solid #c9d9ee; background: var(--tint-2); border-radius: 10px; padding: 26px 28px 14px; margin: 0 0 2.4rem; }
.tldr h2 { margin: 0 0 .9rem; font-size: 1.35rem; }
.tldr ol { padding-left: 1.25rem; }
.tldr li { margin: .55rem 0; }
.tldr .bottom { border-top: 1px solid #c9d9ee; padding-top: 14px; margin-top: 14px; font-size: 1.02rem; }

/* Stat row */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 1.6rem 0 2rem; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 14px 14px 12px; background: #fff; }
.stat .n { display: block; font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; color: var(--ink); font-weight: 600; }
.stat .l { display: block; font-size: 13px; line-height: 1.4; color: var(--muted); margin-top: 6px; }

/* Callouts */
.callout { border-left: 4px solid var(--accent); background: var(--tint); padding: 14px 18px; margin: 1.5rem 0; border-radius: 0 6px 6px 0; }
.callout p:last-child { margin-bottom: 0; }
.callout .label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.callout.caution { border-left-color: #b8651b; background: #fbf6ef; }
.callout.caution .label { color: var(--warn); }
.disclosure { font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 0 0 2rem; }
.disclosure strong { color: var(--body); }

/* Figures */
figure { margin: 1.8rem 0 2rem; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
a.fig-link { display: block; }
figcaption { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 10px; }
figcaption strong { color: var(--body); }
.video-card { display: block; position: relative; text-decoration: none; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.video-card img { border: 0; border-radius: 0; }
.video-card .play { position: absolute; left: 16px; bottom: 16px; background: rgba(16, 24, 40, .86); color: #fff; font-weight: 600; font-size: 15px; padding: 9px 14px; border-radius: 6px; }

/* Equations */
.eq { font-family: var(--mono); font-size: 15px; background: var(--tint); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; margin: 1rem 0 1.2rem; overflow-x: auto; white-space: pre; line-height: 1.6; color: var(--ink); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.4rem 0 1.8rem; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.45; }
caption { caption-side: top; text-align: left; font-size: 14px; color: var(--muted); padding: 12px 14px 4px; }
caption strong { color: var(--body); }
th, td { text-align: left; vertical-align: top; padding: 9px 14px; border-top: 1px solid var(--line); }
thead th { background: var(--tint); color: var(--ink); font-weight: 650; font-size: 13.5px; border-top: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }

/* Assessment grid */
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 1.4rem 0 1.8rem; }
.verdict > div { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px 6px; }
.verdict h3 { margin-top: 0; font-size: 1rem; }
.verdict ul { padding-left: 1.1rem; font-size: 15.5px; }

/* References */
.refs { font-size: 14.5px; line-height: 1.55; padding-left: 1.6rem; }
.refs li { margin: .55rem 0; overflow-wrap: anywhere; }
.glossary dt { font-weight: 650; color: var(--ink); margin-top: .8rem; }
.glossary dd { margin: .15rem 0 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--tint); }
.site-footer-inner { width: min(1120px, calc(100% - 40px)); margin-inline: auto; padding: 24px 0 32px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }

/* Video page */
.watch { width: min(980px, calc(100% - 40px)); margin-inline: auto; padding: 36px 0 64px; }
.watch h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); max-width: none; }
.player { margin: 1.2rem 0 1.4rem; }
.player img { border-radius: 10px; }
.transcript { max-width: var(--measure); }
.transcript p { margin-bottom: .8rem; }
.transcript .ts { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-right: 8px; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 28px; }
  .toc { position: static; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px 8px; margin-bottom: 2rem; }
  .toc ol { border-left: 0; columns: 2; column-gap: 20px; }
  .toc a { padding: 4px 0; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .eq { white-space: pre-wrap; font-size: 13.5px; }
  .titleblock-inner { padding: 36px 0 30px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .verdict { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  .tldr { padding: 20px 18px 8px; }
  h2 { font-size: 1.5rem; }
  .masthead nav { gap: 14px; }
  th, td { padding: 8px 10px; }
  table.stack thead { display: none; }
  table.stack caption { display: block; width: 100%; padding: 12px 14px 8px; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-top: 1px solid var(--line); padding: 8px 0; }
  table.stack td { border-top: 0; padding: 3px 14px; }
  table.stack td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
  table.stack td:empty { display: none; }
}

@media print {
  @page {
    size: Letter; margin: 0.8in 0.85in 0.85in;
    @bottom-left { content: "RVA Cyber Research · Weight-Space Programming · November 2026"; font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; font-size: 8pt; color: #6b7079; }
    @bottom-right { content: counter(page) " / " counter(pages); font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; font-size: 8pt; color: #6b7079; }
  }
  @page :first { @bottom-left { content: none; } @bottom-right { content: none; } }
  body { font-size: 10.5pt; line-height: 1.5; color: #1d2026; }
  .masthead, .toc, .actions, .skip, .site-footer, .no-print { display: none !important; }
  .titleblock { background: #fff; border-bottom: 2px solid var(--ink); }
  .titleblock-inner { width: auto; padding: 0 0 18pt; }
  h1 { font-size: 26pt; max-width: none; }
  .dek { font-size: 13pt; }
  .layout { display: block; width: auto; padding: 18pt 0 0; }
  .content { max-width: none; }
  h2 { font-size: 16pt; margin-top: 22pt; break-after: avoid; break-inside: avoid; }
  h2 .num { break-after: avoid; }
  tr, dt, dd, li { break-inside: avoid; }
  dt { break-after: avoid; }
  .eq { white-space: pre-wrap; font-size: 9pt; overflow: visible; }
  p { orphans: 3; widows: 3; }
  h3 { font-size: 11.5pt; break-after: avoid; }
  figure, .table-wrap, .callout, .stat, .tldr, .verdict > div, .eq { break-inside: avoid; }
  .tldr { break-inside: auto; }
  a { color: var(--accent); text-decoration: none; }
  .refs a::after { content: ""; }
  .print-only { display: block !important; }
  tbody tr:hover { background: none; }
}
.print-only { display: none; }
.fig-hint { display: none; }
@media (max-width: 640px) { .fig-hint { display: inline; font-style: italic; } }
@media print { .fig-hint { display: none !important; } }
@media (max-width: 640px) { .video-card .play { font-size: 13px; padding: 6px 10px; left: 10px; bottom: 10px; } }
