/* =======================================================================
   KI-Glossar — search + A–Z accordion (VT design system)
   ======================================================================= */

/* ── Search bar (sticky under nav) ── */
.gl-searchwrap {
  position: sticky; top: 64px; z-index: 40;
  background: rgba(245,244,240,0.92);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--vt-border);
}
.gl-searchwrap .vt-wrap { padding-top: 16px; padding-bottom: 16px; }
.gl-searchinner { position: relative; }
.gl-searchinner { overflow: hidden; border-radius: 4px; }
/* Green scan-line sweep */
.gl-scan {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  opacity: 0; border-radius: 4px;
  background: linear-gradient(90deg, transparent 0%, rgba(15,59,46,0.10) 42%, rgba(30,90,71,0.22) 50%, rgba(15,59,46,0.10) 58%, transparent 100%);
}
.gl-scan.on { animation: gl-sweep 0.6s var(--vt-ease) forwards; }
@keyframes gl-sweep {
  0% { opacity: 1; transform: translateX(-100%); }
  100% { opacity: 1; transform: translateX(100%); }
}
.gl-prefix {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--vt-font-mono); font-size: 14px; color: var(--vt-signal);
  pointer-events: none;
}
.gl-search {
  width: 100%; background: var(--vt-paper-pure);
  border: 1px solid var(--vt-border); border-radius: 4px;
  padding: 14px 110px 14px 46px;
  font-family: var(--vt-font-mono); font-size: 14px; color: var(--vt-ink);
  outline: none; transition: box-shadow var(--vt-dur-base) var(--vt-ease);
}
.gl-search::placeholder { color: var(--vt-concrete); }
.gl-search:focus { border-color: var(--vt-signal); box-shadow: inset 0 0 0 1px var(--vt-signal); }
.gl-count {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--vt-font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--vt-fg-subtle); pointer-events: none;
}

/* ── Letter sections ── */
.gl-letter { margin-top: clamp(36px, 5vw, 56px); }
.gl-letter:first-child { margin-top: clamp(28px, 4vw, 44px); }
.gl-letter-head { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
.gl-letter-char {
  font-family: var(--vt-font-mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--vt-ink);
  border: 1px solid var(--vt-border); padding: 5px 13px; border-radius: 3px;
}
.gl-letter-rule { flex: 1; height: 1px; background: var(--vt-divider); }
.gl-letter-count {
  font-family: var(--vt-font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--vt-fg-subtle);
}

/* ── Accordion rows ── */
.gl-item { border-bottom: 1px solid var(--vt-divider); }
.gl-row {
  width: 100%; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 4px; background: none; border: none; cursor: pointer;
  text-align: left; color: inherit; font: inherit;
  transition: background var(--vt-dur-fast) var(--vt-ease);
}
.gl-row:hover { background: rgba(10,10,10,0.025); }
.gl-row:focus-visible { outline: 2px solid var(--vt-ink); outline-offset: 2px; }
.gl-term {
  font-family: var(--vt-font-display); font-size: 17px; font-weight: 500;
  letter-spacing: -0.01em; color: var(--vt-ink);
}
.gl-row:hover .gl-term { color: var(--vt-ink); }
.gl-en {
  font-family: var(--vt-font-mono); font-size: 11px; color: var(--vt-fg-subtle);
  letter-spacing: 0.02em;
}
.gl-tag {
  margin-left: auto;
  font-family: var(--vt-font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--vt-steel);
  border: 1px solid var(--vt-mist); padding: 3px 9px; border-radius: 3px;
  white-space: nowrap;
}
.gl-arrow {
  font-family: var(--vt-font-mono); font-size: 16px; color: var(--vt-concrete);
  width: 18px; text-align: center; flex-shrink: 0;
  transition: color var(--vt-dur-fast) var(--vt-ease);
}
.gl-item.open .gl-arrow { color: var(--vt-signal); }
.gl-item.open .gl-tag { border-color: var(--vt-border); color: var(--vt-ink); }

.gl-body { max-height: 0; overflow: hidden; transition: max-height var(--vt-dur-slow) var(--vt-ease); }
.gl-item.open .gl-body { max-height: 420px; }
.gl-body-inner {
  font-size: 15px; line-height: 1.7; color: var(--vt-fg-muted);
  padding: 0 4px 22px 18px; border-left: 2px solid var(--vt-signal);
  margin-left: 4px; text-wrap: pretty;
}
/* Word-by-word reveal on open */
.gl-word { opacity: 0; animation: gl-fadeword 0.26s var(--vt-ease) forwards; }
@keyframes gl-fadeword { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .gl-word { opacity: 1; animation: none; }
  .gl-scan { display: none; }
}

/* Blinking caret (hero) */
.gl-caret {
  display: inline-block; width: 0.32ch; height: 0.74em; vertical-align: -0.04em;
  margin-left: 0.12em; background: var(--vt-signal);
  animation: gl-blink 1.05s steps(1) infinite;
}
@keyframes gl-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ── No results ── */
.gl-noresults {
  display: none; text-align: center; padding: 80px 0;
  font-family: var(--vt-font-mono); font-size: 14px; color: var(--vt-fg-subtle);
}
.gl-noresults strong { color: var(--vt-ink); }

@media (max-width: 760px) {
  .gl-searchwrap { top: 64px; }
  .gl-en { display: none; }
  .gl-tag { margin-left: 0; }
}

/* ═══════════════════════════════════════════════════════════
   "HARTE" EFFEKTE — bewusst nur auf der Glossar-Seite.
   Bricht absichtlich mit dem ruhigen Marken-Chrome.
   ═══════════════════════════════════════════════════════════ */
body.gl-fx { cursor: none; }
/* Inhalts-Ebenen über die Partikel heben */
body.gl-fx .vt-metastrip,
body.gl-fx .vt-hero,
body.gl-fx .vt-main,
body.gl-fx .vt-footer { position: relative; z-index: 1; }

/* Partikelfeld (hinter Inhalt) */
#glParticles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* Matrix-Regen Intro-Overlay */
#glMatrix {
  position: fixed; inset: 0; z-index: 9990; pointer-events: none;
  transition: opacity 0.9s var(--vt-ease);
}

/* Custom-Cursor + Schweif */
.gl-cursor-dot {
  position: fixed; top: 0; left: 0; width: 9px; height: 9px; border-radius: 50%;
  background: var(--vt-signal-mid);
  box-shadow: 0 0 8px var(--vt-signal-mid), 0 0 18px rgba(30,90,71,0.55);
  pointer-events: none; z-index: 10001; transform: translate(-50%, -50%);
}
.gl-cursor-trail {
  position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none;
  z-index: 10000; background: var(--vt-signal-mid); transform: translate(-50%, -50%);
}

/* Glitch-Headline */
.vt-hero h1.gl-glitch { animation: gl-glitch 0.42s steps(2, end); }
@keyframes gl-glitch {
  0%   { transform: translate(0); text-shadow: none; }
  20%  { transform: translate(-2px, 1px);  text-shadow: 2px 0 #ff2bbb, -2px 0 #1e5a47; }
  40%  { transform: translate(2px, -1px);  text-shadow: -2px 0 #ff2bbb, 2px 0 #2f9b6e; }
  60%  { transform: translate(-1px, 1px);  text-shadow: 2px 0 #4d9fff, -2px 0 #ff2bbb; }
  80%  { transform: translate(1px, -1px);  text-shadow: none; }
  100% { transform: translate(0); text-shadow: none; }
}

/* Neon-Puls beim Aufklappen */
.gl-fx .gl-item.open {
  animation: gl-neon 0.55s var(--vt-ease) forwards;
  border-bottom-color: rgba(30,90,71,0.45);
}
@keyframes gl-neon {
  0%   { box-shadow: 0 0 0 rgba(30,90,71,0); }
  35%  { box-shadow: 0 0 24px rgba(30,90,71,0.28), inset 0 0 24px rgba(30,90,71,0.05); }
  100% { box-shadow: 0 0 10px rgba(30,90,71,0.10); }
}
.gl-fx .gl-item.open .gl-term { text-shadow: 0 0 14px rgba(30,90,71,0.30); }

/* Touch / kein Hover: Cursor & schwere Effekte aus */
@media (hover: none), (max-width: 760px) {
  body.gl-fx { cursor: auto; }
  .gl-cursor-dot, .gl-cursor-trail { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  #glMatrix, #glParticles, .gl-cursor-dot, .gl-cursor-trail { display: none !important; }
  .vt-hero h1.gl-glitch { animation: none; }
  .gl-fx .gl-item.open { animation: none; }
}
