/* Downloads: compact shelves and a continuous fade into the collection. */
#downloads .downloads-entry::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: clamp(160px, 26vh, 300px);
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, rgb(0 0 0 / .12) 18%, rgb(0 0 0 / .44) 46%, rgb(0 0 0 / .82) 75%, #000 100%);
}
#downloads .downloads-stage {
  margin-top: 0;
  background: #000;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 28%, #000 74%, transparent 100%);
}
#downloads .downloads-jump { display: none; }

@media (max-width: 1199px), (any-pointer: coarse) and (max-width: 1366px) {
  #downloads .downloads-entry { padding-bottom: 66px; }
  #downloads .downloads-motion-controls { z-index: 3; }
  #downloads .offers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 2vw, 20px);
    max-width: none;
    align-items: stretch;
  }
  #downloads .offers > .product-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: clamp(10px, 2vw, 20px);
    min-width: 0;
    height: auto;
  }
  #downloads .product-visual {
    width: 100%;
    max-width: none;
    aspect-ratio: 1;
    margin: 0 0 12px;
    flex-shrink: 0;
  }
  #downloads .product-copy { margin: 0; text-align: center; }
  #downloads .product-family { min-height: 2.8em; font-size: 11px; line-height: 1.4; }
  #downloads .offers h3 { font-size: clamp(22px, 3.4vw, 34px); line-height: 1.05; min-height: 2.1em; margin: 8px 0 0; }
  #downloads .product-detail { margin: 6px 0 14px; font-size: 13px; }
  #downloads .product-card .collection-button {
    margin: auto 0 0;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 4px;
    gap: 5px;
    font-size: clamp(16px, 2.1vw, 22px);
    line-height: 1.05;
  }
  #downloads .product-card .collection-button svg { width: 16px; height: 16px; flex-shrink: 0; }
}

@media (max-width: 600px), (max-height: 500px) and (max-width: 1000px) {
  #downloads .downloads-opening { --fluffy-slot: 264px; }
  #downloads .downloads-intro { position: relative; }
  #downloads .downloads-character {
    top: 226px;
    left: 10%;
    width: 90%;
    height: 254px;
  }
  #downloads .downloads-emblem { top: 183px; right: -17%; height: 318px; }
  #downloads .download-packs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: var(--fluffy-slot);
    max-width: none;
    scroll-margin-top: 24px;
  }
  #downloads .download-pack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 14px 10px 12px;
    border-radius: 16px;
    text-align: center;
  }
  #downloads .pack-visual { width: clamp(64px, 20vw, 84px); flex-shrink: 0; }
  #downloads .download-meta { display: flex; flex-direction: column; align-items: center; width: 100%; flex: 1; }
  #downloads .download-meta h3 { display: block; font-size: clamp(23px, 6.1vw, 29px); line-height: 1; margin: 0; }
  #downloads .download-meta h3 em { display: block; font-size: 20px; margin: 5px 0 0; }
  #downloads .pack-tags { display: block; font-size: 12px; line-height: 1.4; margin: 9px 0 10px; }
  #downloads .download-meta .collection-button {
    display: flex; flex-direction: row; justify-content: center;
    width: 100%; min-width: 0; min-height: 44px; margin: auto 0 0;
    padding: 6px 2px; gap: 6px; font-size: 17px; line-height: 1.1;
  }
  #downloads .download-meta .collection-button svg { width: 24px; height: 24px; flex-shrink: 0; }
  #downloads .downloads-jump {
    display: grid;
    place-items: center;
    position: absolute;
    z-index: 4;
    top: 324px;
    left: max(22px, 8%);
    width: 62px;
    height: 78px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 16px;
    -webkit-tap-highlight-color: transparent;
  }
  #downloads .downloads-jump svg {
    width: 38px; height: 62px; overflow: visible;
    filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 15px #ff80c8);
    animation: downloads-arrow-breathe 1.8s ease-in-out infinite;
  }
  #downloads .downloads-jump:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
  #downloads .downloads-jump:hover svg { filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 22px #ff80c8); }
  #downloads .downloads-motion-controls { margin-top: 16px; }
  #downloads .downloads-entry { padding-bottom: 62px; }
  #downloads .downloads-entry::after { height: 220px; }
  #downloads .rebel-collection { padding-top: 20px; padding-bottom: 34px; }
  #downloads .collection-heading { margin-bottom: 22px; }
  #downloads .collection-heading__intro { font-size: 18px; }
  #downloads .collection-heading__name { font-size: clamp(34px, 9vw, 50px); }
  #downloads .collection-heading__suffix { font-size: 21px; }
  #downloads .offers { gap: 8px; }
  #downloads .offers > .product-card { padding: 10px 6px; border-radius: 12px; }
  #downloads .product-visual { margin-bottom: 8px; }
  #downloads .product-family { font-size: 10px; line-height: 1.35; min-height: 4.05em; letter-spacing: .02em; margin-bottom: 4px; }
  #downloads .offers h3 { font-size: clamp(21px, 5.4vw, 26px); }
  #downloads .product-detail { font-size: 12px; margin-bottom: 12px; }
  #downloads .product-card .collection-button { font-size: 16px; padding: 7px 2px; gap: 2px; }
  #downloads .product-card .collection-button svg { width: 12px; height: 12px; }
}
@media (min-width: 601px) and (max-width: 1000px) and (max-height: 500px) {
  #downloads .downloads-opening { --fluffy-slot: 260px; }
  #downloads .downloads-character { top: 190px; left: 33%; width: 67%; height: 260px; }
  #downloads .downloads-jump { top: 295px; left: 23%; }
  #downloads .pack-visual { width: 84px; }
}
@keyframes downloads-arrow-breathe {
  0%, 100% { transform: translateY(-5px); opacity: .6; }
  50% { transform: translateY(5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #downloads .downloads-jump svg { animation: none; }
}

/* The encoded three-second loop owns its clock; no scroll/visibility zoom. */
#downloads .downloads-stage__picture { display: block; width: 100%; height: 100%; }
#downloads .downloads-stage__image,
#downloads .downloads-stage.is-visible .downloads-stage__image {
  animation: none !important;
  transform: none !important;
}

/* Feather the backdrop itself to avoid a fractional-pixel magenta seam. */
#downloads .downloads-entry { background: #000; }
#downloads .downloads-backdrop {
  mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent 100%);
}

/* Generated spray-paint silhouette: luminance removes the black transfer plate.
   This is one graphic, with no live font or SVG lettering behind it. */
#downloads .downloads-intro .downloads-graffiti {
  display: block;
  position: relative;
  width: min(100%, clamp(380px, 38vw, 520px));
  aspect-ratio: 1983 / 793;
  margin: 24px 0 32px;
  padding: 0;
  background: #fff;
  mask-image: url("assets/downloads-collection/rebel-signal-spray-v2.png");
  mask-mode: luminance;
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  transform: rotate(-4deg);
  transform-origin: 50% 50%;
}
#downloads .downloads-graffiti > img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  pointer-events: none;
}
#downloads .downloads-graffiti__fallback { display: none; }
#downloads .downloads-intro .downloads-graffiti.is-unavailable {
  mask-image: none; background: none; aspect-ratio: auto;
}
#downloads .downloads-graffiti.is-unavailable > img { display: none; }
#downloads .downloads-graffiti.is-unavailable .downloads-graffiti__fallback {
  display: block; color: #fff; font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1; text-transform: uppercase;
}
@media (min-width: 1200px) and (max-height: 800px) {
  #downloads .downloads-intro .downloads-graffiti {
    width: min(100%, 410px); margin-top: 16px; margin-bottom: 22px;
  }
}
@media (max-width: 1199px), (any-pointer: coarse) and (max-width: 1366px) {
  #downloads .downloads-intro .downloads-graffiti {
    width: min(57%, 480px);
    margin: 24px 0 30px;
    transform: rotate(-4deg);
  }
  #downloads .download-packs { margin-top: 152px; }
}
@media (max-width: 600px), (max-height: 500px) and (max-width: 1000px) {
  #downloads .downloads-intro .downloads-graffiti {
    width: 100%;
    margin: 18px 0 12px;
    transform: rotate(-1.5deg);
  }
  #downloads .downloads-character { top: var(--graffiti-stage-top, 300px); }
  #downloads .downloads-jump { top: calc(var(--graffiti-stage-top, 300px) + 90px); }
  #downloads .download-packs { margin-top: 284px; }
}
@media (min-width: 601px) and (max-width: 1000px) and (max-height: 500px) {
  #downloads .downloads-intro .downloads-graffiti { width: min(62%, 460px); }
  #downloads .download-packs { margin-top: 284px; }
}

@media (min-width: 1200px) and (max-height: 760px) {
  #downloads .downloads-opening { top: 100px; }
  #downloads .downloads-intro .downloads-graffiti {
    width: min(100%, 350px); margin: 10px 0 14px;
  }
}

/* Solid inverted title and route chrome on the magenta Downloads surface. */
#downloads #downloads-title {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 15px 20px 12px;
  border: 1px solid #000;
  border-radius: 6px;
  background: #000;
  color: var(--pink);
  box-shadow: 0 5px 18px rgb(54 0 28 / .16);
  white-space: nowrap;
  vertical-align: top;
}
#downloads #downloads-title > span { color: var(--pink); }
#downloads #downloads-title .downloads-title__dot { color: #fff; }
#downloads .downloads-entry .route-header > a,
#downloads .downloads-entry .route-header > p {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #090005;
  border-radius: 4px;
  background: #050003;
  color: var(--pink);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .1), 0 3px 12px rgb(54 0 28 / .12);
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}
#downloads .downloads-entry .route-header > a {
  min-width: 156px;
  transition: color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
#downloads .downloads-entry .route-header > p { gap: 6px; }
#downloads .downloads-entry .route-header > p > span { color: var(--pink); }
#downloads .downloads-entry .route-header > a:hover {
  color: #fff;
  border-color: rgb(255 255 255 / .8);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 0 16px rgb(255 255 255 / .15);
}
#downloads .downloads-entry .route-header > a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}
@media (max-width: 1199px), (any-pointer: coarse) and (max-width: 1366px) {
  #downloads #downloads-title { padding: 13px 16px 10px; }
  #downloads .downloads-entry .route-header > a { min-width: 104px; }
  #downloads .downloads-entry .route-header > a,
  #downloads .downloads-entry .route-header > p { font-size: 20px; padding: 10px 14px; }
}
@media (max-width: 600px), (max-height: 500px) and (max-width: 1000px) {
  #downloads #downloads-title {
    width: 100%;
    padding: 12px 10px 9px;
    font-size: clamp(44px, 13vw, 66px);
    text-align: center;
  }
  #downloads .downloads-entry .route-header { gap: 10px; }
  #downloads .downloads-entry .route-header > a { min-width: 82px; }
  #downloads .downloads-entry .route-header > a,
  #downloads .downloads-entry .route-header > p { font-size: 19px; padding: 10px 10px; }
  #downloads .downloads-entry .route-header > p { gap: 4px; }
}
@media (min-width: 1200px) and (max-height: 760px) {
  #downloads .downloads-opening { top: 90px; }
  #downloads #downloads-title { padding: 10px 16px 8px; }
  #downloads .downloads-intro .downloads-graffiti {
    width: min(100%, 330px); margin-top: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #downloads .downloads-entry .route-header > a { transition: none; }
}

/* Keep the touch entrance fade below the cards, with room for their reveal. */
@media (max-width: 1199px), (any-pointer: coarse) and (max-width: 1366px) {
  #downloads .downloads-entry { padding-bottom: 80px; }
  #downloads .downloads-entry::after { height: 128px; }
  #downloads .downloads-entry:has(.downloads-motion-controls[hidden])::after { height: 80px; }
  #downloads .downloads-backdrop::after {
    background: radial-gradient(ellipse at 4% 86%, #54003526, transparent 60%);
  }
  #downloads .downloads-motion-controls {
    margin-top: 32px;
    min-height: 48px;
    justify-content: center;
  }
  #downloads .downloads-replay { padding: 10px 18px; }

  /* The source video has transparent margins: enlarge its stage, not its anatomy. */
  @media (min-width: 601px) and (min-height: 501px) {
    #downloads .downloads-character {
      top: 60px;
      left: 14%;
      right: auto;
      width: 90%;
      height: clamp(520px, 54vw, 540px);
    }
    #downloads .downloads-intro .downloads-graffiti { width: min(51%, 440px); }
    #downloads .download-packs {
      margin: 180px auto 0;
      width: calc(100% - 16px);
      max-width: 820px;
      gap: clamp(16px, 2.5vw, 24px);
    }
    #downloads .download-pack {
      grid-template-columns: 68px minmax(0, 1fr);
      gap: 12px;
      padding: 14px;
      border-radius: 16px;
    }
    #downloads .pack-visual { width: 68px; }
    #downloads .download-meta { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
    #downloads .download-pack h3 { font-size: 28px; line-height: 1; }
    #downloads .download-pack h3 em { font-size: 20px; margin-top: 4px; }
    #downloads .pack-tags { margin: 8px 0 5px; font-size: 13px; }
    #downloads .download-meta .collection-button {
      flex-direction: row; justify-content: flex-start;
      min-width: 0; min-height: 44px; width: auto;
      padding: 4px 0; gap: 7px; margin: 0;
      font-size: 16px; line-height: 1.1; white-space: nowrap;
    }
    #downloads .download-meta .collection-button svg { width: 30px; height: 30px; padding: 6px; flex-shrink: 0; }
    @media (min-width: 880px) {
      #downloads .downloads-character { top: 35px; }
    }
  }
}
