/* SDK Paperboy — shared stylesheet.
   Every edition links this file, so the design stays identical week to week.
   Edit here, not in an edition. */

html { -webkit-text-size-adjust: 100%; }
img, svg { max-width: 100%; height: auto; }

/* ── Light palette (also the un-stamped default) ───────────────── */
:root {
  --ground:      #F4F5F7;
  --surface:     #FFFFFF;
  --surface-sunk:#EDEFF3;
  --ink:         #16202B;
  --ink-soft:    #445264;
  --ink-faint:   #74839A;
  --rule:        #D3D9E2;
  --rule-strong: #A9B4C4;

  /* structural accent — used for rules, eyebrows, links. Never for severity. */
  --accent:      #1F3A5F;
  --accent-soft: #E3EAF4;

  /* severity is the ONLY other colour on this page */
  --sev-p0:      #B03127;
  --sev-p0-bg:   #FBE9E7;
  --sev-p1:      #96650A;
  --sev-p1-bg:   #FAF0DC;
  --sev-p2:      #40607F;
  --sev-p2-bg:   #E7EDF4;
  --sev-p3:      #6E7C90;
  --sev-p3-bg:   #EBEEF2;
  --cleared:     #26654A;
  --cleared-bg:  #E2F0E9;

  --shadow: 0 1px 2px rgba(22,32,43,.06), 0 8px 24px -16px rgba(22,32,43,.28);
}

/* ── Dark palette: OS-dark, unless an explicit light choice was made ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #10151C;
    --surface:     #171E27;
    --surface-sunk:#1D262F;
    --ink:         #E4E9F0;
    --ink-soft:    #A7B3C3;
    --ink-faint:   #7A8798;
    --rule:        #2A3542;
    --rule-strong: #3D4B5C;

    --accent:      #9CC0E8;
    --accent-soft: #1C2B3D;

    --sev-p0:      #F09189;
    --sev-p0-bg:   #351C1A;
    --sev-p1:      #E0B15C;
    --sev-p1-bg:   #33270F;
    --sev-p2:      #9DBEDD;
    --sev-p2-bg:   #1B2733;
    --sev-p3:      #8D9AAB;
    --sev-p3-bg:   #1E262F;
    --cleared:     #71C6A0;
    --cleared-bg:  #142A21;

    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -16px rgba(0,0,0,.8);
  }
}

/* ── Explicit dark choice wins over a light OS ─────────────────── */
:root[data-theme="dark"] {
  --ground:      #10151C;
  --surface:     #171E27;
  --surface-sunk:#1D262F;
  --ink:         #E4E9F0;
  --ink-soft:    #A7B3C3;
  --ink-faint:   #7A8798;
  --rule:        #2A3542;
  --rule-strong: #3D4B5C;

  --accent:      #9CC0E8;
  --accent-soft: #1C2B3D;

  --sev-p0:      #F09189;
  --sev-p0-bg:   #351C1A;
  --sev-p1:      #E0B15C;
  --sev-p1-bg:   #33270F;
  --sev-p2:      #9DBEDD;
  --sev-p2-bg:   #1B2733;
  --sev-p3:      #8D9AAB;
  --sev-p3-bg:   #1E262F;
  --cleared:     #71C6A0;
  --cleared-bg:  #142A21;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -16px rgba(0,0,0,.8);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.62;
  margin: 0;
  padding: 0 20px 96px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 860px; margin: 0 auto; }

/* ── Typographic system ────────────────────────────────────────── */
.eyebrow {
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

h1, h2, h3 {
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  text-wrap: balance;
  margin: 0;
}

code, .mono, .ver {
  font-family: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: .87em;
  font-variant-ligatures: none;
}
code {
  background: var(--surface-sunk);
  border-radius: 3px;
  padding: .1em .35em;
  color: var(--ink);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ── Dateline ──────────────────────────────────────────────────── */
.dateline {
  padding: 56px 0 28px;
  border-bottom: 3px double var(--rule-strong);
}
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
}
.masthead h1 {
  font-size: clamp(38px, 7vw, 62px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .95;
}
.issue {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-faint);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 3px 8px;
  white-space: nowrap;
}
.dateline p.standfirst {
  margin: 14px 0 0;
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* Run stats — the numbers that describe the run itself */
.runbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 26px 0 0;
}
.runbar div {
  background: var(--surface);
  padding: 12px 14px;
}
.runbar .n {
  font-family: Archivo, sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  display: block;
}
.runbar .l {
  font-family: Archivo, sans-serif;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}

/* ── Sections ──────────────────────────────────────────────────── */
section { margin: 54px 0 0; }
section > h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
section > h2 .count {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
  font-size: 12px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.005em;
  margin: 30px 0 8px;
}
p { margin: 0 0 14px; max-width: 68ch; }
.lede { font-size: 19px; line-height: 1.6; }
.lede strong { font-weight: 600; }

/* ── Finding cards: a severity rail is the structural device ───── */
.finding {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--sev);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin: 0 0 16px;
}
.finding.p0 { --sev: var(--sev-p0); }
.finding.p1 { --sev: var(--sev-p1); }
.finding.ok { --sev: var(--cleared); }

.finding header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.finding header h3 { margin: 0; font-size: 16px; }
.finding p { font-size: 15.5px; margin-bottom: 10px; }
.finding p:last-child { margin-bottom: 0; }

.chip {
  font-family: Archivo, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
}
.chip.p0 { color: var(--sev-p0); background: var(--sev-p0-bg); }
.chip.p1 { color: var(--sev-p1); background: var(--sev-p1-bg); }
.chip.p2 { color: var(--sev-p2); background: var(--sev-p2-bg); }
.chip.p3 { color: var(--sev-p3); background: var(--sev-p3-bg); }
.chip.ok { color: var(--cleared); background: var(--cleared-bg); }

.repos {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-faint);
}

.fix {
  border-top: 1px dashed var(--rule);
  margin-top: 12px;
  padding-top: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.fix b {
  font-family: Archivo, sans-serif;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

/* ── Platform entries ──────────────────────────────────────────── */
.platform { border-top: 1px solid var(--rule); padding: 18px 0 4px; }
.platform:first-of-type { border-top: none; padding-top: 0; }
.platform > h3 {
  margin: 0 0 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.platform ul { margin: 0; padding-left: 20px; }
.platform li { margin-bottom: 10px; max-width: 68ch; }
.platform li:last-child { margin-bottom: 0; }

/* ── Tables ────────────────────────────────────────────────────── */
.scroll { overflow-x: auto; margin: 0 0 8px; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 14.5px;
  background: var(--surface);
  border: 1px solid var(--rule);
}
th, td { padding: 10px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
tbody tr:last-child td { border-bottom: none; }
th {
  font-family: Archivo, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--surface-sunk);
  white-space: nowrap;
}
td.when {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}
td.who { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--ink-faint); }

/* ── Proposals: an ordered list where order is priority ────────── */
ol.proposals { counter-reset: p; list-style: none; margin: 0; padding: 0; }
ol.proposals li {
  counter-increment: p;
  position: relative;
  padding-left: 44px;
  margin-bottom: 18px;
  max-width: 68ch;
}
ol.proposals li::before {
  content: counter(p, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 1px 6px;
}

/* ── Caveats ───────────────────────────────────────────────────── */
.caveats {
  background: var(--surface-sunk);
  border: 1px solid var(--rule);
  padding: 18px 22px;
}
.caveats ul { margin: 0; padding-left: 20px; }
.caveats li { margin-bottom: 9px; font-size: 15px; color: var(--ink-soft); max-width: 66ch; }
.caveats li:last-child { margin-bottom: 0; }

/* ── Sources ───────────────────────────────────────────────────── */
.sources { columns: 2; column-gap: 32px; font-size: 12.5px; line-height: 1.75; }
.sources a { font-family: "IBM Plex Mono", monospace; word-break: break-all; display: block; break-inside: avoid; margin-bottom: 3px; }
@media (max-width: 640px) { .sources { columns: 1; } }

footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 3px double var(--rule-strong);
  font-size: 13px;
  color: var(--ink-faint);
}
footer p { max-width: 68ch; margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ── Shell: sticky edition sidebar + article column ─────────────── */
.shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 0 52px;
  max-width: 1210px;
  margin: 0 auto;
  align-items: start;
}
.shell > .wrap { max-width: 860px; margin: 0; }

.sidenav {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 44px 26px 40px 0;
  border-right: 1px solid var(--rule);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
}
.sidenav .brand {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.sidenav .brand:hover { color: var(--accent); }
.sidenav .tagline {
  margin: 10px 0 26px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: none;
}
.sidenav .lbl {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  max-width: none;
}
.sidenav ol { list-style: none; margin: 0; padding: 0; }
.sidenav li a {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 4px 8px;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-decoration: none;
}
.sidenav li a:hover { background: var(--surface-sunk); color: var(--accent); }
.sidenav li a.cur {
  border-left-color: var(--accent);
  background: var(--surface-sunk);
  color: var(--ink);
}
.sidenav li a .no { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.sidenav li a.cur .no { color: var(--accent); }
.sidenav li a .dt { font-variant-numeric: tabular-nums; }
.sidenav li a .tag {
  grid-column: 1 / -1;
  font-family: Archivo, sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cleared);
}
.sidenav .foot {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  color: var(--ink-faint);
  max-width: none;
}
.sidenav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* first heading sits level with the sidebar's top */
.shell > .wrap .dateline { padding-top: 40px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .shell > .wrap { max-width: none; }
  .sidenav {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 26px 0 14px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .sidenav .tagline { margin-bottom: 18px; }
  .sidenav ol { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .sidenav li a {
    display: flex;
    gap: 7px;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .sidenav li a.cur { border-left: none; border-bottom-color: var(--accent); }
  .sidenav li a .tag { display: none; }
  .sidenav .foot { display: none; }
  .shell > .wrap .dateline { padding-top: 30px; }
}
