/* Inter (SIL Open Font License), self-hosted: no request to Google, nothing to consent to. */
@font-face {
    font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url(fonts/inter-latin-ext.woff2) format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url(fonts/inter-latin.woff2) format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg: #fbfbfd; --surface: #ffffff; --text: #151826; --muted: #5a6078; --line: #e4e6ef;
    --accent: #5b47e0; --accent-2: #0ea5b7; --accent-soft: #efedfd; --warn-soft: #fff4e5;
    --radius: 16px; --measure: 720px;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #0d1020; --surface: #151a2e; --text: #eceefa; --muted: #a2a8c4; --line: #262c47; --accent: #9d8cff; --accent-2: #4dd4e3; --accent-soft: #1d2140; --warn-soft: #2a2218; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }  /* kotvy nezajedou pod lištu nahoře */
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 18px/1.72 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
strong { font-weight: 650; }
.wrap { width: min(var(--measure), 100% - 32px); margin: 0 auto; }

header.hero { padding: 56px 0 56px; background: radial-gradient(1200px 420px at 50% -60px, var(--accent-soft), transparent); }
.eyebrow { font-weight: 700; font-size: 13px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 16px 0 0; font-size: clamp(42px, 8vw, 72px); line-height: 1.02; letter-spacing: -.045em; font-weight: 800; }
.lead { margin: 22px 0 0; font-size: 21px; line-height: 1.6; color: var(--muted); }

nav.toc { margin: 36px 0 0; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
nav.toc b { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
nav.toc ol { margin: 10px 0 0; padding-left: 22px; columns: 2 230px; font-size: 16px; line-height: 1.95; }
nav.toc a { color: var(--text); text-decoration: none; }
nav.toc a:hover { color: var(--accent); }

main section { padding: 44px 0 8px; scroll-margin-top: 64px; }
h2 { margin: 52px 0 16px; font-size: clamp(28px, 4.4vw, 36px); line-height: 1.15; letter-spacing: -.03em; font-weight: 750; }
main > h2:first-child { margin-top: 0; }
h3 { margin: 30px 0 8px; font-size: 20px; letter-spacing: -.015em; font-weight: 700; }
p { margin: 0 0 18px; }
blockquote { margin: 26px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent); color: var(--muted); font-size: 19px; font-style: italic; }
blockquote cite { display: block; margin-top: 8px; font-style: normal; font-size: 14px; }

.levels { display: grid; gap: 12px; margin: 22px 0; }
.level { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.level .name { font-weight: 800; font-size: 18px; }
.level .name small { font-weight: 600; color: var(--muted); margin-left: 6px; }
.level p { margin: 6px 0 0; font-size: 16.5px; color: var(--muted); }
.level.asi { border-color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }

.callout { margin: 24px 0; padding: 20px 22px; border-radius: var(--radius); background: var(--accent-soft); font-size: 17px; }
.callout .num { display: block; font-weight: 800; font-size: 40px; line-height: 1.1; color: var(--accent); letter-spacing: -.035em; margin-bottom: 6px; }

/* "Did you know" asides that break up longer sections. */
.aside { margin: 26px 0; padding: 18px 22px 4px; border-radius: var(--radius); background: var(--warn-soft); font-size: 16.5px; }
.aside b.tag { display: block; margin-bottom: 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.timeline { list-style: none; margin: 22px 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; margin: 0 0 18px; padding-left: 22px; font-size: 16.5px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline b { display: block; font-size: 15px; color: var(--accent); letter-spacing: .02em; }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 22px 0; }
.compare div { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 15.5px; line-height: 1.55; }
.compare b { display: block; font-size: 16px; margin-bottom: 4px; }

ul.plain { padding-left: 22px; }
ul.plain li { margin: 8px 0; }

details { border-bottom: 1px solid var(--line); padding: 16px 0; }
details summary { cursor: pointer; font-weight: 700; font-size: 18px; line-height: 1.4; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; float: right; color: var(--muted); }
details[open] summary::after { content: "−"; }
details p { margin: 10px 0 0; }

dl.glossary { margin: 0; }
dl.glossary dt { font-weight: 700; font-size: 17px; margin-top: 18px; }
dl.glossary dd { margin: 4px 0 0; color: var(--muted); font-size: 16.5px; }

ol.sources { padding-left: 22px; font-size: 16px; }
ol.sources li { margin: 8px 0; }

footer { margin-top: 64px; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; color: var(--muted); }
footer a { color: inherit; }

.lang { flex: none; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: 13px; line-height: 1; }
.lang a, .lang span { padding: 7px 11px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.lang span { background: var(--accent); color: #fff; }

/* Inline SVG charts: one hue (accent), text in ink tokens, recessive axes. */
figure.chart { margin: 26px 0; padding: 18px 18px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
figure.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
figure.chart figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.chart .t { fill: var(--text); font: 600 16px Inter, system-ui, sans-serif; }
.chart .m { fill: var(--muted); font: 500 14px Inter, system-ui, sans-serif; }
.chart .h { fill: var(--text); font: 700 14px Inter, system-ui, sans-serif; }
.chart .bar { fill: var(--accent); }
.chart .bar.soft { fill: var(--muted); opacity: .45; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .link { stroke: var(--accent); stroke-width: 2; }
.chart .old { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.chart .new { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .arrow { fill: var(--accent); }
.chart g[tabindex]:focus { outline: none; }
.chart g:hover .bar, .chart g:focus .bar { opacity: .85; }

/* Justified body text; hyphenation keeps the word gaps even in the narrow mobile column. */
main p, main li, main dd, .lead { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
/* Do bloku jen souvisly text: nadpisy, karty, popisky a navigace by se roztrhaly. */
main h2, main h3, main .topics li, main .topics *, main .timeline li, main figcaption, main .compare div, main .level p,
main table, main summary, .sidenav, .pager, footer { text-align: left; hyphens: manual; -webkit-hyphens: manual; }

/* ---------- Navigation for the long article (nav.js) ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.sidenav { position: fixed; z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.sidenav.shown { opacity: 1; pointer-events: auto; }
.sidenav ol { list-style: none; margin: 0; padding: 0; }
.sidenav a { display: block; padding: 5px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35; text-align: left; hyphens: manual; }
.sidenav a:hover { color: var(--text); }
.sidenav a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 650; }
.sidenav-bar { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.sidenav-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Wide screens: contents in the left margin next to the text. */
@media (min-width: 1200px) {
    .sidenav { top: 96px; left: max(16px, calc(50% - 360px - 260px)); width: 220px; transform: translateX(-8px); }
    .sidenav.shown { transform: none; }
    .sidenav-bar { display: block; margin: 0 0 10px 14px; cursor: default; pointer-events: none; }
    .sidenav-current, .sidenav-chev { display: none; }
}

/* Narrower screens: a slim bar with the current chapter, tap to open the contents. */
@media (max-width: 1199px) {
    .sidenav { top: 52px; left: 0; right: 0; transform: translateY(-110%); background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
    .sidenav.shown { transform: none; }
    .sidenav-bar { display: flex; align-items: center; gap: 10px; width: min(var(--measure), 100% - 32px); margin: 0 auto; padding: 11px 0; cursor: pointer; text-align: left; }
    .sidenav-current { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; font-weight: 650; }
    .sidenav-chev { color: var(--muted); transition: transform .2s; }
    .sidenav.open .sidenav-chev { transform: rotate(180deg); }
    .sidenav ol { display: none; width: min(var(--measure), 100% - 32px); margin: 0 auto; padding: 0 0 12px; max-height: 65vh; overflow-y: auto; }
    .sidenav.open ol { display: block; }
    .sidenav a { padding: 9px 12px; font-size: 16px; }
    html { scroll-padding-top: 116px; }
}

.totop { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.1); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.totop.shown { opacity: 1; pointer-events: auto; transform: none; }
.totop:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .sidenav, .totop { transition: none; } }
.chart .layer { fill: var(--accent-soft); stroke: var(--line); stroke-width: 1; }
.chart .layer.key { stroke: var(--accent); stroke-width: 2; }

/* ---------- Site structure: home topics, subpage header, pager ---------- */
.lead-note { margin: 14px 0 0; color: var(--muted); font-size: 16px; }
.note { margin: 24px 0; padding: 16px 20px; border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--accent-soft); font-size: 17px; }
.note p { margin: 0; }

.topics { list-style: none; margin: 22px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.topic { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.topic:hover, .topic:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.topic-n { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.topic-name { font-size: 18px; font-weight: 750; letter-spacing: -.01em; line-height: 1.3; }
.topic-desc { font-size: 14.5px; line-height: 1.5; color: var(--muted); text-align: left; hyphens: manual; }

body.sub header.hero { padding: 44px 0 32px; }
body.sub h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.08; letter-spacing: -.035em; }
/* Lišta nahoře: drobečky a jazyk, zůstává při scrollování. */
.topbar { position: sticky; top: 0; z-index: 35; height: 52px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%; width: min(var(--measure), 100% - 32px); margin: 0 auto; }
.breadcrumb { flex: 1; min-width: 0; }
.breadcrumb ol { list-style: none; display: flex; align-items: center; margin: 0; padding: 0; font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.breadcrumb li { flex: none; }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; color: var(--muted); opacity: .5; font-weight: 700; }
.breadcrumb .crumb-home a { color: var(--text); font-weight: 750; }
.breadcrumb .crumb-current { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 520px) { .breadcrumb .crumb-topics { display: none; } }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; }
.pager a { flex: 1; max-width: 50%; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; line-height: 1.35; }
.pager a:hover { border-color: var(--accent); }
.pager a small { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }

.footer-topics { margin: 0 0 8px; }
footer p { margin: 0 0 6px; }

main table { width: 100%; margin: 20px 0; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
main th, main td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
main th { font-weight: 700; background: var(--accent-soft); }
@media (max-width: 600px) { main table { display: block; overflow-x: auto; } }
