/* ==========================================================================
   pranavkulkarni.org — Editorial design system
   Style: Swiss Modernism 2.0  ·  Type: Archivo / system sans
   Monochrome + single blue accent  ·  Auto light/dark
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  /* Type */
  --font-heading: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Monaco, "Cascadia Code", "Courier New", monospace;

  /* Modular type scale (1.2 minor third), base 18px */
  --text-xs: 0.78rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;  /* 17px reading base */
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.85rem;
  --text-3xl: 2.4rem;
  --text-4xl: 3rem;

  /* Spacing rhythm (8px base) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;

  --measure: 72ch;          /* readable line length */
  --container: 960px;
  --radius: 8px;

  /* Light theme */
  --bg: #fbfaf8;            /* warm paper */
  --surface: #ffffff;
  --surface-2: #f5f4f1;
  --text: #18181b;
  --text-secondary: #3f3f46;
  --text-muted: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;
  --selection: #dbeafe;
  --logo-filter: brightness(0) saturate(0);
  --logo-opacity: 0.84;
  --logo-hover-bg: #ffffff;
  --logo-hover-border: #d4d4d8;
  --logo-hover-shadow: 0 0.7rem 1.8rem rgba(24, 24, 27, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b;
    --surface: #131316;
    --surface-2: #1c1c20;
    --text: #f4f4f5;
    --text-secondary: #c4c4cc;
    --text-muted: #8b8b94;
    --border: #27272a;
    --border-strong: #3f3f46;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-contrast: #0a0a0b;
    --selection: #1e3a5f;
    --logo-filter: brightness(0) invert(1);
    --logo-opacity: 0.9;
    --logo-hover-bg: #f8f7f3;
    --logo-hover-border: rgba(255, 255, 255, 0.78);
    --logo-hover-shadow: 0 0.9rem 2.2rem rgba(0, 0, 0, 0.34);
  }
}

/* ---- Reset & base ------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}

::selection { background: var(--selection); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-3); }

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

/* ---- Navigation --------------------------------------------------------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.nav-links { display: flex; gap: var(--space-3); list-style: none; }
.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color 0.18s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"] { font-weight: 600; }

/* ---- Layout ------------------------------------------------------------- */
main { padding: var(--space-8) 0 var(--space-6); min-height: 64vh; }
main.container > p { max-width: var(--measure); }

/* ---- Headings ----------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--text);
}
h1 { font-size: var(--text-3xl); margin-bottom: var(--space-2); }
h2 { font-size: var(--text-xl); margin: var(--space-6) 0 var(--space-2); }
h3 { font-size: var(--text-lg); margin: var(--space-4) 0 var(--space-1); }

p, ul, ol { margin-bottom: var(--space-2); }
main li { margin-bottom: 0.35rem; }

.lead {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: var(--space-2) 0 var(--space-3);
  max-width: var(--measure);
}
.text-muted { color: var(--text-muted); }
.no-margin-top { margin-top: 0; }
.monospace { font-family: var(--font-mono); font-size: 0.92em; }

/* ---- Links -------------------------------------------------------------- */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.18s ease, color 0.18s ease;
}
a:hover { text-decoration-color: var(--accent); color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Hero (home) -------------------------------------------------------- */
.hero { padding-top: var(--space-2); }
.hero h1 {
  font-size: var(--text-4xl);
  letter-spacing: 0;
  margin-bottom: var(--space-2);
}
.hero .lead { font-size: var(--text-xl); color: var(--text); max-width: 44ch; }
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.hero-profile {
  max-width: 760px;
  padding-top: var(--space-3);
  padding-bottom: var(--space-2);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.button-link,
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button-link {
  padding: 0.55rem 0.9rem;
  color: var(--accent-contrast);
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 6px;
}

.button-link:hover {
  color: var(--accent-contrast);
  background: var(--accent);
  border-color: var(--accent);
}

.text-link {
  color: var(--text-secondary);
}

.text-link:hover { color: var(--accent); }

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: var(--space-6);
  align-items: start;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.intro-copy {
  max-width: var(--measure);
}

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

.leadership-brief {
  padding-left: var(--space-4);
  border-left: 1px solid var(--border);
}

.leadership-brief h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--text-muted);
}

.leadership-brief dl {
  display: grid;
  gap: var(--space-2);
}

.leadership-brief dt {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.leadership-brief dd {
  margin-top: 0.25rem;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.trust-strip {
  display: grid;
  grid-template-columns: minmax(14rem, 0.42fr) minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  align-items: start;
  padding: 0 0 var(--space-3);
}

.trust-strip-label {
  max-width: 21ch;
  padding-top: 0.32rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-secondary);
}

.trust-strip ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.trust-strip li { margin: 0; }
.trust-strip a {
  display: flex;
  min-width: 0;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.trust-strip a:hover,
.trust-strip a:focus-visible {
  background: var(--logo-hover-bg);
  border-color: var(--logo-hover-border);
  box-shadow: var(--logo-hover-shadow);
  opacity: 1;
  transform: translateY(-1px);
}

.trust-strip img {
  display: block;
  width: auto;
  max-width: 7.25rem;
  height: 1.6rem;
  filter: var(--logo-filter);
  opacity: var(--logo-opacity);
  object-fit: contain;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.trust-strip a:hover img,
.trust-strip a:focus-visible img {
  filter: none;
  opacity: 1;
}

.trust-strip img[src$="netflix.png"],
.trust-strip img[src$="snowflake.svg"] {
  width: 1.85rem;
  height: 1.85rem;
}

.trust-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: min(20rem, calc(100vw - 2rem));
  aspect-ratio: 16 / 10;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translate3d(var(--preview-x, 0), var(--preview-y, 0), 0) translateY(0.35rem) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.16s ease, transform 0.16s ease;
  will-change: opacity, transform;
}

.trust-preview.is-visible {
  opacity: 1;
  transform: translate3d(var(--preview-x, 0), var(--preview-y, 0), 0) scale(1);
}

.trust-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: none), (pointer: coarse) {
  .trust-preview { display: none; }
}

.section-item[id] {
  scroll-margin-top: 5rem;
}

/* ---- Section heading w/ rule ------------------------------------------- */
.section-label {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: var(--space-8) 0 var(--space-3);
}
.section-label h2 { margin: 0; font-size: var(--text-sm); font-weight: 600; letter-spacing: 0; text-transform: uppercase; color: var(--text-muted); }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.section-intro {
  max-width: var(--measure);
  color: var(--text-secondary);
  margin-top: calc(var(--space-2) * -1);
  margin-bottom: var(--space-3);
}

/* ---- Blog library ------------------------------------------------------- */
.featured-essays {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.essay-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.45rem;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.essay-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.card-image {
  display: block;
  aspect-ratio: 1200 / 627;
  overflow: hidden;
  margin-bottom: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.18s ease;
}

.featured .card:hover .card-image img,
.essay-card:hover .card-image img {
  transform: scale(1.015);
}

.essay-badge,
.essay-meta,
.cluster-list a span:last-child,
.topic-index {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.35;
  color: var(--text-muted);
}

.essay-badge {
  text-transform: uppercase;
}

.essay-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.22;
  color: var(--text);
  transition: color 0.18s ease;
}

.essay-card:hover .essay-title {
  color: var(--accent);
}

.essay-dek {
  flex: 1;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.essay-meta {
  margin-top: var(--space-1);
}

.topic-clusters {
  display: grid;
  gap: var(--space-4);
}

.topic-cluster {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.topic-header {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: var(--space-2);
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.topic-header h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.topic-index {
  margin: 0;
}

.cluster-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cluster-list li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.cluster-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: var(--space-3);
  padding: 0.8rem 0;
  color: var(--text);
  text-decoration: none;
}

.cluster-list a span:first-child {
  min-width: 0;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
  transition: color 0.18s ease;
}

.cluster-list a:hover span:first-child {
  color: var(--accent);
}

.cluster-list a span:last-child {
  justify-self: end;
  white-space: nowrap;
}

/* ---- Post list (writings) ---------------------------------------------- */
.post-list { list-style: none; padding: 0; }
.post-list li { margin: 0; border-bottom: 1px solid var(--border); }
.post-list li:first-child { border-top: 1px solid var(--border); }
.post-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  text-decoration: none;
  color: var(--text);
}
.post-list a .title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: 0;
  transition: color 0.18s ease;
}
.post-list a:hover .title { color: var(--accent); }
.post-list a .meta {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---- Featured cards ----------------------------------------------------- */
.featured { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.featured .card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.featured .card:hover { border-color: var(--accent); transform: translateY(-2px); }
.featured .card .kicker { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0; text-transform: uppercase; color: var(--text-muted); }
.featured .card .title { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-lg); line-height: 1.2; letter-spacing: 0; }
.featured .card .dek { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.55; }

/* ---- Generic content sections (about / projects / research) ------------ */
.section-start { margin-top: var(--space-4); }
.section-item { margin-bottom: var(--space-4); }
.section-item > p,
.section-item > ul,
.contact-section > p,
.section-start > p,
.section-start > ul { max-width: var(--measure); }
.contact-section { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--border); }

/* ---- Article ------------------------------------------------------------ */
article { max-width: var(--measure); }
article h1 { font-size: var(--text-3xl); margin: var(--space-2) 0 var(--space-2); }
article h2 { margin-top: var(--space-6); }
article h3 { margin-top: var(--space-4); }
article h2,
article h3 { scroll-margin-top: 6rem; }
article p { color: var(--text); }
article strong { font-weight: 600; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.article-meta .dot { color: var(--border-strong); }
.article-date { color: var(--text-muted); font-size: var(--text-sm); font-family: var(--font-mono); margin-top: var(--space-4); }

.article-cover {
  display: block;
  width: 100%;
  aspect-ratio: 1400 / 788;
  overflow: hidden;
  margin: calc(var(--space-2) * -1) 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.article-cover picture,
.article-cover img {
  display: block;
  width: 100%;
  height: 100%;
}

.article-cover img {
  object-fit: cover;
}

.article-toc {
  margin: 0 0 var(--space-4);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-toc-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
}

.article-toc ol {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc li {
  margin: 0;
}

.article-toc a {
  display: block;
  padding-left: 0.75rem;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.35;
  text-decoration: none;
}

.article-toc a:hover,
.article-toc a[aria-current="true"] {
  color: var(--text);
  border-left-color: var(--accent);
}

.article-toc .toc-depth-3 a {
  padding-left: 1.35rem;
  font-size: var(--text-xs);
}

article code {
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: var(--font-mono);
}
article pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2);
  overflow-x: auto;
  margin: var(--space-3) 0;
}
article pre code { background: none; padding: 0; font-size: 0.9rem; line-height: 1.6; }

article ul, article ol { padding-left: 1.3em; }

.data-figure,
.math-note {
  margin: var(--space-4) 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 78%, var(--surface-2));
}

.data-figure h3,
.math-note h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-base);
}

.data-figure p,
.math-note p {
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.data-figure p:last-child,
.math-note p:last-child {
  margin-bottom: 0;
}

.data-figure > img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.data-caption,
.data-source {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text-muted);
}

.data-bars {
  display: grid;
  gap: 0.7rem;
  margin: var(--space-2) 0;
}

.data-bar {
  display: grid;
  grid-template-columns: minmax(8rem, 0.8fr) minmax(8rem, 1.4fr) 3.5rem;
  gap: var(--space-1);
  align-items: center;
  font-size: var(--text-sm);
}

.data-bar-label {
  color: var(--text-secondary);
}

.data-bar-track {
  position: relative;
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.data-bar-track::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--value, 0) * 1%);
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 54%, var(--text-muted));
}

.data-bar-value {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  margin: var(--space-2) 0;
}

.metric-grid div {
  padding: var(--space-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.metric-grid strong,
.formula {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  line-height: 1.25;
  color: var(--text);
}

.metric-grid span {
  display: block;
  margin-top: 0.25rem;
  font-size: var(--text-xs);
  line-height: 1.35;
  color: var(--text-muted);
}

.formula {
  margin: var(--space-1) 0;
  padding: var(--space-1) 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  overflow-x: auto;
  white-space: nowrap;
}

@media (min-width: 1180px) {
  .article-toc {
    position: fixed;
    top: 6.35rem;
    right: max(1.25rem, calc((100vw - 1220px) / 2));
    z-index: 20;
    width: 13.5rem;
    max-height: calc(100vh - 8rem);
    margin: 0;
    padding: 0 0 0 var(--space-2);
    overflow: auto;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 1px solid var(--border);
    background: transparent;
  }

  .article-toc a {
    font-size: var(--text-xs);
  }
}

.research-figure {
  margin: var(--space-4) 0;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.research-figure-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.research-figure-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.research-figure img {
  display: block;
  width: 100%;
  min-width: min(720px, 190vw);
  height: auto;
}

.research-caption {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.research-summary,
.research-source-note {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.research-source-note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text-muted);
}

.research-pullquote {
  margin: var(--space-4) 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  border-left: 3px solid var(--border-strong);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.research-related {
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.research-related h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--text-muted);
}

.research-related ul {
  display: grid;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.research-related li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.research-related a {
  display: block;
  padding: 0.75rem 0;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  color: var(--text);
}

.research-related a:hover { color: var(--accent); }

.references { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.references h2 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0; color: var(--text-muted); margin-top: 0; }
.references ol { font-size: var(--text-sm); color: var(--text-secondary); padding-left: 1.3em; }
.references li { margin-bottom: 0.5rem; }
sup a { text-decoration: none; color: var(--accent); font-weight: 600; }

/* ---- Tweetable pull quote ---------------------------------------------- */
.tweetable {
  border-left: 3px solid var(--accent);
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
  margin: var(--space-4) 0;
}
.tweetable p {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: var(--space-1);
}
.tweetable .tweetable-action {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs); font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  transition: color 0.18s ease;
}
.tweetable .tweetable-action:hover { color: var(--accent); }
.tweetable .tweetable-action svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---- Back link / article footer nav ------------------------------------ */
.article-footer { margin-top: var(--space-8); padding-top: var(--space-3); border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.article-footer a { font-family: var(--font-mono); font-size: var(--text-sm); text-decoration: none; color: var(--text-muted); }
.article-footer a:hover { color: var(--accent); }

/* ---- Follow / social CTA ----------------------------------------------- */
.follow {
  margin-top: var(--space-6);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.follow h2 { margin: 0 0 var(--space-1); font-size: var(--text-lg); }
.follow p { color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: var(--space-2); }
.social-links { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.social-links a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  text-decoration: none; color: var(--text-secondary);
  font-size: var(--text-sm); font-weight: 500;
  padding: 0.4rem 0.7rem; border: 1px solid var(--border); border-radius: 6px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.social-links a:hover { color: var(--accent); border-color: var(--accent); }
.social-links svg { width: 16px; height: 16px; }

/* ---- Contact (compact) -------------------------------------------------- */
.contact-small { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.contact-small h2 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0; color: var(--text-muted); margin: 0 0 var(--space-1); }
.contact-small p { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: var(--space-1); }
.location { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-8);
  padding: var(--space-4) 0;
}
.site-footer .container { display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.site-footer p, .site-footer a { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* simple legacy list (fallback) */
.simple-list { list-style: none; padding: 0; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 768px) {
  :root { --text-base: 1rem; }
  main { padding: var(--space-6) 0 var(--space-4); }
  nav .container { gap: var(--space-2); }
  .nav-links { gap: var(--space-2); }
  .nav-links a { font-size: var(--text-xs); }
  .hero h1 { font-size: var(--text-3xl); }
  .hero .lead { font-size: var(--text-lg); }
  .hero-profile { padding-bottom: var(--space-3); }
  .intro-panel {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-3) 0;
  }
  .leadership-brief {
    padding-left: 0;
    padding-top: var(--space-3);
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .trust-strip {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
  .trust-strip-label { max-width: 30ch; padding-top: 0; }
  .trust-strip ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: var(--text-2xl); }
  .featured-essays {
    grid-template-columns: 1fr;
  }
  .cluster-list a {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .cluster-list a span:last-child {
    justify-self: start;
    white-space: normal;
  }
  .featured { grid-template-columns: 1fr; }
  .post-list a { flex-direction: column; gap: 0.15rem; }
  .post-list a .meta { font-size: 0.72rem; }
  .data-bar {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .data-bar-value {
    justify-self: start;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container { padding-left: 1.25rem; padding-right: 1.25rem; }
  nav .container {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }
  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .logo { font-size: 1rem; }
  .hero h1 { font-size: var(--text-3xl); }
  .hero .lead { font-size: var(--text-lg); line-height: 1.5; }
  .button-link,
  .text-link { min-height: 38px; }
  .trust-strip ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
