/* =========================================================
   Zinvana Magazine — Shared stylesheet for ALL article pages
   (biographies, leader profiles, scientists, creators, SCP)
   Light, editorial, magazine-style. Replaces the per-page
   inline <style> blocks and the old article.css / leader-shared.css.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Palette — warm cream + ink + amber accent */
  --mag-bg: #fbf8f3;
  --mag-surface: #ffffff;
  --mag-ink: #161513;
  --mag-ink-soft: #3a3833;
  --mag-muted: #6b6760;
  --mag-line: #e7e2d8;
  --mag-accent: #c4451c; /* warm rust */
  --mag-accent-soft: #fce7dc;
  --mag-amber: #b8860b;
  --mag-highlight: #fff3d6;

  /* Typography */
  --mag-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mag-sans: "Inter", system-ui, -apple-system, sans-serif;

  /* Layout */
  --mag-max: 1180px;
  --mag-prose: 720px;

  --mag-radius: 6px;
  --mag-radius-lg: 14px;

  --mag-shadow-sm: 0 1px 2px rgba(22, 21, 19, 0.06);
  --mag-shadow-md: 0 8px 24px -8px rgba(22, 21, 19, 0.12);
  --mag-shadow-lg: 0 24px 48px -16px rgba(22, 21, 19, 0.18);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--mag-bg);
  color: var(--mag-ink);
  font-family: var(--mag-sans);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--mag-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
::selection {
  background: var(--mag-highlight);
  color: var(--mag-ink);
}

/* ---------- Header / Nav ---------- */
.mag-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 248, 243, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--mag-line);
}
.mag-nav__inner {
  max-width: var(--mag-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.mag-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mag-serif);
  font-weight: 700;
  font-size: 22px;
  color: var(--mag-ink);
  letter-spacing: -0.02em;
}
.mag-brand:hover {
  text-decoration: none;
}
.mag-brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.mag-nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mag-nav__links a {
  color: var(--mag-ink-soft);
  font-weight: 500;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 6px;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.mag-nav__links a:hover {
  color: var(--mag-ink);
  background: rgba(196, 69, 28, 0.08);
  text-decoration: none;
}
.mag-nav__cta {
  background: var(--mag-ink);
  color: #fff !important;
  padding: 9px 16px !important;
  border-radius: 999px !important;
  font-weight: 600;
}
.mag-nav__cta:hover {
  background: var(--mag-accent);
}
.mag-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--mag-line);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: var(--mag-ink);
}

@media (max-width: 820px) {
  .mag-nav__links {
    display: none;
  }
  .mag-nav__links.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 64px;
    left: 16px;
    right: 16px;
    background: #fff;
    padding: 12px;
    border: 1px solid var(--mag-line);
    border-radius: 12px;
    box-shadow: var(--mag-shadow-md);
  }
  .mag-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---------- Article wrapper ---------- */
.mag-page {
  max-width: var(--mag-max);
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.mag-breadcrumb {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mag-muted);
  margin-bottom: 18px;
}
.mag-breadcrumb a {
  color: var(--mag-muted);
}
.mag-breadcrumb a:hover {
  color: var(--mag-accent);
}

/* ---------- Hero ---------- */
.mag-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 32px 0 56px;
  border-bottom: 1px solid var(--mag-line);
  margin-bottom: 56px;
}
.mag-hero__kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mag-accent);
  font-weight: 700;
  margin-bottom: 18px;
}
.mag-hero__title {
  font-family: var(--mag-serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--mag-ink);
  margin: 0 0 20px;
}
.mag-hero__dek {
  font-family: var(--mag-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.5;
  color: var(--mag-ink-soft);
  margin: 0 0 24px;
  max-width: 520px;
}
.mag-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  color: var(--mag-muted);
  align-items: center;
}
.mag-hero__meta strong {
  color: var(--mag-ink);
  font-weight: 600;
}
.mag-hero__meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mag-line);
}

.mag-hero__media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--mag-radius-lg);
  overflow: hidden;
  background: var(--mag-line);
  box-shadow: var(--mag-shadow-lg);
}
.mag-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 820px) {
  .mag-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 16px 0 40px;
    margin-bottom: 40px;
  }
  .mag-hero__media {
    aspect-ratio: 4 / 3;
    max-height: 360px;
  }
}

/* ---------- Article body grid ---------- */
.mag-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 64px;
  align-items: start;
}
@media (max-width: 980px) {
  .mag-body {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* ---------- Prose ---------- */
.mag-prose {
  max-width: var(--mag-prose);
  font-size: 1.075rem;
  color: var(--mag-ink-soft);
}
.mag-prose > * + * {
  margin-top: 1.1em;
}
.mag-prose p {
  margin: 0;
}
.mag-prose p + p {
  margin-top: 1.1em;
}

.mag-prose h2 {
  font-family: var(--mag-serif);
  font-weight: 700;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  letter-spacing: -0.015em;
  line-height: 1.18;
  color: var(--mag-ink);
  margin: 56px 0 16px;
  padding-top: 8px;
  position: relative;
}
.mag-prose h2::before {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  background: var(--mag-accent);
  margin-bottom: 16px;
  border-radius: 2px;
}
.mag-prose h2:first-child {
  margin-top: 0;
}

.mag-prose h3 {
  font-family: var(--mag-serif);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--mag-ink);
  margin: 36px 0 8px;
  letter-spacing: -0.01em;
}

.mag-prose .lead {
  font-family: var(--mag-serif);
  font-size: 1.35rem;
  line-height: 1.55;
  color: var(--mag-ink);
  font-weight: 400;
  border-left: 3px solid var(--mag-accent);
  padding-left: 22px;
  margin-bottom: 32px;
}

.mag-prose .dropcap::first-letter {
  font-family: var(--mag-serif);
  font-weight: 700;
  font-size: 4.6em;
  float: left;
  line-height: 0.9;
  padding: 6px 12px 0 0;
  color: var(--mag-accent);
}

.mag-prose ul,
.mag-prose ol {
  padding-left: 22px;
  margin: 0;
}
.mag-prose li + li {
  margin-top: 8px;
}

.mag-prose blockquote {
  font-family: var(--mag-serif);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.4;
  color: var(--mag-ink);
  margin: 36px 0;
  padding: 0 0 0 24px;
  border-left: 4px solid var(--mag-accent);
}
.mag-prose blockquote cite {
  display: block;
  font-family: var(--mag-sans);
  font-style: normal;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mag-muted);
  margin-top: 14px;
}

.mag-prose hr {
  border: 0;
  border-top: 1px solid var(--mag-line);
  margin: 40px 0;
}

/* ---------- Pull stats / fact strip ---------- */
.mag-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  background: var(--mag-surface);
  border: 1px solid var(--mag-line);
  border-radius: var(--mag-radius-lg);
  padding: 28px;
  margin: 36px 0;
}
.mag-stat__num {
  font-family: var(--mag-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--mag-accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.mag-stat__lbl {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--mag-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Callout box ---------- */
.mag-callout {
  background: var(--mag-accent-soft);
  border-radius: var(--mag-radius-lg);
  padding: 24px 28px;
  margin: 36px 0;
  border-left: 4px solid var(--mag-accent);
}
.mag-callout__title {
  font-family: var(--mag-serif);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 8px;
  color: var(--mag-ink);
}
.mag-callout p {
  margin: 0;
  color: var(--mag-ink-soft);
}

/* ---------- Sidebar ---------- */
.mag-aside {
  position: sticky;
  top: 96px;
  font-size: 14px;
}
.mag-card {
  background: var(--mag-surface);
  border: 1px solid var(--mag-line);
  border-radius: var(--mag-radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--mag-shadow-sm);
}
.mag-card h4 {
  font-family: var(--mag-serif);
  font-weight: 700;
  margin: 0 0 14px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mag-muted);
}
.mag-fact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mag-fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--mag-line);
}
.mag-fact-list li:last-child {
  border-bottom: 0;
}
.mag-fact-list span:first-child {
  color: var(--mag-muted);
  font-weight: 500;
}
.mag-fact-list span:last-child {
  color: var(--mag-ink);
  font-weight: 600;
  text-align: right;
}

.mag-toc {
  font-size: 14px;
}
.mag-toc a {
  display: block;
  padding: 6px 0 6px 12px;
  color: var(--mag-ink-soft);
  border-left: 2px solid var(--mag-line);
  transition:
    border-color 0.15s,
    color 0.15s;
}
.mag-toc a:hover {
  color: var(--mag-accent);
  border-left-color: var(--mag-accent);
  text-decoration: none;
}

@media (max-width: 980px) {
  .mag-aside {
    position: static;
  }
}

/* ---------- Tags / chips ---------- */
.mag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mag-chip {
  font-size: 12px;
  padding: 5px 10px;
  background: var(--mag-bg);
  border: 1px solid var(--mag-line);
  border-radius: 999px;
  color: var(--mag-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ---------- Related strip ---------- */
.mag-related {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--mag-line);
}
.mag-related h3 {
  font-family: var(--mag-serif);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mag-muted);
  font-weight: 600;
  margin: 0 0 24px;
}
.mag-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.mag-related__card {
  display: block;
  background: var(--mag-surface);
  border: 1px solid var(--mag-line);
  border-radius: var(--mag-radius-lg);
  padding: 20px;
  color: var(--mag-ink);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}
.mag-related__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--mag-shadow-md);
  border-color: var(--mag-accent);
  text-decoration: none;
}
.mag-related__kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mag-accent);
  font-weight: 700;
  margin-bottom: 8px;
}
.mag-related__title {
  font-family: var(--mag-serif);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--mag-ink);
  margin: 0;
}

/* ---------- Footer ---------- */
.mag-footer {
  background: var(--mag-ink);
  color: #c8c4ba;
  margin-top: 80px;
  padding: 56px 24px 28px;
  font-size: 14px;
}
.mag-footer__inner {
  max-width: var(--mag-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}
.mag-footer h5 {
  font-family: var(--mag-serif);
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
}
.mag-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mag-footer li {
  margin-bottom: 8px;
}
.mag-footer a {
  color: #c8c4ba;
}
.mag-footer a:hover {
  color: #fff;
  text-decoration: none;
}
.mag-footer__brand {
  font-family: var(--mag-serif);
  font-weight: 700;
  color: #fff;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.mag-footer__tagline {
  color: #918d83;
  max-width: 320px;
  line-height: 1.5;
}
.mag-footer__bottom {
  max-width: var(--mag-max);
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid #2c2925;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #6b6760;
}

@media (max-width: 820px) {
  .mag-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}
@media (max-width: 520px) {
  .mag-footer__inner {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reading progress bar ---------- */
.mag-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--mag-accent);
  z-index: 200;
  transition: width 80ms linear;
}

/* ---------- Buttons ---------- */
.mag-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease;
}
.mag-btn--primary {
  background: var(--mag-ink);
  color: #fff !important;
}
.mag-btn--primary:hover {
  background: var(--mag-accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.mag-btn--ghost {
  background: transparent;
  color: var(--mag-ink) !important;
  border-color: var(--mag-line);
}
.mag-btn--ghost:hover {
  border-color: var(--mag-ink);
  text-decoration: none;
}

/* ---------- Print sanity ---------- */
@media print {
  .mag-nav,
  .mag-aside,
  .mag-footer,
  .mag-progress,
  .mag-related {
    display: none;
  }
  body {
    background: #fff;
  }
}
