/* ═══════════════════════════════════════════════════════════════════════
   Downloads - two builds, and honesty about the rest
   ═══════════════════════════════════════════════════════════════════════
   Same language as the platform and integrations pages: one obsidian
   ground, hairline separators, weight-300 headings, a single lilac accent.

   The page used to give Linux, macOS and iOS the same card treatment as
   the builds that exist. Anything unbuilt now drops to a plain list, the
   same demotion the integrations roadmap gets - a card reads as a product.
   ═════════════════════════════════════════════════════════════════════ */

.dl-page {
  --dl-void:  #07070C;
  --dl-lilac: #A78BFA;
  --dl-ice:   #EEEDFF;
  --dl-mute:  rgba(238, 237, 255, .56);
  --dl-faint: rgba(238, 237, 255, .34);
  --dl-line:  rgba(238, 237, 255, .08);

  background: var(--dl-void);
  color: var(--dl-ice);
}

/* ── Ground and rhythm ─────────────────────────────────────────────── */

.dl-page > section {
  position: relative;
  padding: clamp(60px, 7.5vw, 96px) 0;
}

.dl-page > section + section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(1080px, 88%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .22), transparent);
}

.dl-page > section > .container { position: relative; }
.dl-page > section > .container::before {
  content: '';
  position: absolute;
  top: -12%; left: 50%;
  width: 720px; height: 320px; max-width: 110%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(124, 58, 237, .12), transparent 70%);
}
.dl-page > section > .container > * { position: relative; z-index: 1; }

/* ── Hero ──────────────────────────────────────────────────────────── */

.dl-hero {
  padding: clamp(92px, 12vw, 144px) 0 clamp(56px, 7vw, 88px) !important;
  text-align: center;
}

.dl-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.036em;
  color: var(--dl-ice);
  text-wrap: balance;
}
.dl-hero h1 span { font-weight: 500; color: var(--dl-lilac); }

.dl-lede {
  max-width: 52ch;
  margin: 0 auto;
  font-size: clamp(.9375rem, 1.5vw, 1.0625rem);
  line-height: 1.7;
  color: var(--dl-mute);
}

.dl-release {
  margin-top: 22px;
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dl-faint);
}

.dl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dl-faint);
}
.dl-eyebrow::before,
.dl-eyebrow::after {
  content: '';
  width: 24px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--dl-lilac));
}
.dl-eyebrow::after { background: linear-gradient(90deg, var(--dl-lilac), transparent); }

/* ── Section heads ─────────────────────────────────────────────────── */

.dl-head { max-width: 600px; margin: 0 auto 40px; text-align: center; }
.dl-head h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 300;
  line-height: 1.16;
  letter-spacing: -.03em;
  color: var(--dl-ice);
  text-wrap: balance;
}
.dl-head p { margin: 0; font-size: .9375rem; line-height: 1.7; color: var(--dl-mute); }

/* ── Build cards ───────────────────────────────────────────────────── */
/* Stacked rather than gridded: with two builds, full width lets the
   install steps open without the card jumping around a column. */

.dl-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}

.dl-card {
  padding: 28px;
  border: 1px solid var(--dl-line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(238, 237, 255, .04), rgba(238, 237, 255, .014));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color .35s ease, background .35s ease;
}
.dl-card:hover {
  border-color: rgba(167, 139, 250, .26);
  background: linear-gradient(180deg, rgba(238, 237, 255, .06), rgba(238, 237, 255, .02));
}

.dl-top { display: flex; align-items: center; gap: 15px; }

.dl-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border: 1px solid rgba(167, 139, 250, .2);
  border-radius: 12px;
  background: rgba(167, 139, 250, .07);
}
.dl-logo img { width: 21px; height: 21px; object-fit: contain; display: block; }

.dl-titles h2 {
  margin: 0 0 3px;
  font-size: 1.1875rem;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--dl-ice);
}
.dl-req { margin: 0; font-size: .8125rem; line-height: 1.5; color: var(--dl-mute); }

.dl-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 24px;
  border: 1px solid var(--dl-ice);
  border-radius: 100px;
  background: var(--dl-ice);
  color: #0B0A12;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .25s ease, border-color .25s ease;
}
.dl-btn:hover { background: #fff; border-color: #fff; }

.dl-meta {
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--dl-faint);
}

/* ── Install steps ─────────────────────────────────────────────────── */

.dl-details { margin-top: 20px; border-top: 1px solid var(--dl-line); padding-top: 16px; }

.dl-details summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .8125rem;
  color: var(--dl-faint);
  transition: color .25s ease;
}
.dl-details summary::-webkit-details-marker { display: none; }
/* A chevron drawn from a rotated corner, so it turns with the disclosure. */
.dl-details summary::before {
  content: '';
  width: 6px; height: 6px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .25s ease;
}
.dl-details[open] summary::before { transform: rotate(45deg); }
.dl-details summary:hover { color: var(--dl-ice); }

.dl-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 18px 0 0;
}
.dl-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 14px 34px;
  font-size: .8438rem;
  line-height: 1.65;
  color: var(--dl-mute);
}
.dl-steps li:last-child { padding-bottom: 0; }
/* Numbered because installation genuinely is a sequence - the order is
   information, not decoration. */
.dl-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border: 1px solid rgba(167, 139, 250, .26);
  border-radius: 50%;
  background: rgba(167, 139, 250, .07);
  font-size: .6875rem;
  font-weight: 500;
  color: var(--dl-lilac);
}
.dl-steps strong { color: rgba(238, 237, 255, .8); font-weight: 500; }
.dl-steps code {
  padding: 2px 7px;
  border: 1px solid var(--dl-line);
  border-radius: 5px;
  background: rgba(238, 237, 255, .05);
  font-size: .8125em;
  color: rgba(196, 181, 253, .9);
}

/* ── Upcoming ──────────────────────────────────────────────────────── */

.up-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 640px;
  border-top: 1px solid var(--dl-line);
}

.up-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 2fr auto;
  align-items: baseline;
  gap: 20px;
  padding: 17px 4px;
  border-bottom: 1px solid var(--dl-line);
}

.up-name { font-size: .9375rem; font-weight: 500; color: rgba(238, 237, 255, .78); }
.up-note { font-size: .8438rem; line-height: 1.55; color: var(--dl-mute); }
.up-tag {
  font-size: .625rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dl-faint);
  white-space: nowrap;
}

/* ── Licence ───────────────────────────────────────────────────────── */

.dl-license {
  max-width: 620px;
  margin: 0 auto;
  padding: 40px;
  border: 1px solid rgba(167, 139, 250, .18);
  border-radius: 20px;
  background: rgba(167, 139, 250, .045);
  text-align: center;
}
.dl-license h2 {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.03em;
  color: var(--dl-ice);
  text-wrap: balance;
}
.dl-license > p {
  max-width: 48ch;
  margin: 0 auto 24px;
  font-size: .9375rem;
  line-height: 1.7;
  color: var(--dl-mute);
}

.lic-points {
  list-style: none;
  display: inline-block;
  padding: 0;
  margin: 0 0 30px;
  text-align: left;
}
.lic-points li {
  position: relative;
  padding: 0 0 10px 22px;
  font-size: .8438rem;
  line-height: 1.6;
  color: rgba(238, 237, 255, .68);
}
/* Drawn tick - renders identically everywhere and sits on the baseline. */
.lic-points li::before {
  content: '';
  position: absolute;
  left: 1px; top: .42em;
  width: 9px; height: 5px;
  border-left: 1.5px solid var(--dl-lilac);
  border-bottom: 1.5px solid var(--dl-lilac);
  border-radius: 1px;
  transform: rotate(-45deg);
}

.dl-cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.dl-page .btn-primary {
  background: var(--dl-ice) !important;
  border: 1px solid var(--dl-ice) !important;
  color: #0B0A12 !important;
  font-weight: 500;
  box-shadow: none !important;
}
.dl-page .btn-primary:hover { background: #fff !important; transform: none !important; }

.dl-page .btn-ghost {
  background: transparent !important;
  border: 1px solid rgba(238, 237, 255, .16) !important;
  color: var(--dl-ice) !important;
  font-weight: 500;
}
.dl-page .btn-ghost:hover {
  border-color: rgba(167, 139, 250, .4) !important;
  background: rgba(167, 139, 250, .06) !important;
  transform: none !important;
}

.dl-page :focus-visible { outline: 2px solid var(--dl-lilac); outline-offset: 3px; }

/* ── Narrow ────────────────────────────────────────────────────────── */

@media (max-width: 620px) {
  .dl-card, .dl-license { padding: 24px; }
  .up-row { grid-template-columns: 1fr auto; row-gap: 6px; }
  .up-note { grid-column: 1 / -1; }
  .dl-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .dl-card, .dl-btn, .dl-details summary, .dl-details summary::before { transition: none; }
}

/* ── Live catalogue ────────────────────────────────────────────────── */
/* The build list is fetched rather than baked in, so this file has to carry
   the states that only exist at runtime: loading, failure, and the visitor's
   own platform being singled out. */

.dl-loading {
  padding: 44px 24px;
  border: 1px dashed var(--dl-line);
  border-radius: 14px;
  text-align: center;
  font-size: .875rem;
  color: var(--dl-mute);
}

/* A disabled button is doing something, not broken. */
.dl-btn[disabled] {
  opacity: .6;
  cursor: progress;
}

.dl-error {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(248, 113, 113, .28);
  border-left-width: 2px;
  border-radius: 8px;
  background: rgba(248, 113, 113, .06);
  font-size: .8125rem;
  color: #fca5a5;
}

/* The one card the visitor can actually use gets the accent. */
.dl-card.is-yours { border-color: rgba(167, 139, 250, .38); }

.dl-yours {
  margin-left: 10px;
  padding: 3px 9px;
  border: 1px solid rgba(167, 139, 250, .3);
  border-radius: 100px;
  background: rgba(167, 139, 250, .1);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dl-lilac);
  vertical-align: middle;
}

.dl-notes {
  margin-top: 16px;
  font-size: .875rem;
  line-height: 1.65;
  color: var(--dl-mute);
}

/* Long enough to wrap on a phone, so it breaks anywhere rather than
   pushing the page sideways. */
.dl-sum {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--dl-line);
  font-size: .6875rem;
}
.dl-sum span {
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dl-faint);
}
.dl-sum code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--dl-mute);
  word-break: break-all;
}

/* ── Channel switch ────────────────────────────────────────────────── */
/* Hidden until a beta build exists, so most visitors never see a choice
   they do not need to make. */

.dl-channel {
  display: flex;
  gap: 4px;
  width: fit-content;
  margin-bottom: 26px;
  padding: 4px;
  border: 1px solid var(--dl-line);
  border-radius: 100px;
}

.dl-chan-btn {
  padding: 7px 20px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--dl-mute);
  font: inherit;
  font-size: .8125rem;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.dl-chan-btn.is-on {
  background: rgba(238, 237, 255, .08);
  color: var(--dl-ice);
}

@media (prefers-reduced-motion: reduce) {
  .dl-chan-btn { transition: none; }
}
