/* ═══════════════════════════════════════════════════════════════
   Glossary page (/glossary.html, generated by scripts/gen-glossary.mjs).
   Loaded after styles.css; uses its tokens, .container, .eyebrow,
   .section-title, .serif and .reveal.
   ═══════════════════════════════════════════════════════════════ */

/* Without JavaScript nothing would reveal, so show everything. */
html:not(.gl-js) .gl-page .reveal { opacity: 1; transform: none; }

.gl-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Space reserved for the fixed nav (and the sticky A to Z bar on wide screens) when jumping to an anchor. */
.gl-page { --gl-nav: 58px; --gl-jump: 84px; }
@media (min-width: 900px) { .gl-page { --gl-jump: 136px; } }
/* When the nav slides away on scroll-down (js/app.js adds .nav-hidden), the sticky bar rides up with it. */
html:has(.nav.nav-hidden) .gl-page { --gl-nav: 0px; --gl-jump: 26px; }
@media (min-width: 900px) { html:has(.nav.nav-hidden) .gl-page { --gl-jump: 78px; } }
.gl-bar, .gl-sec-head { transition: top .5s var(--ease); }
.gl-item, .gl-letter, .gl-sec, .gl-index, .gl-about { scroll-margin-top: var(--gl-jump); }
/* Jump targets receive focus for screen readers; the scroll itself is the visual cue. */
.gl-letter:focus, .gl-sec:focus, .gl-index:focus, .gl-about:focus { outline: none; }

/* ── Hero ───────────────────────────────────────────────────── */
.gl-hero {
  position: relative; overflow: hidden;
  padding: clamp(7rem, 13vw, 9.25rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  background:
    radial-gradient(55% 60% at 12% 0%, rgba(79,190,116,.11), transparent 70%),
    radial-gradient(45% 55% at 96% 8%, rgba(47,134,224,.13), transparent 70%),
    var(--bg);
}
.gl-hero .dot-grid { opacity: .55; }
.gl-hero .container { position: relative; z-index: 1; }
.gl-crumb ol { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; font-size: .85rem; color: var(--ink-3); margin-bottom: 1.6rem; }
.gl-crumb li + li::before { content: '/'; margin-right: .45rem; color: var(--ink-3); opacity: .6; }
.gl-crumb a { color: var(--ink-2); transition: color .2s; }
.gl-crumb a:hover { color: var(--blue); }
.gl-hero-inner { max-width: 820px; }
.gl-h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin: .1rem 0 1.25rem; }
.gl-h1 .serif { font-weight: 400; }
.gl-lede { font-size: clamp(1.05rem, 1.7vw, 1.2rem); color: var(--ink-2); line-height: 1.7; max-width: 660px; }
.gl-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.gl-meta span { font-size: .85rem; color: var(--ink-2); background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: var(--pill); padding: .35rem .85rem; box-shadow: var(--sh-sm); }
.gl-meta b { color: var(--ink); font-weight: 700; }

/* Topic shortcuts */
.gl-topics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; margin-top: clamp(2.25rem, 5vw, 3.25rem); }
.gl-topic {
  height: 100%; display: flex; flex-direction: column; gap: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.15rem 1.15rem 1rem;
  box-shadow: var(--sh-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s var(--ease);
}
.gl-topic:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: rgba(47,134,224,.35); }
.gl-topic-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); margin-bottom: .2rem; }
.gl-topic-ic .ic { width: 19px; height: 19px; }
.gl-topic-name { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 600; font-size: 1rem; line-height: 1.3; letter-spacing: -.015em; color: var(--ink); }
.gl-topic-n { margin-top: auto; font-size: .8rem; font-weight: 600; color: var(--ink-3); }

/* ── A to Z bar (sticky on wide screens) ────────────────────── */
.gl-bar { position: relative; z-index: 60; background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.gl-bar-in { display: flex; align-items: center; gap: 1.25rem; padding-top: .7rem; padding-bottom: .7rem; }
.gl-search { position: relative; flex: 0 0 270px; }
.gl-search-ic { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; }
.gl-search input {
  width: 100%; height: 42px; padding: 0 1rem 0 2.6rem;
  font: inherit; font-size: .92rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--pill);
  transition: border-color .2s, box-shadow .2s;
}
.gl-search input::placeholder { color: var(--ink-3); }
.gl-search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47,134,224,.15); }
.gl-az { flex: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .1rem; }
.gl-az a, .gl-az span { min-width: 1.85rem; height: 2rem; display: inline-grid; place-items: center; border-radius: 8px; font-size: .86rem; font-weight: 600; }
.gl-az a { color: var(--ink); transition: background .2s, color .2s; }
.gl-az a:hover { background: var(--blue-soft); color: var(--blue); }
.gl-az .off { color: var(--ink-3); opacity: .45; pointer-events: none; }
@media (min-width: 900px) {
  .gl-bar { position: sticky; top: var(--gl-nav); }
}

/* ── A to Z index ───────────────────────────────────────────── */
.gl-index { padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 3.5rem); }
.gl-head { margin-bottom: clamp(2rem, 4vw, 2.75rem); }
.gl-head .section-title { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
.gl-letters { columns: 4 210px; column-gap: 2.25rem; }
.gl-letter { break-inside: avoid; padding-bottom: 1.4rem; }
.gl-letter h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.35rem; font-weight: 700; line-height: 1; color: var(--blue); padding-bottom: .55rem; margin-bottom: .45rem; border-bottom: 1px solid var(--line); }
.gl-letter a { display: block; padding: .24rem 0; font-size: .95rem; color: var(--ink-2); transition: color .2s, transform .25s var(--ease); }
.gl-letter a:hover { color: var(--blue); transform: translateX(3px); }

/* ── Topic sections ─────────────────────────────────────────── */
.gl-sec { padding: clamp(3.5rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.gl-tint { background: var(--bg-2); }
.gl-sec-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.gl-sec-head { display: flex; flex-direction: column; align-items: flex-start; }
.gl-sec-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-blue); color: #fff; box-shadow: var(--sh-blue); margin-bottom: 1.25rem; }
.gl-sec-ic .ic { width: 22px; height: 22px; }
.gl-sec-head .section-title { font-size: clamp(1.75rem, 3vw, 2.3rem); }
.gl-sec-intro { margin-top: .9rem; color: var(--ink-2); font-size: 1rem; line-height: 1.65; }
.gl-sec-course { margin-top: 1.25rem; display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 600; color: var(--blue-2); line-height: 1.4; }
.gl-sec-course .ic { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.gl-sec-course:hover .ic { transform: translateX(3px); }
.gl-back { margin-top: .9rem; font-size: .82rem; font-weight: 600; color: var(--ink-3); }
.gl-back:hover { color: var(--blue); }
@media (min-width: 900px) {
  .gl-sec-head { position: sticky; top: calc(var(--gl-jump) + 1rem); }
  .gl-back { display: none; }
}

.gl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.gl-item {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.4rem 1.45rem 1.25rem;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.gl-item:hover { border-color: rgba(47,134,224,.3); box-shadow: var(--sh); }
.gl-item:focus { outline: none; }
.gl-item:target, .gl-item.gl-flash { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47,134,224,.14), var(--sh-md); }
.gl-term { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.22rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; color: var(--ink); padding-right: 2.25rem; }
.gl-term dfn { font-style: normal; }
.gl-hash {
  position: absolute; top: 1.05rem; right: 1rem; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; color: var(--ink-3); opacity: 0;
  transition: opacity .2s, background .2s, color .2s;
}
.gl-hash::before { content: '#'; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.05rem; }
.gl-item:hover .gl-hash, .gl-hash:focus-visible { opacity: 1; }
.gl-hash:hover { background: var(--blue-soft); color: var(--blue); }
@media (hover: none) { .gl-hash { opacity: .7; } }
.gl-def { margin-top: .65rem; font-size: .97rem; line-height: 1.7; color: var(--ink-2); }
.gl-aka { margin-top: .65rem; font-size: .84rem; line-height: 1.5; color: var(--ink-3); }
.gl-aka b { font-weight: 600; color: var(--ink-2); }
.gl-links { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: auto; padding-top: 1.05rem; }
.gl-chip {
  display: inline-flex; align-items: flex-start; gap: .45rem; max-width: 100%;
  font-size: .8rem; font-weight: 600; line-height: 1.35; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: .42rem .75rem;
  transition: background .2s, color .2s, border-color .2s;
}
.gl-tint .gl-chip { background: #fff; }
.gl-chip .ic { width: 15px; height: 15px; margin-top: 1px; color: var(--ink-3); transition: color .2s; }
.gl-chip:hover { border-color: rgba(47,134,224,.35); color: var(--blue-2); }
.gl-chip:hover .ic { color: var(--blue); }
.gl-chip.gl-chip-course, .gl-tint .gl-chip.gl-chip-course { background: var(--blue-soft); border-color: transparent; color: var(--blue-2); }
.gl-chip.gl-chip-course .ic { color: var(--blue); }
.gl-chip.gl-chip-course:hover { border-color: rgba(47,134,224,.4); }

/* Filter: nothing matched */
.gl-empty { padding: clamp(3rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); text-align: center; }
.gl-empty p { max-width: 520px; margin: 0 auto 1.25rem; color: var(--ink-2); font-size: 1.05rem; line-height: 1.65; }
.gl-empty b { color: var(--ink); }

/* ── About + courses ────────────────────────────────────────── */
.gl-about { padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(4rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.gl-about-card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4rem);
  background: var(--grad-ink); color: #fff; border-radius: var(--r-xl); padding: clamp(1.75rem, 5vw, 3.5rem); box-shadow: var(--sh-lg);
}
.gl-about-card::before { content: ''; position: absolute; width: 420px; height: 420px; right: -140px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(47,134,224,.38), transparent 70%); pointer-events: none; }
.gl-about-card > * { position: relative; }
.gl-about-main .section-title { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-bottom: 1.1rem; }
.gl-about-main p { color: rgba(255,255,255,.7); line-height: 1.75; font-size: 1rem; }
.gl-about-main p + p { margin-top: .9rem; }
.gl-about-main a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.gl-about-main a:hover { text-decoration-color: #fff; }
.gl-about-main code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; overflow-wrap: anywhere; }
.gl-about-more a { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; text-decoration: none; }
.gl-about-more .ic { width: 16px; height: 16px; }
.gl-about-k { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green); margin-bottom: .9rem; }
.gl-courses { display: flex; flex-direction: column; gap: .55rem; }
.gl-courses a { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; border-radius: var(--r); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); transition: background .2s, border-color .2s, transform .3s var(--ease); }
.gl-courses a:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.24); transform: translateX(4px); }
.gl-c-name { font-weight: 600; font-size: .95rem; color: #fff; }
.gl-c-meta { font-size: .8rem; color: rgba(255,255,255,.55); }
.gl-about-note { margin-top: 1rem; font-size: .85rem; line-height: 1.6; color: rgba(255,255,255,.55); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .gl-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gl-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .gl-bar-in { flex-direction: column; align-items: stretch; gap: .75rem; }
  .gl-search { flex: none; }
  .gl-az { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.1rem, 1fr)); justify-content: stretch; }
  .gl-sec-grid { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .gl-about-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .gl-topics { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .gl-topic { flex-direction: row; align-items: center; gap: .85rem; padding: .85rem 1rem; }
  .gl-topic-ic { margin-bottom: 0; flex: 0 0 auto; }
  .gl-topic-name { flex: 1; font-size: .95rem; }
  .gl-topic-n { margin-top: 0; flex: 0 0 auto; }
  .gl-letters { columns: 2 130px; column-gap: 1.25rem; }
  .gl-item { padding: 1.2rem 1.15rem 1.1rem; }
  .gl-term { font-size: 1.12rem; }
}
