:root {
  --bg: #0b1020;
  --bg-soft: #121933;
  --card: rgba(18, 25, 51, 0.78);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #eef2ff;
  --muted: #b9c2e3;
  --accent: #7c9cff;
  --accent-2: #55d6be;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 156, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(85, 214, 190, 0.14), transparent 26%),
    linear-gradient(180deg, #0a1020 0%, #0f1730 100%);
  color: var(--text);
  line-height: 1.55;
}

.wrapper {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 48px 0 24px;
}

.hero-card {
  background: linear-gradient(135deg, rgba(124, 156, 255, 0.14), rgba(85, 214, 190, 0.08));
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.subtitle {
  max-width: 820px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.1vw, 1.16rem);
}

.toolbar {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px;
  margin-top: 24px;
}

.search,
.stats {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.search {
  padding: 16px;
}

.search label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.search input {
  width: 100%;
  padding: 15px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search input:focus {
  border-color: rgba(124, 156, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.16);
  background: rgba(255,255,255,0.08);
}

.search input::placeholder {
  color: #94a0cb;
}

.stats {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.stats strong {
  font-size: 1.8rem;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-size: 0.96rem;
}

.alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 6px;
}

.alphabet a {
  text-decoration: none;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.alphabet a:hover {
  color: var(--text);
  background: rgba(124, 156, 255, 0.14);
  transform: translateY(-1px);
}

main {
  padding: 18px 0 56px;
}

.section {
  margin-top: 26px;
}

.section-header {
  position: sticky;
  top: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(124, 156, 255, 0.16);
  border: 1px solid rgba(124, 156, 255, 0.24);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.entry {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.entry:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 156, 255, 0.35);
  background: rgba(20, 29, 58, 0.92);
}

.term {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.25;
  display: flex;
  align-items: start;
  gap: 10px;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,156,255,0.24), rgba(85,214,190,0.18));
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: #dfe7ff;
  font-weight: 700;
}

.description {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.entry.hidden,
.section.hidden {
  display: none;
}

.no-results {
  display: none;
  margin-top: 26px;
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  text-align: center;
}

footer {
  padding: 0 0 44px;
  color: #99a5cf;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    padding: 24px;
    border-radius: 24px;
  }
}

@media (max-width: 560px) {
  .wrapper {
    width: min(100% - 20px, 1200px);
  }

  .hero {
    padding-top: 22px;
  }

  .hero-card {
    padding: 18px;
  }

  .alphabet {
    gap: 8px;
  }

  .alphabet a {
    padding: 7px 10px;
    font-size: 0.86rem;
  }

  .section-header {
    top: 8px;
    min-width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.1rem;
  }

  .entry {
    padding: 16px 14px 14px;
  }

  .term {
    font-size: 1rem;
  }

  .description {
    font-size: 0.95rem;
  }
}