/* Terra Chronica — museum-dark theme */
:root {
  --ink: #080d1a; --bg: #0a0f1e; --panel: #111a30; --panel2: #17223d; --line: rgba(236, 229, 211, .13);
  --text: #ece5d3; --dim: #a9a691; --faint: #77778a;
  --gold: #d9b56a; --gold2: #f1d58a; --teal: #5ec4b6; --ember: #e2664a; --violet: #b79cf0; --sky: #6fb1f0;
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --navh: 64px; --r: 14px; --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--navh) + 60px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
em { font-style: italic; color: var(--gold2); }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; border-radius: 6px; }
code { background: var(--panel2); padding: .15em .45em; border-radius: 6px; font-size: .9em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #111; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 8px; }
.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--dim); }
.eyebrow, .kicker { font: 600 .74rem/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 1em; }
.kicker { letter-spacing: .1em; margin-bottom: .6em; }
.lede { font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: #d4cdb9; max-width: 62ch; }
.src { font-size: .78rem; color: var(--faint); margin-top: .8em; }
.src a { color: var(--dim); text-decoration: underline; text-decoration-color: var(--line); }
.more { font-weight: 600; font-size: .92rem; white-space: nowrap; }
.empty { text-align: center; color: var(--dim); padding: 40px 0; }

/* starfield */
.stars { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(1200px 700px at 78% -10%, rgba(60, 100, 190, .28), transparent 60%),
  radial-gradient(900px 600px at -10% 30%, rgba(217, 181, 106, .08), transparent 60%), var(--bg); }
.stars::before, .stars::after { content: ''; position: absolute; inset: 0; background-repeat: repeat;
  background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 140px 80px, rgba(255,255,255,.7), transparent), radial-gradient(1.4px 1.4px at 90px 190px, rgba(255,240,200,.8), transparent), radial-gradient(1px 1px at 230px 140px, rgba(255,255,255,.55), transparent), radial-gradient(1px 1px at 300px 260px, rgba(200,220,255,.7), transparent);
  background-size: 340px 300px; opacity: .5; animation: twinkle 7s ease-in-out infinite alternate; }
.stars::after { background-size: 520px 460px; opacity: .3; animation-duration: 11s; transform: rotate(8deg) scale(1.4); }
@keyframes twinkle { to { opacity: .22; } }

/* buttons, chips, pills */
.btn { display: inline-flex; align-items: center; gap: .5em; padding: .72em 1.25em; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text); font-weight: 600; font-size: .93rem; transition: .2s; text-decoration: none !important; }
.btn:hover:not(:disabled) { border-color: var(--gold); background: rgba(217, 181, 106, .12); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #1b1404; border-color: transparent; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(135deg, var(--gold2), var(--gold)); }
.btn:disabled { opacity: .35; cursor: default; }
.linkbtn { background: none; border: 0; color: var(--gold2); font-weight: 600; padding: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .42em 1em; font-size: .86rem; font-weight: 500; color: var(--dim); transition: .2s; display: inline-flex; align-items: center; gap: .5em; }
.chips button:hover { color: var(--text); border-color: var(--dim); }
.chips button[aria-selected="true"] { background: var(--gold); color: #1b1404; border-color: var(--gold); font-weight: 600; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: .3em .85em; font-size: .86rem; background: rgba(255, 255, 255, .03); color: var(--text); }
.flagpill { display: inline-flex; align-items: center; gap: .5em; text-decoration: none !important; }
.flagpill img { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; }
.flagpill:hover { border-color: var(--gold); }

/* reveal */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.rv.in { opacity: 1; transform: none; }
#view.enter > * { animation: viewin .5s ease backwards; }
@keyframes viewin { from { opacity: 0; } } /* opacity only: a transform here would trap position:fixed children */
.loading { display: flex; gap: 8px; padding: 30px 0; justify-content: center; }
.loading i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: bounce 1s infinite ease-in-out; }
.loading i:nth-child(2) { animation-delay: .15s; } .loading i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* ── nav ── */
.nav { position: fixed; inset: 0 0 auto 0; height: var(--navh); z-index: 60; display: flex; align-items: center; gap: 18px; padding: 0 max(20px, calc((100vw - 1320px) / 2)); transition: background .3s, box-shadow .3s; }
.nav.solid, body:not([data-view="home"]) .nav { background: rgba(8, 13, 26, .86); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 500 1.28rem var(--serif); text-decoration: none !important; white-space: nowrap; }
.brand svg { color: var(--gold); transition: transform .8s; } .brand:hover svg { transform: rotate(180deg); }
.links { display: flex; gap: 2px; flex: none; }
.links a { color: var(--dim); padding: .5em .85em; border-radius: 999px; font-size: .92rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.links a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.links a.on { color: var(--gold2); background: rgba(217, 181, 106, .12); }
.search { position: relative; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; flex: 0 1 300px; min-width: 150px; margin-left: auto; color: var(--dim); transition: .2s; }
.search:focus-within { border-color: var(--gold); background: rgba(8, 13, 26, .95); color: var(--text); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: .62em 0; font-size: .92rem; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 600 .7rem var(--sans); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--faint); }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 290px; margin: 0; padding: 6px; list-style: none; background: #0e1629; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); z-index: 80; max-height: 60vh; overflow: auto; }
.search-results li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: var(--text); }
.search-results li.on, .search-results li:hover { background: rgba(217, 181, 106, .14); }
.search-results li.none { color: var(--dim); cursor: default; background: none; }
.search-results img { width: 32px; height: 24px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px var(--line); }
.sr-name { display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; flex: 1; }
.sr-name small { color: var(--dim); font-weight: 400; font-size: .78rem; }
.sr-tag { font-size: .68rem; color: var(--faint); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }

main { padding-top: var(--navh); min-height: 80vh; outline: 0; }
.boot { display: grid; place-items: center; min-height: 70vh; align-content: center; gap: 20px; color: var(--dim); }
.boot-globe { width: 70px; height: 70px; border-radius: 50%; border: 2px solid var(--gold); border-right-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { border-top: 1px solid var(--line); margin-top: 90px; padding: 30px 20px 44px; text-align: center; color: var(--faint); font-size: .84rem; }
.notfound { text-align: center; padding: 16vh 0; }

/* tooltip, lightbox, modal */
.tip { position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none; display: flex; gap: 12px; align-items: center; background: rgba(8, 13, 26, .94); border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; box-shadow: var(--shadow); }
.tip[hidden] { display: none; }
.tip img { width: 40px; height: 30px; object-fit: cover; border-radius: 3px; }
.tip strong { display: block; font: 500 1.05rem var(--serif); } .tip span { font-size: .78rem; color: var(--dim); }
.lightbox, .modal { position: fixed; inset: 0; grid-template-columns: minmax(0, 1fr); justify-items: center; z-index: 120; background: rgba(3, 6, 14, .9); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 24px; animation: fade .25s; }
.lightbox[hidden], .modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { margin: 0; max-width: min(1200px, 94vw); text-align: center; }
.lightbox img { max-height: 80vh; max-width: 100%; margin: auto; border-radius: 8px; box-shadow: var(--shadow); background: #fff1; }
.lightbox figcaption { color: #d4cdb9; font-size: .9rem; margin-top: 14px; max-width: 80ch; margin-inline: auto; }
.lb-close { position: absolute; top: 14px; right: 16px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(8, 13, 26, .8); font-size: 1.5rem; line-height: 1; z-index: 2; }
.lb-close:hover { border-color: var(--gold); color: var(--gold2); }
.modal-card { position: relative; width: min(980px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); animation: pop .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { transform: translateY(24px) scale(.97); opacity: 0; } }
img.zoomable { cursor: zoom-in; }

/* ── home ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 20px; min-height: calc(100vh - var(--navh)); padding: 20px max(20px, calc((100vw - 1320px) / 2)) 40px; }
.hero h1 { font-size: clamp(2.6rem, 5.6vw, 5rem); font-weight: 400; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 40px; }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; }
.hero-stat b { display: block; font: 500 clamp(1.7rem, 3vw, 2.4rem)/1.1 var(--serif); color: var(--gold2); font-variant-numeric: tabular-nums; }
.hero-stat span { display: block; font-weight: 600; font-size: .92rem; } .hero-stat small { color: var(--faint); font-size: .76rem; }
.hero-globe { position: relative; aspect-ratio: 1; max-height: calc(100vh - var(--navh) - 40px); width: 100%; justify-self: center; }
canvas.globe { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
canvas.globe:active { cursor: grabbing; }
.globe-ctl { position: absolute; right: 4%; bottom: 10%; display: flex; flex-direction: column; gap: 6px; }
.globe-ctl button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(8, 13, 26, .7); font-size: 1.1rem; }
.globe-ctl button:hover { border-color: var(--gold); color: var(--gold2); }
.globe-hint { position: absolute; left: 0; right: 0; bottom: -4px; text-align: center; font-size: .78rem; color: var(--faint); margin: 0; letter-spacing: .06em; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-head h2 { margin: 0; }
.spot-row { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 16px; scrollbar-width: thin; scrollbar-color: var(--panel2) transparent; }
.spot { flex: 0 0 150px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; color: var(--text); text-decoration: none !important; transition: .25s; }
.spot:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: var(--shadow); }
.spot img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; margin-bottom: 10px; box-shadow: 0 0 0 1px var(--line); }
.spot span { display: block; font: 500 1.05rem/1.2 var(--serif); } .spot small { color: var(--dim); font-size: .78rem; }
.spot-row.small .spot { flex-basis: 112px; padding: 9px; } .spot-row.small .spot span { font-size: .9rem; }
.portals { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 70px; }
.portal { position: relative; min-height: 380px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); display: flex; align-items: flex-end; color: var(--text); text-decoration: none !important; background: var(--panel); isolation: isolate; }
.portal > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s; filter: saturate(.85); }
.portal::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 13, 26, .15), rgba(8, 13, 26, .95) 78%); }
.portal:hover > img, .portal:hover .strata { transform: scale(1.06); }
.portal > div:last-child { padding: 30px; }
.portal h3 { font-size: 2.1rem; } .portal p { color: #d4cdb9; max-width: 46ch; }
.go { font-weight: 700; color: var(--gold2); }
.strata { position: absolute; inset: 0; z-index: -2; display: flex; flex-direction: column; transition: transform 1.2s; }
.strata i { display: block; opacity: .9; }
.trust { margin-top: 80px; text-align: center; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 28px 0; text-align: left; }
.trust-grid div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.trust-grid h4 { color: var(--gold2); } .trust-grid p { color: var(--dim); font-size: .93rem; margin: 0; }

/* ── countries list ── */
.page-head { padding: 54px 0 26px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; padding: 14px 0; border-block: 1px solid var(--line); position: sticky; top: var(--navh); background: rgba(10, 15, 30, .92); backdrop-filter: blur(12px); z-index: 20; }
.filter, .sel select { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 999px; padding: .45em 1em; font-size: .88rem; outline: 0; }
.filter:focus, .sel select:focus { border-color: var(--gold); }
.sel select option { background: var(--panel); }
.sel, .tog { font-size: .86rem; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.tog input { accent-color: var(--gold); }
.count { color: var(--faint); font-size: .84rem; margin: 16px 0; }
.c-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.c-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--text); text-decoration: none !important; transition: transform .25s, border-color .25s, box-shadow .25s; animation: cardin .5s both; animation-delay: calc(var(--i) * 18ms); }
@keyframes cardin { from { opacity: 0; transform: translateY(14px); } }
.c-card:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: var(--shadow); }
.c-flag { aspect-ratio: 4/3; overflow: hidden; background: #0004; }
.c-flag img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.c-card:hover .c-flag img { transform: scale(1.07); }
.c-meta { padding: 11px 13px 13px; }
.c-meta strong { display: block; font: 500 1.08rem/1.2 var(--serif); }
.c-meta span { display: block; color: var(--gold2); font-size: .84rem; font-variant-numeric: tabular-nums; }
.c-meta small { color: var(--faint); font-size: .76rem; }
.c-rank { position: absolute; top: 8px; left: 8px; background: rgba(8, 13, 26, .85); border-radius: 99px; padding: 1px 9px; font: 600 .74rem var(--sans); color: var(--gold2); font-style: normal; }

/* ── country page ── */
.c-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.c-hero-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(60px) saturate(1.3); opacity: .28; z-index: -1; }
.c-hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 30px; align-items: center; padding-block: 34px 10px; }
.crumbs { font-size: .8rem; color: var(--faint); margin-bottom: 22px; } .crumbs a { color: var(--dim); }
.flag-wave { position: relative; width: clamp(150px, 20vw, 230px); border-radius: 8px; overflow: hidden; box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .15); margin-bottom: 22px; transform-origin: left center; animation: flagin 1s cubic-bezier(.2, .8, .2, 1) both; }
.flag-wave img { width: 100%; }
.flag-wave::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 0 18%, rgba(255,255,255,.22) 28%, transparent 40%, rgba(0,0,0,.2) 52%, transparent 64%, rgba(255,255,255,.16) 76%, transparent 88%); background-size: 220% 100%; animation: wave 5s linear infinite; mix-blend-mode: soft-light; }
@keyframes wave { from { background-position: 220% 0; } to { background-position: 0 0; } }
@keyframes flagin { from { transform: perspective(600px) rotateY(-70deg); opacity: 0; } }
.c-id h1 { margin-bottom: .1em; font-size: clamp(2.6rem, 6.5vw, 5.2rem); }
.official { color: var(--dim); font: italic 400 1.12rem var(--serif); min-height: 1em; } .native { font-style: normal; color: var(--faint); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag { font-size: .76rem; font-weight: 600; border-radius: 999px; padding: .28em .9em; border: 1px solid var(--line); color: var(--dim); }
.tag.member { color: var(--teal); border-color: rgba(94, 196, 182, .45); } .tag.observer { color: var(--sky); border-color: rgba(111, 177, 240, .45); } .tag.territory, .tag.other { color: var(--violet); border-color: rgba(183, 156, 240, .4); }
.c-loc { aspect-ratio: 1; width: min(100%, 360px); justify-self: end; }
.c-loc canvas { border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 0 60px rgba(110,170,255,.25); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-block: 26px 34px; }
.stat { background: rgba(13, 20, 38, .9); padding: 18px 20px; }
.stat span { display: block; font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.stat b { display: block; font: 500 clamp(1.25rem, 2vw, 1.7rem)/1.25 var(--serif); color: var(--gold2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat small { color: var(--faint); font-size: .74rem; }
.subnav { position: sticky; top: var(--navh); z-index: 30; background: rgba(8, 13, 26, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subnav a { padding: 13px 16px; color: var(--dim); font-size: .9rem; font-weight: 500; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; }
.subnav a:hover { color: var(--text); } .subnav a.on { color: var(--gold2); border-color: var(--gold); }
.sec { padding-block: 64px 10px; }
.two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.prose p { font: 400 1.08rem/1.75 var(--serif); color: #ddd6c2; }
.prose p:first-child::first-letter { font-size: 3.3em; float: left; line-height: .82; padding: .08em .1em 0 0; color: var(--gold2); font-weight: 500; }
.facts-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.facts-card img.lead { width: 100%; max-height: 260px; object-fit: cover; }
.facts-card dl { margin: 0; padding: 8px 20px 14px; display: grid; grid-template-columns: auto 1fr; }
dt { color: var(--faint); font-size: .8rem; padding: 9px 16px 9px 0; border-bottom: 1px solid var(--line); }
dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
dl > :nth-last-child(-n+2) { border-bottom: 0; }
.neigh { margin-top: 34px; } .langs { margin-top: 22px; }
.people-data { display: grid; gap: 20px; }
.viz h4 small { color: var(--faint); font-weight: 400; }
.bar { display: flex; height: 34px; border-radius: 9px; overflow: hidden; gap: 2px; }
.bar i { display: grid; place-items: center; min-width: 3px; font: 700 .78rem var(--sans); color: #10141f; transform-origin: left; animation: grow 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.rv:not(.in) .bar i { animation: none; transform: scaleX(0); }
@keyframes grow { from { transform: scaleX(0); } }
.legend { font-size: .78rem; color: var(--dim); margin: 8px 0 0; display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mini-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; }
.mini-tiles div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.mini-tiles span { display: block; font-size: .74rem; color: var(--faint); } .mini-tiles b { font: 500 1.2rem var(--serif); color: var(--gold2); display: block; } .mini-tiles small { color: var(--faint); font-size: .7rem; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.fact { background: linear-gradient(160deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; gap: 14px; transition: .3s; }
.rv.in .fact { animation: cardin .6s both; animation-delay: calc(var(--i) * 70ms); }
.fact:hover { transform: translateY(-4px) rotate(-.4deg); border-color: var(--gold); }
.fact.curated { border-color: rgba(217, 181, 106, .4); background: linear-gradient(160deg, rgba(217, 181, 106, .14), var(--panel)); }
.fi { font-size: 1.5rem; line-height: 1.2; color: var(--gold2); } .fact p { margin: 0; font-size: .96rem; }
.history { background: linear-gradient(180deg, transparent, rgba(17, 26, 48, .7) 12%, rgba(17, 26, 48, .7) 88%, transparent); margin-top: 50px; padding-block: 60px; }
.lead-fig { margin: 0; } .lead-fig img { border-radius: var(--r); width: 100%; max-height: 340px; object-fit: cover; }
.history h3 { margin-top: 40px; }
.stones { list-style: none; margin: 18px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); display: grid; gap: 4px; }
.stones li { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 8px 0; }
.stones li::before { content: ''; position: absolute; left: -29px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--bg); }
.stones li.world::before { background: var(--c, var(--teal)); }
.stones time { font: 500 1.05rem var(--serif); color: var(--gold2); } .stones p { margin: 0; }
.world-tag { font-size: .68rem; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; margin-left: 8px; color: var(--faint); white-space: nowrap; }
.chap-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 34px; align-items: start; margin-top: 18px; }
.chap-list { list-style: none; margin: 0; padding: 0; position: sticky; top: calc(var(--navh) + 64px); max-height: calc(100vh - var(--navh) - 90px); overflow: auto; scrollbar-width: thin; border-left: 2px solid var(--line); }
.chap-list button { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--dim); font-size: .93rem; line-height: 1.35; transition: .2s; }
.chap-list button i { font: 500 .8rem var(--serif); color: var(--faint); font-style: normal; padding-top: 2px; }
.chap-list button:hover { color: var(--text); }
.chap-list button.on { color: var(--gold2); border-left-color: var(--gold); background: linear-gradient(90deg, rgba(217, 181, 106, .12), transparent); }
.reader { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 3.4vw, 44px); min-height: 300px; scroll-margin-top: calc(var(--navh) + 70px); }
.reader h3 { font-size: 1.9rem; margin-top: 0; }
.wiki { font: 400 1.06rem/1.78 var(--serif); color: #ddd6c2; }
.wiki::after { content: ''; display: block; clear: both; }
.wiki h3, .wiki h4, .wiki h5 { font: 600 1.15rem var(--sans); color: var(--text); margin: 1.6em 0 .5em; clear: both; }
.wiki figure { float: right; clear: right; width: min(300px, 44%); margin: 4px 0 18px 26px; }
.wiki figure img { width: 100%; border-radius: 10px; transition: transform .3s; } .wiki figure img:hover { transform: scale(1.03); }
.wiki figcaption, .dt-intro figcaption { font: 400 .78rem/1.45 var(--sans); color: var(--faint); margin-top: 7px; }
.wiki > img { display: none; }
.wiki a { text-decoration: underline; text-decoration-color: rgba(241, 213, 138, .35); text-underline-offset: 3px; }
.wiki a.inlink { color: var(--teal); text-decoration-color: rgba(94, 196, 182, .4); }
.wiki ul, .wiki ol { padding-left: 1.3em; } .wiki blockquote { border-left: 3px solid var(--gold); margin: 1em 0; padding: .2em 1.2em; color: var(--dim); }
.reader-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.reader-foot .btn { max-width: 48%; text-align: left; }
.gallery { columns: 4 240px; column-gap: 14px; }
.gallery figure { break-inside: avoid; margin: 0 0 14px; position: relative; border-radius: 12px; overflow: hidden; cursor: zoom-in; animation: cardin .6s both; animation-delay: calc(var(--i) * 60ms); background: var(--panel); }
.gallery img { width: 100%; transition: transform .6s; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption { position: absolute; inset: auto 0 0 0; padding: 30px 12px 10px; font-size: .78rem; line-height: 1.35; background: linear-gradient(transparent, rgba(3, 6, 14, .92)); opacity: 0; transform: translateY(8px); transition: .3s; }
.gallery figure:hover figcaption, .gallery figure:focus figcaption { opacity: 1; transform: none; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; margin-top: 70px; }
.pager a { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; color: var(--text); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; text-decoration: none !important; transition: .2s; font: 500 1.1rem var(--serif); }
.pager a:hover { border-color: var(--gold); transform: translateY(-3px); }
.pager a:last-child { justify-content: flex-end; text-align: right; }
.pager small { flex-basis: 100%; font: 600 .7rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.pager img { width: 34px; height: 25px; object-fit: cover; border-radius: 3px; }

/* ── timeline ── */
.timeline { display: flex; flex-direction: column; }
.tl-head { padding: 22px max(20px, calc((100vw - 1320px) / 2)) 14px; display: grid; gap: 12px; }
.tl-title { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tl-title h1 { font-size: clamp(1.8rem, 3.6vw, 2.9rem); margin: 0; } .tl-title .eyebrow { margin-bottom: .3em; }
.tl-flag { width: 76px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.tl-country-links { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tl-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.search.pick { flex: 0 0 240px; margin-left: 0; }
.theme-chips button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.theme-chips button[aria-pressed="true"] { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.theme-chips button[aria-pressed="false"] { opacity: .5; text-decoration: line-through; }
/* sticky navigation bar */
.tl-bar { position: sticky; top: var(--navh); z-index: 35; display: grid; gap: 8px; padding: 10px max(20px, calc((100vw - 1320px) / 2)); background: rgba(8, 13, 26, .94); backdrop-filter: blur(14px); border-block: 1px solid var(--line); }
.tl-bar-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tl-bar .era-chips { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tl-bar .era-chips button { flex: none; white-space: nowrap; padding: .34em .9em; }
.tl-bar-scale { font-size: .72rem; color: var(--faint); }
.tl-bar-scale .tl-mini { flex: 1; }
.tl-end { white-space: nowrap; }
.tl-mode { display: flex; flex: none; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.tl-mode button { border: 0; background: none; padding: .38em .95em; font-size: .84rem; font-weight: 600; color: var(--dim); }
.tl-mode button[aria-pressed="true"] { background: var(--gold); color: #1b1404; }
.tl-mini { position: relative; height: 22px; background: rgba(255, 255, 255, .04); border-radius: 6px; }
.tl-mini-era { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--line); }
.tl-mini-era:nth-child(odd) { background: rgba(255, 255, 255, .035); }
.tl-mini b { position: absolute; top: 3px; width: 3px; height: 16px; margin-left: -1px; border-radius: 2px; cursor: pointer; opacity: .85; }
.tl-mini b:hover { transform: scaleY(1.5); opacity: 1; }
.tl-mini-view { position: absolute; top: -3px; bottom: -3px; border: 2px solid var(--gold2); border-radius: 6px; pointer-events: none; transition: left .2s, width .2s; box-shadow: 0 0 14px rgba(241, 213, 138, .4); }
.tl-note { font-size: .78rem; color: var(--faint); margin: 0; }
.tl-hud { font: 500 .92rem var(--serif); color: var(--dim); white-space: nowrap; min-width: 190px; text-align: right; } .tl-hud b { color: var(--gold2); font-weight: 500; }
.tl-river { position: relative; }
.tl-river[hidden], .tl-list[hidden] { display: none; }
.tl-scroller { height: clamp(460px, calc(100vh - var(--navh) - 150px), 700px); overflow-x: auto; overflow-y: hidden; cursor: grab; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; border-block: 1px solid var(--line); background: linear-gradient(180deg, rgba(17, 26, 48, .0), rgba(17, 26, 48, .8) 50%, rgba(17, 26, 48, 0)); outline-offset: -3px; }
.tl-scroller.dragging { cursor: grabbing; user-select: none; } .tl-scroller.dragging * { pointer-events: none; }
.tl-track { display: flex; height: 100%; width: max-content; padding-right: 30vw; }
.tl-era { display: flex; height: 100%; position: relative; }
.tl-era::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: linear-gradient(90deg, var(--gold), rgba(217, 181, 106, .25)); }
.tl-era > header { width: 300px; flex: none; align-self: center; padding: 26px 30px; margin: 0 20px 0 max(20px, calc((100vw - 1320px) / 2)); background: var(--bg); border: 1px solid var(--gold); border-radius: 18px; position: relative; z-index: 2; box-shadow: var(--shadow); }
.tl-era + .tl-era > header { margin-left: 60px; }
.tl-era > header small { color: var(--gold); font-weight: 600; letter-spacing: .08em; font-size: .72rem; text-transform: uppercase; }
.tl-era > header h2 { font-size: 1.7rem; margin: .2em 0 .3em; } .tl-era > header p { color: var(--dim); font-size: .88rem; margin: 0; }
.tl-events { display: flex; height: 100%; padding: 0 40px; }
.tl-card { position: relative; width: 236px; margin-inline: -42px; height: 100%; background: none; border: 0; padding: 0; flex: none; text-align: left; pointer-events: none; }
.tl-card > * { pointer-events: auto; }
.tl-box { position: absolute; left: 8px; right: 8px; display: block; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 12px; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.tl-card.high .tl-box { bottom: calc(50% + 30px); } .tl-card.low .tl-box { top: calc(50% + 30px); }
.tl-box img { width: 100%; height: clamp(60px, 11vh, 110px); object-fit: cover; object-position: center 30%; }
.tl-box strong { display: block; padding: 9px 12px 2px; font: 500 1rem/1.25 var(--serif); }
.tl-box small { display: block; padding: 0 12px 10px; font-size: .7rem; color: var(--c); font-weight: 600; }
.tl-card:hover .tl-box, .tl-card:focus-visible .tl-box, .tl-card.current .tl-box { transform: scale(1.05); box-shadow: var(--shadow); border-color: var(--c); z-index: 3; }
.tl-card::before { content: ''; position: absolute; left: 50%; width: 2px; height: 30px; background: var(--c); opacity: .6; }
.tl-card.high::before { bottom: 50%; } .tl-card.low::before { top: 50%; }
.tl-dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--bg), 0 0 14px var(--c); z-index: 1; }
.tl-year { position: absolute; left: 0; right: 0; text-align: center; font: 500 .86rem var(--serif); color: var(--gold2); white-space: nowrap; }
.tl-card.high .tl-year { top: calc(50% + 12px); } .tl-card.low .tl-year { bottom: calc(50% + 12px); }
.tl-arrow { position: absolute; top: 50%; z-index: 5; width: 54px; height: 54px; margin-top: -27px; border-radius: 50%; border: 1px solid var(--gold); background: rgba(8, 13, 26, .9); color: var(--gold2); font-size: 2rem; line-height: 1; box-shadow: var(--shadow); transition: .2s; }
.tl-arrow.left { left: 14px; } .tl-arrow.right { right: 14px; }
.tl-arrow:hover:not(:disabled) { background: var(--gold); color: #1b1404; }
.tl-arrow:disabled { opacity: .25; cursor: default; }

/* list layout */
.tl-list { width: min(980px, 100% - 40px); margin: 10px auto 0; }
.tl-lera { margin-top: 34px; }
.tl-lera-head { padding: 18px 22px; border: 1px solid var(--gold); border-radius: 16px; background: linear-gradient(135deg, rgba(217, 181, 106, .12), transparent); scroll-margin-top: calc(var(--navh) + 110px); }
.tl-lera-head small { color: var(--gold); font-weight: 600; letter-spacing: .08em; font-size: .72rem; text-transform: uppercase; }
.tl-lera-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: .15em 0 .2em; } .tl-lera-head p { color: var(--dim); margin: 0; font-size: .92rem; }
.tl-rows { list-style: none; margin: 0; padding: 14px 0 0; position: relative; }
.tl-rows::before { content: ''; position: absolute; left: 150px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--gold), rgba(217, 181, 106, .2)); }
.tl-row { display: grid; grid-template-columns: 132px 36px minmax(0, 1fr); align-items: center; padding: 7px 0; }
.tl-row-year { text-align: right; font: 500 1rem/1.2 var(--serif); color: var(--gold2); padding-right: 4px; }
.tl-row-dot { justify-self: center; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px var(--bg), 0 0 12px var(--c); position: relative; left: 1px; }
.tl-row-card { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 10px; border-radius: 14px; border: 1px solid var(--line); border-left: 3px solid var(--c); background: var(--panel); transition: transform .2s, border-color .2s, box-shadow .2s; }
.tl-row-card:hover, .tl-row-card:focus-visible, .tl-row.current .tl-row-card { transform: translateX(4px); border-color: var(--c); box-shadow: var(--shadow); }
.tl-row-card img { width: 96px; height: 72px; flex: none; object-fit: cover; border-radius: 9px; }
.tl-row-text { display: grid; gap: 2px; min-width: 0; }
.tl-row-text strong { font: 500 1.08rem/1.3 var(--serif); }
.tl-row-text small { color: var(--c); font-size: .72rem; font-weight: 600; }
.tl-row-desc { color: var(--dim); font-size: .86rem; line-height: 1.45; }
body[data-view="timeline"] .foot { margin-top: 60px; }
.ev-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ev-img { background: #000; min-height: 320px; } .ev-img img { width: 100%; height: 100%; object-fit: cover; }
.ev-body { padding: clamp(22px, 3vw, 40px); } .ev-body h2 { font-size: 2rem; } .ev-body > p { font: 400 1.08rem/1.7 var(--serif); color: #ddd6c2; }
.ev-detail > .ev-body:only-child { grid-column: 1 / -1; }
.ev-flags { margin: 22px 0; } .ev-flags small { display: block; color: var(--faint); margin-bottom: 8px; font-size: .76rem; }
.ev-nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ── deep time ── */
.deeptime { --dt: #AE027E; }
.dt-hero { min-height: calc(92vh - var(--navh)); display: grid; align-items: center; text-align: center; background: radial-gradient(900px 500px at 50% 110%, rgba(174, 2, 126, .5), transparent 70%); }
.dt-hero .lede { margin-inline: auto; } .dt-hero h1 { font-variant-numeric: tabular-nums; }
.dt-legend { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 20px 0 30px; font-size: .84rem; color: var(--dim); }
.dt-legend span { display: inline-flex; align-items: center; gap: 7px; } .dt-legend i { width: 11px; height: 11px; border-radius: 50%; background: var(--k); }
.k-event { --k: var(--sky); } .k-life { --k: #7FC64E; } .k-human { --k: var(--gold2); } .k-extinction { --k: var(--ember); }
.dt-hud { position: fixed; top: var(--navh); left: 0; right: 0; z-index: 40; display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center; padding: 10px max(20px, calc((100vw - 1320px) / 2)); background: rgba(8, 13, 26, .93); backdrop-filter: blur(14px); border-bottom: 2px solid var(--pc, var(--gold)); transform: translateY(-110%); transition: transform .4s, border-color .6s; }
.dt-hud.show { transform: none; }
.dt-hud small { display: block; font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }
.dt-hud-now { min-width: 190px; } .dt-hud-now b { display: block; font: 500 1.4rem/1.1 var(--serif); color: var(--pc); transition: color .6s; filter: brightness(1.35) saturate(.8); } .dt-hud-now span { font-size: .8rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.dt-scales { display: grid; gap: 5px; }
.dt-scale { position: relative; display: flex; height: 15px; border-radius: 4px; }
.dt-scale a { min-width: 1px; overflow: hidden; font: 700 .58rem/15px var(--sans); text-align: center; text-decoration: none; white-space: nowrap; }
.dt-scale a:first-child { border-radius: 4px 0 0 4px; } .dt-scale a:nth-last-child(2) { border-radius: 0 4px 4px 0; }
.dt-scale a:hover { filter: brightness(1.25); }
.dt-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: #fff; border-radius: 2px; box-shadow: 0 0 10px #fff; transition: left .15s linear, opacity .3s; pointer-events: none; }
.dt-hud-clock { text-align: right; } .dt-clock { font: 500 1.55rem/1.1 var(--serif); font-variant-numeric: tabular-nums; color: var(--gold2); }
.dt-band { background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 55%, #000)); color: var(--ink); padding: clamp(50px, 9vw, 110px) 0 clamp(34px, 5vw, 60px); position: relative; overflow: hidden; }
.dt-band::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(178deg, transparent 0 22px, rgba(0, 0, 0, .06) 22px 24px); pointer-events: none; }
.dt-band h2 { font-size: clamp(3.2rem, 11vw, 8.5rem); font-weight: 500; margin: 0; letter-spacing: -.03em; }
.dt-rank { font: 700 .76rem var(--sans); letter-spacing: .16em; text-transform: uppercase; opacity: .85; margin: 0 0 .4em; } .dt-rank span { font-weight: 500; letter-spacing: .04em; text-transform: none; }
.dt-tag { font: italic 400 clamp(1.2rem, 2.4vw, 1.8rem) var(--serif); margin: .2em 0 .5em; }
.dt-range { font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; } .dt-range span { font-weight: 400; opacity: .8; }
.dt-body { padding-block: 46px 70px; border-left: 3px solid var(--pc); padding-left: clamp(16px, 3vw, 40px); margin-top: 0; }
.dt-intro { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-bottom: 44px; }
.dt-text { font: 400 1.18rem/1.72 var(--serif); color: #e3dcc8; }
.dt-intro figure, .dt-moment figure, .dt-ext figure { margin: 0; } .dt-intro img { border-radius: var(--r); width: 100%; max-height: 380px; object-fit: cover; }
.dt-moments { display: grid; gap: 22px; }
.dt-moment { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--k); border-radius: var(--r); padding: 18px; max-width: 900px; transition: border-color .3s, transform .8s, opacity .8s; }
.dt-moment:nth-child(even) { margin-left: auto; }
.dt-moment:not(:has(figure)) { grid-template-columns: 1fr; }
.dt-moment figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.dt-moment h4 { font: 500 1.45rem var(--serif); } .dt-moment p:not(.kicker) { color: #d4cdb9; margin-bottom: .5em; }
.dt-kind { color: var(--k); } .dt-at { color: var(--faint); font-variant-numeric: tabular-nums; } .dt-moment .kicker { color: var(--dim); }
.dt-ext { position: relative; margin: 34px 0; border-radius: 20px; overflow: hidden; border: 1px solid rgba(226, 102, 74, .55); background: radial-gradient(700px 320px at 12% 0%, rgba(226, 102, 74, .34), transparent 70%), #1a0d0c; }
.dt-ext-pulse { position: absolute; left: -80px; top: -80px; width: 240px; height: 240px; border-radius: 50%; border: 2px solid var(--ember); animation: pulse 3s ease-out infinite; }
@keyframes pulse { from { transform: scale(.3); opacity: .9; } to { transform: scale(4.5); opacity: 0; } }
.dt-ext-in { position: relative; padding: clamp(22px, 4vw, 44px); }
.dt-ext .kicker { color: var(--ember); } .dt-ext h3 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); }
.dt-ext-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr) minmax(0, 300px); gap: 30px; align-items: start; }
.dt-ext-grid figure img { border-radius: 12px; width: 100%; }
.dt-loss-n { font: 500 4.4rem/1 var(--serif); color: var(--ember); font-variant-numeric: tabular-nums; } .dt-loss small { color: var(--dim); display: block; margin: 4px 0 12px; }
.dt-loss-bar, .five-bar { height: 12px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; }
.dt-loss-bar i, .five-bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, #f0a35e, var(--ember)); border-radius: 99px; transform-origin: left; transition: transform 1.8s cubic-bezier(.2, .8, .2, 1) .2s; }
.rv:not(.in) .dt-loss-bar i, .rv:not(.in) .five-bar i { transform: scaleX(0); }
.dt-loss-text { font: 500 1.2rem/1.4 var(--serif); color: #ffd9cc; }
.dt-ext h4 { color: var(--ember); margin-top: 1.2em; }
.five-chart { display: grid; gap: 16px; margin: 30px 0 12px; }
.five-row { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: center; }
.five-name { font: 500 1.12rem var(--serif); } .five-name small { display: block; font: 400 .76rem var(--sans); color: var(--faint); }
.five-bar { height: 30px; position: relative; border-radius: 8px; } .five-bar i { border-radius: 8px; } .five-bar b { position: absolute; right: 12px; top: 0; line-height: 30px; font-size: .86rem; }
.sixth { margin-top: 34px; padding: 26px; border: 1px dashed rgba(226, 102, 74, .6); border-radius: var(--r); background: rgba(226, 102, 74, .06); }
.day-list { list-style: none; padding: 0; margin: 26px 0; display: grid; gap: 2px; }
.day-list li { display: grid; grid-template-columns: 130px 1fr auto; gap: 20px; align-items: baseline; padding: 12px 16px; border-radius: 10px; }
.day-list li:nth-child(odd) { background: rgba(255, 255, 255, .035); }
.day-list time { font: 500 1.35rem var(--serif); color: var(--gold2); font-variant-numeric: tabular-nums; } .day-list small { color: var(--faint); }
.day-punch { font: 400 1.3rem/1.5 var(--serif); max-width: 46ch; } .day-punch b { color: var(--gold2); }

/* ── about ── */
.about section { margin-top: 46px; max-width: 980px; }
.src-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.src-table th { text-align: left; font: 600 .72rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.src-table th, .src-table td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.src-table td:first-child { color: var(--text); font-weight: 500; width: 34%; } .src-table td { color: var(--dim); }
.plain { padding-left: 1.2em; display: grid; gap: 10px; } .plain b { color: var(--gold2); }

/* ── responsive ── */
@media (max-width: 1040px) {
  :root { --navh: 104px; }
  .nav { flex-wrap: wrap; gap: 0 14px; padding-block: 8px 0; align-content: flex-start; }
  .brand { flex: none; } .search { flex: 1; width: auto; min-width: 0; } .search kbd { display: none; }
  .timeline .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .timeline .chips button { flex: none; white-space: nowrap; }
  .tl-controls { flex-direction: column; align-items: stretch; } .search.pick { flex: none; width: 100%; }
  .tl-scroller { height: clamp(430px, 66vh, 580px); }
  .tl-hud { min-width: 0; } .tl-end { display: none; }
  .links { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
  .nav { background: rgba(8, 13, 26, .9); backdrop-filter: blur(14px); }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; text-align: center; }
  .hero-globe { order: -1; max-width: 520px; } .hero-cta, .hero-stats { justify-content: center; } .hero .lede { margin-inline: auto; }
  .portals, .trust-grid, .two, .dt-intro, .ev-detail { grid-template-columns: minmax(0, 1fr); }
  .c-hero-in { grid-template-columns: minmax(0, 1fr); } .c-loc { justify-self: center; width: min(74vw, 300px); order: -1; }
  .chap-layout { grid-template-columns: minmax(0, 1fr); }
  .chap-list { position: static; display: flex; overflow-x: auto; max-height: none; border-left: 0; border-bottom: 2px solid var(--line); }
  .chap-list li { flex: none; max-width: 220px; } .chap-list button { border-left: 0; border-bottom: 2px solid transparent; margin: 0 0 -2px; } .chap-list button.on { border-bottom-color: var(--gold); }
  .dt-hud { grid-template-columns: 1fr auto; gap: 10px; } .dt-scales { grid-column: 1 / -1; order: 3; } .dt-scale a span { display: none; }
  .dt-ext-grid { grid-template-columns: minmax(0, 1fr); } .dt-moment { grid-template-columns: 120px 1fr; gap: 14px; }
  .five-row { grid-template-columns: 1fr; gap: 6px; } .ev-img { min-height: 200px; max-height: 280px; }
  .tl-era > header { width: 240px; } .tl-country-links { margin-left: 0; }
}
@media (max-width: 560px) {
  .stones li { grid-template-columns: 1fr; gap: 0; } .wiki figure { float: none; width: 100%; margin: 0 0 18px; }
  .day-list li { grid-template-columns: 96px 1fr; } .day-list small { grid-column: 2; }
  .pager { grid-template-columns: 1fr 1fr; } .pager a:nth-child(2) { display: none; }
  .dt-moment { grid-template-columns: minmax(0, 1fr); } .tl-note { display: none; }
  .tl-bar-scale .tl-hud { display: none; }
  .tl-rows::before { left: 7px; }
  .tl-row { grid-template-columns: 16px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; }
  .tl-row-dot { grid-row: 1; grid-column: 1; left: 0; width: 12px; height: 12px; }
  .tl-row-year { grid-row: 1; grid-column: 2; text-align: left; font-size: .95rem; }
  .tl-row-card { grid-column: 2; } .tl-row-card img { width: 72px; height: 58px; } .tl-row-desc { display: none; }
  .tl-arrow { width: 44px; height: 44px; margin-top: -22px; font-size: 1.6rem; } .tl-arrow.left { left: 6px; } .tl-arrow.right { right: 6px; }
  .c-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
}

/* ── quiz ── */
.quiz { max-width: 760px; text-align: center; padding-bottom: 40px; }
.quiz-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0 22px; color: var(--dim); font-size: .9rem; }
.quiz-bar b { color: var(--gold2); font: 500 1.3rem var(--serif); }
.quiz-flag { width: min(420px, 86%); margin: 0 auto 26px; border-radius: 10px; box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .15); animation: pop .4s cubic-bezier(.2, .8, .2, 1); background: #fff1; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz-opts button { padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); font: 500 1.1rem var(--serif); transition: .2s; }
.quiz-opts button:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.quiz-opts button.right { background: rgba(94, 196, 182, .22); border-color: var(--teal); }
.quiz-opts button.wrong { background: rgba(226, 102, 74, .2); border-color: var(--ember); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.quiz-after { min-height: 92px; margin-top: 22px; display: grid; gap: 12px; justify-items: center; }
.quiz-after p { margin: 0; color: #d4cdb9; }
@media (max-width: 560px) { .quiz-opts { grid-template-columns: 1fr; } }
