/* Vertical timeline v1 - story-agnostic */
:root {
  --paper: #faf7f1;
  --ink: #22262a;
  --ink-soft: #5a5f66;
  --line: #e5ded2;
  --card: #fffdf8;
  --rail: #d8d0c0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
.vwrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* header */
.vhead { padding: 48px 0 20px; }
.vhead .kicker {
  margin: 0; text-transform: uppercase; letter-spacing: .18em;
  font-size: 12px; color: var(--ink-soft); font-family: Georgia, serif;
}
.vhead h1 { margin: .2em 0 .3em; font-size: clamp(28px, 5vw, 44px); line-height: 1.1; }
.vhead .subtitle { margin: 0 0 .4em; color: var(--ink-soft); font-size: 17px; max-width: 640px; }
.vhead .provenance { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* chapter chips (overview nav) */
.vchapters { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.vchapters a {
  text-decoration: none; color: var(--ink); font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
  background: var(--card);
}
.vchapters a:hover { border-color: var(--ink); }

/* actor filter chips */
.chips-toggle, .chip-badge { font-family: inherit; }
.vchips {
  position: sticky; top: 0; z-index: 40;
  padding: 8px 20px; max-width: 900px; margin: 0 auto;
  background: rgba(250, 247, 240, .96); border-bottom: 1px solid var(--line);
}
.vchips .lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-soft); font-family: Georgia, serif;
}
.chips-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); cursor: pointer;
}
.chips-toggle:hover { border-color: var(--ink-soft); }
.chips-toggle .car { transition: transform .15s ease; color: var(--ink-soft); font-size: 11px; }
.vchips.open .chips-toggle .car { transform: rotate(180deg); }
.chip-badge {
  font-size: 11px; font-family: Georgia, serif;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 9px;
}
.chip-panel {
  position: absolute; top: 100%; left: 0; right: 0; display: none;
  flex-wrap: wrap; gap: 8px 10px; align-items: center;
  padding: 12px 20px 14px; background: rgba(250, 247, 240, .98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 18px rgba(60, 50, 30, .10);
}
.vchips.open .chip-panel { display: flex; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); cursor: pointer; font-family: inherit;
  transition: transform .08s ease;
}
.chip:hover { border-color: var(--ink-soft); transform: translateY(-1px); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip .n { color: var(--ink-soft); font-size: 12px; }
.chip.on { color: #fff; border-color: transparent; }
.chip.on .n { color: rgba(255,255,255,.8); }
.chip.clear { border-style: dashed; }

/* timeline */
.vtl { position: relative; padding: 24px 0 10px 74px; margin-top: 8px; }
.vtl::before {
  content: ""; position: absolute; left: 30px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(var(--rail), var(--rail));
  opacity: .8;
}

/* year headers */
.vy {
  position: sticky; top: 45px; z-index: 30;
  margin: 26px 0 12px; margin-left: -74px; padding: 6px 0 6px 74px;
  font-size: 22px; letter-spacing: .06em; color: var(--ink);
  background: linear-gradient(rgba(250,247,241,0) 0%, var(--paper) 8%, var(--paper) 92%, rgba(250,247,241,0));
  border-bottom: 2px solid var(--line);
}
.vy .yc { float: right; font-size: 12px; color: var(--ink-soft); font-family: Georgia, serif; padding-top: 9px; }

/* per-day sections */
.vday { position: relative; margin: 16px 0; }
.vmark {
  position: absolute; left: -49.5px; top: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--ink);
  cursor: pointer; z-index: 5; transition: transform .1s ease;
}
.vmark:hover { transform: scale(1.5); }
.vmark.has-src::after {
  content: attr(data-n); position: absolute; left: 16px; top: -3px;
  font-size: 11px; color: var(--ink-soft); font-family: Georgia, serif;
  background: var(--paper); padding: 0 2px;
}
.vmark.ms {
  width: 17px; height: 17px; left: -51.5px; top: 0;
  background: var(--ink); border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(34,38,42,.15);
}
.vday .vdate {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-soft); margin-bottom: 6px; cursor: pointer;
}
.vdate b { color: var(--ink); font-weight: 600; }

/* milestone banner */
.vband {
  background: var(--ink); color: #f5efe4;
  margin: 6px 0 10px; margin-left: -74px; padding: 10px 16px 10px 74px;
  border-radius: 4px;
}
.vband .ml { font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.vband .md { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #b9b2a2; }

/* event cards */
.vcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 13px 9px 12px; margin: 7px 0;
  box-shadow: 0 1px 2px rgba(120,110,90,.06);
  border-left: 3px solid var(--line);
}
.vcard .vh { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.vcard .actor { font-weight: 700; font-size: 14.5px; }
.vcard .actor .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: baseline; }
.vcard .tipo {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-soft); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
  font-family: Georgia, serif;
}
.vcard .corr { font-size: 11.5px; color: var(--ink-soft); }
.vcard .body { font-size: 14.5px; }
.vcard .src {
  margin-top: 4px; font-size: 12px; font-family: Georgia, serif;
}
.vcard .src a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px dotted var(--rail); }
.vcard .src a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* consolidated day cards */
.vcard.day { cursor: pointer; }
.vcard.day .vh { margin-bottom: 4px; }
.vcard.day .actor {
  font-weight: 700; font-size: 14.5px; display: inline-flex;
  align-items: center; gap: 6px; flex-wrap: wrap;
}
.vcard.day .actor .dot { margin-right: 2px; }
.vcard.day .more { color: var(--ink-soft); font-weight: 400; font-size: 13px; }
.vcard.day .nogen {
  font-weight: 400; font-size: 13px; color: var(--ink-soft); font-style: italic;
}
.vcard .meios {
  margin-left: auto; font-family: Georgia, serif; font-size: 12px;
  color: var(--ink-soft); background: none; border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px; cursor: pointer;
}
.vcard .meios:hover { color: var(--ink); border-color: var(--ink-soft); }
.vdate .nv { color: var(--ink-soft); text-transform: none; letter-spacing: .02em; }

/* filtering: unrelated days collapse to a slim entry instead of greying out */
.vday.co { margin: 7px 0; }
.vday.co .vcard {
  padding: 4px 12px; background: transparent; border-style: dashed;
  border-left-color: var(--line); box-shadow: none; opacity: .75;
}
.vday.co .vcard .body,
.vday.co .vcard .meios { display: none; }
.vday.co .vband { display: none; }
.vday.co .vdate { margin-bottom: 2px; font-size: 11px; }
.vday.co .vcard.day .actor { font-size: 13px; font-weight: 400; }
.vday.co .vcard.day .actor .dot { width: 7px; height: 7px; margin-right: 3px; }
.vday, .vcard, .vdate { transition: opacity .15s ease; }
.vcard .meios { transition: opacity .15s ease; }

/* sources popover */
.vpop {
  position: absolute; z-index: 60;
  min-width: 270px; max-width: min(400px, calc(100vw - 24px));
  max-height: min(70vh, 560px); overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(60,50,30,.18);
  padding: 10px 12px; font-size: 13px;
}
.vpop h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: .04em; }
.vpop .clm {
  font-weight: 700; font-size: 13.5px; margin: 8px 0 2px;
  padding-bottom: 2px; border-bottom: 1px solid var(--line);
}
.vpop .s { margin: 7px 0; border-top: 1px solid #f1ece1; padding-top: 7px; }
.vpop .clm + .s { border-top: 0; }
.vpop .ttl { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.vpop .ln { font-size: 12px; font-family: Georgia, serif; margin-top: 2px; }
.vpop .s:first-of-type { border-top: 0; padding-top: 0; }
.vpop .out { font-weight: 700; font-size: 12.5px; }
.vpop .qchip { color: var(--ink-soft); font-size: 11px; font-style: italic; font-family: Georgia, serif; }
.vpop .dt { color: var(--ink-soft); font-size: 11.5px; font-family: Georgia, serif; }
.vpop a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--rail); }
.vpop a:hover { border-bottom-color: var(--ink); }
.vpop .act { margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.vpop::before {
  content: ""; position: absolute; left: -7px; top: 14px;
  width: 12px; height: 12px; background: #fff;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

footer { margin: 40px 0 30px; font-size: 12.5px; color: var(--ink-soft); }

@media (max-width: 640px) {
  .vtl { padding-left: 48px; }
  .vtl::before { left: 18px; }
  .vmark { left: -35.5px; }
  .vmark.ms { left: -37.5px; }
  .vy { margin-left: -48px; padding-left: 48px; }
  .vband { margin-left: -48px; padding-left: 48px; }
}