/* =====================================================================
   IIPR — Institute for Inverse Problems Research
   Shared stylesheet · v4 · June 2026
   Editorial palette: night blue + sand + gold accent
   Tipography: Crimson Pro (serif), Inter (sans)
   ===================================================================== */

:root {
  --night: #0a1428;
  --night-2: #121e38;
  --night-3: #1a2845;
  --paper: #faf7f2;
  --paper-warm: #f3ede3;
  --sand: #f3e8c8;
  --sand-2: #d4c9a8;
  --muted: #9aa0b5;
  --rule: #2a3556;
  --rule-paper: #d4cab1;
  --acc-blue: #3a9ec9;
  --acc-red: #d4453a;
  --acc-amber: #e8b840;
  --acc-magenta: #d04891;
  --memory: #b59bd4;
  --serif: 'Crimson Pro', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  background: var(--night);
  color: var(--sand);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

/* PREVIEW STRIP */
.preview {
  background: #fff4d6;
  border-bottom: 1px solid #d4a958;
  padding: 12px 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  color: #5c4515;
  letter-spacing: 0.04em;
}

/* NAV ============================================================== */
nav.primary {
  background: rgba(10, 20, 40, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
nav.primary .nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-mark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-mark-icon {
  width: 38px; height: 38px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--night-2);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-mark-icon::before {
  content: 'IIPS';
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  color: var(--sand);
  letter-spacing: 0.02em;
}
.nav-mark-text {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.13em;
  color: var(--sand);
  text-transform: uppercase;
  line-height: 1.25;
}
.nav-mark-text .nm-sub {
  display: block;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 10.5px;
  margin-top: 3px;
  text-transform: none;
}
nav.primary ul { list-style: none; display: flex; gap: 26px; margin-left: auto; }
nav.primary a {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sand);
  text-decoration: none;
  letter-spacing: 0.05em;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: all 0.2s;
}
nav.primary a:hover, nav.primary a.active {
  color: var(--sand); border-color: var(--sand);
}

/* PAGE HEADER (non-homepage pages) */
header.page-head {
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 40px 44px;
  border-bottom: 1px solid var(--rule);
}
header.page-head .eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
header.page-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--sand);
  margin-bottom: 18px;
  max-width: 880px;
}
header.page-head h1 em { font-style: italic; color: var(--sand); }
header.page-head .lede {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--sand-2);
  max-width: 740px;
}
header.page-head .meta {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--rule);
}

/* HOMEPAGE HERO */
header.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 40px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 54px;
  align-items: center;
}
.hero-text .hero-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
h1.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--sand);
  margin-bottom: 22px;
}
h1.hero-title em { font-style: italic; color: var(--sand); }
.hero-lede {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--sand-2);
  margin-bottom: 22px;
  max-width: 520px;
}
.hero-meta {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.hero-image {
  aspect-ratio: 16 / 10;
  background: var(--night-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 22% 30%, var(--acc-blue) 1px, transparent 2px),
    radial-gradient(circle at 68% 25%, var(--acc-red) 1px, transparent 2px),
    radial-gradient(circle at 45% 50%, var(--acc-amber) 1.2px, transparent 2px),
    radial-gradient(circle at 75% 60%, var(--acc-magenta) 1px, transparent 2px),
    radial-gradient(circle at 35% 75%, var(--sand) 0.8px, transparent 1.5px),
    radial-gradient(circle at 60% 80%, var(--acc-blue) 1px, transparent 2px),
    radial-gradient(circle at 15% 55%, var(--acc-amber) 0.8px, transparent 1.5px),
    radial-gradient(circle at 85% 45%, var(--acc-red) 0.9px, transparent 1.8px);
  background-size: 32px 32px, 28px 28px, 36px 36px, 30px 30px, 24px 24px, 34px 34px, 26px 26px, 38px 38px;
  background-position: 0 0, 14px 9px, 6px 18px, 20px 4px, 10px 22px, 24px 16px, 8px 12px, 18px 20px;
  opacity: 0.85;
}
.hero-image::after {
  content: '— image placeholder — \A iipr_horse_hero_master.png';
  white-space: pre;
  font-family: var(--sans);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.6;
  z-index: 2;
  background: rgba(10, 20, 40, 0.75);
  padding: 12px 20px;
  border: 1px dashed var(--rule);
  border-radius: 2px;
}

/* Real image — overrides placeholder pseudo-elements */
.hero-image.has-image {
  background: transparent;
  border: none;
  aspect-ratio: auto;
  max-width: 85%;        /* a bit smaller than the full slot */
  justify-self: center;  /* recentre within the grid cell */
  align-self: center;
}
.hero-image.has-image::before,
.hero-image.has-image::after { content: none; display: none; }
.hero-image.has-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Ornament */
.ornament {
  text-align: center;
  color: var(--rule);
  font-family: var(--serif);
  font-size: 22px;
  margin: 32px auto;
  letter-spacing: 1em;
  padding-left: 1em;
}

/* SECTION / EDITORIAL ============================================== */
section.editorial {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 40px;
  border-top: 1px solid var(--rule);
}
section.editorial.paper {
  background: var(--paper);
  color: #2b2418;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  border-top: none;
}
section.editorial.paper > .inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
}
.section-header {
  display: grid;
  grid-template-columns: 1fr 2.8fr;
  gap: 44px;
  margin-bottom: 36px;
}
.section-header .roman {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.3em;
  color: var(--muted);
  padding-top: 6px;
}
.editorial.paper .section-header .roman { color: #8a7e6f; }
.section-header h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.18;
  color: var(--sand);
  letter-spacing: -0.005em;
}
.editorial.paper .section-header h2 { color: #1f3864; }
.section-header h2 em { font-style: italic; }
.editorial.paper .section-header h2 em { color: #4a3b2a; }

/* Inline subhead (within editorial section) */
h3.sub {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--sand);
  margin: 32px 0 14px;
}
.editorial.paper h3.sub { color: #1f3864; }
h3.sub em { font-style: italic; color: var(--sand); }
.editorial.paper h3.sub em { color: #4a3b2a; }

h4.minor {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 22px 0 8px;
}
.editorial.paper h4.minor { color: #8a7e6f; }

p.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--sand-2);
  margin-bottom: 14px;
  max-width: 700px;
}
.editorial.paper p.lede { color: #3a3936; }
p.body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--sand-2);
  margin-bottom: 14px;
  max-width: 700px;
}
.editorial.paper p.body { color: #5a5550; }
p em { font-style: italic; color: var(--sand); }
.editorial.paper p em { color: #1f3864; }

ul.body, ol.body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--sand-2);
  margin: 0 0 14px 22px;
  max-width: 700px;
}
.editorial.paper ul.body, .editorial.paper ol.body { color: #5a5550; }
ul.body li, ol.body li { margin-bottom: 8px; }

/* LINE BLOCK (used in projects + homepage) — institutional refresh */
.line-block {
  background: var(--paper-warm);
  padding: 32px 36px;
  border: 1px solid var(--rule-paper);
  border-radius: 2px;
  margin-bottom: 22px;
}
.line-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  color: #8a7e6f;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.line-block h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: #1f3864;
  line-height: 1.2;
  margin-bottom: 18px;
}
.line-block h3 em { font-style: italic; color: #4a3b2a; }
.line-block h4 {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  color: #8a7e6f;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 18px 0 6px;
}
.line-block p {
  font-size: 14.5px;
  line-height: 1.6;
  color: #3a3936;
  margin-bottom: 10px;
  max-width: 780px;
}
.line-block ul {
  font-size: 14px;
  color: #3a3936;
  margin: 4px 0 10px 20px;
}

/* PEOPLE CARDS — institutional unified style */
.people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 28px;
}
.person-card {
  background: var(--night-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 22px 24px;
}
.person-eyebrow {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.person-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--sand);
  margin-bottom: 3px;
}
.person-where {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--sand-2);
  margin-bottom: 12px;
}
.person-bio {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.person-bio em { color: var(--sand-2); }

.memoriam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 18px;
  margin-top: 28px;
}
.memorial-card {
  background: var(--night-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 20px 22px;
}
.memorial-name {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--sand);
  margin-bottom: 3px;
}
.memorial-where {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.memorial-bio {
  font-size: 12px;
  line-height: 1.6;
  color: var(--sand-2);
}

/* LIBRARY TABLE */
.library-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 18px;
  align-items: center;
}
.library-controls input[type="search"],
.library-controls select {
  font-family: var(--sans);
  font-size: 12px;
  padding: 7px 12px;
  background: var(--night-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--sand);
  min-width: 160px;
}
.library-controls input[type="search"] { min-width: 240px; }
.library-controls input::placeholder { color: var(--muted); }
.library-controls label {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.library-counter {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-left: auto;
}

table.library {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-family: var(--sans);
}
table.library thead {
  border-bottom: 1px solid var(--rule);
}
table.library th {
  text-align: left;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 8px;
  font-weight: 600;
}
table.library td {
  font-size: 12.5px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--sand-2);
  line-height: 1.5;
}
table.library tr:hover td { background: rgba(243, 232, 200, 0.03); }
table.library .col-year { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--sand); width: 60px; }
table.library .col-id { font-family: var(--sans); font-size: 9.5px; letter-spacing: 0.1em; color: var(--muted); width: 48px; }
table.library .col-title { font-family: var(--serif); font-size: 14px; color: var(--sand); line-height: 1.4; }
table.library .col-title em { font-style: italic; color: var(--sand); }
table.library .col-authors { color: var(--sand-2); font-size: 11.5px; }
table.library .col-venue { font-style: italic; color: var(--muted); font-size: 11.5px; }
table.library .col-line { width: 70px; }
table.library .col-line span {
  display: inline-block;
  padding: 2px 7px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  border-radius: 2px;
  background: transparent;
  color: var(--sand);
  border: 1px solid var(--rule);
}
.tag-A, .tag-B { color: var(--sand); border-color: var(--rule); background: transparent; }
table.library .col-links { width: 150px; text-align: right; }
.lib-link {
  display: inline-block;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  margin-left: 3px;
  margin-bottom: 3px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--sand);
  text-decoration: none;
  transition: all 0.2s;
}
.lib-link:hover { border-color: var(--sand); color: var(--sand); }
.lib-link.placeholder { color: var(--muted); border-style: dashed; pointer-events: none; }
.status-pill {
  display: inline-block;
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  margin-top: 3px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--muted);
}
/* Status pills: subtle, no acid colour — institutional uniformity */
.status-archive { color: var(--sand); border-color: var(--sand-2); }
.status-recovery,
.status-confirmed,
.status-torecover,
.status-hypothesis { color: var(--muted); border-color: var(--rule); }

/* FOOTER ============================================================ */
footer.bottom {
  background: var(--night);
  color: var(--sand-2);
  padding: 56px 0 28px;
  border-top: 1px solid var(--rule);
}
footer.bottom .colophon-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 40px;
}
.colophon-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 32px;
}
.colophon-grid .col-eyebrow {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.colophon-statement {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--sand);
  font-style: italic;
  max-width: 360px;
}
.colophon-grid ul { list-style: none; }
.colophon-grid li {
  font-family: var(--sans);
  font-size: 12px;
  margin-bottom: 6px;
}
.colophon-grid a {
  color: var(--sand-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: all 0.2s;
}
.colophon-grid a:hover { color: var(--acc-amber); border-color: var(--acc-amber); }
.colophon-base {
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  letter-spacing: 0.04em;
}

/* RESPONSIVE ======================================================= */
@media (max-width: 1100px) {
  header.hero, .section-header, .colophon-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .people-grid, .memoriam-grid { grid-template-columns: 1fr 1fr; }
  h1.hero-title, header.page-head h1 { font-size: 32px; }
  .section-header h2 { font-size: 28px; }
  .hero-lede, header.page-head .lede { font-size: 16px; }
  nav.primary ul { display: none; }
  nav.primary .nav-inner, header.hero, header.page-head, section.editorial, section.editorial.paper > .inner, footer.bottom .colophon-inner {
    padding-left: 24px;
    padding-right: 24px;
  }
  .line-block { padding: 32px 28px; }
  table.library { font-size: 12px; }
  table.library td, table.library th { padding: 10px 6px; }
  .col-links { display: none; }
}
@media (max-width: 720px) {
  .people-grid, .memoriam-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   V5.1 — Card grid layout
   Aggiunte per riorganizzazione in box compatte
   ===================================================================== */

/* CARD GRID */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.card-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.card-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* CARD — base style on dark sections — uniform institutional look */
.card {
  background: var(--night-2);
  border: 1px solid var(--rule);
  padding: 18px 20px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card.line-a,
.card.line-b,
.card.foundation,
.card.collab { /* no colour border — distinction is textual via eyebrow */ }
.card.compact { padding: 14px 16px; }

/* CARD — on paper (light) sections */
.editorial.paper .card {
  background: var(--paper-warm);
  border: 1px solid var(--rule-paper);
  color: #2b2418;
}

/* CARD anatomy */
.card-eyebrow {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Line distinction is purely textual now — eyebrow colour uniform */
.editorial.paper .card-eyebrow { color: #8a7e6f; }

.card-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--sand);
  line-height: 1.25;
  margin: 0;
}
.editorial.paper .card-title { color: #1f3864; }
.card-title em { font-style: italic; color: var(--sand); }
.editorial.paper .card-title em { color: #4a3b2a; }

.card-body {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--sand-2);
  margin: 0;
}
.editorial.paper .card-body { color: #5a5550; }
.card-body em { font-style: italic; color: var(--sand); }
.editorial.paper .card-body em { color: #1f3864; }

.card-meta {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.editorial.paper .card-meta { border-top-color: var(--rule-paper); color: #8a7e6f; }
.card-meta strong { color: var(--sand); font-weight: 500; }
.editorial.paper .card-meta strong { color: #1f3864; }

.card-link {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--sand);
  text-decoration: none;
  border-bottom: 1px solid var(--sand-2);
  padding-bottom: 1px;
  align-self: flex-start;
}
.editorial.paper .card-link {
  color: #1f3864;
  border-bottom-color: #1f3864;
}

/* LARGE CARD — for detailed sections (projects, manifesto) */
.card-large {
  padding: 26px 28px;
  gap: 12px;
}
.card-large .card-title {
  font-size: 20px;
}
.card-large .card-body {
  font-size: 14.5px;
}

/* CARD with sub-blocks (h4 + paragraph pairs) */
.card-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 6px;
}
.card-section h4 {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.editorial.paper .card-section h4 { color: #8a7e6f; }
.card-section p {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--sand-2);
  margin: 0;
}
.editorial.paper .card-section p { color: #5a5550; }

/* LINE BADGE — discreet institutional version (no acid colour) */
.line-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 4px;
  background: transparent;
  color: var(--sand);
  border: 1px solid var(--rule);
}
.line-badge.a { color: var(--sand); border-color: var(--rule); }
.line-badge.b { color: var(--sand); border-color: var(--rule); }
.editorial.paper .line-badge { color: #1f3864; border-color: #d4cab1; }

/* INTRO COMPACT — short lede with rule below */
.intro-compact {
  max-width: 820px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--sand-2);
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}
.editorial.paper .intro-compact {
  color: #3a3936;
  border-bottom-color: var(--rule-paper);
}
.intro-compact em { color: var(--sand); font-style: italic; }
.editorial.paper .intro-compact em { color: #1f3864; }

@media (max-width: 1100px) {
  .card-grid.cols-3 { grid-template-columns: 1fr; }
  .card-large { padding: 24px 24px; }
}

/* =====================================================================
   V5.2 — Conceptual diagram for inversion (two functional roles)
   ===================================================================== */
.inversion-diagram {
  background: var(--night-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 32px 28px;
  margin: 32px 0;
}
.editorial.paper .inversion-diagram {
  background: var(--paper-warm);
  border-color: var(--rule-paper);
}
.inversion-diagram svg { display: block; width: 100%; height: auto; max-width: 880px; margin: 0 auto; }
.inversion-caption {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 16px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}
.editorial.paper .inversion-caption { color: #6b6056; }
