/* History section (/history/ and /learn/glossary), built by builder/history/build_history.py on top of minerals.css,
   guides.css and nav.css: full-bleed archive pictures with slow drifts and reveals, chapter openers, story cards,
   charts, globe scenes, timelines, entity pages and the hub. Same tokens as the rest of the site. */
.hx { --c: #f2c14e; overflow-x: clip; }
.hx-page .guide { padding: 0; max-width: none; }
.hx .wrap { max-width: 1180px; }
.hx a { text-underline-offset: 3px; }

/* ---------- hero (chapters and hub) ---------- */
.hx-hero { position: relative; min-height: 92vh; min-height: 92svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; background: #05080a; }
.hx-hero-media, .hx-hero-media picture { position: absolute; inset: 0; z-index: -2; }
.hx-hero-media img { width: 100%; height: 100%; object-fit: cover; animation: hx-kb 34s ease-in-out infinite alternate; transform-origin: 50% 40%; }
.hx-hero.archive .hx-hero-media img, .hx-open.archive img, .hx-fig.archive img { filter: sepia(.32) contrast(1.06) brightness(.92); }
.hx-hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, #05080a 0%, rgba(5, 8, 10, .82) 28%, rgba(5, 8, 10, .25) 62%, rgba(5, 8, 10, .55) 100%),
    linear-gradient(90deg, rgba(5, 8, 10, .7), transparent 60%), linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 55%); }
.hx-hero-copy { position: relative; padding-top: 140px; padding-bottom: 72px; width: 100%; }
.hx-hero h1 { font-size: clamp(46px, 7.6vw, 104px); line-height: .96; letter-spacing: -.045em; max-width: 960px; text-wrap: balance; }
.hx-hero .lead { max-width: 660px; color: #dbe3e0; text-shadow: 0 1px 16px rgba(0, 0, 0, .6); }
.hx-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font: 12.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hx-meta span + span::before { content: "·"; margin-right: 18px; color: var(--faint); }
.hx-hero-credit, .hx-open-credit { position: absolute; right: 18px; bottom: 12px; z-index: 2; max-width: min(520px, 60vw); text-align: right; margin: 0;
  font: 10.5px/1.45 var(--mono); color: rgba(255, 255, 255, .6); text-shadow: 0 1px 8px #000; }
.hx-hero-credit a, .hx-open-credit a { color: inherit; }
.hx-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
@keyframes hx-kb { from { transform: scale(1.03); } to { transform: scale(1.16) translate(-1.5%, -1%); } }

/* chapter spine under the hero */
.hx-spine { position: relative; z-index: 3; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(5, 8, 10, .92); }
.hx-spine ol { display: flex; overflow-x: auto; scrollbar-width: none; max-width: 1180px; margin: 0 auto; padding: 0 12px; }
.hx-spine ol::-webkit-scrollbar { display: none; }
.hx-spine li { flex: 0 0 auto; }
.hx-spine a { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; padding: 12px 14px; text-decoration: none; color: var(--muted); max-width: 220px; border-bottom: 2px solid transparent; }
.hx-spine a span { font: 11px var(--mono); color: var(--faint); grid-row: span 2; padding-top: 2px; }
.hx-spine a b { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-spine a em { font: normal 10.5px var(--mono); color: var(--faint); }
.hx-spine a:hover { color: var(--text); }
.hx-spine li.on a { color: var(--text); border-bottom-color: var(--c); }
.hx-spine li.on a span { color: var(--c); }

/* ---------- the chapter text ---------- */
.hx-art { position: relative; counter-reset: sec; }
.hx .hx-col { max-width: 760px; padding-top: 8px; }
.hx-col > p, .hx-ent-main p, .hx-ent-main li { font-size: 18px; line-height: 1.72; color: #d3dcd9; }
.hx-col > p { margin: 0 0 22px; }
.hx-sec:first-of-type .hx-col > p:first-child::first-letter { font-family: var(--head); font-weight: 600; float: left; font-size: 3.4em; line-height: .9; margin: 6px 10px 0 0; color: var(--c); }
.hx-col > h3 { font-size: 22px; margin: 34px 0 12px; }
.hx-sec { padding-bottom: 40px; }
.hx-num-s { font: 500 13px var(--mono); color: var(--c); margin: 70px 0 6px; letter-spacing: .1em; }
.hx-h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.05; margin-bottom: 26px; scroll-margin-top: 90px; }
.hx-sup { font: 500 10.5px var(--mono); margin-left: 2px; vertical-align: super; line-height: 0; white-space: nowrap; }
.hx-sup a { color: var(--c); text-decoration: none; padding: 0 1px; }
.hx-sup a:hover { text-decoration: underline; }
.hx-e { color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--c) 60%, transparent); text-decoration-thickness: 1.5px; }
.hx-e:hover { color: var(--c); }
.hx-e.k-person::before, .hx-e.k-mine::before, .hx-e.k-event::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 5px 2px 1px; border-radius: 50%; background: var(--c); opacity: .8; }
.hx-e.k-mine::before { border-radius: 1px; transform: rotate(45deg); }
.hx-e.k-event::before { background: none; border: 1.5px solid var(--c); width: 5px; height: 5px; }
.hx-gl { color: inherit; text-decoration: underline dotted color-mix(in srgb, var(--c) 70%, transparent); text-decoration-thickness: 1.5px; cursor: help; }
.hx-gl:hover { color: var(--c); }

/* section openers: a picture band with the section's heading */
.hx-open { position: relative; min-height: 78vh; min-height: 78svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; margin: 60px 0 46px; }
.hx-open-media, .hx-open-media picture { position: absolute; inset: 0; z-index: -2; }
.hx-open-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 2.6s var(--ease); }
.hx-open.in .hx-open-media img { transform: scale(1.02); }
.hx-open::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #05080a 2%, rgba(5, 8, 10, .45) 40%, rgba(5, 8, 10, .1) 70%, rgba(5, 8, 10, .5)); }
.hx-open-copy { width: 100%; padding-bottom: 46px; opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease) .2s, transform 1s var(--ease) .2s; }
.hx-open.in .hx-open-copy { opacity: 1; transform: none; }
.hx-num { display: block; font: 500 14px var(--mono); color: var(--c); letter-spacing: .14em; margin-bottom: 10px; }
.hx-open h2 { font-size: clamp(36px, 5.6vw, 76px); line-height: 1; letter-spacing: -.035em; max-width: 900px; text-shadow: 0 2px 30px rgba(0, 0, 0, .6); scroll-margin-top: 80px; }

/* in-page table of contents (wide screens: pinned at the left of the text) */
.hx-toc { display: none; }
@media (min-width: 1320px) {
  .hx-toc { display: block; position: absolute; top: 40px; bottom: 0; left: max(20px, calc(50vw - 640px)); width: 190px; pointer-events: none; }
  .hx-toc p, .hx-toc ol { position: sticky; top: 100px; pointer-events: auto; }
  .hx-toc p { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: 8px; top: 84px; }
  .hx-toc ol { counter-reset: t; border-left: 1px solid var(--line2); }
  .hx-toc li { counter-increment: t; }
  .hx-toc a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13px; color: var(--muted); text-decoration: none; line-height: 1.35; }
  .hx-toc a:hover, .hx-toc a.on { color: var(--text); border-left-color: var(--c); }
}

/* ---------- pictures in the text ---------- */
.hx-fig { margin: 44px 0; }
.hx-fig-media { position: relative; overflow: hidden; border-radius: 16px; background: #0b1013; }
.hx-fig img { display: block; width: 100%; height: auto; }
.hx-fig figcaption, .hx-chart figcaption, .hx-map figcaption { font: 11.5px/1.5 var(--mono); color: var(--faint); margin-top: 10px; }
.hx-fig figcaption a, .hx-credits a { color: var(--muted); }
.hx-credit { color: var(--faint); }
/* full-bleed figures (Ken Burns, wipe, mask, duotone) break out of the text column */
.hx-col .hx-fig:not(.fx-inset) { width: min(1180px, 100vw - 32px); margin-left: 50%; transform: translateX(-50%); }
.hx-fig.fx-kenburns .hx-fig-media, .hx-fig.fx-wipe .hx-fig-media, .hx-fig.fx-mask .hx-fig-media, .hx-fig.fx-duo .hx-fig-media { aspect-ratio: 16 / 9; max-height: 82vh; }
.hx-fig.fx-kenburns img, .hx-fig.fx-wipe img, .hx-fig.fx-mask img, .hx-fig.fx-duo img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.hx-fig.fx-kenburns img { animation: hx-kb 30s ease-in-out infinite alternate paused; }
.hx-fig.fx-kenburns.in img { animation-play-state: running; }
/* wipe: the picture uncovers left to right as it scrolls up the screen (--p from history.js) */
.hx-fig.fx-wipe .hx-fig-media { clip-path: inset(0 calc((1 - var(--p, 1)) * 100%) 0 0 round 16px); }
.hx-fig.fx-wipe .hx-fig-media::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--p, 1) * 100% - 2px); width: 2px; background: var(--c);
  box-shadow: 0 0 24px 6px color-mix(in srgb, var(--c) 50%, transparent); opacity: calc((1 - var(--p, 1)) * 8); }
/* mask: an iris that opens with the scroll */
.hx-fig.fx-mask .hx-fig-media { clip-path: circle(calc(8% + var(--p, 1) * 70%) at 50% 50%); }
.hx-fig.fx-mask img { transform: scale(calc(1.25 - var(--p, 1) * .23)); }
/* duotone: the print in the chapter's colour, warming to full colour on hover or focus */
.hx-fig.fx-duo .hx-fig-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--c), #0b2a2a); mix-blend-mode: color; transition: opacity 1s var(--ease); }
.hx-fig.fx-duo img { filter: grayscale(1) contrast(1.15) brightness(.95); transition: filter 1s var(--ease); }
.hx-fig.fx-duo:hover .hx-fig-media::after { opacity: .25; }
.hx-fig.fx-duo:hover img { filter: grayscale(.2) contrast(1.05); }
/* inset: a smaller picture beside the text */
.hx-fig.fx-inset { margin: 10px 0 24px; }
.hx-fig.fx-inset .hx-fig-media { clip-path: inset(0 0 100% 0 round 14px); transition: clip-path 1.2s var(--ease); }
.hx-fig.fx-inset.in .hx-fig-media { clip-path: inset(0 0 0 0 round 14px); }
@media (min-width: 900px) { .hx-col .hx-fig.fx-inset { float: right; width: 46%; margin: 8px -140px 20px 32px; } }
.hx-col::after { content: ""; display: block; clear: both; }

/* ---------- story cards ---------- */
.hx-card { position: relative; margin: 34px 0; padding: 22px 24px 18px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--c) 10%, transparent), transparent 60%), var(--bg2); clear: both; }
.hx-card-kind { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--c); margin: 0 0 8px !important; }
.hx-card h3 { font-size: 21px; line-height: 1.2; margin-bottom: 8px; }
.hx-card > p { font-size: 15.5px !important; line-height: 1.6 !important; color: #c9d4d0; margin: 0; }
.hx-card-stat { margin-top: 14px !important; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.hx-card-stat b { font: 600 34px/1 var(--head); letter-spacing: -.03em; color: var(--text); }
.hx-card-stat span { font-size: 15px; color: var(--c); }
.hx-card-stat small { flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.hx-card-src { font-size: 12px !important; color: var(--faint) !important; margin-top: 12px !important; }
.hx-card-src a { color: var(--muted); }
.hx-card-about { display: inline-block; margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--c); text-decoration: none; }
.hx-card.k-myth_vs_fact { border-style: dashed; }
.hx-card.k-quote h3 { font-style: italic; }
.hx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.hx-cards .hx-card { margin: 0; }
@media (min-width: 900px) { .hx-col > .hx-card { margin-right: -120px; } }

/* ---------- big numbers and quotes ---------- */
.hx-stat { margin: 40px 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--c); clear: both; }
.hx-stat p { margin: 0; }
.hx-stat b { font: 600 clamp(52px, 8vw, 96px)/1 var(--head); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.hx-stat span { font: 500 clamp(18px, 2vw, 24px) var(--head); color: var(--c); }
.hx-stat-l { color: var(--muted) !important; font-size: 15px !important; margin-top: 8px !important; }
.hx-quote { margin: 44px 0; padding: 0; border: 0; clear: both; }
.hx-quote p { font: 500 clamp(24px, 3vw, 34px)/1.28 var(--head); letter-spacing: -.02em; color: var(--text); text-wrap: balance; }
.hx-quote p::before { content: "“"; color: var(--c); margin-right: 2px; }
.hx-quote p::after { content: "”"; color: var(--c); }
.hx-quote footer { margin-top: 12px; font: 12.5px var(--mono); color: var(--muted); }
.hx-quote footer::before { content: "— "; }

/* ---------- charts, comparisons, maps, timeline strips ---------- */
.hx-chart { margin: 40px 0; padding: 20px 22px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg2); clear: both; }
.hx-chart h3 { font: 11.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hx-chart-box { margin-top: 10px; min-height: 120px; }
.hx-chart figcaption p { font: 13px/1.55 Inter, system-ui, sans-serif; color: var(--muted); margin: 0 0 6px; }
.hx-chart figcaption .hx-src, .hx-src { font-size: 12px; color: var(--faint); }
.hx-src a { color: var(--muted); }
.hx-compare { margin: 40px 0; clear: both; }
.hx-rush-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.hx-rush { border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 10px; background: var(--bg2); }
.hx-rush h3 { font-size: 17px; margin-bottom: 8px; }
.hx-rush h3 a { color: var(--text); text-decoration: none; }
.hx-rush h3 a:hover { color: var(--c); }
.hx-rush li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; border-top: 1px solid var(--line); padding: 7px 0; font-size: 13.5px !important; line-height: 1.4 !important; }
.hx-rush li span { color: var(--muted); }
.hx-rush li b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.hx-rush li small { grid-column: 1 / -1; color: var(--faint); font-size: 12px; }
.hx-rush li .hx-sup { grid-column: 2; justify-self: end; }
.hx-compare > h3 { font: 11.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 6px; }
.hx-bars li { grid-template-columns: 150px 1fr 90px; }
.hx-bars .bar { transform: none; }
.hx-compare:not(.in) .hx-bars .bar { transform: scaleX(0); }
.hx-map { margin: 40px 0; clear: both; }
.hx-col .hx-map { width: min(1180px, 100vw - 32px); margin-left: 50%; transform: translateX(-50%); }
.hx-map-stage { position: relative; aspect-ratio: 16 / 9; max-height: 78vh; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(60% 70% at 50% 50%, color-mix(in srgb, var(--c) 10%, transparent), transparent 70%), #05080a; }
.hx-map.short .hx-map-stage { aspect-ratio: 16 / 8; }
.hx-map.hero .hx-map-stage { aspect-ratio: 1; max-height: none; }
.hx-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s var(--ease); touch-action: pan-y; cursor: grab; }
.hx-map.ready canvas { opacity: 1; }
.hx-map-hint { position: absolute; left: 14px; bottom: 12px; font: 10.5px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; pointer-events: none; }
.hx-map-list { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 4px; }
.hx-map-list li { font-size: 12.5px; }
.hx-map-list a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--text); text-decoration: none; background: rgba(255, 255, 255, .03); }
.hx-map-list a:hover { border-color: var(--c); }
.hx-map-list li span { margin-left: 5px; color: var(--faint); }
.hx-map-list i, .hx-glyph { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.hx-map-list i.k-mine { border-radius: 1px; transform: rotate(45deg); }
.hx-map-list i.k-event { background: none; border: 1.5px solid var(--c); }
.hx-map-list i.k-route { width: 12px; height: 2px; border-radius: 1px; }
.hx-map-all { flex-basis: 100%; }
.hx-map-all summary { cursor: pointer; font: 12px var(--mono); color: var(--muted); padding: 4px 0; }
.hx-map-all .hx-map-list { max-height: 240px; overflow-y: auto; margin-top: 8px; }
.hx-tstrip { margin: 40px 0; clear: both; position: relative; z-index: 2; background: var(--bg); }
.hx-col .hx-fig:not(.fx-inset), .hx-col .hx-map { position: relative; z-index: 2; }
.hx-col .hx-tstrip { width: min(1180px, 100vw - 32px); margin-left: 50%; transform: translateX(-50%); }
.hx-tstrip ol { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 0; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 10px; border-top: 1px solid var(--line2); scrollbar-width: thin; }
.hx-tstrip li { position: relative; padding: 18px 18px 0 0; scroll-snap-align: start; }
.hx-tstrip li::before { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--c); }
.hx-tstrip time { font: 500 13px var(--mono); color: var(--c); }
.hx-tstrip b { display: block; font-weight: 600; font-size: 15px; margin: 4px 0; line-height: 1.3; }
.hx-tstrip b a { color: var(--text); text-decoration: none; }
.hx-tstrip b a:hover { color: var(--c); }
.hx-tstrip p { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; }

/* ---------- end of a chapter ---------- */
.hx-end { padding-top: 40px; padding-bottom: 20px; }
.hx-end > section, .hx-ent-main > section { margin-top: 48px; }
.hx-end h2, .hx-ent-main h2, .hx-sources h2 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 16px; }
.hx-nextch { position: relative; display: flex; align-items: flex-end; min-height: 380px; border-radius: 22px; overflow: hidden; isolation: isolate; text-decoration: none;
  border: 1px solid var(--line); background: #0b1013; }
.hx-nextch picture { position: absolute; inset: 0; z-index: -2; }
.hx-nextch img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); filter: saturate(.9); }
.hx-nextch::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 8, 10, .96) 10%, rgba(5, 8, 10, .3) 70%); }
.hx-nextch:hover img { transform: scale(1.04); }
.hx-nextch-copy { padding: 28px 30px; max-width: 760px; }
.hx-nextch em { display: block; font: normal 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--c); }
.hx-nextch b { display: block; font: 600 clamp(30px, 4.4vw, 54px)/1.02 var(--head); letter-spacing: -.035em; margin: 8px 0; }
.hx-nextch small { font-size: 16px; color: #c9d4d0; line-height: 1.5; }
.hx-next-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.hx-next-g { margin-top: 18px; }
.hx-next-g h3 { font: 11.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.hx-next { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  text-decoration: none; color: var(--text); transition: border-color .2s, background .2s, transform .2s; min-width: 0; }
.hx-next:hover { border-color: color-mix(in srgb, var(--c) 50%, transparent); background: rgba(255, 255, 255, .04); transform: translateY(-2px); }
.hx-next picture { flex: none; }
.hx-next .hx-face, .hx-next .hx-glyph { width: 44px; height: 44px; flex: none; border-radius: 50%; object-fit: cover; }
.hx-next .hx-glyph { display: block; background: radial-gradient(circle, color-mix(in srgb, var(--c) 60%, transparent) 0 18%, transparent 20%), color-mix(in srgb, var(--c) 12%, #0b1013);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.hx-next .hx-glyph.k-mine { border-radius: 10px; }
.hx-next > span { display: grid; gap: 2px; min-width: 0; }
.hx-next em { font: normal 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.hx-next b { font-weight: 600; font-size: 15px; line-height: 1.25; }
.hx-next small { font-size: 13px; line-height: 1.45; color: var(--muted); }
.hx-next-cite { display: none; }
.hx-sources { margin-top: 56px; }
.hx-sources ol { list-style: decimal; padding-left: 26px; columns: 2 340px; column-gap: 36px; }
.hx-sources li { font-size: 13px; line-height: 1.5; color: var(--muted); padding: 3px 0; break-inside: avoid; }
.hx-sources li::marker { font: 11px var(--mono); color: var(--faint); }
.hx-sources li:target { color: var(--text); background: color-mix(in srgb, var(--c) 10%, transparent); border-radius: 6px; }
.hx-sources a { color: #c9d4d0; }
.hx-sources span { color: var(--faint); }
.hx-credits { font-size: 12px; color: var(--faint); margin-top: 22px; line-height: 1.55; }
.hx-related .cols a { font-size: 14px; }

/* ---------- entity pages ---------- */
.hx-ent-wrap { padding-top: 104px; padding-bottom: 24px; }
.hx-ent-head { display: grid; gap: 30px; align-items: end; margin-bottom: 30px; }
.hx-ent-head.has-visual { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.hx-ent-head h1 { font-size: clamp(38px, 5.4vw, 70px); line-height: 1; letter-spacing: -.04em; text-wrap: balance; }
.hx-ent-head .lede { font-size: clamp(17px, 1.6vw, 20px); color: #c9d4d0; margin-top: 16px; max-width: 640px; }
.hx-ent-visual { order: 2; }
.hx-ent-visual .hx-map { margin: 0; }
.hx-ent-visual .hx-map figcaption { display: none; }
.hx-portrait { max-width: 320px; margin-left: auto; border-radius: 20px; overflow: hidden; border: 1px solid var(--line2); box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--c) 60%, transparent);
  background: #0b1013; transform: rotate(1.2deg); }
.hx-portrait img { display: block; width: 100%; height: auto; filter: sepia(.25) contrast(1.05); }
.hx-ent-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.hx-ent-main > section:first-child { margin-top: 0; }
.hx-ent-main p { margin: 0 0 14px; }
.hx-ent-main .hx-card > p, .hx-ent-main .hx-rush li { font-size: 15px; }
.hx-ent-side { display: grid; gap: 14px; position: sticky; top: 86px; }
.hx-facts td:last-child { text-align: left; font-weight: 500; }
.hx-facts td:first-child { width: 40%; }
.hx-facts small { color: var(--faint); font-weight: 400; display: block; }
.hx-facts a { color: var(--text); }
.hx-facts .chip { margin: 1px 4px 1px 0; }
.hx-ent .tline { margin-top: 6px; }
.hx-ent .tline li { font-size: 15px; }
.hx-ent .tline a { color: var(--text); }
.hx-ent .hx-map { margin: 18px 0; }
.hx-where { clear: both; }

/* ---------- index pages ---------- */
.hx-idx > .wrap { padding-top: 104px; padding-bottom: 30px; }
.hx-idx-head { max-width: 820px; margin-bottom: 30px; }
.hx-idx-head h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1; letter-spacing: -.04em; }
.hx-idx-head .lede { font-size: clamp(17px, 1.6vw, 20px); color: #c9d4d0; margin-top: 16px; }
.hx-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.hx-filter button { font: inherit; font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, .03); border: 1px solid var(--line2); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.hx-filter button small { color: var(--faint); margin-left: 3px; font-size: 11px; }
.hx-filter button[aria-pressed="true"] { color: #0b1200; background: var(--c); border-color: var(--c); }
.hx-filter button[aria-pressed="true"] small { color: #0b1200; }
[data-hide] { display: none !important; }
.hx-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 18px; }
.hx-pcard { display: grid; grid-template-rows: auto 1fr; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); text-decoration: none; color: var(--text);
  transition: transform .3s var(--ease), border-color .3s; }
.hx-pcard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.hx-pcard picture, .hx-pcard .hx-mono { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #0b1013; }
.hx-pcard img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.3) contrast(1.05) grayscale(.2); transition: filter .5s, transform .8s var(--ease); }
.hx-pcard:hover img { filter: none; transform: scale(1.03); }
.hx-mono { display: grid !important; place-items: center; font: 600 46px var(--head); color: color-mix(in srgb, var(--c) 70%, #fff); letter-spacing: -.04em;
  background: radial-gradient(70% 60% at 50% 40%, color-mix(in srgb, var(--c) 18%, transparent), transparent), #0b1013 !important; }
.hx-pcard > span { display: grid; gap: 2px; padding: 12px 14px 14px; }
.hx-pcard b { font-weight: 600; font-size: 15.5px; line-height: 1.25; }
.hx-pcard em { font: normal 12px var(--mono); color: var(--c); }
.hx-pcard small { font-size: 12.5px; color: var(--muted); }
.hx-era h2 { font-size: 22px; margin: 34px 0 10px; }
.hx-elist li { display: grid; grid-template-columns: 150px 1fr; gap: 2px 16px; padding: 9px 0; border-top: 1px solid var(--line); }
.hx-elist time { font: 13px var(--mono); color: var(--c); grid-row: span 2; }
.hx-elist a { color: var(--text); text-decoration: none; font-weight: 600; }
.hx-elist a:hover { color: var(--c); }
.hx-elist span { font-size: 13px; color: var(--muted); }
.hx-dgrid, .hx-lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.hx-dcard { display: grid; gap: 6px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); text-decoration: none; color: var(--text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 12%, transparent), rgba(255, 255, 255, .015) 60%); transition: transform .3s var(--ease), border-color .3s; }
.hx-dcard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.hx-dcard b { font: 600 18px/1.2 var(--head); }
.hx-dcard small { font: 11.5px var(--mono); color: var(--c); text-transform: uppercase; letter-spacing: .05em; }
.hx-dcard span { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.hx-lcard { position: relative; display: flex; align-items: flex-end; min-height: 300px; border-radius: 18px; overflow: hidden; isolation: isolate; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: radial-gradient(90% 80% at 70% 20%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%), #0b1013; }
.hx-lcard picture { position: absolute; inset: 0; z-index: -2; }
.hx-lcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.hx-lcard::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 8, 10, .96) 15%, rgba(5, 8, 10, .3) 80%); }
.hx-lcard:hover img { transform: scale(1.04); }
.hx-lcard > span { display: grid; gap: 6px; padding: 20px; }
.hx-lcard em { font: normal 11.5px var(--mono); color: var(--c); text-transform: uppercase; letter-spacing: .08em; }
.hx-lcard b { font: 600 22px/1.15 var(--head); letter-spacing: -.015em; }
.hx-lcard small { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* timeline page */
.hx-tlz { position: sticky; top: 62px; z-index: 5; margin: 0 -24px 6px; padding: 12px 24px 10px; background: var(--bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); }
.hx-tlz-eras { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.hx-tlz-eras button { flex: none; font: inherit; font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--line2); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.hx-tlz-eras button[aria-pressed="true"] { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.hx-tlz-axis { position: relative; margin-top: 10px; }
.hx-tlz-axis svg { display: block; width: 100%; height: 64px; cursor: crosshair; touch-action: none; user-select: none; }
.hx-tlz-axis .bin { fill: var(--c); opacity: .75; }
.hx-tlz-axis .sel { fill: color-mix(in srgb, var(--c) 18%, transparent); stroke: var(--c); }
.hx-tlz-axis text { fill: var(--faint); font: 10.5px var(--mono); }
.hx-tlz-axis line { stroke: var(--line2); }
.hx-tlz-read { font: 12px var(--mono); color: var(--text); margin: 4px 0 0; }
.hx-tlz-help { font-size: 11.5px; color: var(--faint); margin: 2px 0 0; }
.hx-timeline .hx-filter { margin: 8px 0; }
.hx-tera h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 40px 0 12px; position: relative; }
.hx-tline { border-left: 2px solid var(--line2); margin-left: 6px; }
.hx-tline li { position: relative; display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 10px 0 12px 22px; }
.hx-tline li::before { content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cc, var(--c)); }
.hx-tline time { font: 500 13.5px var(--mono); color: var(--cc, var(--c)); padding-top: 2px; }
.hx-tline b { font-weight: 600; font-size: 16px; }
.hx-tline b a { color: var(--text); text-decoration: none; }
.hx-tline b a:hover { color: var(--c); }
.hx-tline p { font-size: 14.5px; color: #c9d4d0; margin: 3px 0 2px; }
.hx-tline small { font-size: 12px; color: var(--faint); }
.c-disaster { --cc: #ff8a4c; } .c-economy { --cc: #f2c14e; } .c-technology { --cc: #5fe0c8; } .c-people { --cc: #c084fc; } .c-law { --cc: #5fb4ff; }
.c-environment { --cc: #a3e635; } .c-discovery { --cc: #dcff3c; } .c-rush { --cc: #fbbf24; }
.hx-tstrip li[class*="c-"]::before { border-color: var(--cc, var(--c)); }
.hx-tstrip li[class*="c-"] time { color: var(--cc, var(--c)); }
.hx-tl-empty { color: var(--muted); padding: 30px 0; }

/* trade routes page */
.hx-routes { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.hx-routes-stage { position: sticky; top: 76px; aspect-ratio: 1; max-height: calc(100vh - 100px); border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(60% 60% at 50% 50%, rgba(242, 193, 78, .08), transparent 70%), #05080a; }
.hx-routes-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.hx-routes-ctl { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px;
  background: rgba(5, 8, 10, .78); border: 1px solid var(--line2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hx-routes-ctl input { flex: 1; accent-color: var(--c); }
.hx-routes-ctl output { font: 500 16px var(--mono); min-width: 74px; text-align: right; }
.hx-play { font: 600 13px Inter, sans-serif; color: #0b1200; background: var(--c); border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.hx-route-list { display: grid; gap: 10px; }
.hx-route { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg2); transition: border-color .3s, opacity .4s, background .3s; outline: none; cursor: pointer; }
.hx-route.off { opacity: .38; }
.hx-route.sel, .hx-route:focus-visible, .hx-route:target { border-color: var(--c); background: color-mix(in srgb, var(--c) 6%, var(--bg2)); }
.hx-route h3 { font-size: 17.5px; margin: 4px 0 6px; }
.hx-route p { font-size: 14px; color: #c9d4d0; margin: 0 0 4px; }
.hx-route-k { font: 11px var(--mono) !important; text-transform: uppercase; letter-spacing: .06em; color: var(--c) !important; }
.hx-route-v { font-weight: 600; color: var(--text) !important; }
.hx-route-via { font-size: 13px !important; color: var(--muted) !important; }
.hx-route-ends a { color: var(--muted); font-size: 13px; }

/* glossary */
.hx-gsearch { display: flex; gap: 12px; align-items: center; margin: 0 0 8px; }
.hx-gsearch label { font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hx-gsearch input { flex: 1; max-width: 420px; font: 16px Inter, sans-serif; color: var(--text); background: rgba(255, 255, 255, .04); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 14px; }
.hx-gsearch input:focus { outline: none; border-color: var(--lime); }
.hx-gloss { --c: var(--lime); }
.hx-gl-l h2 { font: 600 40px var(--head); color: var(--c); margin: 38px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 6px; scroll-margin-top: 80px; }
.hx-term { display: grid; grid-template-columns: 240px 1fr; gap: 6px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.hx-term:target { background: color-mix(in srgb, var(--lime) 7%, transparent); border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.hx-term dt a { font: 600 17px var(--head); color: var(--text); text-decoration: none; }
.hx-term dt span { display: block; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-top: 4px; }
.hx-term dd { margin: 0; }
.hx-term dd p { margin: 0 0 4px; color: #c9d4d0; font-size: 15px; }
.hx-term-ex { color: var(--muted) !important; font-size: 14px !important; font-style: italic; }
.hx-term-rel { font-size: 13px !important; color: var(--faint) !important; }
.hx-term-rel a { color: var(--muted); }

/* ---------- the hub ---------- */
.hx-hub-hero { min-height: 100vh; min-height: 100svh; }
.hx-hub-hero h1 { font-size: clamp(50px, 8.6vw, 124px); max-width: 1000px; }
.hx-hub-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 44px; max-width: 980px; }
.hx-hub-stats div { border-left: 2px solid var(--c); padding: 2px 0 2px 12px; }
.hx-hub-stats b { display: block; font: 600 30px/1.05 var(--head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hx-hub-stats span { font-size: 12.5px; color: var(--muted); }
.hx-hub-sec { padding: 96px 0 0; }
.hx-hub-sec > .wrap > h2, .hx-hub-sec h2 { font-size: clamp(32px, 4.6vw, 58px); line-height: 1.02; letter-spacing: -.035em; max-width: 820px; }
.hx-hub-sec .sub { color: var(--muted); font-size: 17px; max-width: 680px; margin: 14px 0 30px; }
.hx-spine-hub { display: grid; gap: 22px; counter-reset: c; }
.hx-sp a { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 36px; text-decoration: none; color: var(--text); }
.hx-sp.r a { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.hx-sp.r .hx-sp-media { order: 2; }
.hx-sp-media { display: block; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; background: radial-gradient(80% 80% at 30% 30%, color-mix(in srgb, var(--c) 22%, transparent), transparent), #0b1013;
  border: 1px solid var(--line); }
.hx-sp-media img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.2); transition: transform 1.2s var(--ease), filter .8s; }
.hx-sp a:hover .hx-sp-media img { transform: scale(1.04); filter: none; }
.hx-sp-copy { display: grid; gap: 8px; }
.hx-sp-copy em { font: normal 12.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--c); }
.hx-sp-copy b { font: 600 clamp(28px, 3.4vw, 44px)/1.04 var(--head); letter-spacing: -.03em; }
.hx-sp-copy small { font-size: 16.5px; color: #c9d4d0; line-height: 1.55; }
.hx-sp-copy i { font-style: normal; font-weight: 600; color: var(--c); font-size: 15px; }
.hx-doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hx-door { position: relative; display: flex; align-items: flex-end; min-height: 250px; border-radius: 18px; overflow: hidden; isolation: isolate; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: #0b1013; transition: transform .35s var(--ease), border-color .35s; }
.hx-door:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.hx-door-media { position: absolute; inset: 0; z-index: -2; display: block; }
.hx-door-media picture, .hx-door-media > img { position: absolute; inset: 0; }
.hx-door-media img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.35) brightness(.85); transition: transform 1s var(--ease), filter .6s; }
.hx-door:hover .hx-door-media img { transform: scale(1.05); filter: sepia(.1); }
.hx-door::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 8, 10, .95) 12%, rgba(5, 8, 10, .25) 70%); }
.hx-door-copy { display: grid; gap: 3px; padding: 16px; }
.hx-door-copy b { font: 600 21px/1.15 var(--head); letter-spacing: -.015em; }
.hx-door-copy small { font-size: 13px; color: var(--muted); }
.hx-mosaic { position: absolute; inset: 0; display: grid !important; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.hx-mosaic picture { position: relative !important; inset: auto !important; overflow: hidden; }
.hx-door-tl { position: absolute; inset: 0; background:
  repeating-linear-gradient(90deg, transparent 0 22px, rgba(242, 193, 78, .5) 22px 24px) 0 60% / 100% 2px no-repeat,
  radial-gradient(circle at 12% 60%, #f2c14e 0 5px, transparent 6px), radial-gradient(circle at 34% 60%, #ff8a4c 0 5px, transparent 6px),
  radial-gradient(circle at 58% 60%, #5fe0c8 0 5px, transparent 6px), radial-gradient(circle at 81% 60%, #c084fc 0 5px, transparent 6px),
  radial-gradient(80% 70% at 50% 40%, rgba(242, 193, 78, .14), transparent), #0b1013; }
.hx-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hx-hub .kx { margin-top: 0; }

/* reveal on scroll for the pieces history.js watches */
.hx-reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.hx-reveal.in { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .hx-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-hub-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hx-cards-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hx-ent-head.has-visual, .hx-ent-grid, .hx-routes { grid-template-columns: 1fr; }
  .hx-ent-visual { order: 0; }
  .hx-portrait { margin: 0; max-width: 220px; }
  .hx-ent-side { position: static; }
  .hx-sp a, .hx-sp.r a { grid-template-columns: 1fr; gap: 16px; }
  .hx-sp.r .hx-sp-media { order: 0; }
  .hx-routes-stage { position: relative; top: 0; aspect-ratio: 1; max-height: 70vh; }
  .hx-term { grid-template-columns: 1fr; }
  .hx-tline li { grid-template-columns: 1fr; gap: 2px; }
  .hx-hero-credit, .hx-open-credit { left: 14px; right: 14px; text-align: left; max-width: none; }
  .hx-ent-visual .hx-map.hero .hx-map-stage { aspect-ratio: 16 / 10; }
}
@media (max-width: 640px) {
  .hx-hero-copy { padding-top: 110px; padding-bottom: 54px; }
  /* the picture credit sits under the copy on phones instead of over it */
  .hx-hero { flex-direction: column; justify-content: flex-end; align-items: stretch; }
  .hx-hero-copy { padding-bottom: 18px; }
  .hx-hero-credit { position: relative; left: auto; right: auto; bottom: auto; padding: 0 16px 14px; }
  .hx-col > p, .hx-ent-main p, .hx-ent-main li { font-size: 17px; }
  .hx-open { min-height: 64vh; margin: 40px 0 30px; }
  .hx-open-copy { padding-bottom: 40px; }
  .hx-hub-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-cards-3 { grid-template-columns: 1fr; }
  .hx-doors { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hx-door { min-height: 190px; }
  .hx-door-copy b { font-size: 17px; }
  .hx-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hx-elist li { grid-template-columns: 1fr; }
  .hx-elist time { grid-row: auto; }
  .hx-bars li { grid-template-columns: 96px 1fr 70px; }
  .hx-map-stage { aspect-ratio: 4 / 5; }
  .hx-map.short .hx-map-stage { aspect-ratio: 1; }
  .hx-fig.fx-kenburns .hx-fig-media, .hx-fig.fx-wipe .hx-fig-media, .hx-fig.fx-mask .hx-fig-media, .hx-fig.fx-duo .hx-fig-media { aspect-ratio: 4 / 3; }
  .hx-ent-wrap, .hx-idx > .wrap { padding-top: 88px; }
  .hx-tlz { margin: 0 -16px 6px; padding: 10px 16px 8px; top: 56px; }
  .hx-nextch { min-height: 300px; }
  .hx-nextch-copy { padding: 20px; }
  .hx-sources ol { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-hero-media img, .hx-fig.fx-kenburns img { animation: none; }
  .hx-open-media img, .hx-open-copy, .hx-reveal, .hx-fig.fx-inset .hx-fig-media { transition: none; transform: none; opacity: 1; }
  .hx-fig.fx-inset .hx-fig-media { clip-path: none; }
  .hx-fig.fx-wipe .hx-fig-media, .hx-fig.fx-mask .hx-fig-media { clip-path: none; }
  .hx-fig.fx-mask img { transform: none; }
}

/* lessons: the writers' comparison tables, in the guides' .tbl frame */
.hx .hx-ltable { margin: 26px 0; }
.hx .lesson-table td:first-child { color: var(--text); font-weight: 500; }
.hx .lesson-table td:last-child, .hx .lesson-table th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hx .lesson-table td { color: var(--muted); }
