/* ============================================================
   GLOSSARY PAGE — glossary.css
   Scoped to body.is-glossary-page  |  prefix: .gl-
   Design tokens: --ink, --fire, --chalk, --ff-head, --ff-body
   ============================================================ */

/* ── Reset & scope ────────────────────────────────────────── */
body.is-glossary-page *,
body.is-glossary-page *::before,
body.is-glossary-page *::after { box-sizing: border-box; }

/* ── Announcement bar ─────────────────────────────────────── */
.gl-announce {
  background: var(--fire);
  color: #fff;
  text-align: center;
  padding: 10px 24px;
  font-family: var(--ff-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  position: relative;
  z-index: 100;
}
.gl-announce a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ── Hero ─────────────────────────────────────────────────── */
.gl-hero {
  background: var(--ink);
  position: relative;
  overflow: hidden;
  padding: clamp(80px, 12vw, 140px) 0 clamp(60px, 8vw, 100px);
}
.gl-hero::before {
  content: 'GLOSSARY';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-head);
  font-size: clamp(60px, 14vw, 200px);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255,255,255,0.04);
  letter-spacing: -0.04em;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}
.gl-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse at 50% 100%, rgba(240,98,12,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.gl-hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}
.gl-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(240,98,12,0.12);
  border: 1px solid rgba(240,98,12,0.3);
  border-radius: 100px;
  padding: 6px 16px;
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fire2, #FF8333);
}
.gl-hero-pill span.dot {
  width: 7px; height: 7px;
  background: var(--fire);
  border-radius: 50%;
  animation: gl-pulse 2s ease-in-out infinite;
}
@keyframes gl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.gl-hero h1 {
  font-family: var(--ff-head);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #fff;
}
.gl-hero h1 em {
  font-style: italic;
  color: var(--fire);
}
.gl-hero-sub {
  font-family: var(--ff-body);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: rgba(255,255,255,0.6);
  max-width: 560px;
  line-height: 1.65;
}
.gl-hero-stats {
  display: flex;
  gap: clamp(24px, 4vw, 56px);
  padding-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.gl-hero-stats li {
  list-style: none;
  text-align: center;
}
.gl-hero-stats .num {
  display: block;
  font-family: var(--ff-head);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}
.gl-hero-stats .lbl {
  display: block;
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Search bar ───────────────────────────────────────────── */
.gl-search-wrap {
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 80;
}
.gl-search-inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.gl-search-field {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.gl-search-field svg {
  position: absolute;
  left: 16px;
  color: rgba(255,255,255,0.35);
  pointer-events: none;
  flex-shrink: 0;
}
.gl-search-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 16px 12px 46px;
  font-family: var(--ff-body);
  font-size: 0.9375rem;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.gl-search-input::placeholder { color: rgba(255,255,255,0.3); }
.gl-search-input:focus {
  border-color: var(--fire);
  background: rgba(255,255,255,0.07);
}
.gl-search-count {
  font-family: var(--ff-body);
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
  transition: color 0.2s;
}
.gl-search-count.active { color: var(--fire2, #FF8333); }

/* ── Alphabet nav ─────────────────────────────────────────── */
.gl-alpha-wrap {
  background: var(--ink2, #0D1E35);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 65px;
  z-index: 79;
  overflow-x: auto;
  scrollbar-width: none;
}
.gl-alpha-wrap::-webkit-scrollbar { display: none; }
.gl-alpha-nav {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 2px;
  align-items: center;
  min-width: max-content;
}
.gl-alpha-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  font-family: var(--ff-head);
  font-size: 0.875rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.02em;
  position: relative;
}
.gl-alpha-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.gl-alpha-nav a.active {
  color: var(--fire);
  background: rgba(240,98,12,0.1);
}
.gl-alpha-nav a.disabled {
  opacity: 0.2;
  pointer-events: none;
}
.gl-alpha-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 2px;
  background: var(--fire);
  border-radius: 2px;
  transition: transform 0.2s var(--ease);
}
.gl-alpha-nav a.active::after { transform: translateX(-50%) scaleX(1); }

/* ── Featured terms ───────────────────────────────────────── */
.gl-featured {
  background: var(--chalk, #FAFAF8);
  padding: clamp(60px, 8vw, 100px) 0;
}
.gl-featured-inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
}
.gl-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.gl-section-label .fire-dot {
  width: 10px; height: 10px;
  background: var(--fire);
  border-radius: 50%;
  flex-shrink: 0;
}
.gl-section-label h2 {
  font-family: var(--ff-head);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.gl-section-label .gl-count-badge {
  margin-left: auto;
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  border-radius: 100px;
  padding: 3px 12px;
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 600;
}
.gl-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.gl-feat-card {
  background: #fff;
  border: 1px solid var(--line2, #E4E0D8);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
  text-decoration: none;
  display: block;
  cursor: pointer;
}
.gl-feat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(8,17,31,0.1);
  border-color: var(--fire);
}
.gl-feat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.gl-feat-card h3 {
  font-family: var(--ff-head);
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.gl-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.gl-feat-card p {
  font-family: var(--ff-body);
  font-size: 0.875rem;
  color: rgba(8,17,31,0.6);
  line-height: 1.6;
}
.gl-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: var(--ff-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Category color system */
.cat-core    { --cc: #6366F1; }
.cat-technical { --cc: #0EA5E9; }
.cat-on-page { --cc: #10B981; }
.cat-off-page { --cc: #F59E0B; }
.cat-local   { --cc: #EC4899; }
.cat-content { --cc: #8B5CF6; }
.cat-analytics { --cc: #14B8A6; }
.cat-tools   { --cc: #F97316; }

.gl-cat-dot  { background: var(--cc, #6366F1); }
.gl-cat-tag  {
  background: rgba(var(--cc-rgb, 99,102,241), 0.1);
  color: var(--cc, #6366F1);
  border: 1px solid rgba(var(--cc-rgb, 99,102,241), 0.2);
}
/* Inline RGB equivalents for rgba() */
.cat-core    { --cc-rgb: 99,102,241; }
.cat-technical { --cc-rgb: 14,165,233; }
.cat-on-page { --cc-rgb: 16,185,129; }
.cat-off-page { --cc-rgb: 245,158,11; }
.cat-local   { --cc-rgb: 236,72,153; }
.cat-content { --cc-rgb: 139,92,246; }
.cat-analytics { --cc-rgb: 20,184,166; }
.cat-tools   { --cc-rgb: 249,115,22; }

/* ── Main glossary body ───────────────────────────────────── */
.gl-body {
  background: var(--chalk);
  padding-bottom: clamp(80px, 12vw, 140px);
}
.gl-body-inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Letter section ───────────────────────────────────────── */
.gl-letter-section {
  padding-top: clamp(48px, 6vw, 80px);
  scroll-margin-top: 120px;
  transition: opacity 0.2s;
}
.gl-letter-section.gl-hidden {
  display: none;
}
.gl-letter-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}
.gl-letter-char {
  font-family: var(--ff-head);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1;
  min-width: 64px;
}
.gl-letter-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gl-letter-meta .count {
  font-family: var(--ff-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(8,17,31,0.45);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gl-letter-meta .range {
  font-family: var(--ff-body);
  font-size: 0.8125rem;
  color: rgba(8,17,31,0.35);
}
.gl-letter-fire {
  width: 36px; height: 4px;
  background: var(--fire);
  border-radius: 4px;
  margin-left: auto;
}

/* ── Term grid ────────────────────────────────────────────── */
.gl-terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.gl-term-card {
  background: #fff;
  border: 1px solid var(--line2, #E4E0D8);
  border-radius: 14px;
  padding: 18px 20px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.gl-term-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cc, #6366F1);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.gl-term-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(8,17,31,0.08); border-color: rgba(8,17,31,0.15); }
.gl-term-card:hover::before { opacity: 1; }
.gl-term-card.gl-no-match { display: none; }
.gl-term-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.gl-term-name {
  font-family: var(--ff-head);
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.gl-term-desc {
  font-family: var(--ff-body);
  font-size: 0.875rem;
  color: rgba(8,17,31,0.6);
  line-height: 1.65;
}
.gl-term-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── No results state ─────────────────────────────────────── */
.gl-no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 24px;
  text-align: center;
}
.gl-no-results.visible { display: flex; }
.gl-no-results svg { color: rgba(8,17,31,0.2); }
.gl-no-results h3 {
  font-family: var(--ff-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.gl-no-results p {
  font-family: var(--ff-body);
  font-size: 0.9375rem;
  color: rgba(8,17,31,0.5);
  max-width: 400px;
  line-height: 1.6;
}

/* ── Category legend ──────────────────────────────────────── */
.gl-legend {
  background: var(--ink);
  padding: clamp(40px, 6vw, 64px) 0;
}
.gl-legend-inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
}
.gl-legend-label {
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 20px;
}
.gl-legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gl-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.gl-legend-item:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.15); }
.gl-legend-item.active { background: rgba(var(--cc-rgb,99,102,241),0.15); border-color: rgba(var(--cc-rgb,99,102,241),0.4); }
.gl-legend-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cc, #6366F1); }
.gl-legend-item span {
  font-family: var(--ff-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.02em;
}
.gl-legend-item.active span { color: #fff; }

/* ── CTA strip ────────────────────────────────────────────── */
.gl-cta {
  background: var(--fire);
  padding: clamp(48px, 7vw, 80px) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.gl-cta::before {
  content: 'SEO';
  position: absolute;
  font-family: var(--ff-head);
  font-size: 280px;
  font-weight: 900;
  color: rgba(0,0,0,0.08);
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  white-space: nowrap;
}
.gl-cta-inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.gl-cta-eyebrow {
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 16px;
}
.gl-cta h2 {
  font-family: var(--ff-head);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.gl-cta p {
  font-family: var(--ff-body);
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.8);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.gl-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--fire);
  font-family: var(--ff-body);
  font-size: 0.9375rem;
  font-weight: 800;
  padding: 15px 32px;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.gl-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.gl-cta-btn svg { transition: transform 0.2s var(--ease); }
.gl-cta-btn:hover svg { transform: translateX(4px); }

/* ── Scroll-to-top ────────────────────────────────────────── */
.gl-back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(8,17,31,0.3);
}
.gl-back-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.gl-back-top:hover { background: var(--fire); border-color: var(--fire); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .gl-search-inner { flex-wrap: wrap; }
  .gl-search-count { min-width: unset; text-align: left; font-size: 0.75rem; }
  .gl-featured-grid { grid-template-columns: 1fr; }
  .gl-terms-grid { grid-template-columns: 1fr; }
  .gl-hero-stats { gap: 20px; }
  .gl-alpha-nav { padding: 0 12px; }
  .gl-alpha-nav a { width: 30px; }
  .gl-letter-char { font-size: 2.5rem; min-width: 48px; }
}
@media (max-width: 480px) {
  .gl-hero h1 { font-size: 2rem; }
  .gl-featured-grid,
  .gl-terms-grid { gap: 10px; }
}

/* ── Search highlight ─────────────────────────────────────── */
.gl-highlight {
  background: rgba(240,98,12,0.18);
  color: var(--fire);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 700;
}

/* ── Term card links ─────────────────────────────────────── */
.is-glossary-page .gl-term-link {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}
.is-glossary-page .gl-term-link:hover {
  color: var(--fire);
  text-decoration: none;
}
.is-glossary-page .gl-term-card:hover .gl-term-link {
  color: var(--fire);
}
.is-glossary-page .gl-term-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.is-glossary-page .gl-read-more {
  font-size: .75rem;
  font-weight: 700;
  color: var(--fire);
  text-decoration: none;
  letter-spacing: .04em;
  opacity: 0;
  transition: opacity .2s;
}
.is-glossary-page .gl-term-card:hover .gl-read-more {
  opacity: 1;
}

/* ── Featured card as link ───────────────────────────────── */
.is-glossary-page a.gl-feat-card {
  text-decoration: none;
  display: block;
  cursor: pointer;
}
.is-glossary-page a.gl-feat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(8,17,31,0.10);
}
.is-glossary-page a.gl-feat-card h3 {
  color: var(--ink);
  transition: color .2s;
}
.is-glossary-page a.gl-feat-card:hover h3 {
  color: var(--fire);
}
