:root {
  color-scheme: light;
  --ink: #211b32;
  --muted: #6f687e;
  --line: rgba(47, 35, 76, 0.11);
  --accent: #7657e8;
  --accent-dark: #5838c4;
  --surface: rgba(255, 255, 255, 0.82);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #f7f5fc;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(196, 180, 255, 0.48), transparent 28rem),
    radial-gradient(circle at 90% 70%, rgba(193, 232, 230, 0.52), transparent 30rem),
    #f7f5fc;
}

.is-embedded,
.is-embedded body {
  min-height: 0;
  background: transparent;
}

.is-embedded .catalog-shell {
  width: min(320px, calc(100% - 16px));
  margin: 0 auto;
  padding: 14px 0;
}

.is-embedded .catalog-header {
  display: none;
}

.is-embedded .apps-grid {
  grid-template-columns: 1fr;
}

.is-embedded .app-card {
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 16px;
  border-radius: 22px;
}

.is-embedded .app-icon {
  width: 70px;
  height: 70px;
  border-radius: 17px;
}

.is-embedded .app-title {
  font-size: 20px;
}

.is-embedded .app-description {
  font-size: 13px;
}

.is-embedded .store-button {
  padding: 9px 11px;
  font-size: 12px;
}

a {
  color: inherit;
}

.catalog-shell {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(44px, 8vw, 92px) 0 64px;
}

.catalog-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 42px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 8vw, 78px);
  font-weight: 730;
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.intro {
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.developer-link {
  flex: 0 0 auto;
  padding-bottom: 6px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

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

.app-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 24px;
  min-height: 210px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(56, 40, 92, 0.09);
  backdrop-filter: blur(16px);
}

.app-icon {
  width: 112px;
  height: 112px;
  border-radius: 25px;
  box-shadow: 0 13px 30px rgba(34, 24, 61, 0.18);
  object-fit: cover;
}

.app-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.app-meta {
  margin: 2px 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-title {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.app-description {
  display: -webkit-box;
  margin: 12px 0 20px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 11px 15px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.store-button:hover {
  transform: translateY(-2px);
  background: var(--accent-dark);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--muted);
  background: var(--surface);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(118, 87, 232, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .catalog-shell {
    width: min(100% - 28px, 1040px);
    padding-top: 38px;
  }

  .catalog-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

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

@media (max-width: 460px) {
  .app-card {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
    border-radius: 24px;
  }

  .app-icon {
    width: 84px;
    height: 84px;
    border-radius: 20px;
  }

  .app-title {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
