
:root {
  --paper: #f7f5ef;
  --sidebar-paper: #f1eee6;
  --paper2: #ebe7dd;
  --ink: #202426;
  --body: #363a3a;
  --muted: #747775;
  --navy: #243b53;
  --navy2: #40566d;
  --rust: #8d4d3f;
  --line: #d7d1c5;
  --line-dark: #c5beb1;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sidebar: 272px;
  --content: 820px;
  --gap: 54px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font: 16px/1.58 var(--sans);
  text-rendering: optimizeLegibility;
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

a:hover { color: var(--rust); }

.site-layout {
  width: min(100%, calc(var(--sidebar) + var(--gap) + var(--content) + 64px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, var(--content));
  gap: var(--gap);
  align-items: stretch;
  min-height: calc(100vh - 44px);
}

/* SIDEBAR ---------------------------------------------------------------- */

.profile-sidebar {
  position: relative;
  padding: 44px 30px 80px 24px;
  background: var(--sidebar-paper);
  border-right: 1px solid var(--line-dark);
}

.profile-inner {
  position: sticky;
  top: 34px;
}

.profile-name {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--ink);
  font: 700 1.34rem/1.08 var(--serif);
  text-decoration: none;
}

.profile-bio {
  margin: 0 0 24px;
  color: #4d5252;
  font: .94rem/1.55 var(--serif);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line-dark);
  font-size: .81rem;
}

.sidebar-nav a {
  color: var(--navy);
  text-decoration: none;
}

.sidebar-nav a:hover {
  color: var(--rust);
  text-decoration: underline;
}

.sidebar-nav .home-link {
  font-weight: 700;
}

/* INDEX ------------------------------------------------------------------ */

.index-shell,
.article-shell {
  width: 100%;
  min-width: 0;
  padding: 44px 24px 84px 0;
}

.record-index {
  max-width: 780px;
}

.index-entry {
  margin: 0 0 31px;
  padding: 0;
}

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 7px;
}

.entry-head h2 {
  margin: 0;
  color: var(--ink);
  font: 700 1.36rem/1.17 var(--serif);
}

.entry-head h2 a {
  color: var(--ink);
  text-decoration: none;
}

.entry-head h2 a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.entry-head time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .7rem;
  white-space: nowrap;
}

.index-entry > p {
  max-width: 700px;
  margin: 0;
  color: #444949;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--navy);
  font: 700 .64rem/1 var(--sans);
  letter-spacing: .02em;
}

.tags span {
  padding: 4px 8px 4px;
  border: 1px solid #c9c3b7;
  border-radius: 999px;
  background: rgba(255,255,255,.34);
}

/* ARTICLE ---------------------------------------------------------------- */

.article-shell article {
  max-width: 800px;
}

.article-header {
  max-width: 790px;
  margin: 0 0 28px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--rust);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.article-header h1 {
  margin: 0;
  color: var(--ink);
  font: 700 clamp(1.9rem, 3vw, 2.5rem)/1.1 var(--serif);
  letter-spacing: -.018em;
}

.dek {
  max-width: 740px;
  margin: 12px 0 13px;
  color: #4a4e4e;
  font: 1.05rem/1.46 var(--serif);
}

.article-tags { margin: -1px 0 14px; }

.top-meta {
  display: flex;
  gap: 28px;
  max-width: 740px;
  margin: 0;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

dd { margin: 1px 0 0; }

.publication {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  margin: 0 0 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.19);
}

.publication h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font: 700 1.17rem/1.24 var(--serif);
}

.publication p {
  max-width: 680px;
  margin: 0;
}

.publication-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 78px;
  font-size: .81rem;
}

.publication-actions .doi-link { font-weight: 800; }

section {
  margin-top: 42px;
  scroll-margin-top: 18px;
}

section > h2 {
  margin: 0 0 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: 700 1.48rem/1.16 var(--serif);
}

h3, h4 {
  color: var(--ink);
  font-family: var(--serif);
}

h3 {
  margin: 20px 0 7px;
  font-size: 1.24rem;
  line-height: 1.2;
}

h4 {
  margin: 0 0 4px;
  font-size: 1.04rem;
  line-height: 1.23;
}

p { max-width: 740px; }

code {
  font-family: var(--mono);
  font-size: .85em;
  overflow-wrap: anywhere;
}

figure { margin: 18px 0; }

.feature-figure {
  float: right;
  width: 300px;
  max-width: 42%;
  margin: 0 0 18px 30px;
  padding: 4px;
  background: var(--sidebar-paper);
  border: 1px solid var(--line-dark);
}

.feature-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.feature-figure figcaption {
  max-width: none;
  margin: 0;
  padding: 6px 4px 2px;
  text-align: center;
}

.image-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(36,59,83,.03), rgba(141,77,63,.035)),
    var(--paper2);
  color: var(--muted);
  font: italic .92rem var(--serif);
}

.image-placeholder.feature { min-height: 320px; }

.image-placeholder.trace {
  min-height: 250px;
  font-family: var(--mono);
  font-style: normal;
}

figcaption {
  max-width: 740px;
  margin-top: 6px;
  color: var(--muted);
  font-size: .77rem;
  line-height: 1.43;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.figure-grid figure { margin: 0; }

/* CVD -------------------------------------------------------------------- */

.cvd-case { margin-top: 24px; }

.cvd-case + .cvd-case {
  margin-top: 46px;
  padding-top: 27px;
  border-top: 1px solid var(--line);
}

.cvd-header h3 {
  margin: 0 0 4px;
  font-size: 1.34rem;
}

.cvd-label {
  margin: 0;
  color: var(--rust);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .105em;
  text-transform: uppercase;
}

.reported {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.cvd-summary {
  max-width: 740px;
  margin-top: 11px;
  font: .98rem/1.52 var(--serif);
}

.finding {
  margin-top: 20px;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--navy2);
}

.finding + .finding { margin-top: 25px; }

.cwe {
  margin: 0 0 8px;
  color: var(--muted);
  font: .72rem/1.42 var(--mono);
}

.finding-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(max-content, 1fr));
  gap: 11px;
  margin: 0 0 9px;
  padding: 8px 0 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.finding-meta dd { font-size: .82rem; }

.status-pending {
  color: var(--rust);
  font-weight: 800;
}

.timeline-block { margin-top: 25px; }

.timeline-block h4 { margin-bottom: 8px; }

.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 120px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: #c7c2b7;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 106px 1fr;
  gap: 28px;
  padding: 5px 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 116px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--navy);
}

.timeline time {
  color: var(--muted);
  font: 700 .71rem/1.45 var(--sans);
  text-align: right;
}

.timeline span { font-size: .87rem; }

.references { padding-left: 1.15rem; }
.references li + li { margin-top: 3px; }

.revision-list {
  max-width: 740px;
  margin: 0;
}

.revision-list div {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 18px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.revision-list dd { margin: 0; }

/* FOOTER ----------------------------------------------------------------- */

.site-footer {
  width: min(100%, calc(var(--sidebar) + var(--gap) + var(--content) + 64px));
  margin: -44px auto 0;
  padding: 0 24px 26px calc(var(--sidebar) + var(--gap));
  color: var(--muted);
  font-size: .72rem;
}

/* RESPONSIVE ------------------------------------------------------------- */

@media (max-width: 960px) {
  :root {
    --sidebar: 240px;
    --gap: 38px;
  }

  .profile-sidebar {
    padding-left: 20px;
    padding-right: 24px;
  }
}

@media (max-width: 760px) {
  .site-layout {
    display: block;
    width: min(calc(100% - 28px), 820px);
    min-height: 0;
  }

  .profile-sidebar {
    margin: 0 -14px;
    padding: 24px 14px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }

  .profile-inner { position: static; }

  .profile-name { margin-bottom: 10px; }

  .profile-bio {
    max-width: 680px;
    margin-bottom: 13px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-top: 12px;
  }

  .index-shell,
  .article-shell {
    padding: 27px 0 64px;
  }

  .site-footer {
    width: min(calc(100% - 28px), 820px);
    margin: -36px auto 0;
    padding: 0 0 24px;
  }
}

@media (max-width: 620px) {
  .entry-head { display: block; }

  .entry-head time {
    display: block;
    margin-top: 3px;
  }

  .publication { grid-template-columns: 1fr; }

  .publication-actions {
    flex-direction: row;
    align-items: center;
  }

  .figure-grid { grid-template-columns: 1fr; }

  .finding-meta {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .timeline::before { left: 6px; }

  .timeline li {
    display: block;
    padding: 6px 0 6px 26px;
  }

  .timeline li::before {
    left: 2px;
    top: 12px;
  }

  .timeline time {
    display: block;
    text-align: left;
    margin-bottom: 1px;
  }
}

@media (max-width: 430px) {
  .finding-meta { grid-template-columns: 1fr; }
}


/* v12: more graduate-researcher / academic profile tone ----------------- */
.profile-name {
  margin-bottom: 16px;
}

.profile-bio {
  color: #505454;
  font-size: .92rem;
  line-height: 1.58;
}

.sidebar-nav {
  margin-top: 2px;
}


/* v14: record-level DOI/CVE links ---------------------------------------- */
.record-links {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px !important;
  color: var(--muted);
  font-size: .74rem;
}

.record-links a {
  color: var(--navy);
  text-decoration: none;
}

.record-links a:hover {
  color: var(--rust);
  text-decoration: underline;
}

.record-links span {
  color: #b8b2a7;
}

/* Tags belong to the index taxonomy, not the individual dossiers. */
.article-tags {
  display: none;
}


/* v15: DOI/CVE links belong inside vulnerability findings, not the index. */
.record-links {
  display: none !important;
}


/* v17: keep the sidebar physically attached to the viewport's left edge -- */

.site-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  grid-template-columns: var(--sidebar) minmax(0, var(--content));
  gap: var(--gap);
  justify-content: start;
}

.profile-sidebar {
  min-height: 100vh;
}

.index-shell,
.article-shell {
  padding-right: 24px;
}

/* Footer aligns with the main-content column while the sidebar remains flush left. */
.site-footer {
  width: 100%;
  max-width: none;
  margin: -44px 0 0;
  padding-left: calc(var(--sidebar) + var(--gap));
  padding-right: 24px;
}

@media (max-width: 760px) {
  .site-layout {
    width: min(calc(100% - 28px), 820px);
    margin: 0 auto;
  }

  .profile-sidebar {
    min-height: 0;
  }

  .site-footer {
    width: min(calc(100% - 28px), 820px);
    margin: -36px auto 0;
    padding-left: 0;
    padding-right: 0;
  }
}


/* v18: taxonomy is expressed in prose, not pills. */
.tags,
.article-tags {
  display: none !important;
}

.index-entry > p {
  margin-top: 5px;
}


/* v27: compact table of contents on dossier pages ------------------------ */
.page-toc {
  max-width: 560px;
  margin: 0 0 28px;
  padding: 0;
}

.page-toc h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: var(--muted);
  font: 800 .7rem/1.2 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.page-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 30px;
}

.page-toc li {
  break-inside: avoid;
  margin: 0 0 5px;
  font-size: .84rem;
}

.page-toc a {
  color: var(--navy);
  text-decoration: none;
}

.page-toc a:hover {
  color: var(--rust);
  text-decoration: underline;
}

@media (max-width: 520px) {
  .page-toc ol {
    columns: 1;
  }
}


/* v28: cleaner index links, no update dates ------------------------------ */
.entry-head {
  justify-content: flex-start;
}

.entry-head h2 a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .16em;
  text-decoration-color: #8f9696;
}

.entry-head h2 a:hover {
  color: var(--navy);
  text-decoration-color: currentColor;
}


/* v46: article title links home while looking like plain heading text */
.article-header h1 a,
.article-header h1 a:hover {
  color: inherit;
  text-decoration: none;
}


/* v31: index heading */
.index-title {
  margin: 0 0 28px;
  color: var(--ink);
  font: 700 1.75rem/1.12 var(--serif);
  letter-spacing: -.012em;
}


/* v32: make the homepage section label clearly distinct from entry titles */
.index-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: var(--rust);
  font: 800 .72rem/1.2 var(--sans);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.index-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}


/* v35: floated feature figure un-floats on narrow screens */
@media (max-width: 760px) {
  .feature-figure {
    float: none;
    width: auto;
    max-width: 340px;
    margin: 0 0 18px;
  }
}


/* v36: full-width Wikipedia-style article + boxed contents ---------------- */
.site-layout {
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.article-shell article { max-width: none; }

p { max-width: none; }
.cvd-summary { max-width: none; }

.page-toc {
  display: inline-block;
  max-width: 100%;
  margin: 2px 0 24px;
  padding: 8px 18px 10px;
  border: 1px solid var(--line-dark);
  background: var(--sidebar-paper);
}

.page-toc h2 {
  margin: 0 0 6px;
  text-align: center;
  color: var(--ink);
  font: 700 .84rem/1.2 var(--serif);
  letter-spacing: 0;
  text-transform: none;
}

.page-toc ol {
  columns: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.page-toc li {
  margin: 2px 0 0;
  padding: 0;
  font-size: .86rem;
  counter-increment: toc;
}

.page-toc li::before {
  content: counter(toc) "\00a0\00a0";
  color: var(--muted);
}

.doi-line { font-size: .84rem; }
.doi-line a { word-break: break-all; }


/* v37: compact reference lines + clickable feature image -------------------- */
.references {
  list-style: none;
  padding-left: 0;
}

.ref-host { color: var(--muted); }

.feature-figure a { display: block; }


/* v38: image lightbox ------------------------------------------------------- */
.lightbox-link { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(20, 22, 24, .85);
  cursor: zoom-out;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  background: #000;
  box-shadow: 0 8px 48px rgba(0, 0, 0, .55);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: 400 30px/1 var(--sans);
  cursor: pointer;
  opacity: .85;
}

.lightbox-close:hover { opacity: 1; }


/* v39: publication meta to the top-right masthead --------------------------- */
.article-header {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px 40px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.top-meta {
  flex: 0 0 auto;
  max-width: none;
  padding-top: 6px;
  border-top: 0;
  text-align: right;
}

.top-meta div { text-align: right; }

@media (max-width: 760px) {
  .article-header {
    display: block;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .top-meta,
  .top-meta div {
    text-align: left;
  }

  .top-meta {
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }
}


/* v40: timeline block gets the finding's left border (supports a second CVE timeline) */
.timeline-block {
  padding-left: 14px;
  border-left: 2px solid var(--navy2);
}


/* v42: print — bio as a banner across the top, content below ---------------- */
@media print {
  @page { margin: 1.5cm; }

  .site-layout {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
  }

  .profile-sidebar {
    position: static;
    min-height: 0;
    margin: 0 0 18px;
    padding: 0 0 12px;
    background: none;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
    break-inside: avoid;
  }

  .profile-inner {
    position: static;
    top: auto;
  }

  .profile-name { margin-bottom: 8px; }
  .profile-bio { margin-bottom: 12px; max-width: none; }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding-top: 10px;
  }

  .index-shell,
  .article-shell {
    padding: 0 0 12px;
  }

  .site-footer {
    width: 100%;
    margin: 0;
    padding: 8px 0 0;
  }

  .top-meta { display: none; }

  .feature-figure,
  section {
    break-inside: avoid;
  }

  h2, h3, h4 { break-after: avoid; }
}


/* v43: tighten the gap between the contents box and the first section */
.page-toc { margin-bottom: 6px; }
.page-toc + section { margin-top: 20px; }


/* v44: CVSS vectors, one per line */
.cvss-vectors { line-height: 1.9; }


/* v45: homepage entries read clearly as links — navy, underlined, trailing arrow */
.entry-head h2 a {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .16em;
  text-decoration-color: rgba(36, 59, 83, .5);
}

.entry-head h2 a::after {
  content: " \2192";
}

.entry-head h2 a:hover {
  color: var(--rust);
  text-decoration-color: currentColor;
}
