[hidden] { display: none !important; }
:root {
  --paper: #f5efe3;
  --paper-2: #ece3d1;
  --ink: #2a2320;
  --ink-2: #5c5048;
  --rule: #cdbfa6;
  --accent: #7a2e1f;
  --gold: #a87b2c;
  --gold-soft: #f0e2c2;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1916;
    --paper-2: #262119;
    --ink: #ece4d6;
    --ink-2: #b3a796;
    --rule: #4a4136;
    --accent: #d98a6c;
    --gold: #d4a957;
    --gold-soft: #3a2f1c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.6;
  padding-inline: 1.25rem;
}
.wrap { max-width: 56rem; margin: 0 auto; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

.hero { padding-block: 4.5rem 2.5rem; border-bottom: 1px solid var(--rule); }
.kicker, .era, .when, .q, .g, .dates {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.hero h1 {
  font-size: clamp(3.5rem, 13vw, 7.5rem);
  font-weight: 500;
  line-height: 0.95;
  margin: 0.6rem 0 1.2rem;
  letter-spacing: -0.02em;
}
.lede { font-size: 1.4rem; max-width: 40rem; margin: 0; color: var(--ink-2); font-style: italic; }
.toc { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-top: 2rem; font-size: 1rem; }
.toc a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.toc a:hover { border-color: var(--accent); color: var(--accent); }

section { padding-block: 3.5rem 0.5rem; }
h2 { font-size: 2.1rem; font-weight: 500; margin: 0 0 1rem; }
h3 { font-size: 1.5rem; font-weight: 500; margin: 0.2rem 0 0.8rem; }
.section-lede { color: var(--ink-2); max-width: 42rem; margin-top: -0.4rem; }

.answer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; }
.answer { border-top: 3px solid var(--ink); padding-top: 0.8rem; }
.answer p { margin: 0 0 0.6rem; font-size: 1.05rem; }
.answer .q { margin: 0; }
.answer .a { font-size: 1.55rem; line-height: 1.2; margin: 0.2rem 0 0.7rem; }
.a.yes { color: var(--accent); }
.a.maybe { color: var(--gold); }

.tree-scroll { overflow-x: auto; }
.spine { list-style: none; margin: 1.5rem 0 0; padding: 0; position: relative; }
.spine::before {
  content: ""; position: absolute; left: 1.15rem; top: 0.5rem; bottom: 0.5rem;
  border-left: 2px solid var(--rule);
}
.gen { position: relative; display: grid; grid-template-columns: 2.3rem 1fr; gap: 1rem; margin-bottom: 1.1rem; }
.g {
  position: relative; z-index: 1; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--rule);
  display: grid; place-items: center; font-size: 0.7rem; color: var(--ink-2);
}
.gen.key > .g, .gen.fork > .g { border-color: var(--gold); color: var(--ink); }
.person { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 4px; padding: 0.8rem 1rem; }
.person.key, .gen.key > .person { border-left: 4px solid var(--gold); background: var(--gold-soft); }
.person p { margin: 0; }
.name { font-size: 1.2rem; font-weight: 600; }
.dates { font-weight: 400; margin-left: 0.4rem; white-space: nowrap; }
.spouse { font-style: italic; color: var(--ink-2); font-size: 1rem; }
.note { font-size: 1rem; margin-top: 0.35rem !important; }
.branches { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.8rem; }
.gen.open .person { background: transparent; border-style: dashed; }

.chapter { padding-block: 1.2rem; border-top: 1px solid var(--rule); }
.chapter:first-of-type { border-top: 0; padding-top: 0; }
.chapter p { max-width: 42rem; }
.chapter .era { margin: 0; color: var(--accent); }

.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.place { padding: 0.9rem 1rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.place p { margin: 0; font-size: 1rem; }
.place .where { font-size: 1.15rem; font-weight: 600; margin: 0.15rem 0 0.25rem; }

.stories { display: grid; gap: 1.25rem; }
.story { margin: 0; padding: 0.4rem 0 0.4rem 1.4rem; border-left: 3px solid var(--accent); font-size: 1.2rem; font-style: italic; }
.story p { margin: 0; max-width: 44rem; }

.issues dt { font-weight: 600; font-size: 1.2rem; margin-top: 1.2rem; }
.issues dd { margin: 0.25rem 0 0; max-width: 44rem; }

.yours { margin-top: 2.5rem; padding: 2rem 1.5rem; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 4px; }
.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.7rem; max-width: 44rem; }
.callout { font-style: italic; color: var(--ink-2); margin-bottom: 0; }

.refs { padding-left: 1.2rem; font-size: 1rem; }
.refs li { margin-bottom: 0.5rem; }

.foot { margin-top: 4rem; padding-block: 2rem 3rem; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 0.95rem; }

@media (max-width: 34rem) {
  body { font-size: 1.05rem; padding-inline: 1rem; }
  .yours { padding: 1.4rem 1rem; }
  .gen { grid-template-columns: 2rem 1fr; gap: 0.6rem; }
  .g { width: 2rem; height: 2rem; }
  .spine::before { left: 1rem; }
}

.finding { padding-block: 1.2rem; border-top: 1px solid var(--rule); }
.finding p { max-width: 44rem; }
.finding .era { margin: 0; color: var(--accent); }
.cite { font-size: 0.95rem; color: var(--ink-2); }
.plain { padding-left: 1.2rem; max-width: 44rem; } .plain li { margin-bottom: 0.4rem; }

.sitebar { border-bottom: 1px solid var(--rule); padding-block: 0.7rem; font-size: 0.95rem; }
.sitebar .wrap { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: baseline; }
.sitebar a { color: var(--ink-2); text-decoration: none; }
.sitebar a:first-child { color: var(--ink); font-weight: 600; }
.sitebar a[aria-current] { color: var(--accent); }
.sitebar span { color: var(--rule); }
.hero { padding-block: 3.5rem 2.5rem; }

.amp { font-style: italic; color: var(--accent); font-weight: 400; }
.lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.line-col { display: flex; flex-direction: column; gap: 0.6rem; }
.line-col .person { position: relative; }
.line-col .person + .person::before { content: ""; position: absolute; left: 1.2rem; top: -0.65rem; height: 0.6rem; border-left: 2px solid var(--rule); }
.line-col .person.open { background: transparent; border-style: dashed; }
.line-head { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0; }
.feature { border-block: 1px solid var(--rule); padding-block: 1.4rem; margin-bottom: 1rem; }
.feature-quote { font-size: 1.6rem; font-style: italic; line-height: 1.35; margin: 0 0 0.4rem; max-width: 44rem; }
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.side { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-top: 4px solid var(--gold); background: var(--paper-2); padding: 1.3rem 1.3rem 1.1rem; border-radius: 4px; }
.side:hover { border-color: var(--accent); }
.side h2 { margin: 0.3rem 0 0.5rem; font-size: 2rem; }
.side p { margin: 0 0 0.6rem; font-size: 1.05rem; }
.side .go { color: var(--accent); font-size: 1rem; margin: 0; }

.table-scroll { overflow-x: auto; margin-block: 1rem; }
.diff { border-collapse: collapse; width: 100%; min-width: 44rem; font-size: 0.98rem; }
.diff th { text-align: left; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--ink); padding: 0.4rem 0.6rem; }
.diff td { vertical-align: top; border-bottom: 1px solid var(--rule); padding: 0.7rem 0.6rem; }
.diff td:first-child { font-weight: 600; width: 16%; }
.diff td:nth-child(2) { color: var(--ink-2); width: 26%; }
.tag { display: inline-block; font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.3rem; color: var(--ink-2); white-space: nowrap; }
.tag.primary { border-color: var(--gold); color: var(--gold); }

.map-section { padding-top: 2.5rem; }
.map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem 1.5rem; margin-bottom: 1rem; }
.map-head h2 { margin: 0; }
.toggle { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; background: var(--paper-2); }
.toggle button { font: inherit; font-size: 1rem; border: 0; background: transparent; color: var(--ink-2); padding: 0.35rem 0.95rem; border-radius: 999px; cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.toggle button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map { height: min(70vh, 34rem); min-height: 22rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper-2); }
.legend { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.3rem; font-size: 0.98rem; }
.legend li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sw { display: inline-block; width: 1.6rem; height: 4px; border-radius: 2px; background: var(--c); }
.legend-key { color: var(--ink-2); font-size: 0.92rem; gap: 0.35rem 0.6rem !important; }
.dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 2px solid var(--ink-2); }
.dot.solid { background: var(--ink-2); }
.dot.hollow { background: transparent; }
.dash { display: inline-block; width: 1.6rem; border-top: 2px dashed var(--ink-2); }
.map-tip { color: var(--ink-2); font-size: 0.9rem; margin: 0.4rem 0 0; }
.leaflet-container { font-family: var(--serif); }
.leaflet-popup-content { margin: 0.7rem 0.9rem; }
.leaflet-popup-content p { margin: 0; }
.pop-when { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: #7a6a5a; }
.pop-where { font-size: 1.1rem; font-weight: 600; margin: 0.1rem 0 0.2rem !important; }
.pop-note { font-size: 0.98rem; line-height: 1.4; }
.pop-tag { font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: #a87b2c; margin-top: 0.35rem !important; }
.route-main { animation: march 1.6s linear infinite; }
@keyframes march { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: reduce) { .route-main { animation: none; } }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--rule); }
.timeline li { display: grid; grid-template-columns: 5.5rem 11rem 1fr; gap: 0.2rem 1rem; padding: 0.55rem 0 0.55rem 1rem; position: relative; border-bottom: 1px solid color-mix(in srgb, var(--rule) 50%, transparent); }
.timeline li::before { content: ""; position: absolute; left: -0.42rem; top: 0.95rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--c, var(--ink-2)); }
.timeline li[data-side="goudeau"] { --c: #c0532f; }
.timeline li[data-side="borgen"] { --c: #3b74b0; }
.timeline li[data-side="czech"] { --c: #5f8f34; }
.timeline li[data-side="borgen czech"] { --c: linear-gradient(90deg, #3b74b0 50%, #5f8f34 50%); }
.timeline li[data-side="borgen czech"]::before { background: linear-gradient(90deg, #3b74b0 50%, #5f8f34 50%); }
.t-when { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-2); padding-top: 0.2rem; }
.t-where { font-weight: 600; }
@media (max-width: 40rem) {
  .timeline li { grid-template-columns: 1fr; }
  .toggle button { padding: 0.3rem 0.7rem; font-size: 0.95rem; }
}
.zooms { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.7rem; font-size: 0.92rem; color: var(--ink-2); }
.zooms button { font: inherit; font-size: 0.92rem; border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); border-radius: 4px; padding: 0.15rem 0.6rem; cursor: pointer; }
.zooms button:hover { border-color: var(--accent); }
.legend li:not(.legend-key) { display: grid; grid-template-columns: 1.6rem 1fr; align-items: center; gap: 0.6rem; }
