/* The download block — the functional core of the page — its OS-aware
   emphasis, driven by the data-os attribute js/enhance.js sets, and the
   first-run instructions. */

.download {
  border-top: 1px solid var(--border);
}

.download-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

@media (max-width: 56rem) {
  .download-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
}

/* ---- Downloads ---- */

.downloads {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.dl {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--text);
}

a.dl:hover {
  color: var(--text);
  border-color: var(--accent);
}

.dl-os {
  font-weight: 600;
  font-size: 1.1rem;
}

.dl-meta {
  font-size: 0.9rem;
  /* --text-2, not --text-3: this is the only text telling an Intel Mac owner
     the build is Apple Silicon only. */
  color: var(--text-2);
}

.version {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  color: var(--text-2);
}

/* ---- OS-aware emphasis ----
   With no JS the attribute is absent, every selector below misses, and the
   list renders in document order with all downloads weighted equally — a
   correct page, not a degraded one.

   Emphasis only, never reordering: moving a row with `order` left tab order
   and screen-reader order disagreeing with what a visitor saw (WCAG 1.3.2 /
   2.4.3). */

body[data-os='mac'] .dl-item[data-for='mac'] a.dl,
body[data-os='linux'] .dl-item[data-for='linux'] a.dl {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

body[data-os='mac'] .dl-item[data-for='mac'] a.dl:hover,
body[data-os='linux'] .dl-item[data-for='linux'] a.dl:hover {
  background: var(--accent-hover);
}

body[data-os='mac'] .dl-item[data-for='mac'] .dl-meta,
body[data-os='linux'] .dl-item[data-for='linux'] .dl-meta {
  color: var(--accent-fg);
}

/* ---- First run ---- */

.first-run {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.first-run h3 {
  margin-bottom: 0.5rem;
}

.first-run-note {
  color: var(--text-2);
}

.instructions {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin-top: 1.1rem;
}

.instructions h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.instructions p {
  color: var(--text-2);
  font-size: 0.95rem;
}

.instructions p:last-child {
  margin-bottom: 0;
}

/* Every platform's instructions stay fully legible — a tester may be
   downloading for another machine. The visitor's own is pulled forward
   instead of the others being pushed back. */
body[data-os='mac'] .instructions[data-for='mac'],
body[data-os='linux'] .instructions[data-for='linux'],
body[data-os='windows'] .instructions[data-for='windows'] {
  border-top-color: var(--accent);
  border-top-width: 2px;
}

body[data-os='mac'] .instructions[data-for='mac'] p,
body[data-os='linux'] .instructions[data-for='linux'] p,
body[data-os='windows'] .instructions[data-for='windows'] p {
  color: var(--text);
}

/* Step-by-step instructions, written for people who have never opened
   Terminal. */
.howto {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
  color: var(--text-2);
  font-size: 0.95rem;
}

.howto li {
  margin-bottom: 0.6rem;
  padding-left: 0.2rem;
}

.howto pre {
  margin: 0.5rem 0;
}

/* One click selects the whole command, so nobody has to drag-select a long
   line and miss the closing quote. */
.select-all,
.select-all code {
  user-select: all;
  -webkit-user-select: all;
  cursor: text;
}

body[data-os='mac'] .instructions[data-for='mac'] .howto {
  color: var(--text);
}
