:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #14171c;
  --muted: #66707c;
  --line: #dfe3e8;
  --accent: #177245;
  --accent-strong: #0d5c36;
  --accent-soft: #e9f7ef;
  --warning-bg: #fff6df;
  --warning-text: #795a08;
  --focus: #238b57;
  --shadow: 0 10px 30px rgba(20, 23, 28, 0.06);
  --radius: 18px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #11171f;
  --surface-2: #171e27;
  --text: #f0f3f6;
  --muted: #9aa7b5;
  --line: #26303b;
  --accent: #58d68d;
  --accent-strong: #7be3a7;
  --accent-soft: #10291d;
  --warning-bg: #2d250f;
  --warning-text: #efce70;
  --focus: #62d996;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 10% -10%,
      color-mix(in srgb, var(--accent) 9%, transparent),
      transparent 28rem
    ),
    var(--bg);
  color: var(--text);
  font:
    15px/1.58 ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Tahoma,
    Arial,
    sans-serif;
}
html[dir="rtl"] body {
  font-family: Tahoma, Arial, ui-sans-serif, system-ui, sans-serif;
}
button,
input,
select {
  font: inherit;
}
a {
  color: inherit;
}
.shell {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  inset-inline-start: 12px;
  top: -80px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 50;
}
.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 22px;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-button:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}
.language-control select {
  height: 38px;
  min-width: 92px;
}

.hero {
  padding: 28px 0 48px;
  text-align: center;
}
.hero-scene {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 620px;
  padding: 76px 24px 44px;
  border-radius: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(255, 255, 255, 0.07),
      transparent 16rem
    ),
    radial-gradient(
      circle at 18% 18%,
      rgba(96, 216, 149, 0.12),
      transparent 19rem
    ),
    radial-gradient(
      circle at 84% 78%,
      rgba(255, 173, 112, 0.08),
      transparent 20rem
    ),
    linear-gradient(180deg, #18264c 0%, #162344 56%, #131f3d 100%);
  box-shadow: 0 30px 80px rgba(5, 10, 24, 0.28);
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 950px;
  margin: 0 auto;
}
.hero-applause {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.hero-glow {
  position: absolute;
  z-index: 0;
  border-radius: 999px;
  filter: blur(42px);
  pointer-events: none;
}
.hero-glow-1 {
  width: 250px;
  height: 250px;
  inset-inline-start: 7%;
  top: 26%;
  background: rgba(82, 215, 143, 0.13);
}
.hero-glow-2 {
  width: 230px;
  height: 230px;
  inset-inline-end: 8%;
  bottom: 9%;
  background: rgba(255, 179, 117, 0.1);
}
.clap {
  position: absolute;
  inset-inline-start: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  font-size: clamp(30px, calc(var(--size) * 1px), 104px);
  line-height: 1;
  opacity: var(--opacity, 0.96);
  transform: translate(-50%, -50%) rotate(calc(var(--rotate) * 1deg));
  transform-origin: center;
  filter: drop-shadow(0 7px 10px rgba(2, 7, 18, 0.2));
  will-change: transform;
  animation: clap-float calc(var(--duration) * 1s) ease-in-out infinite;
  animation-delay: calc(var(--delay) * -1s);
}
.clap-emoji {
  display: block;
  animation: clap-pulse calc(var(--pulse-duration) * 1s) ease-in-out infinite;
  animation-delay: calc(var(--delay) * -0.73s);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 9px;
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
html[dir="rtl"] .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}
h1 {
  margin: 22px auto 12px;
  max-width: 900px;
  color: #f8fafc;
  font-size: clamp(42px, 6.7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
html[dir="rtl"] h1 {
  letter-spacing: -0.025em;
}
.hero-copy {
  margin: 0 auto;
  max-width: 720px;
  color: rgba(239, 244, 250, 0.8);
  font-size: clamp(17px, 2.2vw, 21px);
}
.search-wrap {
  position: relative;
  max-width: 790px;
  margin: 36px auto 0;
}
.search {
  width: 100%;
  height: 64px;
  padding-inline: 52px 58px;
  border: 1px solid rgba(111, 225, 161, 0.35);
  border-radius: 20px;
  outline: none;
  background: rgba(9, 19, 43, 0.58);
  color: #f4f7fb;
  box-shadow:
    0 0 0 1px rgba(111, 225, 161, 0.11),
    0 18px 45px rgba(2, 8, 22, 0.28);
  backdrop-filter: blur(12px);
  font-size: 17px;
}
.search::placeholder {
  color: rgba(224, 231, 241, 0.56);
}
.search:focus {
  border-color: #6fe1a1;
  box-shadow:
    0 0 0 4px rgba(111, 225, 161, 0.15),
    0 18px 45px rgba(2, 8, 22, 0.28);
}
.search-icon {
  position: absolute;
  width: 20px;
  inset-inline-start: 18px;
  top: 22px;
  color: rgba(238, 244, 250, 0.68);
}
kbd {
  position: absolute;
  inset-inline-end: 16px;
  top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 244, 250, 0.62);
  border-radius: 8px;
  padding: 2px 8px;
  font:
    12px/20px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  direction: ltr;
}
.stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 27px;
  color: rgba(231, 238, 247, 0.7);
}
.stats div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(8px);
}
.stats strong {
  color: #fff;
  font-size: 18px;
}
.stats span {
  font-size: 13px;
}

@keyframes clap-float {
  0%,
  100% {
    transform: translate(-50%, -50%) translate3d(0, 0, 0)
      rotate(calc(var(--rotate) * 1deg));
  }
  50% {
    transform: translate(-50%, -50%)
      translate3d(calc(var(--dx) * 1px), calc(var(--dy) * 1px), 0)
      rotate(calc((var(--rotate) + var(--turn)) * 1deg));
  }
}
@keyframes clap-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.07);
  }
  62% {
    transform: scale(0.975);
  }
}

.catalog {
  padding: 24px 0 80px;
}
.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 16px;
}
h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.025em;
}
.muted {
  margin: 2px 0 0;
  color: var(--muted);
}
.filters {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.filters label {
  display: grid;
  gap: 5px;
}
.filters label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
select {
  width: 100%;
  height: 44px;
  padding-inline: 12px 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent);
}
.button {
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
.button:hover {
  background: var(--accent-strong);
}
.button-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
.button-ghost:hover {
  background: var(--surface-2);
}
.active-query {
  margin: -3px 0 15px;
  color: var(--muted);
  font-size: 13px;
}
.active-query strong {
  color: var(--text);
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  outline: none;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 4px rgba(20, 23, 28, 0.015);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: var(--shadow);
}
.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.category-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.category-pill {
  background: var(--surface-2);
  color: var(--muted);
  max-width: 72%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.mapping-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  margin-bottom: 3px;
}

html[dir="rtl"] .mapping-label {
  text-transform: none;
  letter-spacing: 0;
}

.proprietary {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.project {
  display: inline-block;
  color: var(--accent-strong);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.project:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.arrow {
  color: var(--muted);
  font-size: 20px;
}

.notes {
  color: var(--muted);
  margin: 16px 0 14px;
  min-height: 46px;
}
.detail-block {
  margin-top: 10px;
}
.detail-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
}
.platform-tag {
  color: var(--text);
}
.limitation-tag {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.card-footer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}
.meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.license {
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.action-link {
  color: var(--accent-strong);
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
}
.action-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty-icon {
  font-size: 36px;
  color: var(--accent);
}
.empty-state h3 {
  margin: 8px 0 2px;
  font-size: 21px;
}
.empty-state p {
  color: var(--muted);
  margin: 0 0 16px;
}
.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer-inner {
  min-height: 84px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 13px;
}
.footer-inner div {
  display: flex;
  gap: 8px;
}
.footer a {
  color: var(--text);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  .filters {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 760px) {
  .hero {
    padding-top: 18px;
  }
  .hero-scene {
    min-height: 560px;
    padding: 66px 18px 34px;
    border-radius: 30px;
  }
  .stats {
    gap: 14px;
    flex-wrap: wrap;
  }
  .stats div {
    flex-direction: column;
    gap: 0;
    align-items: center;
    min-width: 78px;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .results {
    grid-template-columns: 1fr;
  }
  .mapping {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .arrow {
    transform: rotate(90deg);
    width: 20px;
  }
  html[dir="rtl"] .arrow {
    transform: rotate(-90deg);
  }
  .card-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .card-actions {
    justify-content: flex-start;
  }
  html[dir="rtl"] .card-actions {
    justify-content: flex-start;
  }
  .footer-inner {
    padding: 22px 0;
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 520px) {
  .shell {
    width: min(100% - 22px, 1180px);
  }
  .brand span:last-child {
    display: none;
  }
  .nav-actions {
    gap: 4px;
  }
  .nav-link {
    display: none;
  }
  .language-control select {
    min-width: 82px;
  }
  .hero {
    padding-top: 14px;
  }
  .hero-scene {
    min-height: 520px;
    padding: 58px 14px 30px;
    border-radius: 24px;
  }
  .clap {
    font-size: clamp(26px, calc(var(--size) * 0.78px), 74px);
  }
  h1 {
    font-size: 42px;
  }
  .search {
    height: 58px;
    padding-inline-end: 16px;
    font-size: 15px;
  }
  .search-icon {
    top: 19px;
  }
  kbd {
    display: none;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .catalog-toolbar {
    align-items: start;
  }
  .card {
    padding: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
  .clap,
  .clap-emoji {
    animation: none !important;
  }
}

.nav-icon-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  padding: 0;
}

.nav-icon-link svg,
.theme-toggle svg {
  width: 19px;
  height: 19px;
}

.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
}

.theme-icon {
  position: absolute;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

/* Light theme → show moon */
.theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-icon-sun {
  opacity: 0;
  transform: scale(0.7) rotate(-45deg);
}

/* Dark theme → show sun */
html[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: scale(0.7) rotate(45deg);
}

html[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

@media (prefers-reduced-motion: reduce) {
  .theme-icon {
    transition: none;
  }
}
