/* ==========================================================================
   Base tokens. Light theme here, dark theme overrides these in dark.css.
   Warm paper neutrals with a teal accent and an amber secondary. The amber
   is used only on small marks: years, counts, the "now" dot.
   ========================================================================== */
:root {
  --bg:          #fcfbf9;
  --bg-soft:     #f7f5f1;
  --surface:     #f8f6f2;
  --surface-2:   #f1eee7;
  --border:      #e4dfd5;
  --border-soft: #ece8e0;

  --text:        #2b2825;
  --text-strong: #14120f;
  --muted:       #5d5852;
  --faint:       #8b857e;

  --accent:      #1d6f7a;
  --accent-ink:  #ffffff;
  --accent-soft: rgba(29, 111, 122, 0.075);
  --accent-line: rgba(29, 111, 122, 0.28);
  --accent-glow: rgba(29, 111, 122, 0.13);
  --accent-glow-0: rgba(29, 111, 122, 0);

  --warm:        #a9601c;
  --warm-soft:   rgba(169, 96, 28, 0.10);

  --alt:         #6b645c;
  --alt-soft:    rgba(107, 100, 92, 0.09);

  --code-bg:     #f2efe8;
  --pre-bg:      #1a1d21;
  --pre-text:    #e4e8ec;

  --shadow:      0 1px 2px rgba(20, 18, 15, 0.04);
  --shadow-lift: 0 6px 20px -8px rgba(20, 18, 15, 0.16);

  --sans: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 8px;
  --radius-sm: 5px;
  --maxw: 920px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ==========================================================================
   Reset and document
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

* { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--accent); color: var(--accent-ink); }

img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Entrance. One short rise on page load, staggered down the page. Anything
   below the fold has already finished by the time it is scrolled to.
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.site-header,
main > *,
.site-footer {
  animation: rise 0.5s var(--ease) both;
}
main > *:nth-child(2) { animation-delay: 0.06s; }
main > *:nth-child(3) { animation-delay: 0.12s; }
main > *:nth-child(4) { animation-delay: 0.18s; }
main > *:nth-child(n+5) { animation-delay: 0.22s; }
.site-footer { animation-delay: 0.26s; }

/* ==========================================================================
   Layout
   ========================================================================== */
.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.4rem 4rem;
  word-wrap: break-word;
}

/* ==========================================================================
   Site header and nav
   ========================================================================== */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.75rem 0 1.25rem;
  margin-bottom: 2.75rem;
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }

.brand a {
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  text-decoration: none;
  border: 0;
  transition: color 0.2s var(--ease);
}
.brand a:hover { color: var(--accent); background: none; }

.brand-sub {
  font-size: 0.76rem;
  color: var(--faint);
  line-height: 1.35;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem;
}

.site-nav a {
  position: relative;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border: 0;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

/* The underline grows out from the centre on hover and stays on the
   current page. */
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.15rem;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}
.site-nav a:hover { color: var(--accent); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.active { color: var(--text-strong); font-weight: 500; }
.site-nav a.active::after { transform: scaleX(1); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 0.35rem;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background-color 0.2s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: rotate(-20deg);
}
.theme-toggle svg { width: 14px; height: 14px; }

/* ==========================================================================
   Hero. A soft off-centre glow sits behind it, nothing else.
   ========================================================================== */
.hero {
  position: relative;
  padding: 1.5rem 0 2.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.25rem;
}

/* Fading to a fully transparent *accent* rather than to `transparent`
   keeps the edge clean; fading to transparent-black leaves a grey haze. */
.hero::before {
  content: '';
  position: absolute;
  top: -7rem;
  left: -20%;
  width: 40rem;
  height: 26rem;
  max-width: 130%;
  background: radial-gradient(50% 50% at 35% 40%, var(--accent-glow), var(--accent-glow-0) 100%);
  pointer-events: none;
  z-index: -1;
}

.hero-greet {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.hero-name {
  font-size: clamp(2rem, 6.5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text-strong);
  margin: 0 0 0.55rem;
}

.hero-role {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 1rem;
}
.hero-role .at { color: var(--muted); font-weight: 400; }

.hero-line {
  font-size: 1.04rem;
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 1.5rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }

/* "Right now" line. The small dot breathes so the page has one live thing
   on it; it stops under prefers-reduced-motion. */
.now {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.93rem;
  color: var(--muted);
  margin: 0 0 1.6rem;
  max-width: 62ch;
}

.now-dot {
  flex: none;
  position: relative;
  top: 0.45em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 0 0 var(--warm-soft);
  animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--warm-soft); }
  70%  { box-shadow: 0 0 0 7px rgba(169, 96, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(169, 96, 28, 0); }
}

.now-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.79rem;
  line-height: 1;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
              background-color 0.2s var(--ease), transform 0.2s var(--ease),
              box-shadow 0.2s var(--ease);
}
.btn:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}
.btn:active { transform: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--accent-ink);
  filter: brightness(1.12);
}

/* The arrow on an outbound button slides a little on hover. */
.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translate(2px, -2px); }

/* ==========================================================================
   Fact line. One sentence, numbers picked out in mono.
   ========================================================================== */
.facts {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--muted);
  margin: 0 0 2.75rem;
}
.facts strong {
  color: var(--text-strong);
  font-weight: 600;
}
.facts .sep { color: var(--faint); opacity: 0.55; margin: 0 0.15rem; }

/* ==========================================================================
   Page heads and section heads
   ========================================================================== */
.page-head { margin-bottom: 2.25rem; }

.page-title {
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text-strong);
  margin: 0 0 0.55rem;
}

.page-intro {
  color: var(--muted);
  max-width: 66ch;
  margin: 0;
}
.page-intro p { margin: 0.4rem 0; }

.home-section { margin-bottom: 3.25rem; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.65rem;
  margin-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0;
}

.more {
  font-family: var(--mono);
  font-size: 0.77rem;
  color: var(--accent);
  text-decoration: none;
  border: 0;
  white-space: nowrap;
  margin-left: auto;
  transition: gap 0.2s var(--ease);
}
.more:hover { background: none; }
.more .arrow { display: inline-block; transition: transform 0.2s var(--ease); }
.more:hover .arrow { transform: translateX(3px); }

/* ==========================================================================
   Year blocks
   ========================================================================== */
.year-block { margin-bottom: 2.75rem; }

.year-heading {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-strong);
  margin: 0 0 1.1rem;
}
.year-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
/* The hairline sits between the year and its count. */
.year-heading::after { order: 1; }
.year-heading .count {
  order: 2;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--faint);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.cards { display: grid; gap: 1.1rem; }

.card {
  position: relative;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
              transform 0.25s var(--ease);
}
.card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lift);
}

/* ---- Featured research. The newest piece of work, given room. ---- */
.featured {
  position: relative;
  display: block;
  padding: 1.5rem 1.6rem;
  margin: 0 0 3.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
              transform 0.25s var(--ease);
}
.featured::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s var(--ease);
}
.featured:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.featured:hover::before { transform: scaleY(1); }

.featured-label {
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm);
  margin: 0 0 0.6rem;
}
.featured-title {
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--text-strong);
  margin: 0 0 0.55rem;
}
.featured-sub {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 68ch;
  margin: 0 0 0.9rem;
}
.featured-cta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}
.featured-cta .arrow { display: inline-block; transition: transform 0.2s var(--ease); }
.featured:hover .featured-cta .arrow { transform: translateX(4px); }

/* ---- Talk card ---- */
.talk-conf {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 0.3rem;
}
.talk-where { color: var(--muted); font-weight: 400; }

.talk-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--faint);
}
/* Separator sits on the preceding item so it never starts a wrapped line. */
.talk-meta .meta-item:not(:last-child)::after {
  content: '\00b7';
  margin-left: 0.55rem;
  color: var(--faint);
  opacity: 0.6;
}
.talk-meta .track {
  color: var(--alt);
  background: var(--alt-soft);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}
.talk-meta .track::after { content: none !important; margin: 0 !important; }

.talk-title {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.38;
  color: var(--text-strong);
  margin: 0 0 0.5rem;
}

.talk-co { font-size: 0.85rem; color: var(--alt); margin: 0 0 0.5rem; }

.talk-summary {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 70ch;
  margin: 0 0 0.9rem;
}

.talk-links { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }

/* ---- Hairline rows. A list of entries with no box around each one.
        Hovering tints the row and draws a short accent bar in the gutter. ---- */
.rows > .row {
  position: relative;
  padding: 1.1rem 0.85rem;
  margin: 0 -0.85rem;
  border-top: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: background-color 0.25s var(--ease);
}
.rows > .row:first-child { border-top: 0; }
.rows > .row:hover { background: var(--bg-soft); }

.rows > .row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.1rem;
  bottom: 1.1rem;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.rows > .row:hover::before { opacity: 1; transform: scaleY(1); }

.row .talk-meta { margin-bottom: 0.3rem; }
.row .talk-title { font-size: 1.01rem; margin: 0.15rem 0 0.4rem; }
.row .talk-summary { font-size: 0.92rem; max-width: 76ch; margin-bottom: 0.5rem; }

.talk-topics {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--faint);
  margin: 0 0 0.4rem;
}

/* Links on a row are text, not buttons. The underline grows in on hover. */
.row .talk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  font-size: 0.86rem;
  margin: 0;
}
.row .talk-links a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.25s var(--ease);
  padding-bottom: 1px;
  border-bottom: 1px solid var(--accent-line);
}
.row .talk-links a:hover { background-size: 100% 1px; border-bottom-color: transparent; }

/* ---- Chips ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.chips li {
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  text-indent: 0;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.chips li a { color: inherit; text-decoration: none; border: 0; }
.chips li:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}
.chips li a:hover { background: none; color: var(--accent); }

.tag-cloud { margin-top: 0; }
.tag-cloud li { font-size: 0.78rem; padding: 0.3rem 0.8rem; }
.tag-cloud .count, .vendor-head .count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}

/* ---- Video embed ---- */
.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 1.1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* On a hairline row the player sits inline at a readable size, not full width. */
.row .video { max-width: 460px; margin-top: 0.85rem; }

/* ==========================================================================
   CVE page
   ========================================================================== */
.vendor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.vendor-name {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent);
  margin: 0;
}

.vendor-head .count {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.cve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.cve-grid li { text-indent: 0; }

.cve {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
              transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cve:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.cve-id { font-family: var(--mono); font-size: 0.81rem; font-weight: 500; }
/* A named bug is the part people remember, so it gets the warm mark. */
.cve-note { font-size: 0.72rem; color: var(--warm); }

/* ==========================================================================
   Post list
   ========================================================================== */
.posts { list-style: none; padding: 0; margin: 0; }

.posts .post {
  position: relative;
  padding: 1.1rem 0.85rem;
  margin: 0 -0.85rem;
  border-bottom: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  text-indent: 0;
  transition: background-color 0.25s var(--ease);
}
.posts .post:last-child { border-bottom: 0; }
.posts .post:hover { background: var(--bg-soft); }

.posts .post::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.1rem;
  bottom: 1.1rem;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.posts .post:hover::before { opacity: 1; transform: scaleY(1); }

.posts .post > a {
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.38;
  color: var(--text-strong);
  text-decoration: none;
  border: 0;
  transition: color 0.2s var(--ease);
}
.posts .post:hover > a { color: var(--accent); background: none; }

.posts .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--faint);
  margin-top: 0.3rem;
}
.posts .meta .publisher { color: var(--alt); }

.post-desc {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 72ch;
  margin: 0.45rem 0 0;
}

.meta { color: var(--faint); font-family: var(--mono); font-size: 0.78rem; }

.draft-label, .ext-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--alt);
  background: var(--alt-soft);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

/* ==========================================================================
   Prose (rendered markdown)
   ========================================================================== */
.prose { max-width: 70ch; }
.home .prose { max-width: none; }

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-strong);
  margin: 2.5rem 0 0.8rem;
  scroll-margin-top: 1rem;
}
.prose h1 { font-size: 1.55rem; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.08rem; }
.prose h4, .prose h5, .prose h6 { font-size: 0.97rem; }

/* On the home page the markdown sections read as sections, not as a
   continuation of the hero, so they keep a hairline above. */
.home .prose h2 {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  margin: 2.75rem 0 1.35rem;
}
.home .prose > h2:first-child { margin-top: 0; }

.prose p { margin: 0 0 1.15rem; }

.prose a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  border-bottom: 1px solid var(--accent-line);
  transition: background-size 0.25s var(--ease), border-color 0.25s var(--ease);
}
.prose a:hover { background-size: 100% 1.5px; border-bottom-color: transparent; }

.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.15rem; }
.prose ul { list-style: none; padding-left: 1.2rem; }
.prose ul > li { position: relative; }
/* A small accent tick instead of a bullet. */
.prose ul > li::before {
  content: '';
  position: absolute;
  left: -1.2rem;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-line);
}
.prose li { margin-bottom: 0.4rem; }
.prose li > ul { margin-top: 0.4rem; margin-bottom: 0; }

.prose blockquote {
  border-left: 2px solid var(--accent-line);
  background: var(--surface);
  color: var(--muted);
  margin: 0 0 1.15rem;
  padding: 0.8rem 1.1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose img { border: 1px solid var(--border); }

figure { margin: 1.5rem 0; max-width: 100%; }
figure img { max-height: 520px; }
figure h4, figcaption {
  font-size: 0.82rem;
  color: var(--faint);
  margin: 0.5rem 0 0;
}

/* ==========================================================================
   Code
   ========================================================================== */
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--code-bg);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--pre-bg);
  color: var(--pre-text);
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.6;
  overflow-x: auto;
  padding: 1.05rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 0 0 1.3rem;
}
pre code {
  background: none;
  border: 0;
  color: inherit;
  font-size: 100%;
  padding: 0;
}

.highlight { position: relative; -webkit-overflow-scrolling: touch; }
.highlight pre { margin-bottom: 1.3rem; }

/* ==========================================================================
   Callout
   ========================================================================== */
.callout {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.6rem;
}
.callout p { font-size: 0.93rem; margin: 0; }
.callout a { color: var(--accent); }

/* ==========================================================================
   Tables
   ========================================================================== */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
}
.prose th {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 500;
}

/* ==========================================================================
   Contact strip. Closes the home page with a way to reach a person.
   ========================================================================== */
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.contact-text { margin: 0; max-width: 46ch; }
.contact-text strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text-strong);
  margin-bottom: 0.2rem;
}
.contact-text span { font-size: 0.93rem; color: var(--muted); }
.contact .hero-actions { gap: 0.5rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
  margin-top: 4rem;
}

.socials { display: flex; gap: 0.5rem; }

.soc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.soc:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.soc svg { width: 16px; height: 16px; }

.footer-info {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--faint);
}
.footer-info a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); }
.footer-info a:hover { color: var(--accent); border-bottom-color: var(--accent-line); }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
}
.page-link {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}
.page-link:hover { text-decoration: underline; }

/* ==========================================================================
   External link posts. Most posts here point at an article published
   elsewhere, so the page states that and links out.
   ========================================================================== */
.external {
  margin: 1.75rem 0 2rem;
  padding: 1.3rem 1.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
}
.external-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.85rem;
}

.post-tags { margin-top: 2rem; }

/* Byline under a post title: date, publisher, reading time. */
.post-meta + .page-intro { margin-top: 0.75rem; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
  margin-top: 0.4rem;
}
.post-meta > span + span::before {
  content: '\00b7';
  margin-right: 0.6rem;
  color: var(--border);
}

/* Older / newer post. Two cards, the newer one aligned right. */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.post-nav-link:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.post-nav-link.next { grid-column: 2; text-align: right; }

.post-nav-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.post-nav-title {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-strong);
}
.post-nav-link:hover .post-nav-title { color: var(--accent); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .content { padding: 0 1.1rem 3rem; }
  .site-header { padding-top: 1.25rem; margin-bottom: 2rem; }
  .site-nav { gap: 0.1rem; margin-left: -0.7rem; }
  .card, .featured { padding: 1.2rem 1.15rem; }
  .hero { padding-top: 1rem; }
  .hero::before { left: -35%; width: 30rem; height: 20rem; }
  .contact { padding: 1.2rem 1.15rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-link.next { grid-column: 1; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  .card:hover, .btn:hover, .cve:hover, .featured:hover,
  .soc:hover, .chips li:hover, .theme-toggle:hover { transform: none; }
}
