/* Security research inventory — monochrome editorial.
   Self-hosted faces only: no external requests of any kind. */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans VF";
  src: url("fonts/plex-sans-var.woff2") format("woff2-variations"),
       url("fonts/plex-sans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --fg: #0b0b0c;
  --fg-2: #3d3d42;
  --fg-3: #74747c;
  --rule: #e4e4e7;
  --fill: #f6f6f7;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans VF", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 900px;
  --rhythm: clamp(52px, 7vw, 92px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --fg: #f3f3f4;
    --fg-2: #c2c2c8;
    --fg-3: #85858d;
    --rule: #26262b;
    --fill: #141416;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(40px, 9vw, 104px) 24px 120px;
}

/* ---- typographic primitives ---- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 18px;
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.1rem, 9vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 .dim { color: var(--fg-3); }

.role {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-2);
  margin: 20px 0 0;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 120ms linear, text-decoration-thickness 120ms linear;
}

a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--fg);
}

/* ---- profile ---- */

.profile {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  align-items: start;
  margin-top: var(--rhythm);
  padding-top: 34px;
  border-top: 1px solid var(--rule);
}

.portrait {
  width: 140px;
  height: 140px;
  border: 1px solid var(--rule);
  background: var(--fill);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.04);
}

.monogram {
  font-family: var(--display);
  font-size: 3.1rem;
  line-height: 1;
  color: var(--fg-3);
  letter-spacing: -0.03em;
  user-select: none;
}

.role .sep {
  color: var(--rule);
  margin: 0 10px;
}

.bio a {
  text-decoration-color: var(--fg-3);
}

.bio {
  margin: 0;
  max-width: 56ch;
  color: var(--fg-2);
  font-size: 1.0425rem;
}

.bio p { margin: 0 0 0.9em; }
.bio p:last-child { margin-bottom: 0; }

.socials {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 22px 0 0;
  padding: 0;
}

.socials li + li { border-left: 1px solid var(--rule); }
.socials li { padding: 0 14px; }
.socials li:first-child { padding-left: 0; }

.socials a {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-3);
  transition: color 120ms linear;
}

.socials a:hover { color: var(--fg); }

/* ---- numbered sections ---- */

section, .sec { margin-top: var(--rhythm); }

/* Collapsible sections are native <details>: no script, so they keep working
   with the sort handler, with keyboard navigation, and with JS unavailable.
   Every section ships open — the content is the point of the page, and a
   reader who wants a section out of the way can put it away. */
.sec > summary { list-style: none; cursor: pointer; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
.sec > summary .rest { transition: color 140ms ease; }
.sec > summary:hover .chev { border-color: var(--fg); }

/* A chevron drawn from two borders rather than a glyph: the palette is
   monochrome and self-hosted, so this adds no font and no asset. */
.chev {
  margin-left: auto;
  align-self: center;
  width: 6px;
  height: 6px;
  border-right: 1.25px solid var(--fg-3);
  border-bottom: 1.25px solid var(--fg-3);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 140ms ease;
}
.sec[open] > summary .chev { transform: translateY(1px) rotate(-135deg); }

@media (prefers-reduced-motion: reduce) {
  .chev { transition: none; }
}

.mark {
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-top: 1px solid var(--fg);
  padding-top: 12px;
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 400;
}

.mark .num { color: var(--fg-3); }
.mark .rest { color: var(--fg); }

.note {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--fg-3);
  margin: 14px 0 0;
  max-width: 62ch;
}

.lede {
  color: var(--fg-2);
  margin: 14px 0 0;
  max-width: 62ch;
}

/* ---- tables ---- */

.scroll {
  overflow-x: auto;
  margin-top: 22px;
  border-bottom: 1px solid var(--rule);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

thead th { cursor: pointer; user-select: none; }

th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: left;
  padding: 0 18px 10px 0;
  border-bottom: 1px solid var(--fg);
  white-space: nowrap;
}

thead th[aria-sort="ascending"], thead th[aria-sort="descending"] { color: var(--fg); }
thead th[aria-sort="ascending"]::after { content: " ↑"; }
thead th[aria-sort="descending"]::after { content: " ↓"; }

td {
  padding: 15px 18px 15px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
  white-space: nowrap;
  color: var(--fg-2);
}

tbody tr:last-child td { border-bottom: none; }
td.wrap { white-space: normal; min-width: 13ch; }

td.id a, td.ref {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--fg);
}

td.date {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

/* CVSS: severity carried by a bar, not a colour, so it survives monochrome */
td.score {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.bar {
  display: block;
  height: 2px;
  margin-top: 5px;
  width: 44px;
  background: var(--rule);
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--fg);
}

td.thin { color: var(--fg-3); }

/* deadline proximity, monochrome: outline then full invert */
.soon, .overdue {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 3px 7px;
}

.soon { box-shadow: inset 0 0 0 1px var(--fg-3); color: var(--fg); }
.overdue { background: var(--fg); color: var(--bg); }
.ok { font-family: var(--mono); font-size: 0.8rem; }

.empty { color: var(--fg-3); font-family: var(--mono); font-size: 0.8rem; }

/* ---- talks and links lists ---- */

.stack { list-style: none; padding: 0; margin: 22px 0 0; }

/* One column per entry, held to the reading measure. A two-column grid put the
   event label at the far right of a full-width row while the abstract stopped at
   68ch, so each talk read as three disconnected fragments across a dead gutter. */
.stack li {
  padding: 24px 0 26px;
  border-bottom: 1px solid var(--rule);
  max-width: 68ch;
}

.stack li:last-child { border-bottom: none; }

.stack .title {
  display: block;
  font-size: 1.08rem;
  line-height: 1.35;
  color: var(--fg);
}

.stack .where {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.stack .abstract {
  display: block;
  margin-top: 15px;
  color: var(--fg-2);
  font-size: 0.955rem;
}

/* Links sit clear of the prose; at 6px they read as part of the last line. */
.stack .meta {
  display: block;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* ---- detail page ---- */

.back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-3);
}

.back:hover { color: var(--fg); }

.facts { border-collapse: collapse; width: 100%; margin-top: 26px; }

.facts th {
  width: 190px;
  border-bottom: 1px solid var(--rule);
  padding: 13px 18px 13px 0;
  vertical-align: baseline;
  cursor: default;
}

.facts td {
  white-space: normal;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--fg);
}

.prose { margin-top: 34px; max-width: 68ch; color: var(--fg-2); }
.prose p { margin: 0 0 1.1em; }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--fill);
  padding: 1px 5px;
}
/* A payload is often wider than the column and must not be reflowed, so the
   block scrolls itself rather than stretching the page. */
.prose pre {
  background: var(--fill);
  border-left: 2px solid var(--rule);
  padding: 14px 16px;
  margin: 0 0 1.1em;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; font-size: 0.82em; }

.credit {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

/* ---- one staggered reveal on load ---- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 620ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .r1 { animation-delay: 0ms; }
  .r2 { animation-delay: 90ms; }
  .r3 { animation-delay: 180ms; }
  .r4 { animation-delay: 260ms; }
  .r5 { animation-delay: 330ms; }
  .r6 { animation-delay: 390ms; }
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* ---- narrow ---- */

@media (max-width: 620px) {
  .profile { grid-template-columns: 1fr; gap: 24px; }
  .portrait { width: 112px; height: 112px; }
  .monogram { font-size: 2.5rem; }
  .facts th { width: 128px; }
}
