/* Família Frydryszewski. Archival paper, sepia ink, one crimson accent (the route, the family line)
   and a pine green for the colony (Paraná). Basemap is desaturated per the vault map style. */
:root {
  --bg: #F2ECE0; --paper: #FBF7EF; --paper-2: #EAE2D2; --ink: #2B241D; --muted: #6B5F52; --line: #D8CDB9;
  --accent: #A3243A; --accent-soft: #F1DCDC; --accent-ink: #FFFFFF;
  --pine: #3F5E3C; --pine-soft: #DDE6D6;
  --sepia: #8A6A3F; --sepia-soft: #EEE1C9;
  --shadow: 0 10px 30px rgba(60, 40, 20, .14);
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-ui: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16120E; --paper: #201A14; --paper-2: #2A231B; --ink: #EDE4D3; --muted: #B3A58F; --line: #3D3327;
    --accent: #E06A78; --accent-soft: #3E2025; --accent-ink: #1A0C0E;
    --pine: #8FB487; --pine-soft: #24311F;
    --sepia: #D2AE78; --sepia-soft: #3A2E1E;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16120E; --paper: #201A14; --paper-2: #2A231B; --ink: #EDE4D3; --muted: #B3A58F; --line: #3D3327;
  --accent: #E06A78; --accent-soft: #3E2025; --accent-ink: #1A0C0E;
  --pine: #8FB487; --pine-soft: #24311F;
  --sepia: #D2AE78; --sepia-soft: #3A2E1E;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-ui); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.theme { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 10; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); font-size: 17px; display: grid; place-items: center; }

/* ---------- hero: a document cover */
.hero { padding: 56px 0 32px; background:
  radial-gradient(ellipse at 20% 0%, var(--sepia-soft), transparent 60%),
  repeating-linear-gradient(0deg, transparent 0 31px, color-mix(in srgb, var(--line) 45%, transparent) 31px 32px); }
.stamp { display: inline-flex; gap: 10px; align-items: center; margin: 0 0 18px; padding: 5px 12px; border: 1.5px solid var(--accent); color: var(--accent);
  border-radius: 4px; font: 700 12px/1 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; transform: rotate(-2deg); }
h1 { font: 700 clamp(38px, 8vw, 76px)/1.02 var(--f-display); margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sub { font: italic 500 clamp(20px, 3.4vw, 30px)/1.2 var(--f-display); margin: 6px 0 0; color: var(--sepia); }
.lede { max-width: 38em; font-size: 18px; color: var(--muted); margin: 18px 0 26px; }
  border-radius: 10px; padding: 14px; box-shadow: 0 1px 0 var(--line); font: 600 17px/1.2 var(--f-display); }
  font: 700 15px/1 var(--f-ui); }

/* ---------- sections */
.sec { padding: 40px 0; border-top: 1px solid var(--line); }
h2 { font: 700 clamp(26px, 4.5vw, 36px)/1.1 var(--f-display); margin: 0 0 18px; display: flex; align-items: center; gap: 12px; }

/* ---------- map */
.mapcard { position: relative; height: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--paper-2); }
#map { position: absolute; inset: 0; }
.mapmsg { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); background: var(--paper); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.seg { display: inline-flex; background: var(--paper); border-radius: 999px; box-shadow: var(--shadow); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; min-height: 36px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ibtn { border: 0; background: var(--paper); box-shadow: var(--shadow); width: 42px; height: 42px; border-radius: 50%; font-weight: 700; font-size: 15px; flex: none; }
.ibtn[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }
.maplibregl-ctrl-attrib { font-size: 10px; }


/* ---------- timeline: bars */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: -6px 0 12px; font-size: 14px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--k); }
.k-polonia { --k: var(--sepia); --ks: var(--sepia-soft); }
.k-familia { --k: var(--accent); --ks: var(--accent-soft); }
.k-colonia { --k: var(--pine); --ks: var(--pine-soft); }

.bars { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 8px; }
.brow { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; min-height: 30px; }
.brow .lab { font-weight: 700; font-size: 14px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { position: relative; height: 22px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dotted var(--line); }
.span { position: absolute; top: 2px; bottom: 2px; background: var(--k); border-radius: 4px; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 18px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: clip; }
:root[data-theme="dark"] .span { color: #16120E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .span { color: #16120E; } }
.span.open { background: linear-gradient(90deg, var(--k) 70%, transparent); }
.axis { position: relative; height: 26px; margin-left: 104px; font-size: 11.5px; color: var(--muted); }
.axis i { position: absolute; top: 4px; transform: translateX(-50%); font-style: normal; }
.knee { position: absolute; top: 0; bottom: 0; width: 10px; transform: translateX(-50%); background: repeating-linear-gradient(135deg, var(--line) 0 2px, transparent 2px 5px); pointer-events: none; }
.marks { position: absolute; inset: 0; pointer-events: none; }
.mark { position: absolute; top: 0; bottom: 0; border-left: 1.5px dashed var(--accent); opacity: .55; }
.barsin { position: relative; }
.barsin .rows { position: relative; }
.mark-lab { position: absolute; top: -2px; font-size: 11px; color: var(--accent); font-weight: 700; white-space: nowrap; transform: translateX(4px); }

/* ---------- timeline: list */

/* ---------- family tree */
.tree { display: grid; justify-items: center; gap: 0; }
.couple { display: flex; align-items: stretch; gap: 0; background: var(--paper); border: 1.5px solid var(--sepia); border-radius: 12px; box-shadow: var(--shadow); position: relative; }
.couple::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--line); border-radius: 8px; pointer-events: none; }
.person { padding: 16px 20px; text-align: center; }
.person .nm { font: 700 20px/1.15 var(--f-display); display: block; }
.person .alt { font-style: italic; color: var(--muted); font-size: 14px; }
.person .yr { color: var(--accent); font-weight: 700; font-size: 14px; display: block; margin-top: 4px; }
.ring { align-self: center; font: 700 22px/1 var(--f-display); color: var(--sepia); padding: 0 2px; }
.married { margin: 8px 0 0; color: var(--muted); font-size: 14px; font-style: italic; text-align: center; }
.stem { width: 2px; height: 24px; background: var(--sepia); }
.kids { list-style: none; margin: 0; padding: 20px 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; width: 100%; position: relative; }
.kids::before { content: ""; position: absolute; top: 0; left: calc(100% / 12); right: calc(100% / 12); border-top: 2px solid var(--sepia); }
.kids > li { position: relative; display: grid; justify-items: center; align-content: start; }
.kids > li::before { content: ""; position: absolute; top: -20px; left: 50%; height: 20px; border-left: 2px solid var(--sepia); }
.kid { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 8px; text-align: center; }
.kid .nm { font: 700 17px/1.15 var(--f-display); }
.kid .yr { display: block; color: var(--accent); font-weight: 700; font-size: 13px; }
.kid.main { border-color: var(--line); }
.spouse { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 14px; }
.spouse b { font-family: var(--f-display); }
.spouse small { display: block; color: var(--muted); font-size: 12px; }
.down { width: 0; height: 26px; border-left: 2px dashed var(--accent); }
.todo { width: 100%; border: 1.5px dashed var(--accent); border-radius: 10px; padding: 10px 8px; text-align: center; color: var(--accent); font-weight: 700; font-size: 13px; background: var(--accent-soft); }
.todo span { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

.after { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card h3 { font: 700 18px/1.2 var(--f-display); margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { background: var(--paper-2); border-radius: 999px; padding: 4px 10px; font-size: 14px; }
.card p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.pend { display: grid; gap: 8px; }
.pend div { border-left: 3px dashed var(--accent); padding: 2px 0 2px 10px; }
.pend b { display: block; font-family: var(--f-display); }
.pend span { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; font: 700 11px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 3px 6px; margin-left: 6px; vertical-align: 2px; }

/* ---------- sources */
.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sources li { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.sources b { font-family: var(--f-display); }
.sources span { display: block; color: var(--muted); font-size: 14px; }
.others { color: var(--muted); font-size: 14px; margin-top: 14px; }
.foot { padding: 26px 0 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); font-style: italic; }

/* ---------- hero extras */
.hero .legend { margin: 6px 0 10px; }
.start { display: inline-block; margin-top: 18px; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }

/* ---------- story: chapters on a rail, the map follows */
.story { border-top: 1px solid var(--line); padding: 32px 0 20px; }
.storygrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.mapcol { position: sticky; top: 16px; height: calc(100vh - 32px); max-height: 760px; order: 2; }
#labelsBtn { position: absolute; top: 10px; right: 10px; }
.mapnote { position: absolute; left: 10px; bottom: 6px; right: 90px; margin: 0; font-size: 11px; color: var(--muted); background: color-mix(in srgb, var(--paper) 80%, transparent); padding: 2px 6px; border-radius: 4px; }
.chapters { list-style: none; margin: 0; padding: 0 0 30vh; position: relative; order: 1; }
.chapters::before { content: ""; position: absolute; left: 13px; top: 10px; bottom: 30vh; border-left: 2px solid var(--line); }
.ch { position: relative; padding: 0 0 0 44px; min-height: 52vh; display: flex; flex-direction: column; justify-content: center; opacity: .45; transition: opacity .35s; }
.ch.on { opacity: 1; }
.ch::before { content: ""; position: absolute; left: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--paper); border: 3px solid var(--k); }
.ch.on::before { background: var(--k); }
.ch .yr { font: 700 clamp(30px, 5vw, 46px)/1 var(--f-display); color: var(--k); letter-spacing: -.01em; }
.ch h3 { font: 700 22px/1.2 var(--f-display); margin: 6px 0 6px; }
.ch p { margin: 0; color: var(--muted); font-size: 16px; max-width: 30em; }
.ev { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.ev li { display: flex; gap: 10px; align-items: baseline; }
.ev b { font-family: var(--f-display); color: var(--k); min-width: 3em; }
.part { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.part span { flex: 1 1 0; min-width: 80px; text-align: center; padding: 10px 6px; border: 1.5px solid var(--sepia); border-radius: 8px; font-weight: 700; color: var(--sepia); background: var(--sepia-soft); }
.part span:nth-child(2) { transform: rotate(-1.5deg); } .part span:nth-child(3) { transform: rotate(1.5deg); }
.figs { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; }
.figs div { border-left: 3px solid var(--accent); padding-left: 10px; }
.figs strong { display: block; font: 700 24px/1.1 var(--f-display); }
.figs span { color: var(--muted); font-size: 14px; }
.ch.pending .yr { font-style: italic; }
.ch .go { display: inline-block; margin-top: 10px; font-weight: 700; }

/* ---------- phone */
@media (max-width: 760px) {
  .hero { padding-top: 64px; }
  .storygrid { display: block; }
  .mapnote { display: none; }
  .mapcol { top: 0; height: 42vh; max-height: none; z-index: 5; margin: 0 -16px; }
  .mapcol .mapcard { border-radius: 0; border-left: 0; border-right: 0; }
  .ch { min-height: 46vh; padding-left: 40px; }
  .chapters { padding-top: 12px; }
  .chapters::before { top: 22px; }
  .after { grid-template-columns: 1fr; }
  .kids { grid-template-columns: 1fr; padding: 0 0 0 28px; gap: 8px; max-width: 360px; }
  .kids::before { top: 0; bottom: 30px; left: 10px; right: auto; border-top: 0; border-left: 2px solid var(--sepia); }
  .kids > li::before { top: 22px; left: -18px; width: 18px; height: 0; border-left: 0; border-top: 2px solid var(--sepia); }
  .kid { text-align: left; padding: 10px 12px; }
  .kids > li { justify-items: start; }
  .kids > li > .down { margin-left: 24px; height: 16px; }
  .stem { height: 18px; }
  .person { padding: 12px 12px; }
  .person .nm { font-size: 17px; }
  .brow { grid-template-columns: 72px 1fr; }
  .axis { margin-left: 80px; }
  .axis i.minor { display: none; }
}
@media (max-width: 400px) {
  .couple { flex-direction: column; }
  .ring { padding: 0; }
}
.todo.solo { width: auto; min-width: 220px; padding: 10px 18px; margin-top: 22px; }

.conf { display: inline-block; font: 700 10.5px/1 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--sepia); border: 1px dashed var(--sepia); border-radius: 4px; padding: 3px 5px; margin-left: 6px; vertical-align: 2px; }
.small { font-size: 12.5px !important; color: var(--muted); margin-top: 8px !important; }
.lots { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; margin-top: 12px; max-width: 360px; }
.lot { aspect-ratio: 1; border: 1px solid var(--line); background: var(--paper); border-radius: 2px; font: 700 10px/1 var(--f-ui); display: grid; place-items: center; color: var(--accent-ink); }
.lot.fam { background: var(--accent); border-color: var(--accent); }
.lotkey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 13px; }
.lotkey b { color: var(--accent); }
.names { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.nmc { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; }
.nmc b { font-family: var(--f-display); font-size: 17px; }
.nmc small { color: var(--muted); font-size: 11.5px; }
.nmc:last-child { border-color: var(--accent); }
.arr { color: var(--accent); font-weight: 700; }
.nk { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.kids .kid { height: 100%; }
.after { grid-template-columns: 1fr; max-width: 640px; }
