/* FRAGIL · Quellen und Belege
   Layout: one long, calm reading page in the book world's colours; a sticky
   search bar; statement cards like marked-up book passages. */
:root {
  --ink: #0a0a0b; --ink-2: #141416; --ink-3: #1d1d20;
  --paper: #f4efe7; --ash: rgba(244,239,231,.38); --ash-2: rgba(244,239,231,.64);
  --accent: #ff3b1f; --accent-rgb: 255,59,31;
  --hair: rgba(244,239,231,.1); --glass: rgba(20,20,22,.78);
  --k-primaer: #ff5a3c; --k-zeitgenoessisch: #f5b14a; --k-fachliteratur: #7fb2ff; --k-nachweis: #b9a7ff; --k-daten: #5fd4a8;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --read: "Newsreader", "Iowan Old Style", Georgia, serif;
  --ui: "Inter", -apple-system, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
.grain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; opacity: .05; mix-blend-mode: overlay; image-rendering: pixelated; }
main { max-width: 860px; margin: 0 auto; padding: 0 max(18px, env(safe-area-inset-right, 0px)) 60px max(18px, env(safe-area-inset-left, 0px)); }

.top { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 12px) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.top > * { pointer-events: auto; }
.toplinks { display: flex; gap: 8px; }
.chip-g { height: 38px; min-width: 38px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; text-decoration: none; background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 0 0 1px var(--hair); }
.mark { padding: 0; width: 38px; } .mark img { height: 22px; }

/* hero */
.hero { padding: 40px 0 10px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin: 0; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(46px, 11vw, 96px); line-height: .92; letter-spacing: .005em; text-transform: uppercase; margin: 14px 0 18px; text-wrap: balance; }
.lead { font-family: var(--read); font-size: 19px; line-height: 1.55; color: var(--ash-2); max-width: 60ch; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0 0; }
.stats div { padding: 14px 14px 12px; border-radius: 18px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); }
.stats b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 7vw, 40px); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--ash-2); }

/* timeline barcode */
.timeline { margin: 28px 0 0; }
.timeline figcaption { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ash-2); margin-bottom: 10px; }
.link { color: var(--accent); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.tl-wrap { position: relative; height: 120px; border-radius: 16px; background: linear-gradient(180deg, var(--ink-2), #0e0e10); box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; cursor: crosshair; touch-action: pan-y; }
.tl-wrap canvas { width: 100%; height: 100%; display: block; }
.tl-sel { position: absolute; top: 0; bottom: 0; background: rgba(var(--accent-rgb), .16); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .7); border-radius: 6px; pointer-events: none; }
.tl-axis { position: relative; height: 18px; font-size: 11px; color: var(--ash); font-variant-numeric: tabular-nums; margin-top: 6px; }
.tl-axis span { position: absolute; transform: translateX(-50%); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--ash-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* sticky search bar */
.bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 58px); z-index: 20; margin: 30px 0 0; padding: 12px; border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); box-shadow: inset 0 0 0 1px var(--hair), 0 20px 50px rgba(0,0,0,.5); display: grid; gap: 10px; }
.bar > * { min-width: 0; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hair); }
.search svg { width: 18px; height: 18px; color: var(--ash-2); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hair); }
.seg button { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ash-2); }
.seg button.on { background: var(--paper); color: var(--ink); }
select { flex: 1; min-width: 0; height: 40px; border-radius: 12px; border: 0; padding: 0 12px; background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hair); font-size: 13.5px; }
.dice { height: 40px; padding: 0 14px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; }
.dice svg { width: 18px; height: 18px; }
.dice.roll svg { animation: roll .6s cubic-bezier(.2,.8,.2,1); }
@keyframes roll { from { transform: rotate(-200deg) scale(.7); } to { transform: none; } }
.kinds { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.kinds::-webkit-scrollbar { display: none; }
.kinds button { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--hair); color: var(--ash-2); display: inline-flex; align-items: center; gap: 6px; }
.kinds button i { width: 8px; height: 8px; border-radius: 50%; }
.kinds button.on { color: var(--paper); background: rgba(244,239,231,.1); }

.count { font-size: 13px; color: var(--ash-2); margin: 22px 4px 10px; }
.chap-h { margin: 34px 4px 12px; }
.chap-h small { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.chap-h h2 { font-family: var(--read); font-weight: 500; font-size: 22px; line-height: 1.25; margin: 4px 0 0; text-wrap: balance; }

/* statement card */
.card { border-radius: 22px; padding: 18px 18px 14px; margin: 0 0 12px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); scroll-margin-top: 200px; }
.card.hit { box-shadow: inset 0 0 0 2px var(--accent), 0 0 40px rgba(var(--accent-rgb), .25); }
.card-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--ash); font-variant-numeric: tabular-nums; }
.card-top a { text-decoration: none; }
.quote { font-family: var(--read); font-size: 20px; line-height: 1.5; margin: 10px 0 14px; }
.quote mark { color: var(--paper); background: linear-gradient(180deg, transparent 55%, rgba(var(--accent-rgb), .38) 55%); padding: 0 .1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.quote .q-hit { background: rgba(var(--accent-rgb), .55); color: #fff; border-radius: 3px; }
.note { font-size: 13px; line-height: 1.45; color: #ffd2c7; background: rgba(var(--accent-rgb), .14); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.src { display: grid; grid-template-columns: 4px 1fr; gap: 12px; padding: 12px 0 10px; box-shadow: 0 -1px 0 var(--hair); }
.src > i { border-radius: 4px; }
.src b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.src .who { font-size: 13px; color: var(--ash-2); margin-top: 2px; }
.src .loc { font-family: var(--read); font-size: 15px; line-height: 1.45; color: rgba(244,239,231,.78); margin: 6px 0 0; }
.src .kind { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.src .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn-s { height: 32px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; text-decoration: none; background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hair); }
.btn-s.primary { background: var(--paper); color: var(--ink); box-shadow: none; }
.card-foot { display: flex; justify-content: flex-end; margin-top: 4px; }
.card-foot button { font-size: 12px; color: var(--ash); }

/* bibliography */
.bib { border-radius: 18px; padding: 14px 16px; margin: 0 0 10px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); display: grid; grid-template-columns: 4px 1fr; gap: 12px; }
.bib > i { border-radius: 4px; }
.bib b { display: block; font-size: 15px; line-height: 1.35; }
.bib .who { font-size: 13px; color: var(--ash-2); margin-top: 2px; }
.bib details { margin-top: 8px; font-size: 13px; color: var(--ash-2); }
.bib summary { cursor: pointer; color: var(--paper); font-weight: 600; }
.bib details a { display: block; padding: 6px 0; text-decoration: none; color: var(--ash-2); }
.bib details a:hover { color: var(--paper); }
.letter { font-family: var(--display); font-size: 40px; color: var(--accent); margin: 26px 4px 8px; }

.more { text-align: center; margin: 18px 0; }
.empty { text-align: center; padding: 40px 10px; color: var(--ash-2); font-family: var(--read); font-size: 19px; }

/* origin chip + KPI view */
.origin { display: inline-block; margin-left: 8px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--ash-2); }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 6px 0 22px; }
.kpi { border-radius: 20px; padding: 16px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); }
.kpi b { display: block; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.kpi span { display: block; font-size: 13px; color: var(--paper); margin-top: 8px; font-weight: 600; }
.kpi small { display: block; font-size: 12px; color: var(--ash-2); margin-top: 4px; line-height: 1.4; }
.panel { border-radius: 22px; padding: 18px; margin: 0 0 14px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); }
.panel h3 { font-family: var(--display); font-weight: 400; font-size: 26px; margin: 0 0 4px; letter-spacing: .01em; }
.panel > p { font-size: 13px; color: var(--ash-2); margin: 0 0 14px; line-height: 1.45; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 4px 10px; align-items: center; margin: 0 0 10px; font-size: 13.5px; }
.hbar .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .val { text-align: right; color: var(--ash-2); font-variant-numeric: tabular-nums; }
.hbar .trk { grid-column: 1 / 3; height: 8px; border-radius: 8px; background: rgba(244,239,231,.08); overflow: hidden; display: flex; }
.hbar .trk i { display: block; height: 100%; }
.hbar.link { cursor: pointer; }
.hbar.link:hover .lbl { color: var(--accent); }
.rank { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: baseline; padding: 10px 0; box-shadow: 0 1px 0 var(--hair); font-size: 14px; cursor: pointer; }
.rank em { font-style: normal; font-family: var(--display); color: var(--accent); font-size: 18px; }
.rank small { display: block; color: var(--ash-2); font-size: 12px; margin-top: 2px; }
.rank .n { font-variant-numeric: tabular-nums; color: var(--ash-2); white-space: nowrap; }
@media (min-width: 700px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

/* footer + report sheet */
.foot { margin-top: 50px; }
.foot-card { border-radius: 26px; padding: 26px 22px; background: radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), .22), transparent 60%), var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair); }
.foot-card h2 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 0 0 10px; }
.foot-card p { font-family: var(--read); font-size: 18px; line-height: 1.55; color: var(--ash-2); margin: 0 0 18px; }
.cta { height: 50px; padding: 0 22px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 12px 30px rgba(var(--accent-rgb), .35); }
.fine { font-size: 12px; color: var(--ash); margin: 18px 4px 0; }
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; border-radius: 26px 26px 0 0; background: #121214; box-shadow: inset 0 0 0 1px var(--hair); padding: 22px 20px calc(env(safe-area-inset-bottom, 0px) + 24px); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 26px; } }
.sheet h2 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0 0 10px; }
.sheet label { display: grid; gap: 6px; font-size: 13px; color: var(--ash-2); margin: 0 0 12px; }
.sheet input, .sheet textarea { border: 0; border-radius: 12px; padding: 12px 14px; font-size: 16px; background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hair); }
.sheet textarea { min-height: 130px; resize: vertical; }
.sheet .x { float: right; width: 36px; height: 36px; border-radius: 50%; background: var(--ink-3); font-size: 20px; }
.sheet .msg { font-size: 14px; margin: 10px 0 0; }
.hp { position: absolute; left: -9999px; }

@media (min-width: 760px) {
  .controls { flex-wrap: nowrap; }
  select { flex: 0 1 300px; }
}
@media (prefers-reduced-motion: reduce) { .dice.roll svg { animation: none; } }
