/*
 * Smooth catalog rendering
 *
 * Large backdrop filters are especially expensive on sticky/fixed elements:
 * the browser has to sample and blur the page behind them for every frame of
 * a scroll. These replacements keep the green glass depth with opaque
 * gradients, while allowing the compositor to move the page at high refresh
 * rates without repainting the whole viewport.
 */

.cloud-catalog .cloud-field {
  contain: strict;
  background:
    radial-gradient(circle at 92% 25%, rgba(80, 212, 130, .09), transparent 29%),
    radial-gradient(circle at 4% 68%, rgba(52, 155, 96, .07), transparent 24%);
}

.cloud-catalog .cloud,
.cloud-catalog .glass-bubble,
.cloud-catalog .ambient {
  display: none;
  animation: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.cloud-catalog .site-header {
  background: linear-gradient(118deg, rgba(8, 29, 18, .98), rgba(10, 39, 23, .97));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cloud-catalog .brand-mark,
.cloud-catalog .free-badge i {
  animation: none;
}

.cloud-catalog .brand-mark {
  filter: none;
}

.cloud-catalog .free-badge {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cloud-catalog .hero,
.cloud-catalog .hero-content,
.cloud-catalog .hero-controls,
.cloud-catalog .quick-filters,
.cloud-catalog .cloud-shelf,
.cloud-catalog .join-section,
.cloud-catalog .site-footer,
.cloud-catalog .supporter-card,
.cloud-catalog .points-wallet-section,
.cloud-catalog .team-login-section,
.cloud-catalog .app-install-section,
.cloud-catalog .genre-card__icon,
.cloud-catalog .genre-card span.genre-card__icon,
.cloud-catalog .app-dock-pill,
.cloud-catalog .secondary-button,
.cloud-catalog .watchlist-button {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cloud-catalog .hero {
  background: rgba(10, 34, 21, .94);
}

.cloud-catalog .hero-content {
  background: linear-gradient(135deg, rgba(8, 36, 21, .96), rgba(13, 55, 31, .91));
}

.cloud-catalog .quick-filters {
  background: linear-gradient(110deg, rgba(8, 35, 21, .98), rgba(13, 52, 31, .97));
}

.cloud-catalog .cloud-shelf {
  background: linear-gradient(120deg, rgba(7, 29, 18, .97), rgba(11, 42, 25, .94));
}

.cloud-catalog .cloud-shelf::before,
.cloud-catalog .join-section::before,
.cloud-catalog .join-section::after {
  filter: none;
  opacity: .42;
}

.cloud-catalog .site-footer {
  background: rgba(7, 27, 17, .97);
}

/* Critical shape of the account invitation. Its complete stylesheet is loaded
   asynchronously, so these matching rules prevent a large desktop reflow. */
.member-growth-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: min(1240px, calc(100% - 80px));
  margin: 24px auto 0;
  padding: 17px 20px;
  border: 1px solid rgba(116, 239, 161, .23);
  border-radius: 19px;
  background: linear-gradient(120deg, rgba(11, 38, 24, .96), rgba(17, 58, 36, .93));
  box-shadow: 0 17px 40px rgba(0, 0, 0, .27);
}

.member-growth-strip[hidden] {
  display: none;
}

.member-growth-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: rgba(100, 232, 154, .09);
  color: #83f4aa;
  font-size: 20px;
  font-weight: 900;
}

.member-growth-strip .eyebrow {
  margin-bottom: 4px;
}

.member-growth-strip h2 {
  margin: 0;
  font: 700 20px/1.1 "Space Grotesk", sans-serif;
  letter-spacing: -.03em;
}

.member-growth-strip div > p:last-child {
  margin: 5px 0 0;
  color: #a8baae;
  font-size: 11px;
}

.member-growth-strip button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #c9ffda, #55db86);
  color: #082014;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

@media (min-width: 761px) {
  .cloud-catalog .hero-controls {
    gap: 0;
  }

  .cloud-catalog .hero-dot,
  .cloud-catalog .hero-dot.is-current {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
  }

  .cloud-catalog .hero-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .3);
    transform: translate(-50%, -50%);
  }

  .cloud-catalog .hero-dot.is-current::after {
    width: 20px;
    border-radius: 8px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(100, 232, 154, .75);
  }
}

/* Do not reserve a GPU layer for every poster before the user interacts. */
.cloud-catalog .card-art {
  transform: none;
}

/* Posters already cover the generated card artwork. Avoid painting dozens of
   blended grain/line/orb layers underneath every poster while scrolling. */
.cloud-catalog .title-card .art:has(.art-poster) .art-grain,
.cloud-catalog .title-card .art:has(.art-poster) .art-orb,
.cloud-catalog .title-card .art:has(.art-poster) .art-lines {
  display: none;
}

.cloud-catalog .title-card--locked .card-art,
.cloud-catalog .title-card--locked .art-poster {
  filter: none;
}

.cloud-catalog .title-card--locked .art-poster {
  opacity: .54;
}

.cloud-catalog .genre-card__glow {
  filter: none;
  opacity: .18;
}

/* Skip layout and painting of shelves that are far outside the viewport. */
.cloud-catalog .content-section,
.cloud-catalog .join-section,
.cloud-catalog .points-wallet-section,
.cloud-catalog .app-install-section,
.cloud-catalog .supporter-program,
.cloud-catalog .team-login-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}

/* The hero and filters already introduce the page; animating every off-screen
   shelf at the same time only creates short-lived compositor layers. */
body.cloud-catalog.catalog-is-ready .content-section {
  animation: none;
}

/* Overlays have their own opaque card, so blurring the complete page is wasteful. */
.cloud-catalog .search-panel,
.cloud-catalog .detail-modal,
.cloud-catalog .player-modal,
.cloud-catalog .account-modal,
.cloud-catalog .uploader-application-modal,
.cloud-catalog .install-nudge {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cloud-catalog .detail-card,
.cloud-catalog .detail-copy,
.cloud-catalog .detail-cast,
.cloud-catalog .detail-copy .watchlist-button {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 760px) {
  /* Mobile keeps a short branded reveal without delaying or covering the
     catalog. Only compositor-friendly transform/opacity are animated. */
  .cloud-catalog .brand-mark i {
    animation: mobile-brand-reveal .58s cubic-bezier(.16, 1, .3, 1) both;
  }

  .cloud-catalog .brand-mark i:nth-child(2) {
    animation-delay: .07s;
  }

  .cloud-catalog .brand-mark i:nth-child(3) {
    animation-delay: .14s;
  }

  /* Lighthouse and real low-end phones need an immediately eligible LCP.
     The intro still provides the visual transition; the page behind it must
     not start at near-zero opacity or Chromium can discard every LCP candidate. */
  body.cloud-catalog.catalog-is-ready .site-header,
  body.cloud-catalog.catalog-is-ready .hero,
  body.cloud-catalog.catalog-is-ready .quick-filters {
    animation: none;
  }

  /* Public catalog data replaces the lightweight HTML placeholders. Reserve
     the first card's text rows so its action buttons never jump on font/data
     arrival (the only CLS recorded by Lighthouse). */
  .cloud-catalog .hero h1 {
    min-height: 2.85em;
  }

  .cloud-catalog .hero .meta {
    min-height: 20px;
  }

  .cloud-catalog .hero-description {
    height: 8em;
  }

  .cloud-catalog .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
    width: 100%;
  }

  .cloud-catalog .hero-actions > button {
    width: 100%;
    min-width: 0;
  }

  .member-growth-strip {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    width: calc(100% - 16px);
    margin-top: 16px;
    padding: 15px;
  }

  .member-growth-strip button {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  /* Accessible 44px hit areas without making the visible controls bulky. */
  .cloud-catalog .brand,
  .cloud-catalog .coin-balance--header,
  .cloud-catalog .icon-button,
  .cloud-catalog .profile,
  .cloud-catalog .filter-chip,
  .cloud-catalog .modal-close,
  .cloud-catalog .install-nudge-action,
  .cloud-catalog .install-nudge-close {
    min-height: 44px;
  }

  .cloud-catalog .icon-button,
  .cloud-catalog .modal-close,
  .cloud-catalog .install-nudge-close {
    min-width: 44px;
  }

  .cloud-catalog .hero-dot {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent !important;
    box-shadow: none !important;
  }

  .cloud-catalog .hero-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .3);
    transform: translate(-50%, -50%);
  }

  .cloud-catalog .hero-dot.is-current::after {
    width: 28px;
    border-radius: 8px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(100, 232, 154, .75);
  }

  .cloud-catalog .site-footer {
    flex-wrap: wrap;
    overflow: hidden;
  }

  .cloud-catalog .footer-note {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .cloud-catalog .footer-legal {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .cloud-catalog .mobile-dock {
    background: linear-gradient(145deg, rgba(8, 34, 20, .99), rgba(5, 24, 14, .99));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .cloud-catalog .quick-filters {
    background: linear-gradient(110deg, rgb(8, 35, 21), rgb(12, 49, 29));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .cloud-catalog .install-nudge {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Mobile devices gain little from an exit blur but pay for a full-screen
     filtered layer. A short opacity transition keeps the polished hand-off. */
  .intro-screen.is-leaving .intro-content,
  .intro-screen.is-leaving::before {
    animation: none;
    filter: none;
  }
}

@keyframes mobile-brand-reveal {
  from {
    opacity: .12;
    transform: translate3d(0, 12px, 0) scaleY(.55);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scaleY(1);
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .cloud-catalog .brand-mark i {
    animation: none;
  }
}

@media (hover: none) {
  .cloud-catalog .title-card .card-art,
  .cloud-catalog .title-card:hover .card-art,
  .cloud-catalog .title-card:focus-visible .card-art {
    transform: none;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloud-catalog *,
  .cloud-catalog *::before,
  .cloud-catalog *::after {
    scroll-behavior: auto !important;
  }
}
