/* ==========================================================================
   Islamic History (/history): hub, prophets timeline, journey map, Seerah and
   spread of Islam, inventions. Everything is scoped under .hx. Logical
   properties throughout so Arabic and Urdu mirror. Dark mode: body.dark (the
   site toggle) and [data-theme="dark"].
   ========================================================================== */

.hx {
  --hx-night: #072a1d;
  --hx-deep: #0d3b29;
  --hx-teal: #16624f;
  --hx-emerald: #1F7A4D;
  --hx-emerald-2: #2E9E67;
  --hx-mint: #9CCFB6;
  --hx-gold: #C9A227;
  --hx-gold-2: #E6C766;
  --hx-gold-ink: #85690f; /* gold for small text on the cream page (AA) */
  --hx-gold-3: #F6DFA4;
  --hx-sand: #E9D3A3;
  --hx-cream: #FBF6EA;
  --hx-ink: #1F2A33;
  --hx-terracotta: #B5562C;
  --hx-lapis: #1f6a55;
  --hx-plum: #6B3A5B;

  --hx-surface: #fffdf8;
  --hx-surface-2: #f5eedd;
  --hx-surface-3: #efe5cc;
  --hx-text: #1F2A33;
  --hx-muted: #5d6870;
  --hx-border: rgba(31, 42, 51, .12);
  --hx-border-strong: rgba(31, 42, 51, .2);
  --hx-shadow: 0 1px 2px rgba(8, 40, 28, .06), 0 12px 32px -12px rgba(8, 40, 28, .22);
  --hx-shadow-lg: 0 2px 6px rgba(8, 40, 28, .08), 0 30px 60px -24px rgba(8, 40, 28, .35);
  --hx-land: #efe3c4;
  --hx-land-stroke: #d6c49a;
  --hx-sea: #dbe9ec;
  --hx-sig: #8fd0a9;
  --hx-maj: #1f8a55;
  --hx-former: #e7c9a6;

  --hx-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hx-arabic: "Amiri", "Noto Naskh Arabic", "Scheherazade New", serif;
  --hx-radius: 22px;
  --hx-ease: cubic-bezier(.2, .7, .2, 1);

  color: var(--hx-text);
  overflow-x: clip;
}

body.dark .hx,
[data-theme="dark"] .hx {
  --hx-gold-ink: #E6C766;
  --hx-surface: #0e1a20;
  --hx-surface-2: #13232b;
  --hx-surface-3: #182d36;
  --hx-text: #e9eef0;
  --hx-muted: #9fb1b9;
  --hx-border: rgba(255, 255, 255, .09);
  --hx-border-strong: rgba(255, 255, 255, .18);
  --hx-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .7);
  --hx-shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 30px 60px -24px rgba(0, 0, 0, .8);
  --hx-land: #1f3a40;
  --hx-land-stroke: #2f545c;
  --hx-sea: #0a1c24;
  --hx-sig: #3fae78;
  --hx-maj: #7fe0a8;
  --hx-former: #6e5640;
}

/* Arabic and Urdu use the Arabic face for the interface too. */
html[lang="ar"] .hx { --hx-display: "Amiri", "Noto Naskh Arabic", serif; }
html[lang="ur"] .hx { --hx-display: var(--ip-font-urdu); }
html[lang="ur"] body :is(.hx-eyebrow, .hx-kicker, .hx-band-label) { font-family: var(--ip-font-urdu); }

.hx a { color: inherit; }
.hx :focus-visible { outline: 3px solid var(--hx-gold); outline-offset: 3px; border-radius: 8px; }
.hx-flip { display: inline-block; }
[dir="rtl"] .hx-flip { transform: scaleX(-1); }
.hx-muted { color: var(--hx-muted); }
.hx-mt { margin-block-start: 2.5rem; }
.hx-gold-text {
  background: linear-gradient(100deg, #f7e08c 0%, #e6c766 35%, #c9a227 70%, #f2d77a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hx-ar-inline { font-family: var(--hx-arabic); font-size: 1.1em; color: var(--hx-gold); margin-inline-start: .35rem; }
body.dark .hx-ar-inline { color: var(--hx-gold-2); }

/* ---------- Buttons, chips, links ---------- */
.hx-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.35rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--hx-ease), box-shadow .2s var(--hx-ease), background .2s;
}
.hx-btn:hover { transform: translateY(-2px); }
.hx-btn-gold { background: linear-gradient(135deg, #f2d77a, #c9a227); color: #1b1a12 !important; box-shadow: 0 10px 30px -10px rgba(201, 162, 39, .8); }
.hx-btn-glass { background: rgba(255, 255, 255, .1); color: #fff !important; border-color: rgba(255, 255, 255, .28); backdrop-filter: blur(8px); }
.hx-btn-glass:hover { background: rgba(255, 255, 255, .18); }
.hx-btn-solid { background: var(--hx-emerald); color: #fff !important; box-shadow: 0 10px 24px -12px rgba(31, 122, 77, .9); }
.hx-btn-solid:hover { background: #1a6b43; }
.hx-btn-ghost { background: transparent; color: var(--hx-text) !important; border-color: var(--hx-border-strong); }
.hx-btn-ghost:hover { background: var(--hx-surface-2); }
.hx-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--hx-emerald) !important; text-decoration: none; }
body.dark .hx-link { color: var(--hx-mint) !important; }
.hx-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.hx-link-btn { background: none; border: 0; padding: 0; font-weight: 600; color: var(--hx-emerald); display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
body.dark .hx-link-btn { color: var(--hx-mint); }
.hx-icon-btn {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid var(--hx-border-strong); background: var(--hx-surface); color: var(--hx-text);
  text-decoration: none; cursor: pointer; transition: background .2s, transform .2s;
}
.hx-icon-btn:hover { background: var(--hx-surface-2); transform: translateY(-1px); }
.hx-chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border-radius: 999px;
  border: 1px solid var(--hx-border-strong); background: var(--hx-surface); color: var(--hx-text);
  font-size: .875rem; font-weight: 500; cursor: pointer; transition: all .2s;
}
.hx-chip:hover { border-color: var(--hx-emerald); }
.hx-chip.is-active { background: var(--hx-ink); color: #fff; border-color: var(--hx-ink); }
body.dark .hx-chip.is-active { background: var(--hx-gold-2); color: #1b1a12; border-color: var(--hx-gold-2); }
.hx-chip-count { font-size: .75rem; opacity: .7; }
.hx-chip-static { cursor: default; padding: .2rem .7rem; font-size: .75rem; letter-spacing: .02em; background: var(--hx-surface-2); border-color: transparent; }
.hx-pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .02em; vertical-align: middle; margin-inline-start: .35rem; }
.hx-pill-approx { background: rgba(201, 162, 39, .16); color: #8a6a10; }
.hx-pill-trad { background: rgba(44, 79, 140, .12); color: var(--hx-lapis); }
body.dark .hx-pill-approx { color: var(--hx-gold-2); }
body.dark .hx-pill-trad { color: #9db7e6; background: rgba(157, 183, 230, .14); }

/* ---------- Header (inner pages) ---------- */
.hx-head {
  position: relative; overflow: hidden; color: #fff; isolation: isolate;
  padding: 3rem 0 2.25rem;
  background:
    radial-gradient(900px 380px at 88% 115%, rgba(201, 162, 39, .32), transparent 62%),
    radial-gradient(700px 300px at 8% -20%, rgba(46, 158, 103, .25), transparent 60%),
    linear-gradient(160deg, #072a1d 0%, #0d3b29 55%, #16624f 100%);
}
.hx-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .09;
  background: url("../images/history/hub/pattern-tile.svg") repeat; background-size: 72px 72px;
}
.hx-head-stars, .hx-hero-shade::before {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1px 1px at 28% 62%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.4px 1.4px at 46% 18%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1px 1px at 63% 44%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.3px 1.3px at 78% 14%, rgba(255,240,200,.9), transparent 60%),
    radial-gradient(1px 1px at 91% 58%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1px 1px at 55% 80%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(1.2px 1.2px at 6% 78%, rgba(255,255,255,.6), transparent 60%);
  animation: hx-twinkle 6s ease-in-out infinite alternate;
}
.hx-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.4rem; font-size: .85rem; color: rgba(255,255,255,.65); }
.hx-crumbs li + li::before { content: "/"; margin-inline-end: .4rem; opacity: .5; }
.hx-crumbs a { color: rgba(255,255,255,.75) !important; text-decoration: none; }
.hx-crumbs a:hover { color: #fff !important; }
.hx-crumbs [aria-current] { color: #fff; }
.hx-eyebrow { font-family: "Cinzel", serif; letter-spacing: .22em; text-transform: uppercase; font-size: .78rem; color: var(--hx-gold-2); margin: 0 0 .6rem; }
html[lang="ar"] .hx-eyebrow, html[lang="ur"] .hx-eyebrow { font-family: var(--hx-arabic); letter-spacing: 0; font-size: 1rem; }
.hx-title { font-family: var(--hx-display); font-weight: 600; font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: 1.05; letter-spacing: -.01em; margin: 0 0 .8rem; color: #fff; }
.hx-lead { max-width: 46rem; font-size: 1.08rem; line-height: 1.7; color: rgba(255,255,255,.82); margin: 0 0 1.6rem; }
.hx-subnav { display: flex; gap: .5rem; flex-wrap: wrap; }
.hx-subnav-link {
  display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1rem; border-radius: 999px;
  color: rgba(255,255,255,.85) !important; text-decoration: none; font-size: .9rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); backdrop-filter: blur(6px);
  transition: all .2s;
}
.hx-subnav-link:hover { background: rgba(255,255,255,.14); color: #fff !important; }
.hx-subnav-link.is-active { background: var(--hx-gold-2); color: #1b1a12 !important; border-color: var(--hx-gold-2); font-weight: 600; }

/* ---------- Sections ---------- */
.hx-section { padding: 4rem 0; position: relative; }
.hx-section-head { max-width: 46rem; margin-block-end: 2rem; }
.hx-section-head-row { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; }
.hx-kicker { font-family: "Cinzel", serif; text-transform: uppercase; letter-spacing: .2em; font-size: .74rem; color: var(--hx-gold); margin: 0 0 .4rem; font-weight: 600; }
html[lang="ar"] .hx-kicker, html[lang="ur"] .hx-kicker { font-family: var(--hx-arabic); letter-spacing: 0; font-size: .95rem; }
body.dark .hx-kicker { color: var(--hx-gold-2); }
.hx-h2 { font-family: var(--hx-display); font-weight: 600; font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.1; margin: 0 0 .6rem; color: var(--hx-text); }
.hx-h2-sm { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.hx-h3 { font-family: var(--hx-display); font-weight: 600; font-size: 1.35rem; margin: 0 0 .75rem; display: inline-flex; align-items: center; gap: .5rem; color: var(--hx-text); }
.hx-section-lead { color: var(--hx-muted); font-size: 1.05rem; line-height: 1.7; margin: 0; }
.hx-empty { text-align: center; padding: 3rem 1rem; color: var(--hx-muted); border: 1px dashed var(--hx-border-strong); border-radius: var(--hx-radius); }
.hx-empty i { font-size: 2rem; color: var(--hx-gold); }
.hx-footnote { font-size: .88rem; color: var(--hx-muted); margin: 1.5rem 0 0; display: flex; gap: .5rem; align-items: start; }
.hx-prose { line-height: 1.75; }
.hx-prose p { margin: 0 0 .85rem; }
.hx-prose .hx-debate { padding: .7rem .9rem; border-inline-start: 3px solid var(--hx-gold); background: rgba(201,162,39,.08); border-radius: 10px; font-size: .92rem; }
.hx-source { font-size: .82rem; color: var(--hx-muted); margin: 0; display: inline-flex; flex-wrap: wrap; gap: .3rem; align-items: baseline; }
.hx-source a { color: var(--hx-muted) !important; text-decoration: underline; text-decoration-color: var(--hx-border-strong); text-underline-offset: 3px; }
.hx-source a:hover { color: var(--hx-text) !important; }
.hx-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-block-start: .9rem; }

/* Reveal on scroll (disabled under reduced motion; .hx-js is set by common.js) */
.hx-js .hx-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--hx-ease), transform .7s var(--hx-ease); }
.hx-js .hx-reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   HUB
   ========================================================================== */
.hx-hero {
  position: relative; min-height: min(86vh, 760px); display: flex; align-items: center; overflow: hidden;
  background: #072a1d; color: #fff; isolation: isolate;
}
.hx-hero-media { position: absolute; inset: 0; z-index: -2; }
.hx-hero-art { width: 100%; height: 100%; display: block; }
.hx-hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(4, 26, 18, .92) 0%, rgba(4, 26, 18, .7) 38%, rgba(4, 26, 18, .1) 70%, rgba(4, 26, 18, 0) 100%),
              linear-gradient(0deg, rgba(4, 26, 18, .55), transparent 35%);
}
[dir="rtl"] .hx-hero-shade { background: linear-gradient(270deg, rgba(4, 26, 18, .92) 0%, rgba(4, 26, 18, .7) 38%, rgba(4, 26, 18, .1) 70%, rgba(4, 26, 18, 0) 100%), linear-gradient(0deg, rgba(4, 26, 18, .55), transparent 35%); }
[dir="rtl"] .hx-hero-art { transform: scaleX(-1); }
.hx-hero-inner { padding-block: 5rem 6rem; }
.hx-hero-title { font-family: var(--hx-display); font-weight: 600; font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; max-width: 15ch; margin: 0 0 1.2rem; color: #fff; letter-spacing: -.015em; text-wrap: balance; }
.hx-hero-lead { max-width: 38rem; font-size: 1.12rem; line-height: 1.75; color: rgba(255,255,255,.85); margin: 0 0 2rem; }
.hx-hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.6rem; }
.hx-hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, max-content)); gap: 1.2rem 2.4rem; margin: 0; }
.hx-hero-stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.hx-hero-stats dd { font-family: var(--hx-display); font-size: 2.6rem; font-weight: 600; line-height: 1; margin: 0; color: var(--hx-gold-2); font-variant-numeric: tabular-nums; }
.hx-hero-stats dt { font-size: .82rem; font-weight: 500; color: rgba(255,255,255,.72); margin-top: .35rem; max-width: 11ch; }
.hx-scroll-cue { position: absolute; inset-inline-start: 50%; bottom: 1.2rem; transform: translateX(-50%); width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; color: #fff !important; border: 1px solid rgba(255,255,255,.3); animation: hx-bob 2.4s ease-in-out infinite; text-decoration: none; }
[dir="rtl"] .hx-scroll-cue { transform: translateX(50%); }
.hx-hero .hx-star, .hx-hero .hx-stars circle { animation: hx-twinkle 3.5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.hx-hero .hx-stars circle:nth-child(3n) { animation-delay: -1.2s; animation-duration: 4.4s; }
.hx-hero .hx-stars circle:nth-child(5n) { animation-delay: -2.1s; animation-duration: 2.8s; }
.hx-hero [class*="hx-layer"] { transition: transform .6s var(--hx-ease); will-change: transform; }

.hx-exp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; }
.hx-exp {
  display: grid; grid-template-columns: 1fr; text-decoration: none; color: var(--hx-text) !important;
  background: var(--hx-surface); border: 1px solid var(--hx-border); border-radius: 28px; overflow: hidden;
  box-shadow: var(--hx-shadow); transition: transform .35s var(--hx-ease), box-shadow .35s var(--hx-ease), border-color .35s;
}
.hx-exp:hover { transform: translateY(-6px); box-shadow: var(--hx-shadow-lg); border-color: rgba(201, 162, 39, .55); }
.hx-exp-art { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--hx-night); }
.hx-exp-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--hx-ease); }
.hx-exp:hover .hx-exp-art img { transform: scale(1.05); }
.hx-exp-body { display: flex; flex-direction: column; gap: .55rem; padding: 1.5rem 1.6rem 1.6rem; position: relative; }
.hx-exp-num { position: absolute; inset-inline-end: 1.4rem; top: -1.7rem; padding: .3rem .7rem .35rem; border-radius: 16px; background: #0b2a20; border: 1px solid rgba(230, 199, 102, .45); font-family: var(--hx-display); font-size: 2.4rem; font-weight: 700; color: var(--hx-gold-2); box-shadow: 0 10px 24px -10px rgba(0,0,0,.55); line-height: 1; }
.hx-exp-title { font-family: var(--hx-display); font-size: 1.7rem; font-weight: 600; line-height: 1.15; display: flex; align-items: center; gap: .55rem; }
.hx-exp-title i { font-size: 1.15rem; color: var(--hx-emerald); }
body.dark .hx-exp-title i { color: var(--hx-mint); }
.hx-exp-text { color: var(--hx-muted); line-height: 1.65; }
.hx-exp-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .5rem; padding-top: .9rem; border-top: 1px solid var(--hx-border); }
.hx-exp-stat { font-size: .85rem; font-weight: 600; color: var(--hx-gold-ink); }
body.dark .hx-exp-stat { color: var(--hx-gold-2); }
.hx-exp-go { font-weight: 600; display: inline-flex; gap: .35rem; align-items: center; color: var(--hx-emerald); }
body.dark .hx-exp-go { color: var(--hx-mint); }
.hx-exp:hover .hx-exp-go i { transform: translateX(4px); }
[dir="rtl"] .hx-exp:hover .hx-exp-go i { transform: scaleX(-1) translateX(4px); }
.hx-exp-go i { transition: transform .25s; }

.hx-ribbon-section { background: linear-gradient(180deg, transparent, rgba(201,162,39,.06) 30%, rgba(201,162,39,.06) 70%, transparent); }
.hx-ribbon { overflow-x: auto; scrollbar-width: thin; padding: 1rem 0 1.5rem; scroll-snap-type: x proximity; scroll-padding-inline: max(1rem, calc((100vw - 1296px) / 2)); }
.hx-ribbon-track { list-style: none; display: flex; gap: 0; margin: 0; padding: 0 max(1rem, calc((100vw - 1296px) / 2)); position: relative; width: max-content; }
.hx-ribbon-track::before { content: ""; position: absolute; inset-inline: max(1rem, calc((100vw - 1296px) / 2)); top: 3.15rem; height: 2px; background: linear-gradient(90deg, var(--hx-gold), var(--hx-emerald), var(--hx-gold)); opacity: .55; }
.hx-ribbon-item { width: 200px; flex: none; scroll-snap-align: start; }
.hx-ribbon-item a { display: flex; flex-direction: column; gap: .35rem; padding-block: 0 0; padding-inline: 0 1rem; text-decoration: none; }
[dir="rtl"] .hx-ribbon-item a { padding: 0 0 0 1rem; }
.hx-ribbon-year { font-family: var(--hx-display); font-weight: 700; font-size: 1.35rem; color: var(--hx-gold); height: 2.2rem; display: flex; align-items: end; }
body.dark .hx-ribbon-year { color: var(--hx-gold-2); }
.hx-ribbon-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--hx-surface); border: 3px solid var(--hx-emerald); position: relative; z-index: 1; transition: transform .2s; }
.hx-ribbon-item.is-seerah .hx-ribbon-dot { border-color: var(--hx-gold); }
.hx-ribbon-item a:hover .hx-ribbon-dot { transform: scale(1.4); }
.hx-ribbon-title { font-weight: 600; line-height: 1.35; color: var(--hx-text); }
.hx-ribbon-place { font-size: .8rem; color: var(--hx-muted); }

.hx-mini-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.hx-mini { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; padding: .6rem .6rem .9rem; border-radius: 20px; background: var(--hx-surface); border: 1px solid var(--hx-border); transition: transform .3s var(--hx-ease), box-shadow .3s; }
.hx-mini:hover { transform: translateY(-4px); box-shadow: var(--hx-shadow); }
.hx-mini img { width: 100%; height: auto; border-radius: 14px; margin-bottom: .4rem; }
.hx-mini-year { font-size: .78rem; font-weight: 700; color: var(--hx-gold-ink); }
.hx-mini-title { font-family: var(--hx-display); font-weight: 600; font-size: 1.12rem; line-height: 1.2; color: var(--hx-text); }
.hx-mini-by { font-size: .8rem; color: var(--hx-muted); }

.hx-method { display: grid; grid-template-columns: 1fr 1.3fr; gap: 2.5rem; align-items: center; padding: 2.5rem; border-radius: 32px; background: var(--hx-surface); border: 1px solid var(--hx-border); box-shadow: var(--hx-shadow); position: relative; overflow: hidden; }
.hx-method::after { content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 240px; height: 240px; background: url("../images/history/hub/pattern-tile.svg"); background-size: 60px; opacity: .14; border-radius: 50%; }
.hx-method-intro p { color: var(--hx-muted); line-height: 1.7; }
.hx-method-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.hx-method-list li { display: flex; gap: 1rem; align-items: start; line-height: 1.6; }
.hx-method-list i { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 14px; display: grid; place-items: center; background: rgba(31,122,77,.1); color: var(--hx-emerald); font-size: 1.15rem; }
body.dark .hx-method-list i { background: rgba(156,207,182,.12); color: var(--hx-mint); }

/* ==========================================================================
   PROPHETS TIMELINE
   ========================================================================== */
.hx-chart-wrap { padding: 2.5rem 0 1rem; background: linear-gradient(180deg, rgba(18,58,68,.06), transparent 70%); }
.hx-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hx-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; padding: 0; margin: 0; font-size: .85rem; color: var(--hx-muted); }
.hx-legend li { display: inline-flex; align-items: center; gap: .5rem; }
.hx-key { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.hx-key-ulul { width: 18px; height: 18px; background: radial-gradient(circle, #f7e08c 35%, #c9a227 70%); box-shadow: 0 0 0 3px rgba(201,162,39,.25), 0 0 14px rgba(201,162,39,.7); clip-path: polygon(50% 0, 61% 30%, 93% 25%, 72% 50%, 93% 75%, 61% 70%, 50% 100%, 39% 70%, 7% 75%, 28% 50%, 7% 25%, 39% 30%); }
.hx-key-dated { background: var(--hx-emerald); box-shadow: 0 0 0 3px rgba(31,122,77,.2); }
.hx-key-approx { background: transparent; border: 2px dashed var(--hx-muted); }
.hx-chart-tools { display: flex; gap: .5rem; }

.hx-chart { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--hx-gold) transparent; cursor: grab; padding: 0 0 1rem; scroll-behavior: smooth; }
.hx-chart.is-dragging { cursor: grabbing; scroll-behavior: auto; user-select: none; }
.hx-track {
  --col: 116px;
  display: flex; width: max-content; position: relative;
  padding-inline: max(1rem, calc((100vw - 1296px) / 2));
}
.hx-track::before { /* the golden thread through every prophet */
  content: ""; position: absolute; inset-inline: max(1rem, calc((100vw - 1296px) / 2)); top: 237px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(201,162,39,.25), var(--hx-gold) 8%, var(--hx-gold-2) 50%, var(--hx-gold) 92%, rgba(201,162,39,.25));
  box-shadow: 0 0 18px rgba(201,162,39,.45);
  transform-origin: left center; animation: hx-draw-x 1.8s var(--hx-ease) both .2s;
}
[dir="rtl"] .hx-track::before { transform-origin: right center; }
.hx-band { width: calc(var(--span) * var(--col)); position: relative; padding-top: 3rem; height: 430px; }
.hx-band::before { /* tinted era band */
  content: ""; position: absolute; inset: 0 3px; border-radius: 26px; z-index: -1;
  background: linear-gradient(180deg, var(--band-a), var(--band-b));
  border: 1px solid var(--band-line);
}
.hx-band-beginnings { --band-a: rgba(44,79,140,.10); --band-b: rgba(44,79,140,.02); --band-line: rgba(44,79,140,.16); --band-ink: #1f6a55; }
.hx-band-arabia { --band-a: rgba(181,86,44,.11); --band-b: rgba(181,86,44,.02); --band-line: rgba(181,86,44,.18); --band-ink: #B5562C; }
.hx-band-ibrahim { --band-a: rgba(201,162,39,.14); --band-b: rgba(201,162,39,.02); --band-line: rgba(201,162,39,.24); --band-ink: #8a6a10; }
.hx-band-israel { --band-a: rgba(14,94,90,.11); --band-b: rgba(14,94,90,.02); --band-line: rgba(14,94,90,.18); --band-ink: #16624f; }
.hx-band-final { --band-a: rgba(31,122,77,.16); --band-b: rgba(31,122,77,.03); --band-line: rgba(31,122,77,.28); --band-ink: #1F7A4D; }
body.dark .hx-band-beginnings { --band-ink: #9db7e6; }
body.dark .hx-band-arabia { --band-ink: #e9a27f; }
body.dark .hx-band-ibrahim { --band-ink: #E6C766; }
body.dark .hx-band-israel { --band-ink: #7fd1c9; }
body.dark .hx-band-final { --band-ink: #9CCFB6; }
.hx-band-label { position: absolute; top: .9rem; inset-inline: .8rem; text-align: center; font-family: "Cinzel", serif; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--band-ink); font-weight: 700; line-height: 1.35; }
html[lang="ar"] .hx-band-label, html[lang="ur"] .hx-band-label { font-family: var(--hx-arabic); letter-spacing: 0; font-size: .95rem; }
.hx-band-nodes { display: flex; height: 100%; }

.hx-node {
  width: var(--col); flex: none; position: relative; background: none; border: 0; padding: 0; color: inherit; cursor: pointer;
  height: calc(100% - 3rem);
}
.hx-node-dot {
  position: absolute; top: 180px; inset-inline-start: 50%; translate: -50% 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--hx-surface); border: 3px solid var(--hx-muted); z-index: 2;
  transition: transform .3s var(--hx-ease), background .3s, border-color .3s, box-shadow .3s;
  animation: hx-pop .6s var(--hx-ease) both; animation-delay: calc(var(--i) * 45ms + .4s);
}
[dir="rtl"] .hx-node-dot { translate: 50% 0; }
.hx-node.is-dated .hx-node-dot { border-color: var(--hx-emerald); background: var(--hx-surface); }
.hx-node:not(.is-dated) .hx-node-dot { border-style: dashed; }
.hx-node.is-ulul .hx-node-dot { width: 40px; height: 40px; top: 171px; border: 0; background: none; }
.hx-star8 { width: 100%; height: 100%; fill: url(#hxStarFill); fill: #e6c766; filter: drop-shadow(0 0 8px rgba(230,199,102,.85)); }
.hx-node.is-ulul .hx-node-dot::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(201,162,39,.45); animation: hx-pulse 2.6s ease-out infinite; }
.hx-node-card {
  position: absolute; inset-inline-start: 50%; translate: -50% 0; width: 150px; display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .7rem .6rem .75rem; border-radius: 18px; text-align: center; background: var(--hx-surface); border: 1px solid var(--hx-border);
  box-shadow: var(--hx-shadow); transition: transform .3s var(--hx-ease), box-shadow .3s, border-color .3s;
  animation: hx-rise .7s var(--hx-ease) both; animation-delay: calc(var(--i) * 45ms + .5s);
}
[dir="rtl"] .hx-node-card { translate: 50% 0; }
.hx-node.is-high .hx-node-card { bottom: calc(100% - 160px); }
.hx-node.is-low .hx-node-card { top: 224px; }
.hx-node-card::after { /* stem to the thread */
  content: ""; position: absolute; inset-inline-start: 50%; width: 0; border-inline-start: 1.5px dashed var(--hx-border-strong);
}
.hx-node.is-high .hx-node-card::after { top: 100%; height: 20px; }
.hx-node.is-low .hx-node-card::after { bottom: 100%; height: 22px; }
.hx-node-index { font-size: .66rem; font-weight: 700; letter-spacing: .08em; color: var(--hx-muted); }
.hx-node-name { font-family: var(--hx-display); font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.hx-node-ar { font-family: var(--hx-arabic); font-size: 1.25rem; line-height: 1.4; color: var(--hx-gold); }
body.dark .hx-node-ar { color: var(--hx-gold-2); }
.hx-node-era { font-size: .72rem; color: var(--hx-muted); line-height: 1.3; }
.hx-node.is-dated .hx-node-era { color: var(--hx-emerald); font-weight: 600; }
body.dark .hx-node.is-dated .hx-node-era { color: var(--hx-mint); }
.hx-node:not(.is-dated) .hx-node-era { font-style: italic; }
.hx-node:hover .hx-node-card { transform: translateY(-4px); border-color: rgba(201,162,39,.6); }
.hx-node:hover .hx-node-dot { transform: scale(1.25); }
.hx-node.is-ulul .hx-node-card { border-color: rgba(201,162,39,.45); background: linear-gradient(180deg, rgba(246,223,164,.35), var(--hx-surface) 55%); }
body.dark .hx-node.is-ulul .hx-node-card { background: linear-gradient(180deg, rgba(201,162,39,.16), var(--hx-surface) 60%); }
.hx-node[aria-selected="true"] .hx-node-card { border-color: var(--hx-gold); box-shadow: 0 0 0 3px rgba(201,162,39,.35), var(--hx-shadow-lg); transform: translateY(-4px); }
.hx-node[aria-selected="true"]:not(.is-ulul) .hx-node-dot { background: var(--hx-gold-2); border-color: var(--hx-gold); border-style: solid; transform: scale(1.35); box-shadow: 0 0 0 6px rgba(201,162,39,.2), 0 0 22px rgba(201,162,39,.7); }
.hx-node[aria-selected="true"].is-ulul .hx-node-dot { transform: scale(1.18); }
.hx-node:focus-visible { outline: none; }
.hx-node:focus-visible .hx-node-card { outline: 3px solid var(--hx-gold); outline-offset: 3px; }
.hx-chart-hint { font-size: .85rem; color: var(--hx-muted); margin: .25rem auto 0; }

/* Detail panel */
.hx-details-section { padding-top: 1.5rem; }
.hx-detail {
  display: grid; grid-template-columns: 300px 1fr; gap: 0; border-radius: 32px; overflow: hidden; position: relative;
  background: var(--hx-surface); border: 1px solid var(--hx-border); box-shadow: var(--hx-shadow-lg);
  animation: hx-fade-up .5s var(--hx-ease) both;
}
.hx-detail[hidden] { display: none; }
.hx-sheet-close { display: none; }
.hx-medallion { background: radial-gradient(500px 300px at 50% 0%, rgba(201,162,39,.35), transparent 60%), linear-gradient(170deg, #072a1d, #0d3b29 60%, #16624f); padding: 2rem 1.6rem; display: flex; align-items: flex-start; position: relative; isolation: isolate; }
.hx-medallion::before { content: ""; position: absolute; inset: 0; background: url("../images/history/hub/pattern-tile.svg"); background-size: 56px; opacity: .1; z-index: -1; }
.hx-medallion-arch {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center; color: #fff; min-height: 420px; position: sticky; top: calc(var(--hx-sticky-top, 84px) + 12px);
  border: 1.5px solid rgba(230,199,102,.55); border-radius: 999px 999px 28px 28px; padding: 3.2rem 1rem 2rem; position: relative;
  box-shadow: inset 0 0 0 6px rgba(230,199,102,.08);
}
.hx-medallion-count { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.hx-medallion-ar { font-family: var(--hx-arabic); font-size: clamp(3rem, 6vw, 4.2rem); line-height: 1.5; color: var(--hx-gold-2); text-shadow: 0 6px 30px rgba(230,199,102,.4); }
.hx-medallion-name { font-family: var(--hx-display); font-size: 1.6rem; font-weight: 600; }
.hx-medallion-band { font-size: .8rem; color: rgba(255,255,255,.65); margin-top: .5rem; }
.hx-ulul-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; border-radius: 999px; background: linear-gradient(135deg, #f2d77a, #c9a227); color: #1b1a12; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.hx-detail-body { padding: 2rem 2.2rem 2rem; min-width: 0; }
.hx-detail-top { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.hx-detail-title { font-family: var(--hx-display); font-weight: 600; font-size: 2.4rem; line-height: 1; margin: 0; outline: none; }
.hx-detail-sub { color: var(--hx-muted); font-size: 1.02rem; margin: .4rem 0 0; font-style: italic; font-family: var(--hx-display); font-size: 1.25rem; }
.hx-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 0 0 1.4rem; }
.hx-fact { padding: .95rem 1.05rem; border-radius: 18px; background: var(--hx-surface-2); border: 1px solid var(--hx-border); }
.hx-fact dt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--hx-muted); margin-bottom: .35rem; display: flex; gap: .4rem; align-items: center; }
.hx-fact dt i { color: var(--hx-gold); font-size: .95rem; }
.hx-fact dd { margin: 0; }
.hx-fact-main { font-weight: 600; font-size: 1.02rem; }
.hx-fact-note { display: block; font-size: .82rem; color: var(--hx-muted); margin-top: .3rem; line-height: 1.45; }
.hx-detail-summary { font-size: 1.06rem; line-height: 1.75; margin: 0 0 1.4rem; }
.hx-verses { margin-bottom: 1.2rem; }
.hx-verses .ip-verse { margin: .4rem 0 .8rem; background: linear-gradient(135deg, rgba(31,122,77,.07), rgba(201,162,39,.06)); border-inline-start-color: var(--hx-gold); }
body.dark .hx-verses .ip-verse { background: rgba(255,255,255,.03); }
body.dark .ip-verse-cite a { color: var(--hx-mint); }
.hx-more-verses summary { cursor: pointer; font-weight: 600; color: var(--hx-emerald); margin: .2rem 0 .4rem; }
body.dark .hx-more-verses summary { color: var(--hx-mint); }
.hx-sources { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .84rem; color: var(--hx-muted); padding: .9rem 0; border-top: 1px dashed var(--hx-border-strong); }
.hx-sources a { color: var(--hx-muted) !important; text-decoration: underline; text-underline-offset: 3px; }
.hx-sources-label { font-weight: 700; }
.hx-detail-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: .6rem; }
.hx-detail-step { margin-inline-start: auto; display: inline-flex; gap: .5rem; }
.hx-sheet-backdrop { display: none; }

.hx-cta-section { padding-top: 1rem; }
.hx-cta { display: grid; grid-template-columns: 260px 1fr auto; align-items: center; gap: 2rem; text-decoration: none; color: #fff !important; padding-block: 1.2rem 1.2rem; padding-inline: 1.2rem 2rem; border-radius: 30px; background: linear-gradient(120deg, #072a1d, #0d3b29 55%, #16624f); box-shadow: var(--hx-shadow-lg); transition: transform .3s var(--hx-ease); overflow: hidden; }
.hx-cta:hover { transform: translateY(-4px); }
.hx-cta img { width: 100%; border-radius: 20px; }
.hx-cta-text { display: flex; flex-direction: column; gap: .35rem; color: rgba(255,255,255,.8); }
.hx-cta-text .hx-kicker { color: var(--hx-gold-2); }
.hx-cta-title { font-family: var(--hx-display); font-size: 2rem; font-weight: 600; color: #fff; line-height: 1.1; }
.hx-cta-play { font-size: 3.6rem; color: var(--hx-gold-2); transition: transform .3s; }
.hx-cta:hover .hx-cta-play { transform: scale(1.1); }

/* ==========================================================================
   MAPS (journey, Seerah, spread)
   ========================================================================== */
.hx-map { position: relative; width: 100%; height: 100%; min-height: 320px; border-radius: 28px; overflow: hidden; background: var(--hx-sea); border: 1px solid var(--hx-border); }
.hx-map svg { display: block; width: 100%; height: 100%; }
.hx-map-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; color: var(--hx-muted); text-align: center; padding: 1.5rem; z-index: 3; background: var(--hx-sea); }
.hx-map-state.is-error { color: var(--hx-terracotta); }
.hx-map-state[hidden] { display: none; }
.hx-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(201,162,39,.25); border-top-color: var(--hx-gold); animation: hx-spin 1s linear infinite; }
.hx-map .land { fill: var(--hx-land); stroke: var(--hx-land-stroke); stroke-width: .5; vector-effect: non-scaling-stroke; }
.hx-map .borders { fill: none; stroke: var(--hx-land-stroke); stroke-width: .6; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; opacity: .8; }
.hx-map .graticule { fill: none; stroke: rgba(44,79,140,.12); stroke-width: .6; vector-effect: non-scaling-stroke; }
body.dark .hx-map .graticule { stroke: rgba(157,183,230,.08); }
.hx-map .sphere { fill: var(--hx-sea); }

/* Journey */
.hx-journey { padding: 2.5rem 0 0; }
.hx-journey-stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2rem; height: min(72vh, 680px); min-height: 520px; padding-inline: max(1rem, calc((100vw - 1296px) / 2)); }
.hx-journey .hx-map { background: radial-gradient(120% 120% at 30% 20%, #dfeef0, #c5dde2); }
body.dark .hx-journey .hx-map { background: radial-gradient(120% 120% at 30% 20%, #0d3324, #06180f); }
.hx-route { fill: none; stroke: var(--hx-gold); stroke-width: var(--hx-route-w, 2.5px); stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(201,162,39,.6)); }
.hx-route.is-past { opacity: .38; filter: none; }
.hx-route.is-current { stroke: #E6C766; filter: drop-shadow(0 0 5px rgba(230,199,102,.9)); }
.hx-journey .hx-map .land, .hx-map-arabia .land { filter: drop-shadow(0 2px 3px rgba(31,42,51,.18)); }
.hx-route-ghost { fill: none; stroke: rgba(201,162,39,.35); stroke-width: 1.5; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.hx-pin circle.hx-pin-dot { fill: var(--hx-surface); stroke: var(--hx-teal); stroke-width: 2.5; vector-effect: non-scaling-stroke; transition: r .3s; }
.hx-pin.is-ulul circle.hx-pin-dot { fill: var(--hx-gold-2); stroke: #8a6a10; }
.hx-pin.is-visited circle.hx-pin-dot { stroke: var(--hx-gold); }
.hx-pin.is-active circle.hx-pin-dot { fill: var(--hx-gold-2); stroke: #fff; }
.hx-pin .hx-pin-halo { fill: rgba(201,162,39,.25); stroke: rgba(201,162,39,.7); stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: 0; }
.hx-pin.is-active .hx-pin-halo { opacity: 1; animation: hx-halo 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.hx-pin text { font: 600 12px/1 Inter, sans-serif; fill: var(--hx-ink); paint-order: stroke; stroke: rgba(251,246,234,.92); stroke-width: 4px; stroke-linejoin: round; opacity: 0; transition: opacity .3s; pointer-events: none; }
body.dark .hx-pin text { fill: #fff; stroke: rgba(8,24,32,.9); }
.hx-pin.is-active text, .hx-pin.is-ulul text, .hx-pin:hover text { opacity: 1; }
.hx-pin.is-muted text { opacity: 0; }
.hx-pin { cursor: pointer; }
.hx-caption {
  border-radius: 28px; padding: 1.6rem 1.6rem 1.4rem; display: flex; flex-direction: column; gap: .4rem; overflow: auto; color: #fff;
  background: radial-gradient(400px 260px at 100% 0%, rgba(201,162,39,.28), transparent 60%), linear-gradient(165deg, #072a1d, #0d3b29 60%, #16624f);
  box-shadow: var(--hx-shadow-lg); position: relative; isolation: isolate;
}
.hx-caption::before { content: ""; position: absolute; inset: 0; background: url("../images/history/hub/pattern-tile.svg"); background-size: 56px; opacity: .07; z-index: -1; }
.hx-caption-top { display: flex; justify-content: space-between; gap: .5rem; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.hx-caption-band { color: var(--hx-gold-2); text-align: end; }
.hx-caption-ar { font-family: var(--hx-arabic); font-size: 3rem; line-height: 1.5; color: var(--hx-gold-2); margin: .6rem 0 0; text-shadow: 0 6px 30px rgba(230,199,102,.35); }
.hx-caption-name { font-family: var(--hx-display); font-size: 2rem; font-weight: 600; margin: 0; color: #fff; }
.hx-caption-meta { color: rgba(255,255,255,.72); font-size: .9rem; margin: 0 0 .6rem; }
.hx-dot-sep { margin-inline: .4rem; }
.hx-caption-text { font-size: 1.04rem; line-height: 1.75; color: rgba(255,255,255,.92); margin: 0; flex: 1; }
.hx-caption-text.is-changing { animation: hx-fade-up .6s var(--hx-ease); }
.hx-caption-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding-top: .9rem; border-top: 1px solid rgba(255,255,255,.12); margin-top: .6rem; }
.hx-caption .hx-link { color: var(--hx-gold-2) !important; }
.hx-controls, .hx-spread-controls {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: 1rem max(1rem, calc((100vw - 1296px) / 2)) .4rem;
}
.hx-ctrl {
  height: 3rem; min-width: 3rem; border-radius: 999px; border: 1px solid var(--hx-border-strong); background: var(--hx-surface);
  color: var(--hx-text); display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font-weight: 600; padding: 0 .9rem;
  cursor: pointer; transition: all .2s; font-size: 1.05rem;
}
.hx-ctrl:hover { background: var(--hx-surface-2); }
.hx-ctrl-play { width: 3.8rem; height: 3.8rem; font-size: 1.7rem; background: linear-gradient(135deg, #f2d77a, #c9a227); border: 0; color: #1b1a12; box-shadow: 0 10px 28px -10px rgba(201,162,39,.9); }
.hx-ctrl-play:hover { background: linear-gradient(135deg, #f7e08c, #d4ad2e); }
.hx-ctrl-wide { font-size: .9rem; }
.hx-ctrl[aria-pressed="true"] { background: var(--hx-emerald); color: #fff; border-color: var(--hx-emerald); }
.hx-progress, .hx-year-slider { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: .25rem; }
.hx input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--hx-gold) var(--p, 0%), var(--hx-border-strong) var(--p, 0%)); outline: none; }
[dir="rtl"] .hx input[type="range"] { background: linear-gradient(270deg, var(--hx-gold) var(--p, 0%), var(--hx-border-strong) var(--p, 0%)); }
.hx input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--hx-gold); box-shadow: 0 2px 10px rgba(0,0,0,.25); cursor: pointer; }
.hx input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--hx-gold); cursor: pointer; }
.hx input[type="range"]:focus-visible { outline: 3px solid var(--hx-gold); outline-offset: 6px; }
.hx-kbd-help { font-size: .8rem; color: var(--hx-muted); padding-inline: max(1rem, calc((100vw - 1296px) / 2)); margin: .2rem 0 .6rem; }
.hx-stops { list-style: none; display: flex; gap: .5rem; overflow-x: auto; padding: .4rem max(1rem, calc((100vw - 1296px) / 2)) 1.2rem; margin: 0; scrollbar-width: thin; }
.hx-stop { display: inline-flex; align-items: center; gap: .45rem; padding-block: .4rem .4rem; padding-inline: .45rem .85rem; border-radius: 999px; border: 1px solid var(--hx-border); background: var(--hx-surface); white-space: nowrap; font-size: .85rem; cursor: pointer; color: var(--hx-text); transition: all .2s; }
.hx-stop-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--hx-surface-2); }
.hx-stop.is-ulul .hx-stop-num { background: linear-gradient(135deg, #f2d77a, #c9a227); color: #1b1a12; }
.hx-stop.is-visited { border-color: rgba(201,162,39,.5); }
.hx-stop[aria-current="step"] { background: var(--hx-ink); color: #fff; border-color: var(--hx-ink); }
body.dark .hx-stop[aria-current="step"] { background: var(--hx-gold-2); color: #1b1a12; }
.hx-stop[aria-current="step"] .hx-stop-num { background: var(--hx-gold-2); color: #1b1a12; }
body.dark .hx-stop[aria-current="step"] .hx-stop-num { background: #1b1a12; color: var(--hx-gold-2); }
.hx-list-alt { border: 1px solid var(--hx-border); border-radius: 24px; background: var(--hx-surface); padding: 1rem 1.4rem; }
.hx-list-alt > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.hx-list-alt > summary::-webkit-details-marker { display: none; }
.hx-list-alt > summary::after { content: "\F282"; font-family: "bootstrap-icons"; transition: transform .3s; }
.hx-list-alt[open] > summary::after { transform: rotate(180deg); }
.hx-list-alt > summary .hx-h3, .hx-list-alt > summary h2 { margin: 0; }
.hx-journey-list { padding-inline-start: 0; list-style: none; margin: 1.2rem 0 0; display: grid; gap: 1rem; }
.hx-journey-list li { padding: 1rem 1.1rem; border-radius: 18px; background: var(--hx-surface-2); }
.hx-journey-list p { margin: .35rem 0 0; line-height: 1.65; }
.hx-journey-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.hx-journey-list-num { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--hx-gold); color: #1b1a12; font-weight: 700; font-size: .8rem; }

/* Seerah scrollytelling */
.hx-jump { display: flex; gap: .6rem; flex-wrap: wrap; padding-top: 1.5rem; }
.hx-jump a { display: inline-flex; gap: .45rem; align-items: center; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--hx-border-strong); background: var(--hx-surface); text-decoration: none; font-weight: 500; font-size: .9rem; }
.hx-jump a:hover { border-color: var(--hx-gold); }
.hx-scrolly { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2.5rem; align-items: start; }
.hx-scrolly-map { position: sticky; top: calc(var(--hx-sticky-top, 84px) + 12px); height: calc(100vh - var(--hx-sticky-top, 84px) - 40px); max-height: 640px; display: flex; flex-direction: column; gap: .6rem; }
.hx-map-arabia { flex: 1; background: radial-gradient(120% 120% at 30% 20%, #e3eff1, #c9dfe4); }
body.dark .hx-map-arabia { background: radial-gradient(120% 120% at 30% 20%, #0d3324, #06180f); }
.hx-scrolly-now { margin: 0; font-family: var(--hx-display); font-size: 1.4rem; font-weight: 600; color: var(--hx-gold); min-height: 1.6em; }
.hx-scrolly-now span:last-child { color: var(--hx-muted); font-family: Inter, sans-serif; font-size: .9rem; font-weight: 500; margin-inline-start: .4rem; }
.hx-seerah-pin circle { fill: var(--hx-surface); stroke: var(--hx-emerald); stroke-width: 2; vector-effect: non-scaling-stroke; transition: all .4s; }
.hx-seerah-pin text { font: 600 11px/1 Inter, sans-serif; fill: var(--hx-ink); paint-order: stroke; stroke: rgba(251,246,234,.9); stroke-width: 3.5px; opacity: .0; transition: opacity .4s; }
body.dark .hx-seerah-pin text { fill: #fff; stroke: rgba(8,24,32,.9); }
.hx-seerah-pin.is-active circle { fill: var(--hx-gold-2); stroke: #fff; }
.hx-seerah-pin.is-active text { opacity: 1; }
.hx-seerah-pin.is-near circle:not(.hx-pin-halo) { stroke: var(--hx-gold); }
.hx-seerah-pin .hx-pin-halo { fill: rgba(201,162,39,.25); stroke: rgba(201,162,39,.8); stroke-width: 1.5; opacity: 0; vector-effect: non-scaling-stroke; }
.hx-seerah-pin.is-active .hx-pin-halo { opacity: 1; animation: hx-halo 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.hx-events { list-style: none; padding: 0; margin: 0; position: relative; }
.hx-events::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 7.3rem; width: 2px; background: linear-gradient(180deg, transparent, var(--hx-gold) 6%, var(--hx-emerald) 94%, transparent); opacity: .5; }
.hx-event { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.6rem; padding-bottom: 1.6rem; position: relative; scroll-margin-top: 100px; }
.hx-event::before { content: ""; position: absolute; inset-inline-start: calc(7.3rem - 7px); top: 1.4rem; width: 16px; height: 16px; border-radius: 50%; background: var(--hx-surface); border: 3px solid var(--hx-gold); z-index: 1; transition: all .3s; }
.hx-event.is-active::before { background: var(--hx-gold-2); box-shadow: 0 0 0 6px rgba(201,162,39,.2); }
.hx-event-year { text-align: end; padding-top: .9rem; padding-inline-end: .2rem; display: flex; flex-direction: column; gap: .2rem; }
.hx-event-ce { font-family: var(--hx-display); font-weight: 700; font-size: 1.3rem; white-space: nowrap; line-height: 1.1; color: var(--hx-text); }
.hx-event-ah { font-size: .75rem; font-weight: 600; color: var(--hx-gold); }
.hx-event-card { padding: 1.3rem 1.4rem; border-radius: 22px; background: var(--hx-surface); border: 1px solid var(--hx-border); box-shadow: var(--hx-shadow); transition: transform .4s var(--hx-ease), border-color .4s, box-shadow .4s; position: relative; }
.hx-event.is-active .hx-event-card { border-color: rgba(201,162,39,.6); box-shadow: var(--hx-shadow-lg); transform: translateX(6px); }
[dir="rtl"] .hx-event.is-active .hx-event-card { transform: translateX(-6px); }
.hx-event-icon { position: absolute; inset-inline-end: 1.1rem; top: 1.1rem; width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); font-size: 1.1rem; }
.hx-event-title { font-family: var(--hx-display); font-weight: 600; font-size: 1.5rem; line-height: 1.15; margin-block: 0 .35rem; margin-inline: 0 3rem; }
[dir="rtl"] .hx-event-title { margin: 0 0 .35rem 3rem; }
.hx-event-place { font-size: .85rem; color: var(--hx-muted); margin: 0 0 .5rem; }
.hx-event-summary { margin: 0; line-height: 1.7; }
.hx-event-more { margin-top: .6rem; }
.hx-event-more summary { cursor: pointer; font-weight: 600; color: var(--hx-emerald); font-size: .9rem; }
body.dark .hx-event-more summary { color: var(--hx-mint); }
.hx-event-more .hx-prose { margin-top: .6rem; font-size: .95rem; }
.hx-tone-emerald { --tone: #1F7A4D; --tone-bg: rgba(31,122,77,.1); }
.hx-tone-gold { --tone: #8a6a10; --tone-bg: rgba(201,162,39,.14); }
.hx-tone-teal { --tone: #16624f; --tone-bg: rgba(14,94,90,.1); }
.hx-tone-lapis { --tone: #1f6a55; --tone-bg: rgba(44,79,140,.1); }
.hx-tone-terracotta { --tone: #B5562C; --tone-bg: rgba(181,86,44,.1); }
.hx-tone-plum { --tone: #6B3A5B; --tone-bg: rgba(107,58,91,.1); }
body.dark [class*="hx-tone-"] { --tone: #e6c766; --tone-bg: rgba(230,199,102,.1); }

/* Spread */
.hx-spread { padding-top: 0; }
.hx-spread-band { padding: 4rem 0 2.5rem; color: #fff; background: radial-gradient(900px 400px at 85% 0%, rgba(201,162,39,.22), transparent 60%), linear-gradient(175deg, #072a1d, #0d3b29 55%, #10503a); position: relative; isolation: isolate; }
.hx-spread-band::before { content: ""; position: absolute; inset: 0; background: url("../images/history/hub/pattern-tile.svg"); background-size: 72px; opacity: .06; z-index: -1; }
.hx-on-dark .hx-h2 { color: #fff; }
.hx-on-dark .hx-section-lead { color: rgba(255,255,255,.78); }
.hx-on-dark .hx-kicker { color: var(--hx-gold-2); }
.hx-spread-stage { position: relative; aspect-ratio: 2 / 1.02; max-height: 680px; width: 100%; }
.hx-spread .hx-map-world { --hx-land: #183c2f; --hx-land-stroke: #2a5a47; --hx-sea: #061a12; background: radial-gradient(120% 100% at 50% 40%, #0d3324, #06180f); border-color: rgba(255,255,255,.08); }
.hx-spread .hx-map-world .graticule { stroke: rgba(157,183,230,.08); }
.hx-spread .hx-map-world .sphere { fill: rgba(255,255,255,.015); stroke: rgba(230,199,102,.25); }
.hx-country { fill: #183c2f; stroke: #2f5862; stroke-width: .5; vector-effect: non-scaling-stroke; transition: fill .6s ease; cursor: pointer; }
.hx-country.is-significant { fill: #3fae78; }
.hx-country.is-majority { fill: #8fe3b4; }
.hx-country.is-former { fill: url(#hxFormerHatch); }
.hx-country.is-new { animation: hx-glow 1.6s ease-out; }
.hx-country:hover, .hx-country:focus { stroke: var(--hx-gold-2); stroke-width: 1.5; outline: none; }
.hx-spread-marker circle { fill: var(--hx-gold-2); stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.hx-spread-marker .hx-pin-halo { fill: rgba(230,199,102,.25); stroke: rgba(230,199,102,.8); animation: hx-halo 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.hx-spread-year { position: absolute; inset-inline-start: 1.4rem; top: 1rem; pointer-events: none; display: flex; flex-direction: column; }
.hx-spread-year span { font-family: var(--hx-display); font-weight: 700; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1; color: var(--hx-gold-2); text-shadow: 0 6px 30px rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
.hx-spread-year small { color: rgba(255,255,255,.75); font-size: .85rem; margin-top: .3rem; }
.hx-spread-legend { position: absolute; inset-inline-start: 1.2rem; bottom: 1rem; list-style: none; margin: 0; padding: .6rem .9rem; border-radius: 14px; background: rgba(8,24,32,.72); backdrop-filter: blur(6px); font-size: .78rem; color: rgba(255,255,255,.85); display: grid; gap: .3rem; }
.hx-spread-legend li { display: flex; align-items: center; gap: .5rem; }
.hx-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.hx-swatch.is-majority { background: #8fe3b4; }
.hx-swatch.is-significant { background: #3fae78; }
.hx-swatch.is-former { background: repeating-linear-gradient(45deg, #6e5640 0 3px, #2a3d42 3px 6px); }
.hx-tooltip { position: absolute; z-index: 5; max-width: 300px; padding: .75rem .9rem; border-radius: 14px; background: rgba(251,246,234,.98); color: var(--hx-ink); box-shadow: 0 14px 40px rgba(0,0,0,.4); font-size: .85rem; line-height: 1.5; pointer-events: none; }
.hx-tooltip strong { font-family: var(--hx-display); font-size: 1.15rem; display: block; }
.hx-tooltip .hx-tip-presence { font-weight: 600; color: var(--hx-emerald); }
.hx-tooltip .hx-tip-source { color: var(--hx-muted); font-size: .76rem; display: block; margin-top: .3rem; }
.hx-spread-controls { padding: 1.2rem 0 .4rem; }
.hx-spread .hx-ctrl { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.hx-spread .hx-ctrl:hover { background: rgba(255,255,255,.16); }
.hx-spread .hx-ctrl-play { background: linear-gradient(135deg, #f2d77a, #c9a227); color: #1b1a12; border: 0; }
.hx-spread .hx-ctrl[aria-pressed="true"] { background: var(--hx-emerald); }
.hx-spread input[type="range"] { --hx-border-strong: rgba(255,255,255,.2); }
.hx-year-ticks { display: flex; justify-content: space-between; font-size: .72rem; color: rgba(255,255,255,.55); padding-inline: 4px; }
.hx-milestone { margin-top: 1rem; padding: 1.2rem 1.4rem; border-radius: 22px; background: rgba(255,255,255,.06); border: 1px solid rgba(230,199,102,.3); display: grid; grid-template-columns: auto 1fr; gap: .2rem 1.4rem; animation: hx-fade-up .5s var(--hx-ease); }
.hx-milestone[hidden] { display: none; }
.hx-milestone-year { grid-row: span 4; font-family: var(--hx-display); font-weight: 700; font-size: 2.2rem; color: var(--hx-gold-2); line-height: 1; padding-top: .2rem; }
.hx-milestone-title { font-family: var(--hx-display); font-size: 1.5rem; font-weight: 600; margin: 0; color: #fff; }
.hx-milestone-place { margin: 0; font-size: .85rem; color: rgba(255,255,255,.65); }
.hx-milestone-text { margin: .3rem 0 0; line-height: 1.7; color: rgba(255,255,255,.9); }
.hx-milestone-source { margin: .3rem 0 0; font-size: .8rem; }
.hx-milestone-source a { color: rgba(255,255,255,.7) !important; }
.hx-population-note { font-size: .84rem; color: rgba(255,255,255,.65); margin: 1rem 0 0; display: flex; gap: .5rem; }
.hx-milestones { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.hx-mcard { padding: 1.3rem 1.3rem 1.1rem; border-radius: 22px; background: var(--hx-surface); border: 1px solid var(--hx-border); box-shadow: var(--hx-shadow); display: flex; flex-direction: column; scroll-margin-top: 100px; }
.hx-mcard p { line-height: 1.65; margin: 0 0 .4rem; }
.hx-mcard .hx-card-foot { margin-top: auto; padding-top: .8rem; }
.hx-mcard-year { align-self: start; border: 0; cursor: pointer; font-family: var(--hx-display); font-weight: 700; font-size: 1.3rem; color: var(--tone); background: var(--tone-bg); padding: .2rem .8rem; border-radius: 999px; margin-bottom: .6rem; display: inline-flex; align-items: center; gap: .4rem; }
.hx-mcard-year i { font-size: .85rem; }
.hx-mcard-title { font-family: var(--hx-display); font-size: 1.35rem; font-weight: 600; line-height: 1.2; margin: 0 0 .3rem; }
.hx-mcard-title i { color: var(--tone); font-size: 1rem; }
.hx-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 1rem; }
.hx-table th, .hx-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--hx-border); vertical-align: top; text-align: start; }
.hx-table thead th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--hx-muted); }
.hx-table a { color: var(--hx-muted) !important; }
.hx-presence { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.hx-presence.is-majority { background: rgba(31,138,85,.15); color: #146c43; }
.hx-presence.is-significant { background: rgba(63,174,120,.12); color: #1f7a4d; }
body.dark .hx-presence.is-majority, body.dark .hx-presence.is-significant { color: var(--hx-mint); }

.hx-civ-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.hx-civ-card { padding: 1.4rem; border-radius: 24px; background: var(--hx-surface); border: 1px solid var(--hx-border); box-shadow: var(--hx-shadow); display: flex; flex-direction: column; scroll-margin-top: 100px; position: relative; overflow: hidden; }
.hx-civ-card::after { content: ""; position: absolute; inset-inline-end: -40px; bottom: -40px; width: 140px; height: 140px; background: url("../images/history/hub/pattern-tile.svg"); background-size: 44px; opacity: .12; border-radius: 50%; }
.hx-civ-card p { line-height: 1.65; margin: 0 0 .4rem; }
.hx-civ-card .hx-card-foot { margin-top: auto; padding-top: .8rem; }
.hx-civ-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.hx-civ-icon { width: 2.8rem; height: 2.8rem; border-radius: 14px; display: grid; place-items: center; background: var(--tone-bg); color: var(--tone); font-size: 1.2rem; }
.hx-civ-year { font-family: var(--hx-display); font-weight: 700; font-size: 1.3rem; color: var(--hx-gold); }
.hx-civ-title { font-family: var(--hx-display); font-size: 1.45rem; font-weight: 600; line-height: 1.15; margin: 0 0 .3rem; }

/* ==========================================================================
   INVENTIONS
   ========================================================================== */
.hx-inv { padding-top: 2.5rem; }
.hx-inv-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 2.5rem; position: sticky; top: calc(var(--hx-sticky-top, 84px) + 8px); z-index: 6; padding: .7rem; border-radius: 22px; background: color-mix(in srgb, var(--hx-surface) 88%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--hx-border); box-shadow: var(--hx-shadow); }
.hx-segment { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--hx-surface-2); border: 1px solid var(--hx-border); }
.hx-segment button { border: 0; background: transparent; padding: .55rem 1.1rem; border-radius: 999px; font-weight: 600; color: var(--hx-muted); display: inline-flex; gap: .45rem; align-items: center; cursor: pointer; transition: all .25s; }
.hx-segment button[aria-selected="true"] { background: var(--hx-ink); color: #fff; box-shadow: 0 6px 16px -8px rgba(0,0,0,.5); }
body.dark .hx-segment button[aria-selected="true"] { background: var(--hx-gold-2); color: #1b1a12; }
.hx-filters { display: flex; flex-wrap: wrap; gap: .45rem; }

.hx-snake-wrap { position: relative; }
.hx-snake-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.hx-snake-path .hx-snake-line { fill: none; stroke: var(--hx-gold); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; opacity: .75; }
.hx-snake-path .hx-snake-glow { fill: none; stroke: url(#hxSnakeGrad); stroke-width: 6; stroke-linecap: round; opacity: .9; filter: drop-shadow(0 0 6px rgba(201,162,39,.5)); }
.hx-snake { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2.2rem; row-gap: 4.5rem; position: relative; z-index: 1; }
.hx-inv-card { position: relative; display: flex; flex-direction: column; align-items: center; scroll-margin-top: 160px; }
.hx-inv-card[hidden] { display: none; }
.hx-inv-medal {
  width: 74px; height: 74px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: -26px; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #f7e08c, #c9a227 70%); color: #1b1a12; box-shadow: 0 0 0 6px var(--hx-surface), 0 0 0 7px rgba(201,162,39,.5), 0 12px 24px -8px rgba(0,0,0,.4);
  font-family: var(--hx-display); line-height: 1;
}
.hx-inv-medal span { font-size: .7rem; font-weight: 600; min-height: .7rem; }
.hx-inv-medal strong { font-size: 1.35rem; font-weight: 700; }
.hx-inv-body { width: 100%; background: var(--hx-surface); border: 1px solid var(--hx-border); border-radius: 26px; overflow: hidden; box-shadow: var(--hx-shadow); transition: transform .35s var(--hx-ease), box-shadow .35s, border-color .35s; display: flex; flex-direction: column; height: 100%; }
.hx-inv-card:hover .hx-inv-body { transform: translateY(-6px); box-shadow: var(--hx-shadow-lg); border-color: rgba(201,162,39,.5); }
.hx-inv-card.is-target .hx-inv-body { border-color: var(--hx-gold); box-shadow: 0 0 0 4px rgba(201,162,39,.35), var(--hx-shadow-lg); }
.hx-inv-art { border: 0; padding: 0; background: var(--hx-cream); display: block; width: 100%; cursor: zoom-in; overflow: hidden; }
.hx-inv-art img { width: 100%; height: auto; display: block; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .8s var(--hx-ease); }
.hx-inv-card:hover .hx-inv-art img { transform: scale(1.04); }
.hx-inv-text { padding: 1.1rem 1.3rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.hx-inv-meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .55rem; }
.hx-inv-when { font-size: .8rem; font-weight: 600; color: var(--hx-gold-ink); }
body.dark .hx-inv-when { color: var(--hx-gold-2); }
.hx-inv-title { font-family: var(--hx-display); font-weight: 600; font-size: 1.55rem; line-height: 1.12; margin: 0 0 .3rem; }
.hx-inv-by { margin: 0 0 .35rem; font-weight: 600; font-size: .92rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem; }
.hx-inv-summary { line-height: 1.65; margin: 0; color: var(--hx-text); }
.hx-inv-text .hx-card-foot { margin-top: auto; padding-top: .9rem; }
.hx-inv-text .hx-source { margin-top: .7rem; }

.hx-globe-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.2rem; }
.hx-globe-wrap[hidden] { display: none; }
.hx-globe { position: relative; height: min(76vh, 720px); min-height: 460px; border-radius: 30px; overflow: hidden; background: radial-gradient(circle at 50% 45%, #0d3b29, #072a1d 60%, #03130c); border: 1px solid var(--hx-border); }
.hx-globe .hx-map-state { background: transparent; color: rgba(255,255,255,.7); }
.hx-globe canvas { outline: none; }
.hx-globe-help { grid-column: 1; font-size: .85rem; color: var(--hx-muted); margin: 0; }
.hx-globe-list { grid-column: 2; grid-row: 1 / span 2; list-style: none; padding: .6rem; margin: 0; max-height: min(76vh, 720px); overflow: auto; border-radius: 24px; background: var(--hx-surface); border: 1px solid var(--hx-border); }
.hx-globe-list button { width: 100%; text-align: start; border: 0; background: none; padding: .55rem .7rem; border-radius: 12px; color: var(--hx-text); font-size: .9rem; cursor: pointer; display: flex; gap: .6rem; }
.hx-globe-list button:hover, .hx-globe-list button:focus-visible { background: var(--hx-surface-2); }
.hx-globe-list strong { color: var(--hx-gold); font-variant-numeric: tabular-nums; min-width: 2.6rem; }
.hx-globe-label { font: 600 12px Inter, sans-serif; color: #fff; background: rgba(8,24,32,.78); padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(230,199,102,.45); white-space: nowrap; pointer-events: auto; cursor: pointer; transform: translate(-50%, -140%); }
.hx-flat-point { fill: var(--hx-gold-2); stroke: #fff; stroke-width: 1.5; cursor: pointer; vector-effect: non-scaling-stroke; }

.hx-dialog { width: min(980px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 30px; background: var(--hx-surface); color: var(--hx-text); box-shadow: 0 40px 100px -20px rgba(0,0,0,.6); overflow: auto; }
.hx-dialog::backdrop { background: rgba(6, 18, 25, .72); backdrop-filter: blur(4px); }
.hx-dialog[open] { animation: hx-fade-up .4s var(--hx-ease); }
.hx-dialog-close { position: absolute; inset-inline-end: 1rem; top: 1rem; z-index: 2; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--hx-ink); box-shadow: 0 4px 14px rgba(0,0,0,.2); cursor: pointer; }
.hx-full { display: grid; grid-template-columns: 1fr 1.1fr; }
.hx-full-art { width: 100%; height: 100%; object-fit: cover; background: var(--hx-cream); min-height: 100%; }
.hx-full-text { padding: 2rem 2rem 1.6rem; }
.hx-full-title { font-family: var(--hx-display); font-weight: 600; font-size: 2.2rem; line-height: 1.05; margin: .4rem 0 1rem; }
.hx-full-facts { display: grid; gap: .5rem; margin: 0 0 1.2rem; padding: 1rem; border-radius: 18px; background: var(--hx-surface-2); }
.hx-full-facts div { display: grid; grid-template-columns: 6rem 1fr; gap: .6rem; }
.hx-full-facts dt { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hx-muted); padding-top: .15rem; }
.hx-full-facts dd { margin: 0; font-weight: 500; }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes hx-twinkle { from { opacity: .45; } to { opacity: 1; } }
@keyframes hx-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }
@keyframes hx-draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hx-pop { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }
@keyframes hx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes hx-pulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes hx-halo { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes hx-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes hx-spin { to { transform: rotate(360deg); } }
@keyframes hx-glow { 0% { fill: #f6dfa4; } 100% { } }

@media (prefers-reduced-motion: reduce) {
  .hx *, .hx *::before, .hx *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .hx-js .hx-reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199.98px) {
  .hx-mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hx-milestones, .hx-civ-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-snake { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .hx-exp-grid { grid-template-columns: 1fr; }
  .hx-method { grid-template-columns: 1fr; padding: 1.8rem; }
  .hx-detail { grid-template-columns: 1fr; }
  .hx-medallion { padding: 1.4rem; }
  .hx-medallion-arch { padding: 2rem 1rem 1.4rem; }
  .hx-journey-stage { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .hx-journey .hx-map { height: 58vh; min-height: 340px; }
  .hx-scrolly { grid-template-columns: 1fr; gap: 1rem; }
  .hx-scrolly-map { top: var(--hx-sticky-top, 84px); height: 32vh; min-height: 210px; z-index: 4; background: var(--hx-surface); padding: .4rem 0; border-radius: 0 0 22px 22px; margin-inline: -.5rem; padding-inline: .5rem; }
  .hx-scrolly-map .hx-map { min-height: 0; }
  .hx-scrolly-now { font-size: 1.05rem; }
  .hx-cta { grid-template-columns: 1fr; padding: 1.2rem; gap: 1rem; }
  .hx-cta-play { display: none; }
  .hx-globe-wrap { grid-template-columns: 1fr; }
  .hx-globe-list { grid-column: 1; grid-row: auto; max-height: 320px; }
  .hx-full { grid-template-columns: 1fr; }
  .hx-full-art { max-height: 320px; }
}

@media (max-width: 767.98px) {
  .hx-section { padding: 2.8rem 0; }
  .hx-head { padding: 2.2rem 0 1.6rem; }
  .hx-lead { font-size: 1rem; }
  .hx-subnav { flex-wrap: nowrap; overflow-x: auto; margin-inline: -1rem; padding-inline: 1rem; scrollbar-width: none; }
  .hx-subnav-link { white-space: nowrap; }
  .hx-hero { min-height: 0; }
  .hx-hero-inner { padding-block: 3rem 4.5rem; }
  .hx-hero-shade { background: linear-gradient(180deg, rgba(8,26,36,.55) 0%, rgba(8,26,36,.88) 55%, rgba(8,26,36,.96) 100%); }
  [dir="rtl"] .hx-hero-shade { background: linear-gradient(180deg, rgba(8,26,36,.55) 0%, rgba(8,26,36,.88) 55%, rgba(8,26,36,.96) 100%); }
  .hx-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.4rem; }
  .hx-hero-stats dd { font-size: 2.1rem; }
  .hx-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-exp-num { font-size: 1.9rem; top: -1.4rem; }
  .hx-exp-title { font-size: 1.45rem; }

  /* Prophets: the timeline turns vertical, the thread runs down the inline-start side */
  .hx-chart-tools, .hx-chart-hint { display: none; }
  .hx-chart { overflow: visible; cursor: default; padding: 0 1rem; }
  .hx-track { display: block; width: auto; padding: 0; }
  .hx-track::before { top: 0; bottom: 0; height: auto; width: 4px; inset-inline-start: 27px; inset-inline-end: auto; animation: none; }
  .hx-band { width: auto; height: auto; padding: 3rem .5rem .8rem; margin-bottom: .8rem; }
  .hx-band::before { inset: 0; }
  .hx-band-label { position: sticky; top: calc(var(--hx-sticky-top, 84px) + 6px); text-align: start; inset-inline: auto; padding: .4rem .7rem; margin: -2.4rem 0 .8rem; display: inline-block; border-radius: 999px; background: var(--hx-surface); box-shadow: var(--hx-shadow); z-index: 3; max-width: 100%; }
  .hx-band-nodes { flex-direction: column; gap: .8rem; height: auto; }
  .hx-node { width: 100%; height: auto; display: flex; align-items: center; gap: .9rem; text-align: start; }
  .hx-node-dot, .hx-node.is-ulul .hx-node-dot { position: relative; top: auto; inset-inline-start: auto; translate: none; flex: none; margin-inline-start: 8px; }
  [dir="rtl"] .hx-node-dot { translate: none; }
  .hx-node.is-ulul .hx-node-dot { margin-inline-start: -1px; }
  .hx-node-card, .hx-node.is-high .hx-node-card, .hx-node.is-low .hx-node-card {
    position: relative; inset: auto; translate: none; width: auto; flex: 1; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "index name ar" "index era ar";
    align-items: center; text-align: start; column-gap: .7rem; padding: .7rem .9rem;
  }
  [dir="rtl"] .hx-node-card { translate: none; }
  .hx-node-card::after { display: none; }
  .hx-node-index { grid-area: index; }
  .hx-node-name { grid-area: name; }
  .hx-node-ar { grid-area: ar; font-size: 1.4rem; }
  .hx-node-era { grid-area: era; }
  .hx-node:hover .hx-node-card, .hx-node[aria-selected="true"] .hx-node-card { transform: none; }

  /* The prophet panel becomes a bottom sheet */
  .hx-details-section { padding: 0; }
  .hx-details { position: fixed; inset: auto 0 0 0; z-index: 1060; max-height: 88vh; overflow: auto; transform: translateY(105%); visibility: hidden; transition: transform .4s var(--hx-ease), visibility 0s linear .4s; border-radius: 28px 28px 0 0; box-shadow: 0 -20px 60px rgba(0,0,0,.4); background: var(--hx-surface); overscroll-behavior: contain; }
  .hx-details.is-open { transform: none; visibility: visible; transition: transform .4s var(--hx-ease); }
  .hx-details::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--hx-border-strong); margin: .6rem auto 0; position: sticky; top: .6rem; z-index: 3; }
  .hx-detail { border-radius: 0; box-shadow: none; border: 0; animation: none; }
  .hx-sheet-close { display: grid; place-items: center; position: absolute; inset-inline-end: .9rem; top: .9rem; z-index: 3; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--hx-ink); }
  .hx-sheet-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1059; background: rgba(6,18,25,.6); backdrop-filter: blur(2px); }
  .hx-medallion-arch { flex-direction: row; flex-wrap: wrap; border-radius: 22px; padding: 1rem; gap: .3rem .8rem; justify-content: flex-start; min-height: 0; position: static; }
  .hx-medallion-ar { font-size: 2.4rem; line-height: 1.3; }
  .hx-medallion-count, .hx-medallion-band { width: 100%; text-align: start; margin: 0; }
  .hx-detail-body { padding: 1.3rem 1.2rem 2rem; }
  .hx-detail-title { font-size: 2rem; }
  .hx-facts { grid-template-columns: 1fr; }
  .hx-detail-step { margin-inline-start: 0; }

  .hx-caption-ar { font-size: 2.2rem; }
  .hx-caption-name { font-size: 1.6rem; }
  .hx-controls { gap: .45rem; }
  .hx-ctrl { height: 2.7rem; min-width: 2.7rem; padding: 0 .7rem; }
  .hx-ctrl-play { width: 3.3rem; height: 3.3rem; }
  .hx-progress { order: 10; flex-basis: 100%; }
  .hx-ctrl-wide span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .hx-events::before { inset-inline-start: 0.45rem; }
  .hx-event { grid-template-columns: 1fr; gap: .4rem; padding-inline-start: 2rem; }
  .hx-event::before { inset-inline-start: 0; top: .35rem; }
  .hx-event-year { text-align: start; flex-direction: row; align-items: baseline; gap: .6rem; padding-top: 0; }
  .hx-event.is-active .hx-event-card { transform: none; }

  .hx-spread-stage { aspect-ratio: auto; height: auto; }
  .hx-spread .hx-map-world { height: 96vw; min-height: 0; }
  .hx-spread-legend { position: static; margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .4rem 1rem; background: transparent; padding: 0; }
  .hx-spread-year { inset-inline-start: .9rem; top: .7rem; }
  .hx-milestone { grid-template-columns: 1fr; }
  .hx-milestone-year { grid-row: auto; font-size: 1.7rem; }
  .hx-year-slider { order: 10; flex-basis: 100%; }
  .hx-milestones, .hx-civ-grid { grid-template-columns: 1fr; }

  .hx-inv-toolbar { position: static; padding: .6rem; }
  .hx-filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; padding-bottom: 2px; }
  .hx-chip { white-space: nowrap; }
  .hx-snake { grid-template-columns: 1fr; row-gap: 3rem; padding-inline-start: 1.6rem; }
  .hx-inv-card { align-items: flex-start; }
  .hx-inv-medal { margin-inline-start: -1.6rem; width: 62px; height: 62px; margin-bottom: -30px; }
  .hx-inv-body { margin-inline-start: 0; }
  .hx-full-text { padding: 1.4rem 1.2rem; }
  .hx-full-title { font-size: 1.8rem; }
  .hx-full-facts div { grid-template-columns: 1fr; gap: 0; }
}

/* ==========================================================================
   The visitor's journey (history/experience.js): the progress card in the
   header, explored marks, the timeline in miniature, "Test yourself", the
   years beside the inventions, the chapter rail and "what next".
   Motion is transform and opacity only, and stops under reduced motion.
   ========================================================================== */
.hx-head--live { padding-bottom: 2.6rem; }
.hx-head-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem; align-items: center; }
.hx-head-copy { min-width: 0; }
@media (min-width: 992px) {
  .hx-head--live .hx-head-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 2.5rem; }
}
.hx-head-star {
  position: absolute; z-index: -1; inset-inline-end: -90px; top: 50%; width: clamp(260px, 32vw, 480px); aspect-ratio: 1;
  translate: 0 -50%; color: var(--hx-gold-2); opacity: .2; pointer-events: none; animation: hx-head-turn 200s linear infinite;
}
@keyframes hx-head-turn { to { transform: rotate(360deg); } }
/* As the page scrolls away, the header copy drifts up and fades a little (scroll-driven where supported). */
@supports (animation-timeline: scroll()) {
  .hx-head--live .hx-head-copy,
  .hx-head--live .hx-live {
    animation: hx-head-drift linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 420px;
  }
  .hx-head--live .hx-live { animation-name: hx-head-drift-slow; }
}
@keyframes hx-head-drift { to { transform: translateY(-36px); opacity: .55; } }
@keyframes hx-head-drift-slow { to { transform: translateY(-14px); } }

.hx-live {
  position: relative; display: grid; gap: .8rem; padding: 1.15rem 1.2rem; border-radius: 24px; color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.hx-live-label { margin: 0; display: inline-flex; gap: .4rem; align-items: center; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hx-gold-2); }
html[lang="ar"] .hx-live-label, html[lang="ur"] .hx-live-label { letter-spacing: 0; font-size: .9rem; }
.hx-live-row { display: flex; align-items: center; gap: .9rem; }
.hx-live-ring { --size: 66px; --lx-ring-hole: rgba(7, 42, 29, .94); --lx-ring-fill: var(--hx-gold-2); }
.hx-live-copy { display: grid; gap: .15rem; min-width: 0; }
.hx-live-title { margin: 0; font-weight: 700; font-size: 1.08rem; color: #fff; }
.hx-live-sub { margin: 0; font-size: .8rem; color: rgba(255, 255, 255, .72); display: inline-flex; gap: .35rem; align-items: center; }
.hx-live .lx-bar { background: rgba(255, 255, 255, .16); height: 6px; }
.hx-live-go {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .95rem; border-radius: 16px;
  background: linear-gradient(135deg, #f2d77a, #c9a227); color: #1b1a12 !important; font-weight: 700; text-decoration: none;
  box-shadow: 0 12px 26px -14px rgba(201, 162, 39, .9); transition: transform .25s var(--hx-ease);
}
.hx-live-go span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-live { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.hx-live-go:hover { transform: translateY(-2px); }
.hx-live.is-complete .hx-live-go { background: rgba(255, 255, 255, .14); color: #fff !important; box-shadow: none; }
.hx-live-facts { list-style: none; margin: 0; padding: .75rem 0 0; border-top: 1px dashed rgba(255, 255, 255, .2); display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: .5rem; }
.hx-live-facts li { display: grid; grid-template-columns: auto 1fr; column-gap: .45rem; align-items: baseline; font-size: .76rem; color: rgba(255, 255, 255, .74); line-height: 1.3; }
.hx-live-facts i { grid-row: span 2; color: var(--hx-gold-2); }
.hx-live-facts strong { color: #fff; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
/* The legacy dark theme colours every p (dark.css); the night-sky header keeps its own. */
body.dark .hx .hx-live-title { color: #fff; }
body.dark .hx .hx-head .hx-eyebrow,
body.dark .hx .hx-live-label { color: var(--hx-gold-2); }
body.dark .hx .hx-head .hx-lead { color: rgba(255, 255, 255, .82); }
body.dark .hx .hx-live-sub { color: rgba(255, 255, 255, .72); }

/* Explored marks */
.hx-node.is-seen .hx-node-card { border-color: rgba(201, 162, 39, .55); }
.hx-node.is-seen .hx-node-index::after { content: "\2713"; margin-inline-start: .3rem; color: var(--hx-emerald); font-weight: 800; }
body.dark .hx-node.is-seen .hx-node-index::after { color: var(--hx-mint); }
.hx-stop.is-seen:not([aria-current]) .hx-stop-num { background: rgba(201, 162, 39, .22); color: var(--hx-gold-ink); }
.hx-event.is-seen::before { background: var(--hx-gold); }
.hx-inv-medal { position: relative; }
.hx-inv-card.is-seen .hx-inv-medal::after {
  content: "\2713"; position: absolute; inset-inline-end: -4px; top: -4px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--hx-emerald); color: #fff; font-size: .7rem; font-weight: 800; box-shadow: 0 0 0 3px var(--hx-surface);
}

/* The prophets' timeline in miniature */
.hx-minimap {
  position: relative; display: flex; gap: 4px; margin-top: .4rem; padding: 6px; border-radius: 16px;
  background: var(--hx-surface); border: 1px solid var(--hx-border); box-shadow: var(--hx-shadow);
}
.hx-minimap-band {
  flex: var(--span) 1 0; min-width: 0; display: grid; gap: .25rem; padding: .45rem .5rem .4rem; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--band-line); background: linear-gradient(180deg, var(--band-a), var(--band-b)); color: var(--band-ink); text-align: start;
  transition: transform .2s var(--hx-ease);
}
.hx-minimap-band:hover { transform: translateY(-2px); }
.hx-minimap-dots { display: flex; flex-wrap: wrap; gap: 4px; }
.hx-minimap-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--hx-border-strong); transition: transform .3s var(--hx-ease), background-color .3s; }
.hx-minimap-dots i.is-ulul { border-radius: 2px; transform: rotate(45deg); }
.hx-minimap-dots i.is-seen { background: var(--hx-gold); }
.hx-minimap-dots i.is-current { background: var(--hx-emerald); transform: scale(1.5); }
.hx-minimap-dots i.is-ulul.is-current { transform: rotate(45deg) scale(1.5); }
body.dark .hx-minimap-dots i.is-current { background: var(--hx-mint); }
.hx-minimap-label { font-size: .68rem; font-weight: 700; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hx-minimap-window {
  position: absolute; z-index: 1; inset-block: 2px; inset-inline-start: 0; width: 100%; pointer-events: none; border-radius: 13px;
  border: 2px solid var(--hx-gold); background: rgba(201, 162, 39, .07); transform-origin: left center; will-change: transform;
}
[dir="rtl"] .hx-minimap-window { transform-origin: right center; }
.hx-minimap.is-whole .hx-minimap-window { opacity: 0; }
.hx-prophets-page .hx-chart-hint { margin: .6rem 0 0; }

/* Test yourself */
.hx-quiz-section { padding-top: 1rem; }
.hx-quiz {
  display: grid; gap: 1.6rem; align-items: center; padding: clamp(1.2rem, 1rem + 1.5vw, 2.2rem); border-radius: 30px; overflow: hidden; position: relative; isolation: isolate;
  background: radial-gradient(500px 260px at 100% 0%, rgba(201, 162, 39, .18), transparent 70%), var(--hx-surface);
  border: 1px solid var(--hx-border); box-shadow: var(--hx-shadow);
}
@media (min-width: 992px) { .hx-quiz { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }
.hx-quiz::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .05; background: url("../images/history/hub/pattern-tile.svg") repeat; background-size: 64px; }
.hx-quiz-best { margin: .9rem 0 0; display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; background: rgba(201, 162, 39, .14); color: var(--hx-gold-ink); font-weight: 600; font-size: .88rem; }
.hx-quiz-best[hidden] { display: none; }
.hx-quiz-card { display: grid; gap: .9rem; padding: 1.2rem; border-radius: 22px; background: var(--hx-surface-2); border: 1px solid var(--hx-border); min-height: 200px; align-content: center; }
.hx-quiz.is-playing .hx-quiz-card { align-content: start; }
.hx-quiz-idle { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.hx-quiz-idle li { display: grid; justify-items: center; gap: .35rem; padding: .9rem .5rem; border-radius: 16px; background: var(--hx-surface); border: 1px dashed var(--hx-border-strong); text-align: center; font-size: .82rem; font-weight: 600; color: var(--hx-muted); }
.hx-quiz-idle i { font-size: 1.4rem; color: var(--hx-gold); }
.hx-quiz.is-playing .hx-quiz-idle, .hx-quiz.is-done .hx-quiz-idle { display: none; }
.hx-quiz-top { display: flex; align-items: center; gap: .8rem; }
.hx-quiz-top:has(.hx-quiz-count:empty) { display: none; }
.hx-quiz-count { font-size: .8rem; font-weight: 700; color: var(--hx-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hx-quiz-bar { flex: 1; height: 6px; }
.hx .hx-quiz-q { margin: 0; font-family: var(--hx-display); font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); font-weight: 600; line-height: 1.3; color: var(--hx-text); }
.hx .hx-quiz-nation { margin: 0; padding: .7rem .9rem; border-radius: 14px; border-inline-start: 4px solid var(--hx-gold); background: var(--hx-surface); font-weight: 600; font-size: 1.05rem; color: var(--hx-text); }
.hx-quiz-nation[hidden] { display: none; }
.hx-quiz-q:empty { display: none; }
.hx-quiz-ar { margin: 0; font-family: var(--hx-arabic); font-size: 2.6rem; line-height: 1.5; color: var(--hx-gold-ink); text-align: center; }
.hx-quiz-ar[hidden] { display: none; }
.hx-quiz-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.hx-quiz-choices:empty { display: none; }
.hx-quiz-choice {
  min-height: 48px; padding: .65rem .9rem; border-radius: 14px; border: 1px solid var(--hx-border-strong); background: var(--hx-surface);
  color: var(--hx-text); font-weight: 600; text-align: start; cursor: pointer; transition: transform .2s var(--hx-ease), border-color .2s, background-color .2s;
}
.hx-quiz-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--hx-emerald); }
.hx-quiz-choice:disabled { cursor: default; opacity: .75; }
.hx-quiz-choice.is-right { opacity: 1; border-color: var(--hx-emerald); background: rgba(31, 122, 77, .12); }
.hx-quiz-choice.is-wrong { opacity: 1; border-color: var(--hx-terracotta); background: rgba(181, 86, 44, .1); animation: hx-shake .4s; }
@keyframes hx-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hx-quiz-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.hx-quiz-foot [hidden] { display: none; }
.hx-quiz-feedback { margin: 0; font-weight: 600; }
.hx-quiz-feedback.is-right { color: var(--hx-emerald); }
.hx-quiz-feedback.is-wrong { color: var(--hx-terracotta); }
body.dark .hx-quiz-feedback.is-right { color: var(--hx-mint); }
body.dark .hx-quiz-feedback.is-wrong { color: #f0a58a; }

/* The years beside the inventions (inside the pinned toolbar) */
.hx-years { flex-basis: 100%; display: flex; align-items: center; gap: .7rem; min-width: 0; position: relative; padding: .55rem 0 .35rem; border-top: 1px dashed var(--hx-border-strong); }
.hx-years-now { flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px; background: var(--hx-ink); color: #fff; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; min-width: 7.5rem; justify-content: center; }
body.dark .hx-years-now { background: var(--hx-gold-2); color: #1b1a12; }
.hx-years-list { flex: 1; min-width: 0; display: flex; gap: .2rem; list-style: none; margin: 0; padding: 0 0 2px; overflow-x: auto; scrollbar-width: none; }
.hx-years-list::-webkit-scrollbar { display: none; }
.hx-years-list a {
  display: inline-block; padding: .25rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--hx-muted) !important;
  text-decoration: none; font-variant-numeric: tabular-nums; transition: background-color .2s, color .2s, opacity .2s;
}
.hx-years-list a:hover { color: var(--hx-text) !important; background: var(--hx-surface-2); }
.hx-years-list a.is-active { background: rgba(201, 162, 39, .2); color: var(--hx-gold-ink) !important; }
.hx-years-list a.is-off { opacity: .35; }
.hx-years-thread { position: absolute; inset-inline: 0; bottom: -.45rem; height: 3px; border-radius: 3px; background: var(--hx-border); overflow: hidden; }
.hx-years-thread span { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(var(--hx-years-p, 0)); background: linear-gradient(90deg, var(--hx-emerald), var(--hx-gold-2)); }
[dir="rtl"] .hx-years-thread span { transform-origin: right center; }
.hx-inv:has(#hxGlobeView:not([hidden])) .hx-years { display: none; }

/* The chapter rail on the Seerah page, in the history palette */
.hx .hx-rail { background: color-mix(in srgb, var(--hx-surface) 90%, transparent); border-color: var(--hx-border); }
.hx .hx-rail .lx-rail__link { color: var(--hx-text); }
.hx .hx-rail .lx-rail__link.is-active { background: var(--hx-ink); color: #fff; }
body.dark .hx .hx-rail .lx-rail__link.is-active { background: var(--hx-gold-2); color: #1b1a12; }
.hx-islam-page .hx-section,
.hx-islam-page #milestones { scroll-margin-top: calc(var(--ip-header-h, 76px) + 64px); }

/* What next */
.hx-next { padding-top: 1rem; }
.hx-next .lx-next__card { background: linear-gradient(135deg, var(--lx-tone-bg), var(--hx-surface) 70%); border-color: var(--hx-border); }
.hx-next .lx-next__text strong { color: var(--hx-text); }

@media (max-width: 991.98px) {
  .hx-live { max-width: 34rem; }
}
@media (max-width: 767.98px) {
  .hx-head-star { opacity: .12; }
  .hx-live { padding: 1rem; gap: .65rem; }
  .hx-live-ring { --size: 56px; }
  .hx-minimap { display: none; }
  .hx-quiz-choices { grid-template-columns: 1fr; }
  .hx-inv-toolbar { position: sticky; top: var(--hx-sticky-top, 64px); z-index: 6; margin-inline: -.5rem; }
  .hx-inv-toolbar.is-stuck .hx-segment,
  .hx-inv-toolbar.is-stuck .hx-filters { display: none; }
  .hx-inv-toolbar.is-stuck .hx-years { border-top: 0; padding-top: 0; }
  .hx-years-now { min-width: 0; font-size: .78rem; padding: .25rem .6rem; }
  /* Shorter cards on phones: a wide banner of the illustration, the summary in four lines (the full entry opens). */
  .hx-inv-art img { aspect-ratio: 2 / 1; }
  .hx-inv-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
  .hx-snake { row-gap: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hx-head-star { animation: none; }
  .hx-head--live .hx-head-copy, .hx-head--live .hx-live { animation: none !important; }
}
