:root {
  --bg: #f6f7f9;
  --text: #1e2738;
  --muted: #5a6476;
  --heading: #0f172a;
  --accent: #2f5ea8;
  --accent-strong: #244a84;
  --accent-soft: #edf2fb;
  --border: #d9dee8;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  --radius: 10px;
  --container: 1140px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', 'Avenir Next', 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-strong);
}

.container {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 247, 249, 0.98);
  border-bottom: 1px solid var(--border);
}

.site-header.scrolled {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-family: 'IBM Plex Mono', 'Fira Code', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--heading);
  font-weight: 600;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  transition: transform 0.2s ease;
}

.site-nav a:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.75);
  transform: translateY(-1px);
}

.site-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--border);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--heading);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.theme-toggle {
  margin-left: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--heading);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
}

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

.page {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0 36px;
}

.sidebar {
  position: sticky;
  top: 94px;
  height: fit-content;
}

.profile {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: none;
  border-radius: var(--radius);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.avatar-img {
  width: 152px;
  height: 152px;
  border-radius: 8px;
  object-fit: cover;
  border: 3px solid #f9fbff;
  box-shadow: none;
  background: #f7f7f8;
}

.profile .name {
  margin: 0;
  color: var(--heading);
  font-size: 1.45rem;
  line-height: 1.25;
}

.profile .title {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.social-icons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

.social-icons a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--heading);
  background: #fff;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.social-icons a:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.social-icons a svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

.badge-soft-action svg {
  width: 0.95em;
  height: 0.95em;
  fill: currentColor;
  vertical-align: -0.12em;
  margin-right: 3px;
}

main.content {
  min-width: 0;
}

.content section {
  margin-bottom: 26px;
}

.content h1,
.content h2,
.content h3 {
  font-family: 'Sora', 'Avenir Next', sans-serif;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.content h1 {
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.08;
  margin: 0 0 12px;
}

.content h2 {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  line-height: 1.2;
  margin: 0 0 12px;
}

.content h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0 0 8px;
}

.subtitle,
.note {
  color: var(--muted);
}

.hero {
  position: relative;
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--border);
  box-shadow: none;
  overflow: hidden;
  background: #ffffff;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.quick-metrics {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-chip {
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  background: #fbfcfe;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-chip strong {
  display: block;
  color: var(--heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.metric-chip span,
.metric-chip ul {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.metric-chip ul {
  margin: 0;
  padding-left: 20px;
}

.metric-chip li {
  margin-bottom: 6px;
}

.metric-chip li:last-child {
  margin-bottom: 0;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid var(--border);
  padding: 9px 15px;
  color: var(--heading);
  background: #fff;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: var(--accent-strong);
}
.btn-primary:hover {
  background: var(--accent);
}

.surface {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: clamp(18px, 2.4vw, 26px);
}

.lead-list {
  margin: 14px 0 0;
  padding-left: 20px;
}

.lead-list li {
  margin: 10px 0;
}

.page-heading {
  margin-bottom: 18px;
}

.page-heading .eyebrow {
  display: inline-flex;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3f4f71;
  margin-bottom: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-2 figure {
  margin: 0;
}

.grid-2 figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.grid-2 figure figcaption {
  font-size: 0.94rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.algo-grid {
  align-items: stretch;
  grid-template-columns: 37.5% 1fr;
}

.algo-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}

.algo-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.algo-card p {
  margin: 6px 0;
}

.algo-card ol {
  margin: 6px 0;
  padding-left: 20px;
}

.algo-card ol > li {
  margin: 6px 0;
}

.algo-card .note {
  color: var(--muted);
}

.data-table {
  border-collapse: collapse;
  margin: 0.6rem 0;
  font-size: 0.95em;
}

.data-table th,
.data-table td {
  padding: 0.35rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid var(--border, #d8dee6);
}

.data-table thead th {
  border-bottom: 2px solid var(--border, #c4ccd6);
  font-weight: 600;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.algo-grid > figure {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  margin: 0;
  min-height: 0;
}

.algo-grid > figure > img {
  height: auto !important;
  max-height: 100%;
  width: 100%;
  object-fit: contain;
  align-self: center;
  justify-self: center;
  min-height: 0;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #d5dcea;
  background: var(--accent-soft);
  color: #244a84;
}

a.badge,
button.badge {
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

a.badge:hover,
button.badge:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

.badge.active {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 24px;
  color: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.05);
}

.card-title {
  font-weight: 700;
  color: var(--heading);
}

.card-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 8px 0 10px;
}

.pub-list {
  margin: 0;
  padding-left: 22px;
}

.pub-list li {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  list-style-position: outside;
  background: #fbfcff;
}

.item {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.item:first-of-type {
  border-top: 0;
}

.item header {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.item .item-main h3 {
  margin: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid #d4dbea;
  background: #f9fafc;
}

.site-footer .container {
  padding: 16px 20px 24px;
  color: var(--muted);
  font-size: 0.94rem;
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.code {
  background: #f8fafc;
  color: #1f2328;
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  border: 1px solid #e6e8eb;
}

.code pre {
  margin: 0;
  white-space: pre;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.92rem;
  line-height: 1.5;
}

.code code {
  display: block;
}

.bt-type {
  color: #1d4ed8;
  font-weight: 600;
}

.bt-key {
  color: #7c3aed;
}

.bt-field {
  color: #166534;
}

.bt-equals {
  color: #6b7280;
}

.bt-value {
  color: #b45309;
}

.bt-brace {
  color: #0284c7;
}

.bt-comma,
.bt-comment {
  color: #6b7280;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  max-width: 720px;
  width: 100%;
  overflow: hidden;
}

.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.modal header h3 {
  margin: 0;
  font-size: 1rem;
}

.modal .modal-body {
  padding: 12px 14px;
}

.modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.modal .close-btn {
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: #f3f4f6;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.tldr {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  border-radius: 8px;
}

#project-root > figure {
  margin: 1.2rem 0;
}

#project-root > figure img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
}

#project-root > figure figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  margin-top: 0.5rem;
}

#project-root > .project-figure {
  width: fit-content;
  max-width: min(100%, 920px);
  margin-left: auto;
  margin-right: auto;
}

#project-root > .project-figure-preview {
  max-width: min(100%, 760px);
}

#project-root > .project-figure-preview img {
  width: min(100%, 760px);
  max-height: min(58vh, 430px);
  object-fit: contain;
  cursor: zoom-in;
}

#project-root > .project-figure-preview .project-figure-link {
  display: block;
  line-height: 0;
}

#project-root > .project-figure-preview figcaption {
  max-width: min(100%, 760px);
}

#project-root > .project-figure-compact {
  max-width: min(100%, 760px);
}

.with-aside {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
}

.aside-text {
  flex: 2;
  min-width: 0;
}

.aside-media {
  float: right;
  width: 300px;
  max-width: 40%;
  margin: 0 0 1em 1.25em;
}

.aside-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
}

.aside-media figcaption {
  font-size: 0.85rem;
  color: var(--muted, #666);
  text-align: center;
  margin-top: 0.5em;
  line-height: 1.4;
}

.zoomable {
  cursor: pointer;
  cursor: -webkit-zoom-in;
  cursor: zoom-in;
  position: relative;
}

.zoomable::after {
  z-index: 1;
}

.zoom-overlay[hidden] {
  display: none;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.zoom-content {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.zoom-content img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  background: #000;
}

.zoom-caption {
  color: #e5e7eb;
  margin-top: 8px;
  font-size: 0.95rem;
}

.zoomable::after {
  content: '';
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'><path d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 10-.71.71l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1114 9.5 4.505 4.505 0 019.5 14z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  pointer-events: none;
}

.zoomable:hover::after {
  opacity: 1;
}

.zoom-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.zoom-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

html[data-theme='dark'],
body[data-theme='dark'] {
  --bg: #11151d;
  --text: #dde3f0;
  --muted: #a8b2c6;
  --heading: #f2f5fb;
  --accent: #7ca3df;
  --accent-strong: #9ab8e7;
  --accent-soft: #1c2738;
  --border: #2c374a;
  --panel: #151c28;
  --panel-strong: #151c28;
}

html[data-theme='dark'] body {
  background: var(--bg);
}

html[data-theme='dark'] .site-header {
  background: rgba(17, 21, 29, 0.96);
}

html[data-theme='dark'] .site-nav a:hover,
html[data-theme='dark'] .social-icons a,
html[data-theme='dark'] .theme-toggle,
html[data-theme='dark'] .nav-toggle,
html[data-theme='dark'] .btn,
html[data-theme='dark'] .metric-chip,
html[data-theme='dark'] .pub-list li {
  background: #1a2231;
}

html[data-theme='dark'] .hero,
html[data-theme='dark'] .card {
  background: #151c28;
}

html[data-theme='dark'] .surface {
  background: #151c28;
}

html[data-theme='dark'] .tldr {
  background: #151c28;
  border-color: #2c374a;
  border-left-color: #7ca3df;
  color: #e5e7eb;
}

html[data-theme='dark'] .badge {
  background: #223148;
  border-color: #3f5375;
  color: #e4ecfb;
}

html[data-theme='dark'] a.badge:hover,
html[data-theme='dark'] button.badge:hover {
  background: #2a3e5d;
}

html[data-theme='dark'] .badge.active {
  background: #7ca3df;
  border-color: #7ca3df;
  color: #0f172a;
}

html[data-theme='dark'] .card-meta .badge {
  background: #283852;
  border-color: #4a5e83;
}

html[data-theme='dark'] .site-footer {
  background: #11151d;
}

html[data-theme='dark'] .zoom-close {
  background: rgba(17, 21, 29, 0.7);
}

@media (max-width: 1024px) {
  .page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .profile {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
  }

  .profile .name {
    font-size: 1.2rem;
  }

  .avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 18px;
  }

  .quick-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .header-inner {
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .theme-toggle {
    margin-left: 8px;
  }

  .site-nav {
    display: none;
    position: absolute;
    right: 20px;
    top: 62px;
    min-width: 210px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    text-align: left;
  }

  .grid-2,
  .cards {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 22px;
  }

  .content h1 {
    font-size: 1.85rem;
  }

  .content h2 {
    font-size: 1.4rem;
  }

  .profile {
    flex-direction: column;
    text-align: center;
  }

  .aside-media {
    float: none;
    max-width: 100%;
    width: auto;
    margin: 1em 0;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 14px;
  }

  .site-nav {
    left: 14px;
    right: 14px;
    min-width: auto;
  }

  .cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .badge {
    font-size: 0.75rem;
  }
}

@media print {
  .site-header,
  .site-footer,
  nav,
  .nav-toggle,
  .theme-toggle,
  .badges a,
  .social-icons,
  .sidebar {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  h1,
  h2 {
    page-break-after: avoid;
  }
}

.credibility-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.venue-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
}
html[data-theme='dark'] .venue-badge {
  background: rgba(255,255,255,0.05);
}
.highlight-strip {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}
html[data-theme='dark'] .metric-chip,
html[data-theme='dark'] .card {
  border-color: var(--border);
  box-shadow: none;
}
html[data-theme='dark'] .card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.badge-soft-venue {
  display: inline-block;
  background: #eff6ff;
  color: #3b82f6;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
  align-self: flex-start;
}

html[data-theme='dark'] .badge-soft-venue {
  background: #1e3a8a;
  color: #93c5fd;
}

.badge-soft-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #3b82f6;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

.badge-soft-action:hover {
  background: #dbeafe;
}

html[data-theme='dark'] .badge-soft-action {
  background: #1e3a8a;
  color: #93c5fd;
}

html[data-theme='dark'] .badge-soft-action:hover {
  background: #1d4ed8;
}

.card-title {
  font-weight: 700;
  color: #1f2937;
  font-size: 1.15rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

html[data-theme='dark'] .card-title {
  color: #f3f4f6;
}

.card p {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.intro {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.intro p {
  margin-bottom: 20px;
}

.intro p.intro-last {
  margin-bottom: 0;
}

.selected-publications.surface {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.selected-publications h2 {
  color: var(--heading);
  font-size: clamp(2.3rem, 5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.selected-publications .note {
  margin-bottom: 20px;
}

#featured-pubs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

#featured-pubs .card {
  min-height: 360px;
  border: 1px solid #dfe5ee;
  border-radius: 16px;
  padding: 28px 28px 22px;
  background: #fff;
  box-shadow: none;
}

#featured-pubs .card:hover {
  transform: none;
  box-shadow: none;
  border-color: #cfd8e6;
}

#featured-pubs .card-title {
  color: #20242c;
  font-size: clamp(1.35rem, 2vw, 1.6rem);
  line-height: 1.55;
  font-weight: 700;
  margin-bottom: 8px;
}

#featured-pubs .badge-soft-venue {
  border: 1px solid #dce5ff;
  border-radius: 999px;
  background: #eef3ff;
  color: #1d4cff;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 3px 12px;
  margin-bottom: 28px;
}

#featured-pubs .card p {
  color: #20242c;
  font-size: clamp(1.16rem, 1.9vw, 1.45rem);
  line-height: 1.62;
  margin: 0 0 28px;
}

#featured-pubs .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

#featured-pubs .badge-soft-action {
  border: 1px solid #dce5ff;
  border-radius: 999px;
  background: #eef3ff;
  color: #1d4cff;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 4px 12px;
}

#featured-pubs .badge-soft-action:hover {
  background: #e1e9ff;
  color: #153bd6;
}

html[data-theme='dark'] .selected-publications.surface {
  background: transparent;
}

html[data-theme='dark'] #featured-pubs .card {
  background: #151c29;
  border-color: #273449;
}

html[data-theme='dark'] #featured-pubs .card-title,
html[data-theme='dark'] #featured-pubs .card p {
  color: #f3f4f6;
}

html[data-theme='dark'] #featured-pubs .badge-soft-venue,
html[data-theme='dark'] #featured-pubs .badge-soft-action {
  background: #182b55;
  border-color: #2d4f91;
  color: #9dbbff;
}

@media (max-width: 860px) {
  #featured-pubs {
    grid-template-columns: 1fr;
  }

  #featured-pubs .card {
    min-height: 0;
  }
}
