/* Policy glossary (/glossary and /glossary/<slug>): "the dictionary".
   The index opens on a night-sky constellation of the published terms
   (sized by real link counts, assets/js/glossary.js), then prints the A–Z as
   dictionary pages: two justified columns, guide words, run-in headwords in
   bold small caps, and thumb-index tabs down the right edge. A term's page is
   a single dictionary entry card with numbered citations. Tokens: site.css. */
:root {
  --gx-gold: #E2B865;
  --gx-gold-deep: #83621E;
  --gx-paper: #FCFAF5;
  --gx-paper-edge: #EEE8DA;
  --gx-rule: #D9D1BF;
}

/* ------------------------------------------------------------- Masthead */
.gx-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(ellipse 60% 70% at 72% 45%, rgba(110, 66, 166, 0.34), transparent 70%),
    radial-gradient(ellipse 40% 50% at 90% 90%, rgba(226, 184, 101, 0.08), transparent 70%),
    linear-gradient(180deg, #1E1233 0%, var(--ink) 55%, #22163A 100%);
  border-bottom: 1px solid rgba(226, 184, 101, 0.28);
}
.gx-hero-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: var(--s-4); align-items: center; padding-top: var(--s-4); padding-bottom: var(--s-4); }
.gx-hero-text { position: relative; z-index: 2; }
.gx-kicker {
  display: inline-flex; align-items: center; gap: 0.55em; margin: 0 0 var(--s-2);
  font-family: var(--font-serif); font-size: var(--kicker-size); font-weight: 600; font-variant-caps: all-small-caps;
  letter-spacing: var(--kicker-track); color: var(--gx-gold);
}
.gx-kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.gx-title { color: #fff; margin: 0 0 var(--s-2); font-size: clamp(2.4rem, 4.4vw, 3.6rem); line-height: 1.02; }
.gx-lede { max-width: 44ch; margin: 0 0 var(--s-2); font-family: var(--font-serif); font-style: italic; font-size: clamp(1.1rem, 1.4vw, 1.28rem); line-height: 1.45; color: var(--on-ink); }
.gx-count { margin: 0; font-family: var(--font-serif); font-variant-caps: all-small-caps; letter-spacing: var(--kicker-track); font-size: 1.02rem; color: var(--on-ink-muted); }

/* The constellation. Without JS: a centred word cloud; with JS (.is-live)
   the words are placed and drift, and the canvas draws the cross-references. */
.gx-sky { position: relative; margin: 0; height: 440px; min-width: 0; }
.gx-sky-c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.gx-sky-w {
  position: absolute; inset: 0 0 28px; margin: 0; padding: 0; list-style: none; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 0.1em 0.9em;
}
.gx-sky-w a {
  display: inline-block; white-space: nowrap; font-family: var(--font-serif); line-height: 1.05;
  font-size: calc(0.78rem + var(--s, 0.4) * 1.45rem); font-weight: calc(400 + var(--s, 0.4) * 220);
  letter-spacing: -0.005em; color: rgba(236, 228, 245, calc(0.62 + var(--s, 0.4) * 0.38));
  text-shadow: 0 0 18px rgba(20, 10, 36, 0.9);
  transition: color 0.35s ease, opacity 0.35s ease, text-shadow 0.35s ease;
}
.gx-sky-w a.is-faint { color: rgba(201, 184, 222, 0.5); }
.gx-sky-w a:hover, .gx-sky-w a.is-hot { color: var(--gx-gold); text-shadow: 0 0 22px rgba(226, 184, 101, 0.45), 0 0 2px rgba(20, 10, 36, 0.9); }
.gx-sky:not(.is-live) .gx-sky-w { -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent); }
.gx-sky.is-live .gx-sky-w { display: block; }
.gx-sky.is-live .gx-sky-w li { position: absolute; left: 0; top: 0; will-change: transform; opacity: 0; transition: opacity 1.1s ease; }
.gx-sky.is-live .gx-sky-w li.is-in { opacity: 1; }
.gx-sky.is-live .gx-sky-w li.is-out { display: none; }
.gx-sky.is-focus .gx-sky-w a:not(.is-hot):not(.is-near) { opacity: 0.28; }
.gx-sky.is-focus .gx-sky-w a.is-near { color: #fff; }
.gx-sky-key {
  position: absolute; right: 0; bottom: 0; margin: 0; display: flex; align-items: center; gap: 8px;
  font-size: 0.72rem; letter-spacing: 0.04em; color: var(--on-ink-muted);
}
.gx-key-s, .gx-key-l { font-family: var(--font-serif); color: var(--on-ink); line-height: 1; }
.gx-key-s { font-size: 0.8rem; }
.gx-key-l { font-size: 1.25rem; font-weight: 600; margin-right: 2px; }
.gx-key-line { display: inline-block; width: 26px; height: 1px; margin-left: 10px; background: linear-gradient(90deg, transparent, var(--gx-gold), transparent); }
.gx-sky.is-empty { display: flex; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(circle at 50% 50%, rgba(226, 184, 101, 0.1) 0 2px, transparent 3px) 50% 50% / 46px 46px; }
.gx-sky-empty { margin: 0; padding: 18px 22px; max-width: 30ch; font-family: var(--font-serif); font-style: italic; font-size: 1.15rem; line-height: 1.5; color: var(--on-ink); background: rgba(30, 18, 51, 0.85); border: 1px solid rgba(226, 184, 101, 0.3); }

/* ----------------------------------------------------------- Search bar */
.gx-tools { position: sticky; top: var(--gx-sticky, 0px); z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.gx-tools-in { display: flex; align-items: center; gap: var(--s-3); padding-top: 10px; padding-bottom: 10px; }
.gx-search { position: relative; display: flex; flex: 0 1 360px; min-width: 0; }
.gx-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gx-search input {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-right: 0; border-radius: 3px 0 0 3px;
  font-family: var(--font-serif); font-size: 1.02rem; background: var(--mist); color: var(--text);
}
.gx-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: #fff; }
.gx-go { height: 42px; padding: 0 16px; border: 0; border-radius: 0 3px 3px 0; background: var(--ink); color: #fff; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.gx-go:hover { background: var(--accent-dark); }
.js .gx-go { display: none; }
.js .gx-search input { border-right: 1px solid var(--line); border-radius: 3px; }
.gx-cats { flex: 1; min-width: 0; }
.gx-cats ul { display: flex; gap: 6px; margin: 0; padding: 2px 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.gx-cats li { flex: none; }
.gx-cats a { display: inline-flex; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.82rem; white-space: nowrap; color: var(--text); }
.gx-cats a:hover { border-color: var(--accent-soft); color: var(--accent-dark); }
.gx-cats a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.gx-n { font-variant-numeric: tabular-nums; color: var(--muted); }
.gx-cats a[aria-current] .gx-n { color: var(--accent-soft); }

/* ---------------------------------------------------- The printed pages */
.gx-book { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 0; padding-top: var(--s-4); padding-bottom: var(--s-5); }
.gx-spread { min-width: 0; }
.gx-sheet {
  position: relative; max-width: 1060px; margin: 0 auto var(--s-4); padding: 26px 44px 34px; background: var(--gx-paper);
  border: 1px solid var(--gx-paper-edge); border-right: 0;
  box-shadow: 0 1px 0 #fff inset, 0 18px 36px -24px rgba(42, 27, 69, 0.35), 3px 3px 0 -1px var(--gx-paper), 3px 3px 0 0 var(--gx-paper-edge), 6px 6px 0 -1px var(--gx-paper), 6px 6px 0 0 var(--gx-paper-edge);
}
.gx-sheet[hidden] { display: none; }
/* Filtering as you type: the matching entries read as one continuous page. */
.is-filtering .gx-sheet { margin-bottom: 0; padding-top: 4px; padding-bottom: 4px; border-top: 0; border-bottom: 0; box-shadow: none; }
.is-filtering .gx-sheet .gx-guide { display: none; }
.is-filtering .gx-sheet.is-first { padding-top: 26px; border-top: 1px solid var(--gx-paper-edge); }
.is-filtering .gx-sheet.is-first .gx-guide { display: grid; }
.is-filtering .gx-sheet.is-last { padding-bottom: 30px; border-bottom: 1px solid var(--gx-paper-edge); box-shadow: 0 18px 36px -24px rgba(42, 27, 69, 0.35); }
.is-filtering .gx-folio { visibility: hidden; }
.is-filtering .gx-cols { columns: 1; }
.is-filtering .gx-entry { max-width: 72ch; }
.gx-guide {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 12px; margin: 0 0 18px; padding-bottom: 7px; border-bottom: 1.5px solid var(--ink);
  font-family: var(--font-serif); font-weight: 700; font-size: 0.98rem; font-variant-caps: small-caps; letter-spacing: 0.04em; color: var(--ink);
}
.gx-guide > :last-child { text-align: right; }
.gx-folio { font-weight: 500; font-size: 0.86rem; color: var(--muted); font-variant-numeric: oldstyle-nums; }
.gx-cols { columns: 2; column-gap: 46px; column-rule: 1px solid var(--gx-rule); }
.gx-letter-h {
  display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; break-after: avoid; break-inside: avoid; scroll-margin-top: calc(var(--gx-sticky, 0px) + 80px);
  font-family: var(--font-serif); font-size: 2.3rem; font-weight: 600; line-height: 1; color: var(--ink);
}
.gx-letter-h::after { content: ""; flex: 1; height: 3px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--gx-rule); }
.gx-letter-h span { font-variant-numeric: lining-nums; }
.gx-letter-h[hidden] { display: none; }
[id^="letter-"] { scroll-margin-top: calc(var(--gx-sticky, 0px) + 80px); }
.gx-entry {
  margin: 0 0 11px; padding-left: 1.1em; text-indent: -1.1em; text-align: justify; hyphens: auto; -webkit-hyphens: auto;
  font-family: var(--font-serif); font-size: 0.98rem; line-height: 1.47; font-variant-numeric: var(--nums-text); color: var(--text);
  break-inside: avoid-column; scroll-margin-top: calc(var(--gx-sticky, 0px) + 80px);
}
.gx-entry[hidden] { display: none; }
.gx-entry:target { background: linear-gradient(to right, rgba(226, 184, 101, 0.22), rgba(226, 184, 101, 0.05)); box-shadow: -6px 0 0 rgba(226, 184, 101, 0.22); }
.gx-hw { display: inline; margin: 0 0.35em 0 0; font-family: var(--font-serif); font-size: 1.08rem; font-weight: 700; font-variant-caps: small-caps; letter-spacing: 0.03em; line-height: 1.2; }
.gx-hw a { color: var(--ink); }
.gx-hw a:hover { color: var(--accent-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gx-pos { font-style: italic; color: #7A5C1C; margin-right: 0.35em; }
.gx-aka { color: var(--muted); }
.gx-aka b { font-weight: 600; color: var(--text); }
.gx-more { margin-left: 0.3em; color: var(--accent); font-family: var(--font); font-size: 0.85em; text-indent: 0; }
.gx-more:hover { color: var(--accent-dark); }

.gx-status { margin: 0 0 var(--s-3); font-size: 0.95rem; color: var(--muted); }
.gx-status a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.gx-empty { padding: var(--s-3) 0; font-family: var(--font-serif); font-size: 1.1rem; color: var(--muted); }
.gx-empty a { color: var(--accent-dark); text-decoration: underline; }
.gx-note { margin: var(--s-3) 0 0; font-family: var(--font-serif); font-style: italic; color: var(--muted); }
.gx-note a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.gx-sheet-soon { min-height: 320px; background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(217, 209, 191, 0.55) 27px 28px); background-color: var(--gx-paper); }
.gx-soon { max-width: 46ch; margin: 60px auto; padding: 22px 26px; text-align: center; background: var(--gx-paper); border: 1px solid var(--gx-rule); font-family: var(--font-serif); font-style: italic; font-size: 1.12rem; line-height: 1.55; color: var(--muted); }
.gx-soon-k { display: block; margin-bottom: 6px; font-style: normal; font-weight: 700; font-variant-caps: small-caps; letter-spacing: 0.08em; color: var(--ink); }

/* Thumb index: tabs cut into the page edge, sticky down the right side. */
.gx-thumbs { position: sticky; top: calc(var(--gx-sticky, 0px) + 72px); align-self: start; height: calc(100vh - var(--gx-sticky, 0px) - 96px); max-height: 760px; min-height: 280px; }
.gx-thumbs ol { display: flex; flex-direction: column; height: 100%; margin: 0; padding: 0; list-style: none; }
.gx-thumbs li { flex: 1 1 0; min-height: 0; display: flex; }
.gx-thumbs a, .gx-thumbs span {
  flex: 1; display: flex; align-items: center; justify-content: center; margin: 0 0 1px; border-radius: 0 9px 9px 0;
  font-family: var(--font-serif); font-size: clamp(0.72rem, 1.9vh, 0.98rem); font-weight: 700; line-height: 1;
}
.gx-thumbs a { background: var(--ink); color: #fff; box-shadow: inset 4px 0 6px -3px rgba(0, 0, 0, 0.45); transition: background 0.2s, transform 0.2s; }
.gx-thumbs a:hover, .gx-thumbs a:focus-visible, .gx-thumbs a.is-here { background: var(--gx-gold); color: var(--ink); transform: translateX(3px); }
.gx-thumbs .is-off { background: #ECE9F0; color: #B9B3C2; box-shadow: none; }
.gx-thumbs a.is-off { pointer-events: none; }

/* ------------------------------------------------------------ Term page */
.gx-page { padding: var(--s-4) 0 var(--s-4); background: linear-gradient(180deg, var(--mist), transparent 420px); }
.gx-crumbs { margin: 0 0 var(--s-3); font-family: var(--font-serif); font-size: var(--kicker-size); font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: var(--kicker-track); }
.gx-crumbs a { color: var(--accent-dark); }
.gx-crumbs a:hover { text-decoration: underline; }
.gx-crumbs span { color: var(--muted); margin: 0 0.2em; }
.gx-page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: var(--s-5); align-items: start; }
.gx-card {
  position: relative; max-width: 760px; padding: 40px 48px 36px; background: var(--gx-paper);
  border: 1px solid var(--gx-paper-edge); outline: 1px solid var(--gx-rule); outline-offset: -9px;
  box-shadow: 0 24px 48px -30px rgba(42, 27, 69, 0.45), 4px 4px 0 -1px var(--gx-paper), 4px 4px 0 0 var(--gx-paper-edge);
}
.gx-card-guide { position: absolute; top: 0; right: 28px; margin: 0; }
.gx-card-guide span {
  display: flex; align-items: flex-end; justify-content: center; width: 44px; height: 58px; padding-bottom: 8px; border-radius: 0 0 22px 22px;
  background: var(--ink); color: #fff; font-family: var(--font-serif); font-size: 1.35rem; font-weight: 700;
}
.gx-card-head { margin: 0 0 18px; padding-right: 64px; padding-bottom: 14px; border-bottom: 1.5px solid var(--ink); }
.gx-page-term { margin: 0 0 6px; font-family: var(--font-serif); font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 700; font-variant-caps: small-caps; letter-spacing: 0.02em; line-height: 1.02; color: var(--ink); }
.gx-card-pos { margin: 0; font-family: var(--font-serif); font-size: 1.15rem; color: var(--muted); }
.gx-card-pos i { color: var(--gx-gold-deep); margin-right: 0.4em; }
.gx-page-aka b { font-weight: 600; color: var(--ink); }
.gx-page-def { margin: 0 0 var(--s-3); font-family: var(--font-serif); font-size: clamp(1.18rem, 1.7vw, 1.36rem); line-height: 1.58; text-align: justify; hyphens: auto; font-variant-numeric: var(--nums-text); color: var(--text); }
.gx-page-def::first-letter { float: left; margin: 0.05em 0.1em 0 0; font-size: 3.3em; line-height: 0.8; font-weight: 600; color: var(--ink); }
.gx-marks { margin-left: 2px; font-family: var(--font); font-size: 0.62em; font-weight: 600; line-height: 0; font-variant-numeric: lining-nums; }
.gx-marks a { color: var(--accent); padding: 0 1px; }
.gx-marks a:hover { color: var(--accent-dark); text-decoration: underline; }
.gx-marks span { color: var(--muted); }
.gx-page-body { margin: 0 0 var(--s-3); font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.65; }
.gx-card-usage { margin: 0 0 var(--s-3); font-family: var(--font-serif); font-style: italic; color: var(--muted); }
.gx-h2 {
  margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--ink);
  font-family: var(--font-serif); font-size: var(--kicker-size); font-weight: 600; line-height: 1.3;
  font-variant-caps: all-small-caps; letter-spacing: var(--kicker-track); color: var(--ink);
}
.gx-sources { margin-top: var(--s-3); }
.gx-cites { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.gx-cite { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px dotted var(--gx-rule); font-family: var(--font-serif); font-size: 1rem; line-height: 1.45; scroll-margin-top: calc(var(--gx-sticky, 0px) + 90px); }
.gx-cite:last-child { border-bottom: 0; }
.gx-cite:target { background: rgba(226, 184, 101, 0.16); }
.gx-cite-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-top: 1px; border: 1px solid var(--ink); border-radius: 50%; font-family: var(--font); font-size: 0.72rem; font-weight: 700; color: var(--ink); }
.gx-cite-b { min-width: 0; overflow-wrap: anywhere; }
.gx-src-t a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
.gx-src-t a:hover { color: var(--accent-dark); text-decoration-color: currentColor; }
.gx-src-p, .gx-src-d { color: var(--muted); }
.gx-src-k { display: inline-block; margin-left: 6px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 2px; font-family: var(--font); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); vertical-align: 2px; }
.gx-page-side { padding-top: 8px; }
.gx-see { margin-bottom: var(--s-4); }
.gx-see ul { margin: 0; padding: 0; list-style: none; }
.gx-see li { border-bottom: 1px solid var(--line); }
.gx-see a { display: block; padding: 9px 0; font-family: var(--font-serif); font-size: 1.06rem; line-height: 1.3; color: var(--ink); }
.gx-see a:hover { color: var(--accent-dark); }
.gx-see-k { display: block; margin-bottom: 2px; font-family: var(--font); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-dark); }
.gx-back a { font-size: 0.9rem; font-weight: 600; color: var(--accent-dark); }

/* --------------------------------------------------------- Smaller screens */
@media (max-width: 1000px) {
  .gx-hero-in { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  .gx-sky { height: 360px; }
  .gx-page-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .gx-card { max-width: none; }
}
@media (max-width: 760px) {
  .gx-cols { columns: 1; }
  .gx-sheet { padding: 20px 20px 24px; }
  .gx-book { grid-template-columns: minmax(0, 1fr) 26px; padding-top: var(--s-3); }
  .gx-thumbs a, .gx-thumbs span { border-radius: 0 7px 7px 0; font-size: 0.7rem; }
}
@media (max-width: 640px) {
  .gx-hero-in { padding-top: var(--s-3); padding-bottom: var(--s-2); }
  .gx-sky { height: 330px; }
  .gx-sky-w a { font-size: calc(0.7rem + var(--s, 0.4) * 0.95rem); }
  .gx-tools-in { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .gx-search { flex: none; }
  .gx-sheet { margin-right: 4px; box-shadow: 0 14px 28px -22px rgba(42, 27, 69, 0.35); }
  .gx-entry { font-size: 0.98rem; text-align: left; hyphens: manual; }
  .gx-thumbs { top: calc(var(--gx-sticky, 0px) + 112px); height: calc(100vh - var(--gx-sticky, 0px) - 128px); min-height: 240px; }
  .gx-sky-key { font-size: 0.66rem; gap: 6px; }
  .gx-key-line { width: 16px; margin-left: 4px; }
  .gx-card { padding: 28px 20px 24px; outline-offset: -6px; }
  .gx-card-guide { right: 16px; }
  .gx-card-guide span { width: 36px; height: 48px; font-size: 1.1rem; }
  .gx-card-head { padding-right: 46px; }
  .gx-page-def { text-align: left; }
}
@media print {
  .gx-tools, .gx-thumbs, .gx-sky { display: none; }
  .gx-book { display: block; }
  .gx-sheet { box-shadow: none; break-inside: auto; }
}
