/* Design tokens — aligned with revlev.org */
:root,
[data-theme="light"] {
  color-scheme: light;
  --white: #FFFFFF;
  --snow: #FAFBFC;
  --ash: #F2F3F5;
  --mist: #E8EAED;
  --smoke: #C4C8CF;
  --slate: #8A8F98;
  --graphite: #5C6370;
  --ink: #1A1D23;
  --blue-pale: #EDF2FF;
  --blue-light: #B4C6FC;
  --blue: #4A6CF7;
  --blue-deep: #2A4AD4;
  --blue-ink: #1B2F80;
  --red: #E5484D;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Russo One", var(--font);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-hero: clamp(1.75rem, 4vw, 2.5rem);

  --sp-sm: 0.75rem;
  --sp-md: 1.25rem;
  --sp-lg: 2rem;
  --sp-xl: 3.5rem;
  --content-max: 40rem;
  --content-max-wide: 52rem;
  --content-pad-x: clamp(1.25rem, 4vw, 2rem);
}

[data-theme="dark"] {
  color-scheme: dark;
  --white: #14171c;
  --snow: #1a1d23;
  --ash: #242830;
  --mist: #2e333c;
  --smoke: #5c6370;
  --slate: #9aa0a8;
  --graphite: #c4c8cf;
  --ink: #f2f3f5;
  --blue-pale: #0f1218;
  --blue-light: #3d4f8c;
  --blue: #7b93f8;
  --blue-deep: #a8b8fc;
  --blue-ink: #c5d0ff;
  --red: #F07A7A;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--blue-pale);
}

a {
  color: var(--blue-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease;
}

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

.shell {
  width: min(100%, calc(var(--content-max) + 2 * var(--content-pad-x)));
  margin: 0 auto;
  padding-left: var(--content-pad-x);
  padding-right: var(--content-pad-x);
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--mist);
  box-shadow: inset 0 -2px 0 var(--blue-light);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  padding-top: var(--sp-lg);
  padding-bottom: var(--sp-md);
}

.header-back,
.header-title,
.header-link {
  font-size: var(--fs-sm);
  font-weight: 450;
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-back:hover,
.header-title:hover,
.header-link:hover {
  color: var(--ink);
}

.header-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.header-about,
.header-link.is-active,
.header-title.is-active,
.site-footer a.is-active {
  color: var(--ink);
}

.header-nav {
  display: flex;
  gap: var(--sp-md);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--mist);
  border-radius: 8px;
  background: var(--snow);
  color: var(--graphite);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--smoke);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.theme-icon {
  display: none;
}

[data-theme="light"] .theme-icon-moon,
:root:not([data-theme]) .theme-icon-moon {
  display: block;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.site-main {
  flex: 1;
  box-sizing: border-box;
  width: min(calc(100% - 1.5rem), calc(var(--content-max) + 2 * var(--content-pad-x)));
  margin: var(--sp-md) auto var(--sp-lg);
  padding: var(--sp-lg) var(--content-pad-x) var(--sp-xl);
  background: var(--white);
  border: 1px solid var(--mist);
  border-radius: 12px;
}

.site-main--wide {
  width: min(calc(100% - 1.5rem), calc(var(--content-max-wide) + 2 * var(--content-pad-x)));
}

.site-footer {
  background: var(--white);
  border-top: 1px solid var(--mist);
  font-size: var(--fs-sm);
  color: var(--slate);
}

.site-footer-inner {
  padding-top: var(--sp-lg);
  padding-bottom: var(--sp-xl);
}

.site-footer a {
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--ink);
}

.footer-sep {
  margin: 0 0.35rem;
}

.page-intro {
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--mist);
}

.page-title {
  margin: 0 0 var(--sp-sm);
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.page-lead {
  margin: 0;
  color: var(--graphite);
  font-size: var(--fs-lg);
  line-height: 1.5;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-card {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: var(--sp-md);
  align-items: start;
  padding: var(--sp-lg) 0;
  border-bottom: 1px solid var(--mist);
}

/* No cover: don't leave an empty thumbnail column that squishes the title */
.post-card:not(:has(.post-card-media)) {
  grid-template-columns: minmax(0, 1fr);
}

.post-card:first-child {
  padding-top: 0;
}

.post-card:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.post-card-media {
  display: block;
  position: relative;
  width: 8.5rem;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ash);
  flex-shrink: 0;
  align-self: start;
}

.post-card-media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.post-card-media .theme-cover-light.has-dark,
.post-card-media .theme-cover-dark {
  position: static;
}

.theme-cover {
  margin: 0 0 1.25em;
}

.theme-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

/* Beat .post-card-media img / .theme-cover img so only one cover shows */
img.theme-cover-dark {
  display: none;
}

[data-theme="dark"] img.theme-cover-light.has-dark {
  display: none;
}

[data-theme="dark"] img.theme-cover-dark {
  display: block;
}

.post-card-body {
  min-width: 0;
}

.post-date {
  display: block;
  margin: 0.25rem 0 0.5rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}

.post-card-title {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.25;
}

.post-card-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card-title a:hover {
  color: var(--blue-deep);
}

.post-card-summary {
  margin: 0;
  color: var(--graphite);
}

@media (max-width: 640px) {
  .post-card {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: var(--sp-sm);
  }

  .post-card:not(:has(.post-card-media)) {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-card-media {
    width: 6.5rem;
  }
}

.post-meta {
  margin: 0 0 var(--sp-sm);
  font-size: var(--fs-sm);
  color: var(--slate);
}

.post-meta a {
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-meta a:hover {
  color: var(--ink);
}

/* Soft article updates — matches site chips/eyebrows, no accent bar */
.article-update {
  margin: 1.75em 0;
  padding: 1.2rem 1.25rem 1.3rem;
  border-radius: 12px;
  background: var(--ash);
}

.article-update > :first-child {
  margin-top: 0;
}

.article-update > :last-child {
  margin-bottom: 0;
}

.article-update-eyebrow {
  margin: 0 0 0.4rem;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.article-update-title {
  margin: 0 0 0.7rem;
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.article-update-body > :first-child {
  margin-top: 0;
}

.article-update-body > :last-child {
  margin-bottom: 0;
}

.article-update-body p {
  margin: 0.55em 0;
}

.article-update-body ul {
  margin: 0.6em 0;
}

.article-update a {
  color: var(--blue-deep);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 35%, transparent);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.article-update a:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.post-header {
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--mist);
}

.prose > *:first-child {
  margin-top: 0;
}

.prose > *:last-child {
  margin-bottom: 0;
}

.prose h2,
.prose h3 {
  margin: 1.75em 0 0.6em;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.prose h2 {
  font-size: 1.25rem;
}

.prose h3 {
  font-size: 1.1rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--blue) 14%, var(--ash));
  color: var(--blue-deep);
}

.prose pre {
  margin: 0 0 1.25em;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--ash);
  border: 1px solid var(--mist);
}

.prose pre code {
  padding: 0;
  background: transparent;
  color: var(--blue-deep);
}

.prose blockquote {
  margin: 0 0 1.25em;
  padding: 0.15em 0 0.15em 1rem;
  border-left: 3px solid var(--blue-light);
  color: var(--graphite);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.prose-video {
  display: block;
  max-width: min(100%, 720px);
  width: auto;
  height: auto;
  border-radius: 8px;
  background: var(--ash);
  pointer-events: none;
}

.fig-video {
  margin: 1.75em 0;
}

.fig-video .prose-video {
  max-width: 100%;
  width: 100%;
}

.prose hr {
  margin: 2em 0;
  border: none;
  border-top: 1px solid var(--mist);
}

/* Markdown tables → stacked cards (narrow column) */
.spec-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5em 0;
}

.spec-card {
  padding: 0.9rem 1rem;
  background: var(--snow);
  border: 1px solid var(--mist);
  border-radius: 10px;
}

.spec-card-title {
  margin: 0 0 0.5rem;
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.spec-card-title code {
  font-size: 0.92em;
}

.spec-card-field + .spec-card-field {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--mist);
}

.spec-card-label {
  margin: 0 0 0.2rem;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}

.spec-card-value {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--graphite);
}

.spec-card-value code {
  font-size: 0.92em;
  color: var(--blue-deep);
}


.empty {
  color: var(--slate);
}

.publications-title {
  margin: 0 0 var(--sp-lg);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   AUTHOR BENTO
   ============================================================ */
.author-bento {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.author-bento-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
}

.author-tile {
  border-radius: 12px;
  padding: var(--sp-md);
}

.author-eyebrow {
  margin: 0 0 0.5rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}

/* ---- Tile A: portrait ---- */
a.author-tile-a {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease;
}

a.author-tile-a:hover {
  border-color: var(--smoke);
}

.author-tile-a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: var(--sp-md);
  align-items: center;
  min-height: 280px;
  background: var(--white);
  border: 1px solid var(--mist);
  overflow: hidden;
}

.author-tile-a-name {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.author-tile-a-role {
  margin: 0 0 0.4rem;
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--blue-deep);
}

.author-tile-a-degrees {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--graphite);
}

.author-tile-a-line {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.55;
  color: var(--graphite);
}

.author-tile-a-photo {
  --parallax-x: 0%;
  --parallax-y: 0%;
  --photo-pos-x: 38%;
  --photo-pos-y: 42%;
  width: 210px;
  height: 210px;
  justify-self: end;
  border-radius: 50%;
  border: 2px solid var(--mist);
  background-image: var(--author-a-photo);
  /* Tighten crop: pull in so light window edge (top-right) stays out */
  background-size: 128%;
  background-position:
    calc(var(--photo-pos-x) + var(--parallax-x))
    calc(var(--photo-pos-y) + var(--parallax-y));
  background-repeat: no-repeat;
  will-change: background-position;
}

.author-tile-a-photo.is-settling {
  transition: background-position 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .author-tile-a {
  background: #0f1013;
  border-color: var(--mist);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  padding: 0 0 0 var(--sp-md);
  min-height: 280px;
}

[data-theme="dark"] .author-tile-a-name {
  color: #ffffff;
}

[data-theme="dark"] .author-tile-a-role {
  color: var(--blue-ink);
}

[data-theme="dark"] .author-tile-a-degrees,
[data-theme="dark"] .author-tile-a-line {
  color: #c4c8cf;
}

[data-theme="dark"] .author-tile-a-copy {
  padding: var(--sp-md) var(--sp-md) var(--sp-md) 0;
}

[data-theme="dark"] .author-tile-a-photo {
  --photo-pos-x: 50%;
  --photo-pos-y: 0%;
  width: 100%;
  height: 100%;
  min-height: 280px;
  justify-self: stretch;
  align-self: stretch;
  border-radius: 0;
  border: none;
  background-size: 118%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 45%);
  mask-image: linear-gradient(to right, transparent 0%, #000 45%);
}

@media (max-width: 640px), (hover: none) {
  .author-tile-a-photo {
    --parallax-x: 0% !important;
    --parallax-y: 0% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .author-tile-a-photo,
  .author-tile-a-photo.is-settling,
  .author-stat-value,
  .author-chip,
  a,
  .ext-icon {
    transition: none !important;
  }

  .author-tile-a-photo {
    --parallax-x: 0% !important;
    --parallax-y: 0% !important;
  }
}

/* ---- Tile B: stats ---- */
.author-tile-b {
  padding: var(--sp-md) 0;
  background: transparent;
  border: none;
}

.author-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  cursor: default;
}

.author-stat {
  padding: 0 var(--sp-sm);
  text-align: center;
  border-right: 1px solid var(--mist);
  cursor: default;
}

.author-stat:first-child {
  padding-left: 0;
}

.author-stat:last-child {
  padding-right: 0;
  border-right: none;
}

.author-stat-value {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  transition: color 0.2s ease, transform 0.2s ease;
}

.author-stat:hover .author-stat-value {
  color: var(--blue-deep);
  transform: translateY(-1px);
}

.author-stat-suffix {
  color: var(--blue);
  transition: color 0.2s ease;
}

.author-stat:hover .author-stat-suffix {
  color: var(--blue);
}

.author-stat-label {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.35;
  color: var(--graphite);
}

/* ---- Tile C: open source ---- */
.author-tile-c {
  background: color-mix(in srgb, var(--blue) 6%, var(--white));
  border: 1px solid var(--mist);
}

.author-oss-title {
  margin: 0 0 0.35rem;
  font-size: var(--fs-base);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--ink);
  line-height: 1.4;
}

.author-oss-title > a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.author-oss-title > a:hover {
  color: var(--blue-deep);
}

.author-oss-github {
  font-weight: 400;
  font-family: var(--font);
  font-size: var(--fs-sm);
  color: var(--slate);
}

.author-oss-github a {
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s ease;
}

.author-oss-github a:hover {
  color: var(--blue-deep);
}

.author-oss-more {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
}

.author-oss-more a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.ext-icon {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.2em;
  vertical-align: 0.08em;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

a:hover .ext-icon {
  opacity: 0.9;
}

/* ---- Tile D: expertise chips ---- */
.author-tile-d {
  background: var(--white);
  border: 1px solid var(--mist);
  cursor: default;
}

.author-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.author-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--ash);
  border: 1px solid var(--mist);
  cursor: default;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.author-chip:hover {
  color: var(--blue-deep);
  border-color: var(--blue-light);
  background: color-mix(in srgb, var(--blue) 8%, var(--white));
  transform: translateY(-1px);
}

.author-chip--more {
  justify-content: center;
  min-width: 2rem;
  color: var(--blue-deep);
  text-decoration: none;
  letter-spacing: 0.08em;
  line-height: 1;
  background: transparent;
  border-color: var(--blue-light);
  border-style: dashed;
  cursor: pointer;
}

.author-chip--more:hover {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--white));
  transform: translateY(-1px);
}

/* ---- Author card (end of post) ---- */
.author-card {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-top: var(--sp-xl);
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--mist);
}

.author-card-photo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  /* Match tile A face crop */
  object-position: 38% 42%;
  border: 2px solid var(--mist);
  background: var(--ash);
}

.author-card-name {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink);
}

.author-card-role {
  margin: 0.15rem 0 0.35rem;
  font-size: var(--fs-sm);
  color: var(--graphite);
}

.author-card-link {
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
}

/* ---- About page ---- */
.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-lg);
  align-items: center;
  margin-bottom: var(--sp-xl);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--mist);
}

.about-hero-role {
  margin: 0 0 0.4rem;
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--blue-deep);
}

.about-hero-degrees {
  margin: 0 0 var(--sp-md);
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--graphite);
}

.about-hero-intro {
  margin: 0;
  color: var(--graphite);
  line-height: 1.55;
}

.about-hero-photo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 38% 42%;
  border: 2px solid var(--mist);
  background: var(--ash);
}

.about-section {
  margin-bottom: var(--sp-xl);
}

.about-section-title {
  margin: 0 0 var(--sp-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}

.about-stack {
  margin: 0;
}

.about-stack-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--sp-md);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--mist);
}

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

.about-stack dt {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.about-stack dd {
  margin: 0;
  color: var(--graphite);
  line-height: 1.5;
}

.about-education p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--graphite);
}

.about-elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-elsewhere a {
  font-weight: 500;
  text-decoration: none;
}

@media (max-width: 640px) {
  .header-nav {
    display: none;
  }

  .header-actions {
    gap: 0;
  }

  .author-bento-row {
    grid-template-columns: 1fr;
  }

  .author-tile-a {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    min-height: 0;
    gap: var(--sp-md);
  }

  .author-tile-a-photo {
    order: -1;
    width: 160px;
    height: 160px;
    justify-self: center;
  }

  .author-tile-a-copy {
    text-align: center;
  }

  [data-theme="dark"] .author-tile-a {
    grid-template-columns: 1fr;
    padding: 0;
    text-align: left;
  }

  [data-theme="dark"] .author-tile-a-copy {
    padding: var(--sp-md);
    text-align: left;
  }

  [data-theme="dark"] .author-tile-a-photo {
    order: -1;
    width: 100%;
    height: 220px;
    min-height: 220px;
    background-image: var(--author-a-photo-mobile);
    background-size: cover;
    background-position: center top;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  }

  .author-stats {
    grid-template-columns: 1fr 1fr;
  }

  .author-stat {
    padding: var(--sp-sm);
    border-right: 1px solid var(--mist);
    border-bottom: 1px solid var(--mist);
  }

  .author-stat:nth-child(2n) {
    border-right: none;
  }

  .author-stat:nth-child(n + 3) {
    border-bottom: none;
  }

  .about-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .about-hero-photo {
    order: -1;
    width: 180px;
    height: 180px;
  }

  .about-stack-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* ============================================================
   ARTICLE FIGURES (inline SVG via the figure-svg shortcode)
   Append to blog.css, or load after it.
   ============================================================ */
:root,
[data-theme="light"] {
  /* Alert red — the one colour the site palette lacks; tuned to sit next to --blue */
  --alert: #D64545;
  --alert-deep: #A8302F;
  --alert-ink: #7A1F1F;
  --alert-light: #F2BDBD;
  --alert-pale: #FDEEEE;
}

[data-theme="dark"] {
  --alert: #F07A7A;
  --alert-deep: #F5A3A3;
  --alert-ink: #FBCACA;
  --alert-light: #5E2C30;
  --alert-pale: #24151A;
}

.fig {
  margin: 1.75em 0;
  cursor: default;
}

.fig-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  cursor: default;
}

.fig-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  cursor: default;
}

.fig-svg *,
.prose svg,
.prose svg * {
  cursor: default;
}

.fig figcaption {
  margin-top: 0.6rem;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--slate);
  text-align: center;
}

.article-demo {
  margin: 1.75em 0;
  display: flex;
  justify-content: center;
}

.article-demo .ssd {
  --ssd-w: min(100%, 50rem);
  width: var(--ssd-w);
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  cursor: default;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue) 28%, transparent);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.article-demo .ssd:hover,
.article-demo .ssd:focus-within {
  border-color: var(--mist);
  box-shadow: none;
}

/* Shared “try it” hint for interactive demos (top-left of .ssd) */
.ssd-tryit {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  height: 2.75rem;
  padding: 0 1.15rem 0 0.72rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: 600 1.05rem / 1 var(--font);
  letter-spacing: 0.03em;
  text-transform: lowercase;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
  transition: padding 0.55s ease;
}

/* Pulse ring on a layer so collapse never fights transform/shadow */
.ssd-tryit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 40%, transparent);
  animation: ssd-tryit-pulse 2.4s ease-in-out infinite;
}

.ssd-tryit-ico {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: block;
}

.ssd-tryit-txt {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 5.5rem;
  margin-left: 0.5rem;
  overflow: hidden;
  opacity: 1;
  white-space: nowrap;
  transition:
    max-width 0.55s ease,
    margin-left 0.55s ease,
    opacity 0.4s ease;
}

/* Collapse: only the label slides away — icon stays put */
@media (hover: hover) and (pointer: fine) {
  .ssd:hover .ssd-tryit:not(:hover),
  .ssd:focus-within .ssd-tryit:not(:hover) {
    padding-right: 0.72rem;
  }

  .ssd:hover .ssd-tryit:not(:hover) .ssd-tryit-txt,
  .ssd:focus-within .ssd-tryit:not(:hover) .ssd-tryit-txt {
    max-width: 0;
    margin-left: 0;
    opacity: 0;
  }
}

/* Stronger pulse while choice / action buttons are on stage */
.ssd:has(.ssd-btn) .ssd-tryit::before {
  animation-name: ssd-tryit-pulse-hot;
  animation-duration: 0.9s;
}

@keyframes ssd-tryit-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 40%, transparent);
  }
  50% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--blue) 0%, transparent);
  }
}

@keyframes ssd-tryit-pulse-hot {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 55%, transparent);
  }
  50% {
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--blue) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ssd-tryit::before {
    animation: none;
  }
}

.article-demo .ssd *,
.article-demo .ssd svg,
.article-demo .ssd svg * {
  cursor: default;
}

.article-demo .ssd-btn,
.article-demo .ssd-btn *,
.article-demo .ssd-replay,
.article-demo .ssd-replay *,
.article-demo .ssd-tryit,
.article-demo .ssd-tryit * {
  cursor: pointer;
}

.article-demo .ssd-btn {
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.22s cubic-bezier(0.33, 1, 0.68, 1);
}

.article-demo .ssd-btn:hover {
  border-color: rgb(123, 147, 248);
  color: #fff;
  background: rgb(123, 147, 248);
  box-shadow: 0 4px 16px color-mix(in srgb, rgb(123, 147, 248) 40%, transparent);
  /* keep at/above .choice peak (1 + 0.035) so hover never shrinks the pulse */
  transform: translateY(-1px) scale(1.04);
}

.article-demo .ssd-btn:hover b,
.article-demo .ssd-btn:hover small {
  color: #fff;
}

.article-demo .ssd-btn:active {
  transform: translateY(0) scale(1.03);
  box-shadow: 0 2px 10px color-mix(in srgb, rgb(123, 147, 248) 35%, transparent);
  background: rgb(123, 147, 248);
  border-color: rgb(123, 147, 248);
  color: #fff;
}

.article-demo .ssd-btn:focus-visible {
  outline: 2px solid rgb(123, 147, 248);
  outline-offset: 2px;
}


/* Below ~560px the diagram text gets too small: keep a readable width and scroll */
@media (max-width: 640px) {
  .fig-svg {
    width: 34rem;
    max-width: none;
  }

  .fig-scroll {
    margin: 0 calc(-1 * var(--content-pad-x));
    padding: 0 var(--content-pad-x);
  }
}
