/*
 * The page takes its palette from the product icon rather than from the
 * application window: warm paper, ink, and the icon's terminal green. A
 * download page is read once, in daylight, often on a phone, by someone who
 * has not decided yet — paper reads faster there than a dark canvas does, and
 * the green ties the page to the thing being downloaded.
 *
 * One accent, no gradients, and exactly one dark surface: the command blocks,
 * which are meant to look like a terminal because that is what they are.
 */
:root {
  --paper: #faf8f3;
  --card: #ffffff;
  --sunken: #f3f0e8;
  --ink: #23211c;
  --ink-muted: #6c665b;
  --hairline: hsl(40 10% 20% / 0.13);
  --hairline-soft: hsl(40 10% 20% / 0.08);
  --accent: #2c7340;
  --accent-hover: #21592f;
  --accent-ink: #ffffff;
  --accent-wash: hsl(138 45% 32% / 0.08);
  --warning: #8a5a12;
  --warning-wash: #fdf6e7;
  --terminal: #262b26;
  --terminal-ink: #d8e6d5;
  --radius: 12px;
  --shadow-card: 0 1px 2px hsl(40 10% 20% / 0.05);
  --shadow-lift: 0 2px 10px hsl(138 30% 18% / 0.16);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  padding: 0 1.5rem 4rem;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.65 ui-sans-serif,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

code,
pre {
  font:
    13px/1.6 ui-monospace,
    SFMono-Regular,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
}

a {
  color: var(--accent);
  text-decoration-color: hsl(138 45% 32% / 0.35);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.langbar,
.masthead,
main,
footer {
  max-width: 54rem;
  margin: 0 auto;
}

/* ---- language ---- */

.langbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  padding-top: 1.25rem;
}

.langbar button {
  padding: 0.3rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.langbar button:hover {
  color: var(--ink);
  background: hsl(40 10% 20% / 0.05);
}

.langbar button[aria-pressed="true"] {
  border-color: var(--hairline);
  background: var(--card);
  color: var(--ink);
}

.langbar button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- masthead ---- */

.masthead {
  padding: 3.25rem 0 1.5rem;
  text-align: center;
}

.mark {
  display: block;
  margin: 0 auto 1.25rem;
}

.masthead h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.4rem 0 1.5rem;
  color: var(--ink-muted);
  font-size: 1.125rem;
}

.blurb {
  margin: 0 auto;
  max-width: 40rem;
  color: var(--ink-muted);
}

.blurb code {
  color: var(--ink);
}

/* ---- sections ---- */

section {
  margin-top: 3.5rem;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 620;
}

.release-line {
  margin: 0 0 1.75rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ---- downloads ---- */

.recommended {
  margin-bottom: 1.75rem;
}

.primary-download {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.95rem 1.6rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  box-shadow: var(--shadow-lift);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 620;
  text-decoration: none;
}

.primary-download:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.primary-download .meta {
  font-weight: 450;
  opacity: 0.78;
  font-size: 0.85rem;
}

.arch-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.arch-hint {
  margin: 0.85rem 0 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.platforms-heading {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.platforms {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.platform-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--hairline-soft);
}

.platform-row:first-child {
  border-top: none;
}

.platform-row .name {
  flex: 1 1 14rem;
  font-size: 0.925rem;
}

/* The one line that tells a visitor which row is theirs. */
.platform-row .hint {
  display: block;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.platform-row .size {
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.platform-row .links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.875rem;
}

/* Looks and reads like the Download link beside it; it copies the digest the
 * manifest already carries rather than sending the reader off to fetch a
 * one-line text file. */
.platform-row .checksum {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: hsl(138 45% 32% / 0.35);
  text-underline-offset: 3px;
}

.platform-row .checksum:hover:not(:disabled) {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.platform-row .checksum:disabled {
  color: var(--ink-muted);
  cursor: default;
  text-decoration: none;
}

.platform-row .digest {
  color: var(--ink-muted);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.source-note {
  margin: 0.9rem 0 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.note {
  margin: 1.5rem 0 0;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.prerelease-note {
  border: 1px solid hsl(38 62% 42% / 0.28);
  background: var(--warning-wash);
  color: var(--ink);
}

.prerelease-note strong {
  color: var(--warning);
}

.fallback {
  color: var(--ink-muted);
}

/* ---- verify ---- */

.verify-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.verify-grid article {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.verify-grid p {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

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

.verify-grid strong,
.verify-grid p code {
  color: var(--ink);
}

/* The page's one dark surface. These are commands typed into a terminal, and
 * looking like one is the fastest way to say so. */
pre {
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: var(--terminal);
  color: var(--terminal-ink);
  /* These are commands a reader is meant to copy, so they wrap rather than
   * scroll off the edge of a card where the tail is invisible. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre code {
  color: inherit;
}

/* Inline code inside running text stays on paper; only blocks go dark. */
.verify-grid p code,
.blurb code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--sunken);
}

/* ---- footer ---- */

footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

footer p {
  margin: 0 0 0.6rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

@media (max-width: 34rem) {
  .langbar {
    justify-content: center;
  }

  .masthead {
    padding-top: 2.25rem;
  }

  .masthead h1 {
    font-size: 2rem;
  }

  .primary-download {
    display: flex;
    justify-content: center;
  }
}
