/* ===== Base / themes ===== */
:root {
  --bg: #0b0d17;
  --bg-soft: #101323;
  --card: #141829;
  --card-hover: #191e33;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1ff;
  --muted: #9aa3bd;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --success: #34d399;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 68px;
  --container: 1180px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-hover: #ffffff;
  --border: rgba(17, 21, 40, 0.09);
  --border-strong: rgba(17, 21, 40, 0.2);
  --text: #12152a;
  --muted: #5c6478;
  --accent: #6d4bff;
  --accent-2: #0891b2;
  --accent-soft: rgba(109, 75, 255, 0.1);
  --success: #059669;
  --shadow: 0 18px 40px rgba(35, 42, 80, 0.12);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.header.is-scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.35);
}

.logo__accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav__link {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--text);
  background: var(--accent-soft);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header__actions .icon-btn:first-child {
  margin-left: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  font-size: 1.05rem;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
}

.icon-btn:active {
  transform: scale(0.94);
}

.burger {
  display: none;
}

.burger__box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.burger__box span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.header.is-open .burger__box span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.header.is-open .burger__box span:nth-child(2) {
  opacity: 0;
}

.header.is-open .burger__box span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 96px) 0 clamp(36px, 6vw, 64px);
}

.hero__glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.5;
  pointer-events: none;
}

.hero__glow--one {
  top: -260px;
  left: -120px;
  background: rgba(124, 92, 255, 0.5);
}

.hero__glow--two {
  top: -200px;
  right: -160px;
  background: rgba(34, 211, 238, 0.32);
}

.hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  margin-bottom: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  animation: fade-up 0.6s ease both;
}

.hero__title {
  max-width: 820px;
  margin: 0 auto 18px;
  font-size: clamp(2rem, 6.2vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  animation: fade-up 0.6s 0.05s ease both;
}

.hero__sub {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.12rem);
  animation: fade-up 0.6s 0.1s ease both;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  animation: fade-up 0.6s 0.15s ease both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
}

.hero-search__icon {
  opacity: 0.7;
  font-size: 0.95rem;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
}

.hero-search input::placeholder {
  color: var(--muted);
}

.hero-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.hero-search__btn {
  flex-shrink: 0;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.hero-search__btn:hover {
  filter: brightness(1.08);
}

.hero-search__btn:active {
  transform: scale(0.97);
}

.hero__stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 44px;
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
  animation: fade-up 0.6s 0.2s ease both;
}

.hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero__stats strong {
  font-size: 1.35rem;
  font-weight: 800;
}

.hero__stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ===== Catalog ===== */
.catalog {
  padding: 18px 0 12px;
}

.section-head {
  max-width: 660px;
  margin-bottom: 26px;
}

.section-head h2 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 3.4vw, 2.2rem);
  font-weight: 800;
}

.section-head p {
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 10px;
  margin: 0 -20px 22px;
  padding: 4px 20px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  padding: 9px 17px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chip.is-active {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.28);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sort select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 252px), 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  animation: fade-up 0.45s ease both;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--card-hover);
  box-shadow: var(--shadow);
}

.card__top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 13px;
}

.app-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--c1, #7c5cff), var(--c2, #22d3ee));
  font-size: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.card__title {
  margin-bottom: 2px;
  font-size: 1.06rem;
  font-weight: 700;
}

.card__cat {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.8rem;
}

.card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: filter 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  flex: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 92, 255, 0.25);
}

.btn--primary:hover {
  filter: brightness(1.08);
}

.btn--ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.empty {
  padding: 60px 20px;
  text-align: center;
}

.empty > span {
  font-size: 2.4rem;
}

.empty h3 {
  margin: 12px 0 6px;
  font-size: 1.3rem;
}

.empty p {
  margin-bottom: 20px;
  color: var(--muted);
}

/* ===== Features ===== */
.features {
  padding: clamp(48px, 8vw, 84px) 0 0;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.feature {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 90%, transparent), var(--card));
}

.feature__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 1.35rem;
}

.feature h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.feature p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ===== How ===== */
.how {
  padding: clamp(48px, 8vw, 88px) 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 26px 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.step__num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
}

.step h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.step p {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ===== Footer ===== */
.footer {
  padding: 44px 0 30px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 28px;
}

.footer__brand {
  max-width: 380px;
}

.footer__brand .logo {
  margin-bottom: 12px;
}

.footer__brand p {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-content: flex-start;
}

.footer__links a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.footer__links a:hover {
  color: var(--text);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.footer__note {
  max-width: 520px;
}

/* ===== Modal ===== */
.modal {
  width: min(94vw, 520px);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: visible;
}

.modal[open] {
  animation: modal-in 0.25s ease both;
}

.modal::backdrop {
  background: rgba(4, 6, 14, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal__inner {
  position: relative;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 22px;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal__close:hover {
  background: var(--card-hover);
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-right: 40px;
}

.modal__head .app-icon {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  font-size: 1.9rem;
}

.modal__title {
  margin-bottom: 4px;
  font-size: 1.35rem;
  font-weight: 800;
}

.modal__cat {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.modal__desc {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.modal__stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
}

.modal__stat span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal__stat strong {
  font-size: 0.95rem;
}

.modal__note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.modal__actions {
  display: flex;
  gap: 10px;
}

.modal__actions .btn {
  flex: 1;
  min-height: 46px;
  font-size: 0.95rem;
}

/* ===== Animations ===== */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .header__inner {
    gap: 12px;
  }

  .burger {
    display: grid;
  }

  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 12px 20px 18px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 97%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .header.is-open .nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav__link {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .header__actions {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding-top: 40px;
  }

  .hero__stats {
    gap: 16px 30px;
  }

  .hero-search {
    padding-left: 14px;
  }

  .hero-search__btn {
    padding: 12px 18px;
  }

  .chips {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card {
    padding: 16px;
  }

  .card__actions .btn--ghost {
    display: none;
  }

  .modal__inner {
    padding: 22px 18px;
  }

  .modal__stats {
    gap: 8px;
  }

  .footer__inner {
    gap: 20px;
  }
}

@media (max-width: 380px) {
  .hero-search__btn {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .btn {
    padding: 9px 12px;
  }
}
