/* ===== HERO ===== */
.hero {
  padding: 72px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: min(300px, 82vw);
  height: min(300px, 82vw);
  border-radius: 50%;
  filter: blur(76px);
  opacity: 0.26;
  pointer-events: none;
  z-index: 0;
  animation: heroBlob 18s ease-in-out infinite;
}

[data-theme="light"] .hero::before,
[data-theme="light"] .hero::after {
  opacity: 0.34;
}

.hero::before {
  background: var(--accent);
  top: -18%;
  right: -8%;
  animation-delay: 0s;
}

.hero::after {
  width: min(200px, 55vw);
  height: min(200px, 55vw);
  background: var(--accent-2);
  bottom: 0;
  left: -6%;
  animation-delay: -9s;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero__label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  animation: fadeRise 0.7s ease both, labelGlow 5s ease-in-out infinite;
}

.hero__title {
  font-family: var(--font-hero);
  font-size: clamp(2.65rem, 6.9vw, 4.45rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
  margin-bottom: 18px;
  font-optical-sizing: auto;
  animation: fadeRise 0.78s ease 0.08s both;
}

.hero__dance {
  display: block;
}

.hero__line {
  display: block;
}

.hero__char {
  display: inline-block;
  color: var(--text);
  transform-origin: 50% 88%;
  animation: heroCharDance 2.75s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.055s);
}

.hero__char--accent {
  color: transparent;
  background: linear-gradient(105deg, var(--accent), var(--accent-2));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: heroCharDance 2.75s ease-in-out infinite, gradientFlow 11s ease infinite;
  animation-delay: calc(var(--i) * 0.055s), 0s;
}

.hero__subtitle {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 1.22rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.62;
  animation: fadeRise 0.85s ease 0.14s both;
}

.stats-banner {
  padding: 14px 0 6px;
  text-align: center;
}

.stats-banner__inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  border-radius: 100px;
  background: var(--green-soft);
  border: 1px solid var(--green);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green);
}

.stats-banner__icon {
  font-size: 1rem;
}

/* ===== CATALOG ===== */
.catalog {
  padding: 8px 0 100px;
}

.catalog__filters {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.catalog__filters .filter-btn {
  animation: fadeRise 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.catalog__filters .filter-btn:nth-child(1) {
  animation-delay: 0.02s;
}

.catalog__filters .filter-btn:nth-child(2) {
  animation-delay: 0.06s;
}

.catalog__filters .filter-btn:nth-child(3) {
  animation-delay: 0.1s;
}

.catalog__filters .filter-btn:nth-child(4) {
  animation-delay: 0.14s;
}

.filter-btn {
  padding: 11px 24px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform var(--transition-smooth),
    box-shadow var(--transition), background var(--transition);
}

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

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(105deg, var(--accent), #ea580c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.28);
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.catalog__empty {
  text-align: center;
  color: var(--text-dim);
  padding: 72px 0;
  font-size: 1.06rem;
}

/* ===== APP CARD ===== */
.app-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  gap: 18px;
  transition: transform var(--transition-smooth), background var(--transition-smooth),
    box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  cursor: pointer;
  animation: fadeRise 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

[data-theme="light"] .app-card {
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04), 0 6px 24px rgba(28, 25, 23, 0.04);
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), transparent 45%, rgba(236, 72, 153, 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.app-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-5px) scale(1.008);
  box-shadow: var(--shadow-glow);
}

[data-theme="light"] .app-card:hover {
  box-shadow: 0 16px 48px rgba(28, 25, 23, 0.1), 0 4px 16px rgba(217, 119, 6, 0.08);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card:nth-child(2) {
  animation-delay: 0.06s;
}

.app-card:nth-child(3) {
  animation-delay: 0.12s;
}

.app-card:nth-child(4) {
  animation-delay: 0.18s;
}

.app-card:nth-child(5) {
  animation-delay: 0.24s;
}

.app-card:nth-child(6) {
  animation-delay: 0.3s;
}

.app-card:nth-child(7) {
  animation-delay: 0.34s;
}

.app-card:nth-child(8) {
  animation-delay: 0.38s;
}

.app-card:nth-child(9) {
  animation-delay: 0.42s;
}

.app-card:nth-child(10) {
  animation-delay: 0.46s;
}

.app-card:nth-child(11) {
  animation-delay: 0.5s;
}

.app-card:nth-child(12) {
  animation-delay: 0.54s;
}

.app-card__icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  transition: transform var(--transition-bounce), box-shadow var(--transition);
}

.app-card:hover .app-card__icon {
  transform: scale(1.06) rotate(-1.5deg);
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.12);
}

.app-card__body {
  flex: 1;
  min-width: 0;
}

.app-card__name {
  font-family: var(--font-display);
  font-size: 1.26rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.app-card__tagline {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.app-card__desc {
  font-family: var(--font-body);
  font-size: 0.93rem;
  color: var(--text-dim);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.app-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--category {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge--free {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge--paid {
  background: var(--orange-soft);
  color: var(--orange);
  border: 1px solid rgba(251, 146, 60, 0.25);
}

.badge--dev {
  background: rgba(113, 113, 122, 0.15);
  color: #a1a1aa;
}

.badge--sold {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

/* ===== APP DETAIL ===== */
.app-detail {
  padding: 36px 0 90px;
  animation: fadeRise 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 44px;
  animation: fadeRise 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
}

.app-hero__icon {
  width: 100px;
  height: 100px;
  border-radius: 22px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.app-hero__info {
  flex: 1;
}

.app-hero__name {
  font-family: var(--font-hero);
  font-size: clamp(1.85rem, 4.4vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 6px;
  font-optical-sizing: auto;
}

.app-hero__tagline {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 1.14rem;
  margin-bottom: 14px;
}

.app-hero__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.app-hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform var(--transition-smooth), filter var(--transition-smooth),
    box-shadow var(--transition-smooth);
}

.btn--primary {
  background: linear-gradient(105deg, var(--accent), #ea580c);
  color: #0a0a0a;
}

.btn--primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.3);
}

.btn--share {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn--share:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.app-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}

.app-content__main {
  min-width: 0;
}

.app-screenshots {
  margin-bottom: 36px;
}

.app-screenshots h2,
.app-screenshots h3,
.app-description h2,
.app-description h3,
.app-features h2,
.app-features h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.022em;
}

.screenshots-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.screenshot-item {
  flex-shrink: 0;
  width: 200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform var(--transition);
}

.screenshot-item:hover {
  transform: scale(1.02);
}

.screenshot-item img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

.app-description {
  margin-bottom: 36px;
}

.app-description p {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.75;
}

.app-features ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.app-features li::before {
  content: "\F26A";
  font-family: "bootstrap-icons";
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
}

.sidebar-card h4 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.86rem;
}

.sidebar-row:last-child {
  border-bottom: none;
}

.sidebar-row__label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
}

.sidebar-row__value {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.sidebar-row__value a {
  color: var(--accent);
  text-decoration: none;
}

.sidebar-row__value a:hover {
  text-decoration: underline;
}

.legal-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.legal-link:last-child {
  border-bottom: none;
}

.legal-link:hover {
  color: var(--accent);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-height: 90vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox__nav--prev {
  left: 18px;
}

.lightbox__nav--next {
  right: 18px;
}

.hero__search-mobile {
  display: none;
  position: relative;
  max-width: 440px;
  margin: 22px auto 0;
}

.hero__search-mobile i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.hero__search-mobile input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.02rem;
  font-family: var(--font-body);
  outline: none;
}

.hero__search-mobile input:focus {
  border-color: var(--accent);
}

@media (max-width: 860px) {
  .app-content {
    grid-template-columns: 1fr;
  }
}

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

  .header__inner {
    height: 60px;
    gap: 10px;
  }

  .header__logo span {
    display: none;
  }

  .header__search {
    display: none;
  }

  .hero__search-mobile {
    display: block;
  }

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

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

  .app-hero {
    flex-direction: column;
    text-align: center;
    gap: 18px;
  }

  .app-hero__badges,
  .app-hero__actions {
    justify-content: center;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

/* ===== 404 ===== */
.nf-page {
  padding: 100px 20px;
  text-align: center;
}

.nf-page__inner {
  animation: fadeRise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nf-page__title {
  font-family: var(--font-hero);
  font-size: clamp(2.1rem, 5.4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}

.nf-page__desc {
  color: var(--text-muted);
  margin-bottom: 26px;
  font-size: 1.1rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

@keyframes heroBlob {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-18px, 14px) scale(1.06);
  }
}

@keyframes gradientFlow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes heroCharDance {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  15% {
    transform: translate3d(0.04em, -0.14em, 0) rotate(-2.5deg);
  }
  30% {
    transform: translate3d(-0.05em, 0.1em, 0) rotate(2deg);
  }
  45% {
    transform: translate3d(0.06em, -0.08em, 0) rotate(3deg);
  }
  60% {
    transform: translate3d(-0.04em, 0.12em, 0) rotate(-2deg);
  }
  75% {
    transform: translate3d(0.03em, -0.05em, 0) rotate(1.5deg);
  }
}

@keyframes labelGlow {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.88;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after {
    animation: none;
  }

  .hero__char,
  .hero__char--accent {
    animation: none !important;
  }

  .catalog__filters .filter-btn {
    animation: none;
  }

  .hero__label {
    animation: fadeRise 0.7s ease both !important;
  }

  .nf-page__inner {
    animation: none;
  }

  .app-card:hover .app-card__icon {
    transform: none;
  }
}
