/* ==========================================================================
   Download page (content/en/pages/download.html). Loaded after feature-page.css.
   Scoped to body.rc-download-page.
   ========================================================================== */

/* Dark cards: same flat glass as the feature pages (the default gradient reads too strongly) */
.rc-download-page .st-card--dark {
  background: rgba(255, 255, 255, 0.035) !important;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.035) 55%, rgba(255, 255, 255, 0.045) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 32px rgba(0, 0, 0, 0.25) !important;
}

/* ---------- Hero: poker cards dealt from the download button (download-page.js) ---------- */
.dl-deal-stage {
  position: absolute;
  visibility: hidden;      /* shown by download-page.js once the cards are stacked on the button */
  inset: 0;
  /* On wide screens the cards stay around the text (1440px frame) instead of going to the edges */
  left: 50%;
  right: auto;
  width: min(100%, 1440px);
  transform: translateX(-50%);
  z-index: 2;              /* under the title/button (.rc-container is z 6) */
  pointer-events: none;
  overflow: hidden;
}

.dl-deal-card {
  position: absolute;
  display: block;
  will-change: transform;
}

.dl-deal-inner {
  display: block;
  will-change: transform, opacity;
}

.dl-deal-card img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 20px 26px rgba(74, 52, 30, 0.28));
  will-change: transform;
}

/* Without JS (or reduced motion) the cards simply sit at their final angle */
.dl-deal-card { transform: rotate(var(--rot, 0deg)); }

/* Positions in % of the frame above; sizes also follow the height of the window (vh), so the cards
   stay beside the text on short laptop screens (Windows zoom 125–175%) */
/* Bottom left: a "hand" of two cards (A♠ + Q♥) */
.ddc-1 { --rot: -13deg; width: clamp(96px, min(12.5vw, 26vh), 205px); left: 4%;  bottom: 9vh; z-index: 2; }
.ddc-2 { --rot: 9deg;   width: clamp(72px, min(9vw, 19vh), 148px);    left: 13%; bottom: 17vh; }
/* Top right: 10♥ */
.ddc-3 { --rot: 11deg;  width: clamp(72px, min(8.6vw, 18vh), 140px);  right: 6%; top: 15vh; }
/* Lower right: A♣ */
.ddc-4 { --rot: -8deg;  width: clamp(56px, min(6vw, 13vh), 100px);    right: 13%; bottom: 13vh; }
/* Top left, small: A♦ */
.ddc-5 { --rot: 16deg;  width: clamp(40px, min(4.2vw, 9vh), 70px);    left: 16%; top: 19vh; }
/* Extra cards: small 10♥ far left, A♣ top centre-right, A♦ bottom centre-left */
.ddc-6 { --rot: -18deg; width: clamp(54px, min(6vw, 13vh), 98px);     left: 2.5%; top: 34vh; }
.ddc-7 { --rot: 22deg;  width: clamp(40px, min(3.8vw, 8vh), 64px);    right: 24%; top: 14vh; }
.ddc-8 { --rot: -10deg; width: clamp(42px, min(4vw, 8.5vh), 66px);    left: 30%; bottom: 8vh; }

@media (max-width: 1100px) {
  .ddc-2 { left: 9%; }
  .ddc-5 { left: 6%; top: 15vh; }
  .ddc-4 { right: 5%; }
  .ddc-7 { right: 20%; top: 12vh; }
  .ddc-8 { left: 26%; bottom: 6vh; }
}

@media (max-width: 768px) {
  .ddc-1 { width: 96px; left: -22px; bottom: 7vh; }
  .ddc-2 { width: 70px; left: 46px; bottom: 5vh; }
  .ddc-3 { width: 72px; right: -18px; top: 11vh; }
  .ddc-4 { width: 58px; right: 16px; bottom: 9vh; }
  .ddc-5, .ddc-7 { display: none; }
  .ddc-6 { width: 54px; left: -14px; top: 13vh; }
  .ddc-8 { width: 44px; left: auto; right: 34%; bottom: 3vh; }
}

/* ---------- Desktop: one big card (visitor's system) + two compact cards ---------- */
.dl-desktop-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.rc-download-page .dl-os-card {
  padding: 28px;
  gap: 0;
  overflow: hidden;
  isolation: isolate;
}

.dl-os-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dl-os-tag,
.dl-os-more,
.dl-os-art { display: none; }

.dl-os-short { margin-bottom: 8px !important; }

/* Big card */
.rc-download-page .dl-os-card.is-featured {
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
  min-height: 440px;
  padding: 40px;
}

.dl-os-card.is-featured .dl-os-body { max-width: 46%; }
.dl-os-card.is-featured .dl-os-short { display: none; }
.dl-os-card.is-featured .dl-os-more { display: flex; flex-direction: column; gap: 16px; margin-bottom: 26px; }
.dl-os-card.is-featured.is-detected .dl-os-tag { display: inline-flex; }

.dl-os-card.is-featured h3 { font-size: 26px; }

.dl-os-card.is-featured .dl-os-pitch {
  font-size: 16px;
  line-height: 1.65;
}

.rc-download-page .dl-os-card.is-featured .st-dl-btn {
  align-self: flex-start;
  height: 52px;
  padding: 0 30px;
}

.dl-os-card.is-featured .dl-os-art {
  display: block;
  position: absolute;
  right: -11%;
  bottom: -8%;
  width: 57%;
  z-index: 0;
  pointer-events: none;
}

.dl-os-art img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45));
}

/* The square Linux mockup has transparent padding: zoom it to match the others */
.dl-os-card[data-platform="linux"] .dl-os-art { width: 68%; right: -15%; bottom: -16%; }

/* The big card gets the Premium blue mesh (same as the Premium pricing card) */
.rc-download-page .st-card.dl-os-card.is-featured {
  background-color: #191A37 !important;
  background-image:
    radial-gradient(circle at 18% 18%, #3563c9 0%, transparent 60%),
    radial-gradient(circle at 88% 85%, #3563c9 0%, transparent 58%),
    radial-gradient(circle at 48% 58%, #101426 0%, #2E3B6D 100%) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 40px rgba(255, 255, 255, 0.06),
    0 20px 50px rgba(0, 0, 0, 0.3) !important;
}

.rc-download-page .dl-os-card.is-featured:hover { transform: none; }

.rc-download-page .dl-os-card.is-featured p,
.rc-download-page .dl-os-card.is-featured li {
  color: rgba(255, 255, 255, 0.85);
}

.rc-download-page .dl-os-card.is-featured .st-dl-btn {
  background: #FFFFFF;
  color: #10204A;
}

.rc-download-page .dl-os-card.is-featured .st-dl-btn:hover { background: #E8EEFB; }

.rc-download-page .dl-os-card.is-featured .st-dl-btn .os-btn-logo {
  filter: brightness(0) saturate(100%) invert(10%) sepia(40%) saturate(2500%) hue-rotate(210deg);
}

.rc-download-page .dl-os-card.is-featured .dl-os-tag {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.16);
}

.dl-os-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

/* ---------- Mobile: one card for iPhone & Android ---------- */
.rc-download-page .dl-mobile-wrap { grid-template-columns: 1fr; }

.rc-download-page .dl-mobile-card {
  flex-direction: row;
  min-height: 420px;
  padding: 44px;
  overflow: hidden;
  isolation: isolate;
}

.dl-mobile-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 52%;
}

.dl-mobile-body h3 { font-size: 26px; }
.dl-mobile-body > p { font-size: 16px; line-height: 1.65; }

.dl-mobile-logos { display: flex; gap: 10px; }

.dl-store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}

.rc-download-page a.dl-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 22px 0 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.rc-download-page a.dl-store-btn:hover,
.rc-download-page a.dl-store-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
}

/* App not published yet on this store (App Store): greyed out, not clickable (modals.js) */
.rc-download-page a.dl-store-btn[aria-disabled="true"],
.rc-download-page a.dl-store-btn[aria-disabled="true"]:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.45);
  cursor: not-allowed;
}
.rc-download-page a.dl-store-btn[aria-disabled="true"] img { filter: grayscale(1); opacity: 0.45; }

.dl-store-btn img { width: 22px; height: 22px; flex-shrink: 0; }

.dl-store-btn span { display: flex; flex-direction: column; }

.dl-store-btn small {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.01em;
}

/* One phone, static */
.dl-mobile-art {
  position: absolute;
  top: 36px;
  right: 6%;
  bottom: -70px;
  width: 30%;
  z-index: 0;
  pointer-events: none;
}

.dl-phone {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 78%;
  height: auto;
  transform: translateX(-50%) rotate(4deg);
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.5));
}

@media (max-width: 960px) {
  .dl-desktop-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-download-page .dl-os-card.is-featured { grid-row: auto; min-height: 400px; }
  .dl-os-card.is-featured .dl-os-body { max-width: 56%; }
  .dl-os-card.is-featured .dl-os-art { width: 56%; right: -10%; }
  .dl-mobile-body { max-width: 58%; }
  .dl-mobile-art { width: 36%; right: 2%; }
}

@media (max-width: 700px) {
  .dl-desktop-bento { grid-template-columns: 1fr; }
  .rc-download-page .dl-os-card.is-featured { grid-column: auto; min-height: 0; padding: 28px 24px 0; }
  .dl-os-card.is-featured .dl-os-body { max-width: none; }
  .dl-os-card.is-featured .dl-os-more { margin-bottom: 20px; }
  .rc-download-page .dl-os-card.is-featured .st-dl-btn { align-self: stretch; }
  .dl-os-card.is-featured .dl-os-art,
  .dl-os-card.is-featured[data-platform="linux"] .dl-os-art {
    position: relative;
    right: auto;
    bottom: auto;
    width: 108%;
    margin: 18px -4% -8%;
  }
  .dl-os-card.is-featured[data-platform="linux"] .dl-os-art { width: 125%; margin: -4% -12% -18%; }

  .rc-download-page .dl-mobile-card { flex-direction: column; padding: 28px 24px 0; min-height: 0; }
  .dl-mobile-body { max-width: none; }
  .dl-store-row { flex-direction: column; }
  .rc-download-page a.dl-store-btn { justify-content: center; }
  .dl-mobile-art { position: relative; top: auto; right: auto; bottom: auto; width: 100%; height: 300px; margin-top: 26px; margin-bottom: -60px; }
  .dl-phone { width: 52%; }

  .dl-cream-zone .dl-faq { padding-top: 70px; }
}

