:root {
  --emerald-950: #05130e;
  --emerald-900: #0a2219;
  --emerald-800: #113427;
  --emerald-600: #1d5c4b;
  --emerald-300: #9cd2bd;
  --gold: #b88a2c;
  --gold-bright: #ddb457;
  --gold-pale: #f0dfb2;
  --malachite: #2c6b5a;
  --vermilion: #b0432a;
  --paper: #f5f1e7;
  --paper-deep: #ece4d1;
  --ink: #1b1a22;

  --bg: var(--paper);
  --surface: #fbf8f1;
  --surface-2: var(--paper-deep);
  --text: var(--ink);
  --muted: #5b5866;
  --rule: #dcd1b8;
  --accent: var(--emerald-600);
  --accent-ink: #16493c;
  --gild: var(--gold);
  --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 8px 30px rgba(20, 20, 40, .07);

  --font-display: "Gulzar", "Noto Nastaliq Urdu", serif;
  --font-body: "Noto Nastaliq Urdu", "Gulzar", serif;
  --font-ui: "Noto Naskh Arabic", "Noto Nastaliq Urdu", sans-serif;
  --font-ar: "Amiri", "Noto Naskh Arabic", serif;

  --reader-size: 1.18rem;
  --reader-leading: 2.45;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  color-scheme: light;
}

:root[data-reading-font="naskh"] {
  --font-body: "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif;
  --reader-leading: 2.05;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1c16;
    --surface: #11271f;
    --surface-2: #173328;
    --text: #ece5d3;
    --muted: #a8a6ba;
    --rule: #2a4a3d;
    --accent: var(--emerald-300);
    --accent-ink: #bfe3d4;
    --gild: var(--gold-bright);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 40px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1c16;
  --surface: #11271f;
  --surface-2: #173328;
  --text: #ece5d3;
  --muted: #a8a6ba;
  --rule: #2a4a3d;
  --accent: var(--emerald-300);
  --accent-ink: #bfe3d4;
  --gild: var(--gold-bright);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 40px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.9;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 6px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gild); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }
.ar, [lang="ar"] { font-family: var(--font-ar); font-size: 1.12em; line-height: 1.9; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--gild) 30%, transparent); }
.hero h1::selection { color: #f8e7b4; -webkit-text-fill-color: #f8e7b4; background: rgba(221, 180, 87, .28); }
[hidden] { display: none !important; }
.wrap { width: min(1240px, 100%); margin-inline: auto; padding-inline: var(--gutter); }

/* ───────── Top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 34px; height: 34px; color: var(--gild); }
.brand b { font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; line-height: 1; padding-top: 6px; }
.nav { display: flex; gap: 2px; margin-inline-start: 12px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 4px 12px; border-radius: 999px; color: var(--muted); white-space: nowrap; font-size: .95rem;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--gild); }
.tools { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn {
  display: inline-grid; place-items: center; height: 38px; min-width: 38px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--text);
  font-size: .9rem; gap: 6px; grid-auto-flow: column;
}
.icon-btn:hover { border-color: var(--gild); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn kbd { font-family: ui-monospace, monospace; font-size: .72rem; color: var(--muted); direction: ltr; }
.menu-btn { display: none; }
.progress-line {
  position: fixed; top: var(--header-h); inset-inline: 0; height: 3px; z-index: 49; pointer-events: none;
  background: linear-gradient(to left, var(--gold-bright), var(--gold));
  transform-origin: right center; transform: scaleX(0);
}

@media (max-width: 980px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; margin: 0;
    background: var(--bg); padding: 12px var(--gutter) 20px; border-bottom: 1px solid var(--rule);
    transform: translateY(-120%); transition: transform .35s ease; box-shadow: var(--shadow);
  }
  .nav.open { transform: translateY(0); }
  .nav a { padding: 10px 14px; font-size: 1.05rem; }
  .menu-btn { display: inline-grid; }
  .search-label { display: none; }
}

/* ───────── Shared atoms ───────── */
.eyebrow { font-size: .88rem; letter-spacing: 0; color: var(--gild); display: inline-flex; gap: 10px; align-items: center; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.display { font-family: var(--font-display); font-weight: 400; line-height: 1.5; margin: 0; }
.lede { font-family: var(--font-body); font-size: 1.12rem; line-height: 2.3; color: var(--muted); max-width: 46ch; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 22px; border-radius: 999px;
  border: 1px solid transparent; font-size: 1rem; text-decoration: none; transition: transform .2s ease, background .2s ease, border-color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #1a1405; box-shadow: 0 6px 20px rgba(184, 138, 44, .3); }
.btn-ghost { border-color: currentColor; color: inherit; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: .86rem; border: 1px solid transparent; white-space: nowrap;
}
button.chip:hover, a.chip:hover { border-color: var(--gild); text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
}
.section-head { display: grid; gap: 6px; margin-bottom: 28px; }
.section-head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.6; margin: 0; }
.section-head p { margin: 0; color: var(--muted); max-width: 60ch; }
.page { padding-block: 48px 96px; }
.page-hero { padding-block: 56px 28px; border-bottom: 1px solid var(--rule); margin-bottom: 36px; }
.page-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.55; margin: 6px 0 4px; }
.page-hero p { color: var(--muted); max-width: 62ch; margin: 0; font-size: 1.05rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; align-items: center; }
.field {
  border: 1px solid var(--rule); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 8px 16px; font: inherit; min-width: 220px;
}
.field:focus { outline: none; border-color: var(--gild); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gild) 25%, transparent); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ───────── Hero ───────── */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 30% 40%, #1e4f3f 0%, var(--emerald-900) 55%, var(--emerald-950) 100%);
  color: #efe7d2;
  min-height: calc(100svh - var(--header-h));
  display: grid; align-items: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .13;
  background-image: url("../img/girih.svg"); background-size: 180px;
  mask-image: radial-gradient(70% 80% at 30% 50%, #000 0%, transparent 85%);
  -webkit-mask-image: radial-gradient(70% 80% at 30% 50%, #000 0%, transparent 85%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(20px, 4vw, 64px); align-items: center; padding-block: 40px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(3.2rem, 8vw, 6.4rem); line-height: 1.45; margin: calc(8px - .08em) 0 calc(6px - .25em); padding: .5em .2em .25em;
  background: linear-gradient(180deg, #f6e3a8 10%, #d6a645 60%, #9c7020 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(214, 166, 69, .25));
}
.hero .eyebrow { color: var(--gold-bright); }
.hero .lede { color: #cdd8d0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-actions .btn-ghost { color: #efe7d2; border-color: rgba(239, 231, 210, .35); }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 36px; color: #a6b8ad; font-size: .92rem; }
.hero-stats b { display: block; font-family: var(--font-display); font-weight: 400; color: #efe7d2; font-size: 1.7rem; line-height: 1.6; }
.shamsa-stage { position: relative; aspect-ratio: 1; width: min(100%, 560px); justify-self: center; }
.shamsa { width: 100%; height: 100%; overflow: visible; }
.shamsa .petal { cursor: pointer; transition: filter .3s ease; }
.shamsa .petal:hover, .shamsa .petal:focus-visible { filter: drop-shadow(0 0 14px rgba(230, 190, 90, .55)); outline: none; }
.shamsa .petal-label { font-family: var(--font-ui); fill: #efe7d2; font-size: 15px; pointer-events: none; }
.shamsa-caption {
  position: absolute; inset-inline: 0; bottom: -6px; text-align: center; color: #a6b8ad; font-size: .9rem; min-height: 1.9em;
}
.hero-scroll { position: absolute; bottom: 18px; inset-inline-start: 50%; translate: 50% 0; color: #8ca596; font-size: .85rem; display: grid; justify-items: center; gap: 4px; }
.hero-scroll span { width: 1px; height: 34px; background: linear-gradient(#8ca596, transparent); animation: drip 2.4s ease-in-out infinite; }
@keyframes drip { 0%, 100% { transform: scaleY(.3); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; padding-block: 28px 70px; }
  .hero .lede { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero .eyebrow::before { display: none; }
  .shamsa-stage { width: min(88vw, 420px); order: -1; }
}

/* ───────── Argument path (home) ───────── */
.path { position: relative; display: grid; gap: 0; }
.path::before {
  content: ""; position: absolute; top: 20px; bottom: 20px; inset-inline-start: 31px; width: 2px;
  background: linear-gradient(var(--gild), color-mix(in srgb, var(--gild) 20%, transparent));
}
.station { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 22px; padding-block: 14px; }
.station-medal {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; z-index: 1;
  background: var(--surface); border: 2px solid var(--gild); color: var(--gild);
  font-family: var(--font-display); font-size: 1.6rem; line-height: 1; padding-top: 8px;
  box-shadow: 0 0 0 6px var(--bg);
}
.station.done .station-medal { background: radial-gradient(circle at 35% 30%, var(--gold-pale), var(--gold-bright) 45%, var(--gold)); color: #241a04; }
.station-card { padding: 22px 26px; display: grid; gap: 8px; transition: transform .25s ease, border-color .25s ease; }
.station-card:hover { transform: translateY(-2px); border-color: var(--gild); text-decoration: none; }
.station-card h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; line-height: 1.6; color: var(--text); }
.station-card .theme { font-family: var(--font-body); color: var(--muted); line-height: 2.2; margin: 0; }
.station-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .88rem; }
.meter { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(to left, var(--gold-bright), var(--gold)); border-radius: inherit; }
.bridge {
  margin-inline-start: 86px; padding: 6px 0 6px; color: var(--muted); font-family: var(--font-body); font-size: .95rem; line-height: 2.1;
  display: flex; gap: 10px; align-items: baseline;
}
.bridge::before { content: "⟵"; color: var(--gild); transform: rotate(-90deg); display: inline-block; }
.station.missing .station-medal { border-style: dashed; color: var(--muted); border-color: var(--muted); background: transparent; }
.station.missing .station-card { background: transparent; box-shadow: none; border-style: dashed; color: var(--muted); }

/* ───────── Home: explore, quote, analogies strip ───────── */
.band { padding-block: clamp(56px, 9vw, 110px); }
.band.alt { background: var(--surface-2); }
.quote-band { text-align: center; }
.quote-band blockquote {
  margin: 0 auto; max-width: 30ch; font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 2.5rem); line-height: 1.95;
}
.quote-band cite { display: block; margin-top: 18px; color: var(--muted); font-style: normal; }
.quote-band .ornament { color: var(--gild); font-size: 1.6rem; margin-bottom: 10px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 320px); gap: 16px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x mandatory; }
.strip > * { scroll-snap-align: start; }
.explore { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.explore a { padding: 24px; display: grid; gap: 6px; color: var(--text); transition: transform .25s, border-color .25s; }
.explore a:hover { transform: translateY(-3px); border-color: var(--gild); text-decoration: none; }
.explore svg { width: 46px; height: 46px; color: var(--gild); margin-bottom: 8px; }
.explore b { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.7; }
.explore span { color: var(--muted); font-size: .95rem; }

.laws { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.law { padding: 26px; display: grid; gap: 8px; position: relative; overflow: hidden; }
.law b { font-family: var(--font-display); font-weight: 400; font-size: 2.3rem; line-height: 1.6; color: var(--gild); }
.law p { margin: 0; font-family: var(--font-body); line-height: 2.2; }
.law small { color: var(--muted); }
@media (max-width: 760px) { .laws { grid-template-columns: 1fr; } }

/* ───────── Reader ───────── */
.lecture-head {
  background: radial-gradient(120% 140% at 20% 0%, #1e4f3f 0%, var(--emerald-900) 60%, var(--emerald-950));
  color: #efe7d2; padding-block: 56px 44px; position: relative; overflow: hidden; isolation: isolate;
}
.lecture-head::before { content: ""; position: absolute; inset: 0; background: url("../img/girih.svg"); background-size: 140px; opacity: .08; z-index: -1; }
.lecture-head .eyebrow { color: var(--gold-bright); }
.lecture-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 5.2vw, 3.8rem); line-height: 1.6; margin: 8px 0; color: #f3e6bf; }
.lecture-head p { color: #c4d1c8; margin: 0; max-width: 60ch; font-family: var(--font-body); line-height: 2.3; }
.lecture-head .station-meta { color: #a6b8ad; margin-top: 16px; }
.lecture-head .chip { background: rgba(255, 255, 255, .08); color: #efe7d2; }

.reader-grid.wrap { width: min(1360px, 100%); }
.reader-grid { display: grid; grid-template-columns: 250px minmax(0, 46rem) minmax(170px, 1fr); gap: 48px; align-items: start; padding-block: 40px 80px; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; padding-inline-end: 6px; font-size: .9rem; scrollbar-width: thin; }
.toc h2 { font-size: .85rem; color: var(--muted); margin: 0 0 10px; font-weight: 400; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.toc a { display: block; padding: 3px 12px; border-inline-start: 2px solid var(--rule); color: var(--muted); line-height: 1.8; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.lv1 { color: var(--text); font-weight: 600; margin-top: 8px; }
.toc a.lv3 { padding-inline-start: 26px; font-size: .84rem; }
.toc a.active { color: var(--text); border-color: var(--gild); background: linear-gradient(to left, color-mix(in srgb, var(--gild) 14%, transparent), transparent); }
.toc-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

.article { font-family: var(--font-body); font-size: var(--reader-size); line-height: var(--reader-leading); }
.article p { margin: 0 0 1.05em; text-align: justify; text-justify: inter-word; hyphens: none; }
.article h2, .article h3, .article h4 { font-family: var(--font-display); font-weight: 400; position: relative; scroll-margin-top: calc(var(--header-h) + 30px); }
.article h2 { font-size: 2.1em; line-height: 1.75; margin: 2.2em 0 .7em; color: var(--gild); text-align: center; padding-bottom: .3em; }
.article h2::after { content: "❖"; display: block; font-size: .4em; color: var(--gild); opacity: .7; margin-top: .4em; }
.article h3 { font-size: 1.55em; line-height: 1.85; margin: 1.9em 0 .5em; }
.article h4 { font-size: 1.22em; line-height: 1.9; margin: 1.5em 0 .4em; color: var(--accent-ink); }
.article .anchor { position: absolute; inset-inline-start: -1.4em; opacity: 0; color: var(--gild); font-size: .55em; top: .9em; transition: opacity .2s; }
.article h3:hover .anchor, .article h4:hover .anchor { opacity: .8; text-decoration: none; }
.article h2 .anchor { display: none; }
.article strong { font-weight: 700; color: var(--accent-ink); }
.article ul { padding-inline-start: 1.4em; margin: 0 0 1em; }
.article .ar { color: var(--malachite); }
:root[data-theme="dark"] .article .ar { color: #8fd0b9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .article .ar { color: #8fd0b9; } }
.article .ornament { text-align: center; color: var(--gild); margin: 1.6em 0; letter-spacing: 1em; }
.article .ornament::before { content: "❁  ❁  "; }
.article .flash { animation: flash 2.6s ease; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--gild) 26%, transparent); } 100% { background: transparent; } }
.term {
  border-bottom: 1.5px dotted var(--gild); cursor: help; text-decoration: none; color: inherit;
  background: linear-gradient(transparent 70%, color-mix(in srgb, var(--gild) 12%, transparent) 70%);
}

.mnote {
  float: left; clear: left; width: 190px; margin-left: -238px; margin-top: .4em;
  font-family: var(--font-ui); font-size: .82rem; line-height: 1.85; color: var(--muted);
  border-inline-end: 0; border-inline-start: 2px solid var(--gild); padding-inline-start: 10px; text-align: start;
}
.mnote b { display: block; color: var(--gild); font-weight: 600; font-size: .78rem; }
.mnote + .mnote { margin-top: 10px; }
.margin { min-height: 1px; }

.summary-card { padding: 28px 30px; margin-bottom: 40px; font-family: var(--font-ui); background: linear-gradient(160deg, var(--surface), var(--surface-2)); }
.summary-card h2 { font-family: var(--font-display); font-weight: 400; color: var(--gild); margin: 0 0 6px; font-size: 1.6rem; line-height: 1.7; text-align: start; }
.summary-card h2::after { display: none; }
.summary-card .q { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.9; margin: 0 0 12px; }
.summary-card p { font-family: var(--font-body); font-size: 1.02rem; line-height: 2.3; text-align: start; }
.takeaways { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: tk; }
.takeaways li { counter-increment: tk; display: grid; grid-template-columns: 30px 1fr; gap: 8px; line-height: 2.1; font-family: var(--font-body); font-size: 1rem; }
.takeaways li::before { content: counter(tk, urdu); color: var(--gild); font-family: var(--font-display); font-size: 1.2rem; }
.in-lecture { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.visual { margin: 0 0 44px; padding: 26px 28px; font-family: var(--font-ui); }
.visual > h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; line-height: 1.7; margin: 0 0 4px; color: var(--gild); text-align: start; }
.visual > h2::after { display: none; }
.visual > p { color: var(--muted); margin: 0 0 18px; font-size: .95rem; text-align: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
.steps li::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; margin: 10px 11px 0; background: var(--gild);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--gild) 20%, transparent);
}
.steps li::after { content: ""; position: absolute; inset-inline-start: 17px; top: 30px; bottom: 0; width: 2px; background: color-mix(in srgb, var(--gild) 35%, transparent); }
.steps li:last-child::after { display: none; }
.steps b { display: block; font-size: 1.05rem; }
.steps span { color: var(--muted); font-size: .95rem; line-height: 2; }
.descent li::before { background: radial-gradient(circle, #fff7d6, var(--gold-bright)); box-shadow: 0 0 16px 4px color-mix(in srgb, var(--gold-bright) 45%, transparent); }
.versus { display: grid; gap: 12px; }
.versus .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.versus .row > div { padding: 14px 16px; line-height: 2; font-size: .95rem; }
.versus .claim { background: color-mix(in srgb, var(--vermilion) 8%, transparent); }
.versus .claim small, .versus .answer small { display: block; font-size: .78rem; color: var(--muted); }
.versus .answer { background: color-mix(in srgb, var(--malachite) 9%, transparent); }
@media (max-width: 640px) { .versus .row { grid-template-columns: 1fr; } }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
.ladder span { padding: 4px 12px; border-radius: 8px; background: var(--surface-2); font-size: .9rem; }
.ladder i { color: var(--gild); font-style: normal; }
.laws-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.laws-mini div { padding: 14px; border: 1px solid var(--rule); border-radius: 12px; line-height: 2; font-size: .92rem; }
.laws-mini b { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; color: var(--gild); display: block; line-height: 1.6; }
@media (max-width: 640px) { .laws-mini { grid-template-columns: 1fr; } }

.lecture-end { margin-top: 60px; display: grid; gap: 24px; font-family: var(--font-ui); }
.complete-btn[data-done="true"] { background: var(--malachite); color: #fff; box-shadow: none; }
.next-card { padding: 28px; display: grid; gap: 8px; background: radial-gradient(120% 140% at 20% 0%, #1e4f3f, var(--emerald-900)); color: #efe7d2; border: 0; }
.next-card:hover { text-decoration: none; }
.next-card small { color: var(--gold-bright); }
.next-card b { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1.7; }
.next-card span { color: #c4d1c8; font-family: var(--font-body); line-height: 2.2; }

@media (max-width: 1180px) {
  .reader-grid { grid-template-columns: 240px minmax(0, 1fr); }
  .margin { display: none; }
  .mnote { float: none; width: auto; margin: 0 0 1em; display: block; padding: 8px 12px; background: var(--surface-2); border-radius: 0 10px 10px 0; }
}
@media (max-width: 900px) {
  .reader-grid { grid-template-columns: 1fr; }
  .toc {
    position: fixed; inset: auto 0 0 0; top: auto; max-height: 70vh; z-index: 60; background: var(--surface);
    border-top: 1px solid var(--rule); border-radius: 18px 18px 0 0; padding: 20px var(--gutter) 30px;
    transform: translateY(105%); transition: transform .35s ease; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
  }
  .toc.open { transform: translateY(0); }
  .toc-fab { display: inline-flex !important; }
  .article { font-size: calc(var(--reader-size) * .95); }
  .article p { text-align: start; }
  .article .anchor { display: none; }
}
.toc-fab {
  display: none !important; position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 55;
  background: var(--emerald-800); color: #efe7d2; border: 0; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

/* ───────── Quiz ───────── */
.quiz { padding: 28px; display: grid; gap: 18px; }
.quiz-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: .9rem; }
.quiz-q { font-family: var(--font-body); font-size: 1.22rem; line-height: 2.3; margin: 0; }
.quiz-options { display: grid; gap: 10px; }
.quiz-options button {
  text-align: start; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface);
  font-family: var(--font-body); line-height: 2.1; font-size: 1rem; transition: border-color .2s, background .2s;
}
.quiz-options button:hover:not(:disabled) { border-color: var(--gild); }
.quiz-options button.right { border-color: var(--malachite); background: color-mix(in srgb, var(--malachite) 14%, transparent); }
.quiz-options button.wrong { border-color: var(--vermilion); background: color-mix(in srgb, var(--vermilion) 10%, transparent); }
.quiz-options button:disabled { cursor: default; }
.quiz-explain { padding: 14px 18px; border-radius: 12px; background: var(--surface-2); line-height: 2.1; font-family: var(--font-body); }
.quiz-dots { display: flex; gap: 6px; }
.quiz-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.quiz-dots i.right { background: var(--malachite); }
.quiz-dots i.wrong { background: var(--vermilion); }
.quiz-dots i.now { box-shadow: 0 0 0 2px var(--gild); }
.quiz-result { text-align: center; display: grid; gap: 10px; justify-items: center; }
.quiz-result b { font-family: var(--font-display); font-weight: 400; font-size: 3rem; color: var(--gild); line-height: 1.5; }

/* ───────── Mindmap & Graph ───────── */
.canvas-page { position: relative; height: calc(100svh - var(--header-h)); overflow: hidden; background: var(--bg); }
.canvas-page svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.canvas-page svg:active { cursor: grabbing; }
.canvas-overlay {
  position: absolute; top: 18px; inset-inline-end: 18px; inset-inline-start: auto; max-width: min(420px, calc(100% - 36px));
  padding: 18px 20px; display: grid; gap: 8px; z-index: 2;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
}
.canvas-overlay h1 { font-family: var(--font-display); font-weight: 400; font-size: 1.8rem; line-height: 1.6; margin: 0; }
.canvas-overlay p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.9; }
.canvas-panel {
  position: absolute; bottom: 18px; inset-inline-end: 18px; width: min(420px, calc(100% - 36px)); max-height: 56%; overflow: auto;
  padding: 20px 22px; z-index: 2; display: none; gap: 8px;
}
.canvas-panel.show { display: grid; }
.canvas-panel h2 { font-family: var(--font-display); font-weight: 400; margin: 0; font-size: 1.7rem; line-height: 1.7; }
.canvas-panel p { margin: 0; font-family: var(--font-body); line-height: 2.2; font-size: .98rem; }
.canvas-panel .close { position: absolute; top: 10px; inset-inline-start: 10px; }
.canvas-legend { position: absolute; bottom: 18px; inset-inline-start: 18px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 45%; z-index: 1; }
.canvas-zoom { position: absolute; top: 18px; inset-inline-start: 18px; display: grid; gap: 6px; z-index: 2; }
.mm-node circle { stroke-width: 2px; transition: r .2s; }
.mm-node text { font-family: var(--font-ui); fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; }
.mm-node { cursor: pointer; outline: none; }
.mm-node:focus-visible circle { stroke-width: 4px; stroke: var(--gild); }
.mm-node:focus-visible text { fill: var(--gild); }
.mm-node:hover text { fill: var(--gild); }
.mm-link { fill: none; stroke-opacity: .55; }
@media (max-width: 700px) {
  .canvas-overlay { top: 10px; inset-inline-end: 10px; padding: 12px 14px; }
  .canvas-overlay p { display: none; }
  .canvas-legend { display: none; }
}

/* ───────── Glossary / analogies / hadith ───────── */
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 26px; }
.letters a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--text); font-family: var(--font-display); font-size: 1.15rem; padding-top: 6px; }
.letters a:hover { background: var(--gild); color: #1a1405; text-decoration: none; }
.gloss-group h2 { font-family: var(--font-display); font-weight: 400; font-size: 2.6rem; color: var(--gild); margin: 26px 0 8px; line-height: 1.5; border-bottom: 1px solid var(--rule); }
.gloss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.gloss { padding: 20px 22px; display: grid; gap: 8px; align-content: start; scroll-margin-top: calc(var(--header-h) + 20px); }
.gloss h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.7; }
.gloss .ar { color: var(--muted); font-size: 1.05rem; }
.gloss p { margin: 0; font-family: var(--font-body); line-height: 2.2; font-size: .98rem; }
.gloss .def + .def { border-top: 1px dashed var(--rule); padding-top: 8px; }
.gloss .def a { font-size: .82rem; }
.presence { display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.presence i { width: 14px; background: var(--gild); border-radius: 2px 2px 0 0; opacity: .85; position: relative; }
.presence i[data-zero] { background: var(--rule); height: 2px !important; }
.gloss:target { border-color: var(--gild); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gild) 25%, transparent); }

.masonry { columns: 3 300px; column-gap: 16px; }
.masonry > * { break-inside: avoid; margin-bottom: 16px; }
.analogy { padding: 22px 24px; display: grid; gap: 10px; position: relative; }
.analogy .initial {
  width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; padding-top: 10px;
  background: radial-gradient(circle at 30% 25%, #256452, var(--emerald-900)); color: var(--gold-bright);
  font-family: var(--font-display); font-size: 2rem; line-height: 1; box-shadow: inset 0 0 0 2px rgba(221, 180, 87, .55), inset 0 0 0 5px var(--emerald-900), inset 0 0 0 6px rgba(221, 180, 87, .35);
}
.analogy h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.75; }
.analogy .teaches { margin: 0; color: var(--accent-ink); line-height: 2.1; font-size: .98rem; }
.analogy .story { margin: 0; font-family: var(--font-body); line-height: 2.25; font-size: .96rem; color: var(--muted); }
.analogy footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .86rem; }

.hadith { padding: 26px 28px; display: grid; gap: 10px; }
.hadith .arabic { font-family: var(--font-ar); font-size: 1.6rem; line-height: 2; color: var(--malachite); text-align: center; margin: 4px 0; }
:root[data-theme="dark"] .hadith .arabic { color: #8fd0b9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hadith .arabic { color: #8fd0b9; } }
.hadith h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.45rem; line-height: 1.8; }
.hadith p { margin: 0; font-family: var(--font-body); line-height: 2.2; }
.hadith-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .hadith-list, .gloss-grid { grid-template-columns: 1fr; } }

/* ───────── Blueprint ───────── */
.blueprint { display: grid; gap: 18px; }
.bp-part { padding: 28px; }
.bp-part > h2 { font-family: var(--font-display); font-weight: 400; color: var(--gild); margin: 0 0 4px; font-size: 2rem; line-height: 1.7; }
.bp-part > p { color: var(--muted); margin: 0 0 18px; font-family: var(--font-body); line-height: 2.2; }
.bp-tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bp-tree .bp-tree { margin-top: 10px; padding-inline-start: 22px; border-inline-start: 1px solid var(--rule); }
.bp-tree li > div { display: grid; gap: 2px; }
.bp-tree b { font-size: 1.08rem; }
.bp-tree span { color: var(--muted); font-size: .93rem; line-height: 2; }

/* ───────── Shah sahib ───────── */
.bio { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.bio p { font-family: var(--font-body); font-size: 1.08rem; line-height: 2.45; margin: 0; }
@media (max-width: 860px) { .bio { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; overflow: hidden; }
.gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s ease; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { padding: 12px 14px; font-size: .88rem; line-height: 1.9; }
.gallery figcaption small { display: block; color: var(--muted); font-size: .74rem; direction: ltr; text-align: end; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 110px; width: 2px; background: var(--rule); }
.tl { display: grid; grid-template-columns: 110px 1fr; gap: 28px; padding-block: 14px; position: relative; }
.tl::after { content: ""; position: absolute; inset-inline-start: 104px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gild); }
.tl.key::after { background: var(--gild); }
.tl .year { text-align: end; font-family: var(--font-display); font-size: 1.6rem; color: var(--gild); line-height: 1.7; }
.tl .year small { display: block; font-family: var(--font-ui); font-size: .78rem; color: var(--muted); line-height: 1.4; }
.tl h3 { margin: 0; font-size: 1.1rem; }
.tl p { margin: 2px 0 0; color: var(--muted); font-family: var(--font-body); line-height: 2.2; }
@media (max-width: 560px) {
  .timeline::before { inset-inline-start: 74px; }
  .tl { grid-template-columns: 74px 1fr; gap: 22px; }
  .tl::after { inset-inline-start: 68px; }
  .tl .year { font-size: 1.25rem; }
}

/* ───────── References ───────── */
.refs { display: grid; gap: 12px; }
.ref { padding: 18px 22px; display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; align-items: start; }
.ref .t { font-weight: 600; }
.ref .en { direction: ltr; text-align: start; unicode-bidi: plaintext; color: var(--muted); font-family: Georgia, serif; font-size: .95rem; }
.ref .meta { color: var(--muted); font-size: .86rem; }
.ref .chip { align-self: center; }

/* ───────── Search dialog ───────── */
.search-dialog {
  width: min(720px, calc(100% - 24px)); max-height: min(78vh, 760px); padding: 0; border: 1px solid var(--rule);
  border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  margin-top: 9vh;
}
.search-dialog::backdrop { background: rgba(5, 19, 14, .55); backdrop-filter: blur(4px); }
.search-dialog form { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.search-dialog input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 1.15rem; color: var(--text); padding: 6px 0; }
.search-dialog input:focus { outline: none; }
.search-results { overflow: auto; max-height: calc(min(78vh, 760px) - 70px); padding: 8px; }
.search-results h3 { font-size: .8rem; color: var(--muted); margin: 12px 12px 4px; font-weight: 400; }
.search-results a { display: grid; gap: 2px; padding: 10px 14px; border-radius: 10px; color: var(--text); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--surface-2); text-decoration: none; }
.search-results a small { color: var(--muted); font-family: var(--font-body); line-height: 2; font-size: .9rem; }
.search-results mark { background: color-mix(in srgb, var(--gild) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.search-hint { padding: 26px; color: var(--muted); text-align: center; line-height: 2; }

/* ───────── Tippy theme ───────── */
.tippy-box[data-theme~="manuscript"] {
  background: var(--surface); color: var(--text); border: 1px solid var(--gild); border-radius: 14px; box-shadow: var(--shadow);
  font-family: var(--font-ui); text-align: start; direction: rtl;
}
.tippy-box[data-theme~="manuscript"] .tippy-content { padding: 14px 16px; }
.tippy-box[data-theme~="manuscript"] .tippy-arrow { color: var(--gild); }
.tip b { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; color: var(--gild); display: block; line-height: 1.7; }
.tip p { margin: 4px 0 8px; font-family: var(--font-body); line-height: 2.1; font-size: .93rem; }
.tip a { font-size: .82rem; }

/* ───────── Footer ───────── */
.site-footer { border-top: 1px solid var(--rule); padding-block: 40px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.site-footer b { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; color: var(--text); }

.reveal { opacity: 0; transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ───────── Lectures index: an illuminated table of contents ───────── */
.course .page-hero { margin-bottom: 28px; }
.course-overview {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px 36px; align-items: center; padding: 26px 30px; margin-bottom: 18px;
  background: radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--gild) 12%, var(--surface)), var(--surface) 60%);
}
.overview-figures { display: flex; gap: 30px; }
.overview-figures div { display: grid; }
.overview-figures b { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1.6; color: var(--gild); white-space: nowrap; }
.overview-figures span { font-size: .84rem; color: var(--muted); }
.segbar { display: flex; gap: 4px; align-items: stretch; height: 34px; }
.segbar a { position: relative; border-radius: 6px; background: var(--surface-2); overflow: hidden; min-width: 22px; display: grid; place-items: center; color: var(--muted); }
.segbar a:hover { text-decoration: none; outline: 1px solid var(--gild); }
.segbar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(to left, var(--gold-bright), var(--gold)); opacity: .9; }
.segbar span { position: relative; font-family: var(--font-display); font-size: .95rem; line-height: 1; padding-top: 6px; }

.part { margin-top: clamp(48px, 7vw, 84px); }
.part-head { display: grid; gap: 4px; margin-bottom: 18px; padding-inline-start: 4px; }
.part-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.6; }
.part-head p { margin: 0; color: var(--muted); }
.lessons { display: grid; border-top: 1px solid var(--rule); }

.lesson {
  position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr) 230px; gap: 28px; align-items: start;
  padding: 28px 18px 26px; border-bottom: 1px solid var(--rule); transition: background .3s ease;
}
.lesson::before { content: ""; position: absolute; inset-block: 18px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--pigment, transparent); opacity: 0; transition: opacity .3s; }
.lesson:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.lesson:hover::before { opacity: .8; }
.lesson-medal { position: relative; width: 84px; height: 84px; display: grid; place-items: center; color: var(--gild); }
.lesson-medal:hover { text-decoration: none; }
.lesson-medal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lesson-medal .track { fill: var(--surface); stroke: var(--rule); stroke-width: 3; }
.lesson-medal .fill { fill: none; stroke: var(--gild); stroke-width: 4; stroke-linecap: round; }
.lesson-medal b { position: relative; font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1; padding-top: 10px; }
.lesson-medal.full .track { fill: var(--gild); }
.lesson-medal.full b { color: #1f1604; }
.lesson-body { display: grid; gap: 6px; min-width: 0; }
.lesson-where { font-size: .85rem; color: var(--gild); }
.lesson-body h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2.8vw, 2.1rem); line-height: 1.65; }
.lesson-body h3 a { color: var(--text); }
.lesson-q { margin: 0; font-family: var(--font-body); font-size: 1.04rem; line-height: 2.3; color: var(--muted); max-width: 46rem; }
.lesson-more { margin-top: 4px; }
.lesson-more summary { cursor: pointer; color: var(--accent-ink); font-size: .9rem; width: max-content; list-style: none; }
.lesson-more summary::-webkit-details-marker { display: none; }
.lesson-more summary::before { content: "＋"; margin-inline-end: 6px; color: var(--gild); }
.lesson-more[open] summary::before { content: "−"; }
.lesson-more p { margin: 10px 0 12px; font-family: var(--font-body); line-height: 2.3; max-width: 46rem; }
.lesson-meta { display: grid; gap: 12px; justify-items: stretch; }
.lesson-meta dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.lesson-meta dl div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--rule); font-size: .88rem; }
.lesson-meta dt { color: var(--muted); }
.lesson-meta dd { margin: 0; font-weight: 600; }
.lesson-meta .chip { justify-self: start; }
.lesson-meta .btn { justify-content: center; }
.btn-quiet { border-color: var(--rule); color: var(--text); }
.btn-quiet:hover { border-color: var(--gild); }
.lesson.missing { opacity: .7; grid-template-columns: 84px minmax(0, 1fr); }
.lesson.missing .lesson-medal .track { fill: transparent; stroke-dasharray: 4 6; }
.lesson.missing .lesson-medal { color: var(--muted); }
.lesson.missing h3 { color: var(--muted); font-size: 1.4rem; }

@media (max-width: 900px) {
  .course-overview { grid-template-columns: 1fr; }
  .overview-figures { justify-content: space-between; gap: 12px; }
  .overview-figures b { font-size: 1.5rem; }
  .lesson { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding-inline: 4px; }
  .lesson-medal { width: 64px; height: 64px; }
  .lesson-medal b { font-size: 1.5rem; }
  .lesson-meta { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; }
  .lesson-meta dl { grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 16px; }
  .lesson-meta dl div { border: 0; gap: 4px; }
  .lesson-meta .chip { display: none; }
}
@media (max-width: 520px) {
  .lesson-meta { grid-template-columns: 1fr; }
  .lesson-meta dl { grid-template-columns: repeat(2, auto); }
}

/* ───────── Concepts: orbit explorer and threads ───────── */
.seg-tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-2); margin-bottom: 22px; }
.seg-tabs button { border: 0; background: transparent; padding: 6px 20px; border-radius: 999px; color: var(--muted); font-size: .98rem; }
.seg-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.orbit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.orbit-main { display: grid; gap: 20px; min-width: 0; }
.orbit-stage {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; padding: 0;
  background: radial-gradient(60% 60% at 50% 50%, color-mix(in srgb, var(--gild) 9%, var(--surface)), var(--surface) 75%);
}
.orbit-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit-lines .ring { fill: none; stroke: var(--rule); stroke-dasharray: 1 6; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-width: 1.4; }
.orbit-lines line { stroke: color-mix(in srgb, var(--gild) 55%, transparent); stroke-width: 1.3; opacity: 0; }
.orbit-lines line.secondary { stroke: var(--rule); stroke-dasharray: 3 5; }
.onode {
  position: absolute; transform: translate(-50%, -50%); z-index: 1; display: grid; justify-items: center; gap: 2px;
  border: 0; background: none; padding: 4px; max-width: 160px; text-align: center; color: var(--text); cursor: pointer;
}
.onode .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); transition: transform .25s; }
.onode .label { font-size: .98rem; line-height: 1.75; padding: 0 8px; border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.onode .kind { font-size: .7rem; color: var(--muted); }
.onode:hover .dot, .onode:focus-visible .dot { transform: scale(1.35); }
.onode:hover .label { color: var(--gild); }
.onode[data-kind="secondary"] .dot { width: 9px; height: 9px; box-shadow: none; opacity: .7; }
.onode[data-kind="secondary"] .label { color: var(--muted); font-size: .88rem; }
.onode[data-kind="focus"] { z-index: 2; cursor: default; max-width: none; }
.onode .medal {
  width: clamp(130px, 22%, 190px); aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; gap: 2px; padding: 14px;
  background: radial-gradient(circle at 35% 30%, #22594a, #0a2219 75%); color: #f3e6bf;
  box-shadow: 0 0 0 2px #ddb457, 0 0 0 7px color-mix(in srgb, var(--surface) 80%, transparent), 0 0 0 8px rgba(221, 180, 87, .45), 0 18px 40px rgba(5, 19, 14, .35);
}
.onode .medal b { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.15rem, 2.2vw, 1.7rem); line-height: 1.6; }
.onode .medal small { font-family: var(--font-ar); color: #ddb457; font-size: .9rem; }
.orbit-caption { position: absolute; bottom: 10px; inset-inline: 18px; margin: 0; text-align: center; color: var(--muted); font-family: var(--font-body); font-size: .9rem; line-height: 2.1; min-height: 2em; pointer-events: none; }

.concept-detail { padding: 24px 28px; display: grid; gap: 14px; }
.detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; }
.detail-head h2 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 3.2vw, 2.4rem); line-height: 1.6; }
.detail-head .ar { color: var(--muted); }
.presence-strip { display: flex; gap: 6px; height: 70px; align-items: stretch; }
.pres { width: 26px; display: grid; grid-template-rows: 1fr auto; gap: 4px; color: var(--muted); }
.pres:hover { text-decoration: none; color: var(--text); }
.pres i { align-self: end; height: var(--h); min-height: 3px; background: var(--c); border-radius: 4px 4px 0 0; }
.pres.none i { background: var(--rule); }
.pres span { text-align: center; font-size: .78rem; line-height: 1; }
.definitions p { margin: 0 0 8px; font-family: var(--font-body); line-height: 2.25; }
.definitions a { font-size: .85rem; white-space: nowrap; }
.more-links, .trail { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .86rem; color: var(--muted); }

.concept-index { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; padding: 18px; display: grid; gap: 16px; align-content: start; scrollbar-width: thin; }
.concept-index .field { min-width: 0; width: 100%; }
.index-group h3 { margin: 0 0 8px; font-size: .86rem; font-weight: 400; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.index-group .dot { width: 8px; height: 8px; border-radius: 50%; }
.index-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ichip { border: 1px solid transparent; background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 1px 11px; font-size: .84rem; line-height: 1.9; }
.ichip.w2 { font-weight: 600; }
.ichip.w3 { font-weight: 600; font-size: .95rem; }
.ichip:hover { border-color: var(--gild); }
.ichip.active { background: var(--gild); color: #1f1604; }

.threads-intro { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 30px; align-items: center; margin-bottom: 16px; }
.threads-intro p { margin: 0; color: var(--muted); max-width: 52rem; line-height: 2; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: .92rem; cursor: pointer; }
.toggle input { accent-color: var(--gold); width: 16px; height: 16px; }
.threads { display: grid; }
.thread-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: center; min-height: 40px; border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); }
.thread-row:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.thread-head { position: sticky; top: var(--header-h); z-index: 2; background: var(--bg); border-bottom: 1px solid var(--rule); font-size: .85rem; color: var(--muted); min-height: 46px; }
.thread-head b { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; padding-top: 6px; }
.thread-group h3 { margin: 26px 0 4px; font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; color: var(--gild); }
.thread-term { border: 0; background: none; color: var(--text); text-align: start; padding: 4px 6px; font-size: 1rem; display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.thread-term small { color: var(--muted); font-size: .76rem; }
.thread-term:hover { color: var(--gild); }
.thread-cells { position: relative; display: grid; grid-template-columns: repeat(var(--cols), 1fr); align-items: center; height: 100%; min-height: 40px; }
.thread-line { position: absolute; top: 50%; height: 2px; translate: 0 -50%; background: linear-gradient(to left, var(--gold-bright), var(--gold)); opacity: .55; border-radius: 2px; }
.cell { position: relative; display: grid; place-items: center; height: 100%; }
.cell i { width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--bg); }
.cell.zero i { width: 4px; height: 4px; background: var(--rule); box-shadow: none; }
a.cell:hover { text-decoration: none; }

@media (max-width: 900px) {
  .orbit-layout { grid-template-columns: 1fr; }
  .concept-index { position: static; max-height: none; }
  .onode { max-width: 96px; }
  .onode .label { font-size: .8rem; padding: 0 4px; }
  .onode .kind { display: none; }
  .onode .medal { width: 100px; padding: 8px; }
  .orbit-stage { aspect-ratio: 3 / 4; }
  .onode .medal b { font-size: 1.05rem; }
  .detail-head { grid-template-columns: 1fr; }
  .thread-row { grid-template-columns: 112px minmax(0, 1fr); }
  .thread-term { font-size: .86rem; flex-direction: column; gap: 0; }
}

.hero-lecturer { margin: -6px 0 18px; color: #a6b8ad; font-size: .95rem; }
