/* ============================================================
   landing/yar-download.css -- gated download-grid styles, now used
   on the /yar/early-access section (#yar-ea-downloads / #yar-ea-gate)
   after the old standalone /yar/download page was folded in (mirrors
   the yar-polish.css pattern: everything routes through the existing
   var(--...) tokens in styles.css / site-extend.css / yar.css except
   where this file intentionally uses the literal brand v11.2.1 accent
   hexes below, scoped to .yar-download-section / #yar-ea-* so nothing
   else on the site is affected). Shared primitives reused as-is:
   .btn/.btn-primary/.btn-ghost, .card-grid, .page-hero, .eyebrow,
   .section-head, .section-title, .section-sub, .grad-text.
   ============================================================ */

.yar-download-section,
.early-access-section {
  --ydl-violet:  #8B3FC7; /* brand v11.2.1 primary/CTA violet */
  --ydl-azure:   #3B7DD6;
  --ydl-indigo:  #5145A8;
  --ydl-teal:    #14A3A3;
  --ydl-coral:   #F26355;
  --ydl-magenta: #E0309E; /* accent only -- not used for text/buttons */
}

/* ---------------------------------------------------------------
   Loading state (brief; shown only until /api/me + downloads.json
   both resolve, which is normally under a second).
   --------------------------------------------------------------- */
.yar-download-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 72px 0; color: var(--muted); font-size: 15px;
}
/* [hidden] follow-up rule (same pattern as .viz-recommendation[hidden] /
   .pack-panel[hidden] elsewhere in this codebase): the class above sets
   its own `display`, which otherwise beats the UA default `[hidden] {
   display: none }` the moment landing/yar-download.js sets
   loading.hidden = true, leaving the spinner visibly stuck on screen. */
.yar-download-loading[hidden] { display: none; }
.yar-dl-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--hair); border-top-color: var(--ydl-violet);
  animation: yar-dl-spin 0.8s linear infinite;
}
@keyframes yar-dl-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------
   /yar/early-access gated-content wiring (landing/yar-download.js):
   #yar-ea-loading is a brief spinner shown while /api/me resolves;
   #yar-ea-gate is the default-visible join-early-access markup
   (already styled by early-access-section / early-access-layout
   below); #yar-ea-downloads (this grid) and its intro line are
   revealed in its place once the visitor is confirmed unlocked.
   --------------------------------------------------------------- */
.yar-ea-unlocked-intro { margin-bottom: 8px; }
.yar-ea-signin-line {
  text-align: right; font-size: 14px; color: var(--muted); margin: 0 0 20px;
}
.yar-ea-signin-line a { color: var(--ydl-indigo); font-weight: 600; margin-left: 6px; }

/* ---------------------------------------------------------------
   Recommended-for-your-device callout (top of the full grid).
   --------------------------------------------------------------- */
.yar-dl-recommend {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap; padding: 26px 30px; border-radius: 20px; margin: 8px 0 48px;
  background: linear-gradient(135deg, rgba(139,63,199,0.09), rgba(59,125,214,0.07));
  border: 1px solid rgba(139,63,199,0.22);
}
.yar-dl-recommend-info { display: flex; align-items: center; gap: 16px; min-width: 0; }
.yar-dl-recommend-icon {
  width: 46px; height: 46px; border-radius: 14px; background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: var(--ydl-violet);
  flex-shrink: 0; box-shadow: 0 6px 18px -8px rgba(139,63,199,0.35);
}
.yar-dl-recommend-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.03em; color: var(--ydl-violet); text-transform: uppercase; margin: 0 0 4px;
}
.yar-dl-recommend-title { font-family: var(--f-display); font-size: 19px; font-weight: 600; color: var(--ink); margin: 0; }
.yar-dl-recommend-sub { font-size: 14px; color: var(--muted); margin: 3px 0 0; }
.yar-dl-recommend-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.yar-dl-seeall { font-size: 14px; font-weight: 600; color: var(--ydl-indigo); white-space: nowrap; }
.yar-dl-seeall .arr { transition: transform 250ms var(--ease); display: inline-block; }
.yar-dl-seeall:hover .arr { transform: translateY(2px); }

/* ---------------------------------------------------------------
   Section spacing + platform grid.
   --------------------------------------------------------------- */
.yar-dl-block { margin-top: 56px; scroll-margin-top: 120px; }
.yar-dl-block:first-of-type { margin-top: 0; }

.yar-platform-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; margin-top: 28px;
}
.yar-platform-card {
  position: relative; padding: 26px 24px 24px; background: var(--surface);
  border: 1px solid var(--hair); border-radius: 18px; display: flex; flex-direction: column;
  gap: 14px;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.yar-platform-card:hover { transform: translateY(-3px); box-shadow: 0 20px 44px -26px rgba(81,69,168,0.28); }
.yar-platform-card.is-recommended {
  border-color: var(--ydl-violet);
  box-shadow: 0 0 0 1px var(--ydl-violet) inset, 0 20px 44px -24px rgba(139,63,199,0.32);
}
.yar-pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.yar-pc-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex-shrink: 0;
}
.yar-pc-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase; color: #fff; background: var(--ydl-violet);
  padding: 4px 9px; border-radius: 999px; white-space: nowrap; margin-top: 2px;
}
.yar-pc-title-wrap { min-width: 0; }
.yar-pc-title { font-family: var(--f-display); font-size: 16.5px; font-weight: 600; color: var(--ink); margin: 0; line-height: 1.3; }
.yar-pc-meta { font-size: 13px; color: var(--muted); margin: 3px 0 0; }
.yar-pc-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.yar-pc-formats { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.yar-pc-format-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 8px 9px 12px; border-radius: 10px; background: var(--bg-soft); font-size: 13.5px; color: var(--ink-2);
}
.yar-pc-format-name { font-weight: 500; }
.yar-pc-req { font-size: 12px; color: var(--faint); line-height: 1.55; margin: 0; }
.yar-pc-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.yar-pc-size { font-size: 12px; color: var(--faint); }

/* Download buttons: active vs. coming-soon are deliberately very
   different at a glance -- solid brand fill vs. dashed outline --
   so the distinction reads even without checking the label text. */
.yar-dl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; font-family: var(--f-display); font-size: 13.5px;
  font-weight: 600; text-decoration: none; transition: all var(--dur-fast) var(--ease); border: 1.5px solid transparent;
}
.yar-dl-btn-active { background: var(--violet); color: #fff; }
.yar-dl-btn-active:hover { background: #5d4cc0; transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(110,91,209,0.4); }
.yar-dl-btn-soon { background: transparent; border: 1.5px dashed var(--hair); color: var(--muted); }
.yar-dl-btn-soon:hover { border-color: var(--ydl-violet); color: var(--ydl-violet); }
.yar-pc-format-row .yar-dl-btn { padding: 6px 14px; font-size: 12.5px; }
.yar-pc-notify { font-size: 12.5px; color: var(--ydl-indigo); font-weight: 600; }

.yar-dl-requirements {
  margin-top: 20px; padding: 16px 18px; border-radius: 14px; background: var(--bg-soft);
  font-size: 13px; color: var(--muted); line-height: 1.65;
}
.yar-dl-requirements strong { color: var(--ink-2); }

/* ---------------------------------------------------------------
   Trust line + releases/changelog link.
   --------------------------------------------------------------- */
.yar-dl-trust {
  display: flex; flex-wrap: wrap; gap: 16px 30px; justify-content: center;
  margin: 56px 0 8px; padding: 26px 10px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.yar-dl-trust-item { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.yar-dl-trust-item svg { color: var(--ydl-teal); flex-shrink: 0; }
.yar-dl-releases { text-align: center; margin-top: 22px; font-size: 14.5px; }
.yar-dl-releases a { color: var(--violet); font-weight: 600; }

.yar-dl-error { text-align: center; padding: 64px 20px; color: var(--muted); font-size: 15px; }
.yar-dl-error a { color: var(--violet); font-weight: 600; }

@media (max-width: 640px) {
  .yar-ea-signin-line { text-align: left; }
  .yar-dl-recommend { flex-direction: column; align-items: flex-start; padding: 22px; }
  .yar-dl-recommend-actions { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .yar-platform-card, .yar-dl-spinner, .yar-dl-btn-active, .yar-dl-seeall .arr { transition: none !important; animation: none !important; }
}
