/* ============================================================
   mars.css — the shared editorial system.
   Display: Fraunces · Body: Instrument Sans · Figures: IBM Plex Mono

   Load this first, then a page's own <style> block for anything
   specific to that page. Page rules come later in the cascade, so
   they win where they overlap — that is intentional.
   ============================================================ */
:root {
  --cream:     #fbf9f3;
  --cream-2:   #f4efe1;
  --paper:     #ffffff;
  --ink:       #1a0e1d;
  --ink-soft:  #6b5f70;
  --ink-faint: #a59aa9;
  --wine:      #5d1e3a;
  --wine-deep: #3d0d24;
  --gold:      #b48a44;
  --gold-soft: #d8b97a;
  --rule:      #d8d0bf;
  --rule-soft: #ebe4d2;

  /* Chart marks — stepped up from the brand hues so they pass as
     categorical marks on cream (lightness band, chroma, CVD ΔE, contrast).
     Do not substitute --wine / --gold here; they fail those checks. */
  --mark-sim:  #a8365e;
  --mark-text: #b8873c;

  --shadow:    18px 24px 64px -34px rgba(26, 14, 29, 0.42);
  --gutter:    clamp(20px, 5vw, 68px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
::selection { background: var(--wine); color: var(--cream); }

a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { color: var(--wine); text-decoration-color: var(--wine); }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--wine); color: var(--cream);
  padding: 12px 20px; z-index: 100;
}
.skip:focus { left: 0; }

/* ---- Type devices ---- */
.eyebrow {
  font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 16px;
}
.eyebrow::before { content: ""; width: 42px; height: 1px; background: var(--ink-soft); flex: none; }

.display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-weight: 350; line-height: 1.0; letter-spacing: -0.026em;
  color: var(--ink); margin: 0;
}
.display em { font-style: italic; font-weight: 400; color: var(--wine); }

.num { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.lede { font-size: 1.06rem; line-height: 1.72; color: var(--ink-soft); max-width: 46ch; }

/* ---- Masthead ---- */
.masthead {
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 249, 243, 0.94);
  backdrop-filter: blur(8px);
}
.masthead__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-block: 18px;
}
.brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; }
.brand__mark {
  font-family: 'Fraunces', serif; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-weight: 400; font-size: 1.5rem; letter-spacing: 0.14em; color: var(--ink);
}
.brand__sub {
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}
@media (max-width: 760px) { .brand__sub { display: none; } }

.masthead__nav { display: flex; align-items: center; gap: 30px; }
.navlink {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-soft); text-decoration: none;
}
.navlink:hover { color: var(--ink); }
.navlink[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--wine); }
@media (max-width: 860px) { .navlink[data-secondary] { display: none; } }

.pill {
  display: inline-block; border-radius: 999px; border: 1px solid var(--ink);
  padding: 9px 22px; font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 600; text-decoration: none;
  color: var(--ink); background: transparent; cursor: pointer;
  transition: background 0.22s, color 0.22s, border-color 0.22s;
}
.pill:hover { background: var(--wine); border-color: var(--wine); color: var(--cream); }
.pill--solid { background: var(--wine); border-color: var(--wine); color: var(--cream); }
.pill--solid:hover { background: var(--wine-deep); border-color: var(--wine-deep); color: var(--cream); }

/* ---- Chapter heading ---- */
.chapter {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 40px; row-gap: 0;
  align-items: end; margin-bottom: clamp(2.4rem, 4vw, 3.6rem);
}
.chapter > * { min-width: 0; }
.chapter__eyebrow { grid-column: 1 / -1; margin-bottom: 1.1rem; }
.chapter__title { grid-column: 1 / 8; font-size: clamp(1.9rem, 3.9vw, 3rem); }
.chapter__note {
  grid-column: 9 / -1; font-size: 0.88rem; color: var(--ink-soft);
  line-height: 1.66; padding-bottom: 6px;
}

/* ---- Pullquote ---- */
.pullquote {
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
  padding: 1.8rem 0; margin: 0;
}
.pullquote p {
  font-family: 'Fraunces', serif; font-variation-settings: "opsz" 48, "SOFT" 100, "WONK" 1;
  font-style: italic; font-weight: 350; font-size: 1.22rem; line-height: 1.42;
  color: var(--ink); margin: 0;
}
.pullquote footer {
  margin-top: 1rem; font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}
.pullquote + .pullquote { border-top: 0; }

/* ---- Contact / detail card ---- */
.card { background: var(--cream-2); border: 1px solid var(--ink); padding: 2.2rem 2rem; }
.card__label { font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.card__name {
  font-family: 'Fraunces', serif; font-variation-settings: "opsz" 72, "SOFT" 100, "WONK" 1;
  font-style: italic; font-weight: 400; font-size: 1.5rem; margin: 0.9rem 0 0; color: var(--ink);
}
.card__role { margin-top: 0.35rem; font-size: 0.82rem; color: var(--ink-soft); }
.card__rule { height: 1px; background: var(--rule); margin: 1.5rem 0; }
.card__line { font-size: 0.94rem; margin: 0 0 0.5rem; }
.card__line a { font-family: 'IBM Plex Mono', monospace; font-size: 0.86rem; }
.card__cta { margin-top: 1.7rem; }
.card__note { margin-top: 1.1rem; font-size: 0.74rem; color: var(--ink-faint); line-height: 1.6; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--ink); padding-block: 2.6rem 3rem; }
.footer__grid { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; align-items: baseline; }
.footer__brand {
  font-family: 'Fraunces', serif; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: 1.1rem; letter-spacing: 0.14em;
}
.footer__meta { font-size: 0.74rem; color: var(--ink-faint); line-height: 1.7; }
.footer__links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer__links a {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-soft); text-decoration: none;
}
.footer__links a:hover { color: var(--wine); }

/* ---- Tooltip ---- */
.tip {
  position: fixed; z-index: 200; pointer-events: none; opacity: 0;
  background: var(--ink); color: var(--cream); padding: 9px 13px;
  font-size: 0.74rem; line-height: 1.5; max-width: 240px;
  transition: opacity 0.14s;
}
.tip.is-on { opacity: 1; }
.tip b { display: block; font-weight: 600; margin-bottom: 4px; }
.tip .num { color: var(--gold-soft); }

/* ============================================================
   Shared responsive collapse — keep last in this file.
   Media queries add no specificity, so these must out-order the
   base rules above.
   ============================================================ */
@media (max-width: 1020px) {
  .chapter { grid-template-columns: 1fr; column-gap: 0; }
  .chapter__title, .chapter__note { grid-column: 1 / -1; }
  .chapter__note { margin-top: 1.2rem; }
}
@media (max-width: 640px) {
  .eyebrow { flex-wrap: wrap; gap: 10px 16px; }
  .lede { max-width: none; }
  .card { padding: 1.7rem 1.4rem; }
}
