/* downloads.html — on tokens.css + site.css */

.dl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); margin: var(--s-5) 0 var(--s-6); }
.dl-updated { color: var(--ink-faint); font-size: 0.875rem; font-family: var(--font-mono); }

.dl-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 640px) { .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .dl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.dl-card {
  display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5);
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--lift);
}
.dl-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.dl-version { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-muted); }
.dl-name { font-size: 1.25rem; }
.dl-desc { color: var(--ink-muted); margin: 0; font-size: 0.9375rem; }
.dl-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: auto; }
.dl-actions .btn { flex: 1 1 auto; }
.dl-size { font-weight: 500; opacity: .85; }
.dl-sha {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  padding-top: var(--s-3); border-top: 1px solid var(--rule); font-size: 0.8125rem;
}
.dl-sha-label { color: var(--ink-faint); font-family: var(--font-mono); }
.dl-sha code { font-family: var(--font-mono); color: var(--ink-soft); }
.dl-copy {
  margin-inline-start: auto; min-height: 36px; min-width: 64px; padding: 0 var(--s-3);
  border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--card);
  color: var(--ink); font: 500 0.8125rem var(--font-body); cursor: pointer;
}
.dl-copy.is-copied { color: var(--ok); border-color: var(--ok); }

/* Phone preview */
.phone-preview { margin-top: var(--s-8); padding-top: var(--s-7); border-top: 1px solid var(--rule); text-align: center; }
.phone-preview h2, .how-it-works h2 { font-size: 1.5rem; }
.phone-preview .page-lede { margin-inline: auto; }
.preview-apps { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); margin: var(--s-5) 0; }
.preview-app {
  min-height: 40px; padding: 0 var(--s-4); border-radius: 999px; border: 1px solid var(--rule-strong);
  background: var(--card); color: var(--ink-soft); font: 500 0.875rem var(--font-body); cursor: pointer;
}
.preview-app[aria-pressed="true"] { background: var(--signal-wash); border-color: var(--signal-edge); color: var(--signal); font-weight: 600; }
.phone-frame {
  position: relative; width: min(320px, 100%); aspect-ratio: 9 / 18.5; margin: 0 auto;
  background: #111; border: 10px solid #1d1f24; border-radius: 40px; overflow: hidden; box-shadow: var(--lift-hover);
}
.phone-frame.landscape { width: min(640px, 100%); aspect-ratio: 18.5 / 9; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 30px; overflow: hidden; background: #000; }
.phone-screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.phone-loader { position: absolute; inset: 0; display: grid; place-items: center; background: #111; z-index: 2; }
.phone-loader.is-hidden { display: none; }
.phone-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #333; border-top-color: var(--signal); animation: dl-spin 1s linear infinite; }
@keyframes dl-spin { to { transform: rotate(360deg); } }
.preview-actions { margin-top: var(--s-4); }

/* How updates work */
.how-it-works { margin-top: var(--s-8); padding-top: var(--s-7); border-top: 1px solid var(--rule); }
.steps { list-style: none; counter-reset: step; margin: var(--s-5) 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-4); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--signal-wash); color: var(--signal); font-weight: 700; margin-bottom: var(--s-2); }
.steps h3 { font-size: 1rem; margin-bottom: var(--s-1); }
.steps p { color: var(--ink-muted); font-size: 0.9375rem; margin: 0; }

/* Install guide dialog */
.guide-overlay[hidden] { display: none; }
.guide-overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 12, 16, 0.55); padding: 0;
}
@media (min-width: 640px) { .guide-overlay { align-items: center; padding: var(--s-5); } }
.guide-modal {
  width: 100%; max-width: 560px; max-height: 90dvh; overflow-y: auto;
  background: var(--paper); color: var(--ink); border-radius: 18px 18px 0 0; padding: var(--s-5);
}
@media (min-width: 640px) { .guide-modal { border-radius: 18px; } }
.guide-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.guide-head h2 { font-size: 1.375rem; }
.guide-close {
  width: var(--tap); height: var(--tap); display: grid; place-items: center; flex: none;
  border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer;
}
.guide-intro { color: var(--ink-muted); margin: 0 0 var(--s-4); }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.guide-step { display: flex; gap: var(--s-3); }
.guide-step .num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--signal-wash); color: var(--signal); font-weight: 700; font-size: 0.875rem; }
.guide-step h4 { font-family: var(--font-display); font-size: 1rem; margin: 2px 0 var(--s-1); }
.guide-step p { margin: 0; color: var(--ink-soft); font-size: 0.9375rem; }
.guide-note { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); background: var(--card-sunk); border-radius: var(--radius); color: var(--ink-muted); font-size: 0.875rem; }

@media (prefers-reduced-motion: reduce) { .phone-spinner { animation: none; } }
