/* The Great Plot Twist — Tanaka plane-portrait world.
   Paper ground, flat outline-less planes, one grotesk on one grid.
   vermilion = the marxist line · indigo = capital · gold = abundance · ink = structure */

:root {
  --paper: #F2E8D5;
  --paper-bright: #FBF5E8;
  --ink: #141110;
  --vermilion: #E23B22;
  --vermilion-ink: #9E2410;
  --indigo: #1E3A8A;
  --gold: #C8A24B;
  --warm-dim: #6B5C48;      /* secondary text on paper */
  --warm-dim-dark: #CCBFA6; /* secondary text on ink panels */
  --shell: 74rem;
  --measure: 42rem;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-variation-settings: "wdth" 100;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--vermilion); color: var(--paper-bright); }

a { color: var(--vermilion-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--vermilion); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip {
  position: absolute; left: -200vw; top: 0;
  background: var(--gold); color: var(--ink); padding: 0.6rem 1rem; font-weight: 700;
}
.skip:focus { left: 0; z-index: 10; }

/* ---------- top bar ---------- */

.topbar {
  display: flex; align-items: stretch; justify-content: space-between;
  background: var(--ink); color: var(--paper);
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}
.topbar-mark {
  display: flex; align-items: center; gap: 0.65rem;
  color: var(--paper); text-decoration: none;
  font-weight: 640; font-size: 0.92rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.9rem 0;
}
.topbar-mark:hover { color: var(--gold); }
.topbar-nav { display: flex; }
.topbar-nav a {
  display: flex; align-items: center; padding: 0 0.85rem;
  color: var(--paper); text-decoration: none;
  font-weight: 620; font-size: 0.95rem; font-variant-numeric: tabular-nums;
}
.topbar-nav a:hover { background: var(--vermilion); color: var(--paper-bright); }
.topbar-nav a[aria-current="page"] { background: var(--vermilion); color: var(--paper-bright); }

/* ---------- home hero ---------- */

.hero {
  background: var(--ink); color: var(--paper);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem) 0;
  align-items: end;
}
.hero-copy { padding-bottom: clamp(2.5rem, 6vw, 5rem); max-width: 36rem; }
.hero-title {
  font-size: clamp(2.7rem, 6.6vw, 5.4rem);
  line-height: 0.96; letter-spacing: -0.015em;
  font-weight: 860; font-variation-settings: "wdth" 122;
  text-transform: uppercase;
}
.hero-title em { font-style: normal; color: var(--vermilion); }
.hero-lede {
  margin-top: 1.6rem; font-size: 1.25rem; line-height: 1.6; color: var(--paper);
  max-width: 32rem;
}
.hero-caption {
  margin-top: 1.4rem; font-size: 0.95rem; letter-spacing: 0.05em;
  color: var(--warm-dim-dark);
}
.hero-figure { align-self: stretch; display: flex; align-items: flex-end; min-width: 0; }
.hero-figure svg { width: 100%; height: auto; display: block; }

/* the recomposition: one set of planes, two men */
.duo .plane {
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  transform-box: fill-box; transform-origin: center;
}
.duo-names { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.2rem 0.9rem; }
.duo-names span {
  font-size: 0.92rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 640;
  color: var(--warm-dim-dark); transition: color 0.9s ease;
}
.duo-names .duo-live { color: var(--vermilion); }
.duo.is-musk .duo-names .duo-live { color: var(--warm-dim-dark); }
.duo.is-musk .duo-names .duo-next { color: var(--gold); }

.duo.is-musk #d-hair   { transform: translate(6px, 34px) scale(0.94, 0.42); }
.duo.is-musk #d-beard  { transform: translate(0, 118px) scale(1.16, 0.52); }
.duo.is-musk #d-face   { transform: translate(0, -14px) scale(1, 1.18); }
.duo.is-musk #d-mouth  { transform: translate(0, -46px) scale(0.72); }
.duo.is-musk #d-collar { transform: translate(0, -26px) scale(1.04, 1); }
.duo.is-musk #d-eye-l  { transform: translate(-4px, -20px); }
.duo.is-musk #d-eye-r  { transform: translate(4px, -20px); }

/* ---------- shared shell ---------- */

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

/* ---------- article opener ---------- */

.opener {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end; gap: clamp(1.5rem, 4vw, 4rem);
  padding-top: clamp(2rem, 5vw, 4rem);
}
.opener-field-vermilion { background: var(--vermilion); }
.opener-field-indigo { background: var(--indigo); }
.opener-field-ink { background: var(--ink); }
.opener-field-gold { background: var(--gold); }
.opener-figure { min-width: 0; }
.opener-figure svg { width: 100%; height: auto; display: block; }
.opener-copy { padding-bottom: clamp(2rem, 5vw, 4rem); }
.opener h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.4rem);
  line-height: 0.98; letter-spacing: -0.012em; text-transform: uppercase;
  font-weight: 860; font-variation-settings: "wdth" 120;
}
.opener-field-vermilion .opener-copy, .opener-field-indigo .opener-copy,
.opener-field-ink .opener-copy { color: var(--paper-bright); }
.opener-field-gold .opener-copy { color: var(--ink); }
.artno {
  display: inline-block; vertical-align: 0.08em;
  width: 0.82em; height: 0.82em; line-height: 0.85em;
  margin-right: 0.18em;
  background: var(--paper-bright); color: var(--ink);
  text-align: center; font-size: 0.82em;
}
.opener-field-gold .artno { background: var(--ink); color: var(--paper-bright); }
.opener-dek { margin-top: 1.3rem; font-size: 1.15rem; line-height: 1.6; max-width: 30rem; }
.opener-stack { grid-template-columns: minmax(0, 1fr); align-items: start; }
.opener-stack .opener-copy { padding-bottom: 0; }
.opener-stack .opener-figure { max-width: 46rem; margin: 0 auto; padding-bottom: clamp(1.5rem, 4vw, 3rem); width: 100%; }
.opener-field-ink .opener-dek { color: var(--warm-dim-dark); }
.opener-field-vermilion .opener-dek, .opener-field-indigo .opener-dek { color: var(--paper); }

/* ---------- prose ---------- */

.article { padding: clamp(2.6rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem); }
.prose { max-width: var(--measure); margin: 0 auto; }
.prose > * + * { margin-top: 1.4rem; }
.prose h2 {
  margin-top: 3.2rem; font-size: 1.85rem; line-height: 1.15;
  font-weight: 780; font-variation-settings: "wdth" 112;
  letter-spacing: -0.01em; text-wrap: balance;
}
.prose h2 + * { margin-top: 1.1rem; }
.prose strong { font-weight: 700; }
.prose .aside { color: var(--warm-dim); font-size: 1.05rem; }

/* primary-source quote */
.source-quote {
  margin-top: 2.2rem; margin-bottom: 2.2rem;
  padding: 1.6rem 1.8rem 1.4rem;
  background: var(--paper-bright);
}
.source-quote p {
  font-size: 1.28rem; line-height: 1.55; font-weight: 540;
  letter-spacing: -0.005em;
}
.source-quote p::before { content: "“"; color: var(--vermilion); font-weight: 860; }
.source-quote p::after { content: "”"; color: var(--vermilion); font-weight: 860; }
.source-quote cite {
  display: block; margin-top: 0.9rem; font-style: normal;
  font-size: 0.92rem; letter-spacing: 0.04em; color: var(--warm-dim);
}
.source-quote.q-indigo p::before, .source-quote.q-indigo p::after { color: var(--indigo); }
.source-quote.q-gold p::before, .source-quote.q-gold p::after { color: var(--gold); }

/* ---------- staged dialogue ---------- */

.dialogue {
  margin: 2.4rem 0; padding: 1.9rem 0 0.5rem;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.dialogue-scene {
  font-size: 0.92rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 660; margin-bottom: 1.6rem;
}
.dialogue-turn { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.2rem; margin-bottom: 1.4rem; }
.dialogue-speaker {
  display: flex; align-items: baseline; gap: 0.55rem;
  font-weight: 700; font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.dialogue-speaker::before {
  content: ""; width: 0.72rem; height: 0.72rem; flex: none; align-self: center;
  background: var(--chip, var(--ink));
}
.dialogue-turn p { font-size: 1.12rem; line-height: 1.6; }
.dialogue-note { font-size: 0.95rem; color: var(--warm-dim); padding-bottom: 1.4rem; }
.chip-vermilion { --chip: var(--vermilion); }
.chip-indigo { --chip: var(--indigo); }
.chip-gold { --chip: var(--gold); }

/* ---------- contents billing (home) ---------- */

.contents { padding: clamp(3rem, 7vw, 5rem) 0; }
.contents h2 {
  font-size: 1.05rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700;
  margin-bottom: 2rem;
}
.contents ol { list-style: none; }
.contents li { border-top: 1px solid var(--ink); }
.contents li:last-child { border-bottom: 1px solid var(--ink); }
.contents a {
  display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: 1.4rem;
  align-items: baseline; padding: 1.15rem 0.3rem;
  text-decoration: none; color: var(--ink);
}
.contents a:hover { background: var(--paper-bright); }
.contents a:hover .contents-title { color: var(--vermilion-ink); }
.contents-no {
  font-size: 1.7rem; font-weight: 840; font-variation-settings: "wdth" 122;
  font-variant-numeric: tabular-nums;
}
.contents-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.005em; }
.contents-hook { display: block; font-size: 0.95rem; color: var(--warm-dim); font-weight: 400; margin-top: 0.15rem; }
.contents-mark { color: var(--vermilion); font-weight: 800; font-size: 1.25rem; }

/* ---------- timeline ---------- */

.timeline { margin: 2.6rem 0; }
.timeline h2 { font-size: 1.05rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.6rem; }
.timeline > p { color: var(--warm-dim); font-size: 1.05rem; max-width: var(--measure); }
.timeline ol { list-style: none; margin-top: 1.8rem; }
.timeline li {
  display: grid; grid-template-columns: 5.4rem 1.05rem minmax(0, 1fr); gap: 1.1rem;
  padding: 0.68rem 0; border-top: 1px solid rgba(20, 17, 16, 0.22);
  align-items: baseline;
}
.timeline-year {
  font-weight: 820; font-variation-settings: "wdth" 118;
  font-variant-numeric: tabular-nums; font-size: 1.15rem;
}
.timeline-plane { width: 1.05rem; height: 1.05rem; align-self: center; background: var(--tl, var(--ink)); }
.tl-vermilion { --tl: var(--vermilion); }
.tl-indigo { --tl: var(--indigo); }
.tl-gold { --tl: var(--gold); }
.timeline li p { font-size: 1.05rem; line-height: 1.55; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 1.4rem; font-size: 0.92rem; color: var(--warm-dim); }
.timeline-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.timeline-legend i { width: 0.8rem; height: 0.8rem; display: inline-block; }

/* ---------- cast map ---------- */

.castmap { margin: 2.6rem 0; }
.castmap h2 { font-size: 1.05rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; margin-bottom: 0.6rem; }
.castmap > p { color: var(--warm-dim); font-size: 1.05rem; max-width: var(--measure); }
.castmap figure { margin-top: 1.6rem; }
.castmap svg { width: 100%; height: auto; display: block; }
.castmap figcaption { margin-top: 0.9rem; font-size: 0.95rem; color: var(--warm-dim); max-width: var(--measure); }

/* ---------- footer ---------- */

.billing { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--ink); }
.billing a {
  display: block; text-decoration: none; color: var(--ink);
  padding: 1.4rem clamp(1rem, 4vw, 2.5rem); flex: 1;
}
.billing a:hover .billing-title { color: var(--vermilion-ink); }
.billing-next { text-align: right; }
.billing-dir { display: block; font-size: 0.92rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--warm-dim); font-weight: 640; }
.billing-title { display: block; font-size: 1.25rem; font-weight: 740; margin-top: 0.2rem; }
.billing-spacer { flex: 1; }

.sitefooter { margin-top: clamp(2rem, 6vw, 4rem); }
.sitefooter-base {
  background: var(--ink); color: var(--warm-dim-dark);
  display: flex; align-items: center; gap: 1rem;
  padding: 1.6rem clamp(1rem, 4vw, 2.5rem);
  font-size: 0.95rem;
}
.sitefooter-base a { color: var(--paper); }
.sitefooter-base a:hover { color: var(--gold); }

/* ---------- sources page ---------- */

.sources-group { margin-top: 3rem; }
.sources-group h2 {
  font-size: 1.45rem; font-weight: 780; font-variation-settings: "wdth" 112;
  margin-bottom: 1rem;
}
.sources-group ul { list-style: none; }
.sources-group li {
  padding: 0.85rem 0.2rem; border-top: 1px solid rgba(20, 17, 16, 0.22);
  font-size: 1.05rem; line-height: 1.6;
}
.sources-group li strong { font-weight: 700; }
.sources-group .src-note { color: var(--warm-dim); font-size: 0.95rem; }

/* ---------- responsive ---------- */

@media (max-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 2rem; }
  .hero-figure { order: -1; max-width: 24rem; }
  .hero-copy { padding-bottom: 2.4rem; }
  .opener { grid-template-columns: minmax(0, 1fr); }
  .opener-figure { max-width: 22rem; }
  .opener-copy { padding-bottom: 2.2rem; }
  .dialogue-turn { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; margin-bottom: 1.6rem; }
  .contents a { grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 0.9rem; }
  .timeline li { grid-template-columns: 4.2rem 0.9rem minmax(0, 1fr); gap: 0.8rem; }
  .billing { flex-direction: column; }
  .billing-next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .duo .plane, .duo-names span { transition: none; }
}
