/* ============================================================
   Ty i Ja (1960s Polish magazine) look, "matchbook" palette,
   USER LOCKED 2026-07-29.
   Four inks only, everything else a screened tint of these on
   the paper stock, as on a 4-colour press run:
     paper #F1E8D0   ink #131010
     vermilion #B02E1F (--lead: headers, rank 1, the map fills)
     plum #472A35 (--acc: war, the gap, the uncounted)
     mustard #C9A227 (--mic, the <5% micro accent: stamps, seam)
   Flat throughout: no gradients, no blurred shadows. Offsets are
   solid ink, like misregistered print or stacked cut paper.
   This :root block is the SINGLE source of truth for every
   color on the page; app.js reads tokens via getComputedStyle.
   ============================================================ */
:root {
  --bg: #f1e8d0;       /* paper */
  --ink: #131010;

  --lead: #b02e1f;     /* vermilion, the lead ink */
  --acc: #472a35;      /* plum, the accent ink */
  --mic: #c9a227;      /* mustard, the micro accent */
  --lead-screen: #e9b7a6;
  --acc-screen: #d6c3cb;
  --mic-screen: #ead9a7;

  /* screened neutrals (ink halftoned on paper) */
  --muted: #6e6250;
  --line: #dccfaf;
  --band: #e7dbbd;
  --soft-ink: #a5987f;

  --serif: "Lora", Georgia, serif;
  --display: "Shrikhand", "Cooper Black", serif;
  --caps: "Anton", "Arial Narrow", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* paper grain over everything: texture, not shading */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0 0.05 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- masthead ---------- */
.masthead {
  display: grid;
  grid-template-columns: 34px 220px 1fr;
  align-items: stretch;
  margin: 14px 24px 0;
  border: 2.5px solid var(--ink);
  background: var(--bg);
}
.mast-tab {
  border-right: 2.5px solid var(--ink);
  background: var(--lead);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mast-tab span {
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--bg);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 10px 0;
}
.mast-logo {
  border-right: 2.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 12px;
}
.logo-en {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.1;
  text-align: center;
  color: var(--lead);
  text-shadow: 3px 3px 0 var(--acc-screen);
}
.mast-title { padding: 14px 20px 12px; }
.mast-title h1 {
  font-family: var(--caps);
  font-size: clamp(22px, 3.2vw, 36px);
  line-height: 1.04;
  text-transform: uppercase;
}
.mast-sub {
  margin-top: 7px;
  font-size: 14.5px;
  font-style: italic;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stamp {
  font-family: var(--caps);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  padding: 2px 8px 1px;
  transform: rotate(-2deg);
  background: var(--bg);
  display: inline-block;
}
.stamp-acc { color: var(--acc); border-color: var(--acc); }
.stamp-lead { color: var(--lead); border-color: var(--lead); }

/* ---------- intro ---------- */
.intro { max-width: 880px; margin: 18px auto 0; padding: 0 24px; }
.intro p { font-size: 15px; line-height: 1.55; margin-bottom: 10px; max-width: 66em; }
.intro .gap-word { color: var(--acc); font-style: italic; }

/* ---------- sticky top bar: era nav, play, inks ---------- */
.controls {
  position: sticky;
  top: 0;
  z-index: 40;
  margin-top: 16px;
  padding: 8px 24px;
  background: var(--bg);
  border-top: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.era-nav { display: flex; flex-wrap: wrap; }
.era-nav a {
  font-family: var(--caps);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  border-right-width: 0;
  padding: 3px 11px 2px;
  background: var(--bg);
}
.era-nav a:last-child { border-right-width: 2px; }
.era-nav a:hover { background: var(--band); }
.era-nav a.active { background: var(--ink); color: var(--bg); }

.play-btn {
  font-family: var(--caps);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--lead);
  border: 2px solid var(--ink);
  padding: 3px 14px 2px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.play-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.play-btn.on { background: var(--ink); }

.now-readout {
  margin-left: auto;
  font-family: var(--caps);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- layout: timeline left, the map holding half the page ------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 26px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px 24px 40px;
  align-items: start;
}

/* ---------- the map, right side ---------- */
.mapbox {
  position: sticky;
  top: 54px;
  border: 2.5px solid var(--ink);
  background: var(--bg);
  box-shadow: 6px 6px 0 var(--ink);
}
.map-plate {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px 6px;
  border-bottom: 2.5px solid var(--ink);
}
.map-plate .mp-label {
  font-family: var(--caps);
  font-size: 22px;
  text-transform: uppercase;
  line-height: 1;
  color: var(--lead);
}
.map-plate .mp-sub {
  font-size: 12.5px;
  font-style: italic;
  color: var(--muted);
}
#worldmap { display: block; width: 100%; height: auto; background: var(--bg); }
.map-roll { padding: 8px 12px 6px; border-top: 2px solid var(--line); }
.map-roll ol {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 18px;
  row-gap: 2px;
}
.map-roll li {
  font-family: var(--caps);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.map-roll li .r-num { color: var(--lead); width: 12px; text-align: right; flex: none; }
.map-roll li.r-1 { font-size: 13.5px; }
.map-roll li.gap-row { color: var(--acc); }
.map-roll li.gap-row .r-num { color: var(--acc); }
.map-roll li .r-men {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.map-foot {
  padding: 5px 12px 7px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--muted);
  border-top: 2px solid var(--line);
}
.map-foot .hollow { color: var(--acc); }

/* ---------- the timeline ---------- */
#timeline { min-width: 0; }

.era-band {
  margin: 34px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.era-band:first-child { margin-top: 0; }
.era-band h2 {
  font-family: var(--caps);
  font-size: clamp(20px, 2.6vw, 28px);
  text-transform: uppercase;
  line-height: 1.05;
}
.era-band .era-range {
  font-family: var(--caps);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.era-rule {
  height: 8px;
  margin: 8px 0 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Cpath d='M0 7 L4 1 L8 7 L12 1 L16 7' fill='none' stroke='%23131010' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
}

/* slices sit on a spine */
.slice { position: relative; padding-left: 26px; margin-bottom: 26px; }
.slice::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: -26px;
  width: 3px;
  background: var(--ink);
}
.slice:last-child::before { bottom: 0; }
.slice::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  width: 13px;
  height: 13px;
  background: var(--bg);
  border: 3px solid var(--ink);
  transform: rotate(45deg);
}
.slice.active::after { background: var(--lead); border-color: var(--lead); }

.slice-head {
  position: sticky;
  top: 44px;
  z-index: 30;
  background: var(--bg);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0 5px;
  border-bottom: 2px solid var(--ink);
}
.slice-label {
  font-family: var(--caps);
  font-size: 24px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--lead);
}
.slice-sub { font-size: 13px; font-style: italic; color: var(--muted); }
.count-tag {
  margin-left: auto;
  font-family: var(--caps);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px 1px;
}
.count-tag.narrative { border: 2px dashed var(--soft-ink); color: var(--muted); }
.count-tag.recorded { border: 2px solid var(--lead); color: var(--lead); }

.powers { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.power {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0;
  border: 2px solid var(--ink);
  background: var(--bg);
  box-shadow: 4px 4px 0 var(--ink);
}
.power .rank {
  font-family: var(--caps);
  font-size: 26px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  border-right: 2px solid var(--ink);
  background: var(--band);
}
.power.rank-1 .rank { background: var(--lead); color: var(--bg); }
.power .p-body { padding: 9px 13px 10px; min-width: 0; }
.p-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.p-name {
  font-family: var(--caps);
  font-size: 19px;
  line-height: 1.1;
  text-transform: uppercase;
}
.power.rank-1 .p-name { font-size: 24px; }
.p-tag {
  font-family: var(--caps);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lead);
}
.p-men {
  margin-left: auto;
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}
.p-line { font-size: 14.5px; line-height: 1.5; margin-top: 4px; }

/* what remains: one surviving object per slice, photo plate left */
.relic {
  margin-top: 10px;
  border: 2px solid var(--ink);
  border-left: 6px solid var(--lead);
  background: var(--band);
  font-size: 13.5px;
  line-height: 1.5;
}
.relic .r-photo {
  display: block;
  border-bottom: 2px solid var(--ink);
  background: var(--bg);
}
.relic .r-photo img {
  display: block;
  width: 100%;
  height: 440px;
  object-fit: contain;
}
.relic .r-text { padding: 8px 12px 9px; min-width: 0; }
.relic b {
  font-family: var(--caps);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lead);
  display: block;
  margin-bottom: 3px;
}
.relic .r-art { font-family: var(--caps); font-size: 14px; text-transform: uppercase; }
.relic a { color: var(--lead); font-size: 12px; }
.relic .r-credit {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-style: italic;
  color: var(--muted);
}

/* more of what remains: the other verified images for the same slice */
.r-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  padding: 0 10px 10px;
  border-top: 2px solid var(--line);
  padding-top: 10px;
}
.r-tile {
  display: block;
  border: 2px solid var(--ink);
  background: var(--bg);
  text-decoration: none;
  color: var(--ink);
}
.r-tile img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 2px solid var(--ink);
}
.r-tile-cap {
  display: block;
  padding: 5px 8px 6px;
  font-family: var(--caps);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.3;
}
.r-tile-cap i {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 2px;
}

/* slice level notes */
.slice-note {
  margin-top: 10px;
  font-size: 13.5px;
  font-style: italic;
  color: var(--muted);
  max-width: 60em;
}

/* the gap: uncounted forces */
.gapnote {
  margin-top: 10px;
  border: 2px dashed var(--acc);
  background: var(--acc-screen);
  padding: 9px 12px 10px;
  font-size: 14px;
  line-height: 1.5;
}
.gapnote b {
  font-family: var(--caps);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
  display: block;
  margin-bottom: 3px;
}

/* ---------- the counting seam ---------- */
.seam {
  position: relative;
  margin: 36px 0;
  padding: 16px 18px 18px;
  border: 2.5px solid var(--ink);
  background: var(--mic-screen);
  box-shadow: 6px 6px 0 var(--ink);
}
.seam::before {
  content: "";
  position: absolute;
  left: -26px;
  right: -8px;
  top: -20px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8'%3E%3Cpath d='M0 7 L4 1 L8 7 L12 1 L16 7' fill='none' stroke='%23131010' stroke-width='2.4'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
}
.seam h2 {
  font-family: var(--caps);
  font-size: 22px;
  text-transform: uppercase;
  color: var(--ink);
}
.seam .seam-year {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  color: var(--mic);
  text-shadow: 3px 3px 0 var(--ink);
  float: right;
  margin-left: 14px;
}
.seam p { font-size: 14.5px; line-height: 1.55; margin-top: 8px; max-width: 62em; }

/* ---------- colophon ---------- */
.colophon { border-top: 2.5px solid var(--ink); margin-top: 10px; background: var(--band); }
.colophon-inner { max-width: 880px; margin: 0 auto; padding: 24px 24px 38px; }
.colophon h2 {
  font-family: var(--caps);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.colophon p { font-size: 14.5px; line-height: 1.55; margin-bottom: 11px; max-width: 66em; }
.colophon-caution { border-left: 4px solid var(--acc); padding-left: 12px; }
.colophon-src { font-style: italic; color: var(--muted); }
.colophon a { color: var(--acc); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding-top: 10px; }
  /* the map rides along above the timeline on small screens */
  .mapbox {
    position: sticky;
    top: 44px;
    z-index: 35;
    order: -1;
    box-shadow: 4px 4px 0 var(--ink);
  }
  .map-roll, .map-foot { display: none; }
  .map-plate .mp-label { font-size: 16px; }
  .slice-head { top: 44px; position: static; }
}
@media (max-width: 680px) {
  .controls { padding: 6px 12px; gap: 6px; }
  .era-nav a { font-size: 10.5px; padding: 3px 7px 2px; letter-spacing: 0.04em; }
  .now-readout { display: none; }
  .play-btn { font-size: 10.5px; padding: 3px 9px 2px; }
  .mapbox { top: 40px; }
  .masthead { grid-template-columns: 26px 1fr; }
  .mast-logo { border-right: 0; }
  .mast-title { grid-column: 1 / -1; border-top: 2.5px solid var(--ink); }
  .power { grid-template-columns: 34px 1fr; }
  .power .rank { font-size: 20px; }
  .relic .r-photo img { height: 260px; }
  .p-men { margin-left: 0; width: 100%; }
  .seam .seam-year { float: none; display: block; margin: 0 0 6px; }
}
