/* Download landing page (issue #37). Follows the system light/dark
   preference with light-dark(); no build step. */

:root {
  color-scheme: light dark;
  --page: light-dark(#f6f8fa, #0b0d12);
  --panel: light-dark(#ffffff, #151a22);
  --line: light-dark(#d0d7de, #2a313c);
  --ink: light-dark(#1f2328, #e6edf3);
  --muted: light-dark(#57606a, #9da7b3);
  --brand: light-dark(#1a7f37, #3fb950);
  --brand-ink: light-dark(#ffffff, #0b0d12);
  --bad: light-dark(#cf222e, #f85149);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    'Noto Sans',
    'Noto Sans Devanagari',
    'Noto Sans SC',
    sans-serif;
  line-height: 1.5;
  background: var(--page);
  color: var(--ink);
}

body {
  margin: 0;
}

a {
  color: var(--brand);
}

#root {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.locale select {
  font: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hero {
  padding: 48px 0 32px;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}

h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.tagline {
  max-width: 640px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1.1rem;
}

.status {
  color: var(--muted);
}
/* Still checking the release: the app's turning arc (R-Y84). */
.status.loading::before {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.5em;
  vertical-align: -0.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: status-turn 0.75s linear infinite;
}
@keyframes status-turn {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .status.loading::before {
    animation-duration: 3s;
  }
}

.primary-download,
.button {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 22px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
  font-weight: 600;
}

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

.primary-download.unavailable {
  background: var(--panel);
  color: var(--muted);
  border: 1px dashed var(--line);
}

.os-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.os-tabs button {
  font: inherit;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.os-tabs button[aria-pressed='true'] {
  border-color: var(--brand);
  color: var(--brand);
}

.links,
footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.card {
  margin: 20px 0;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.card h2 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.group h3 {
  margin: 0 0 8px;
}

.download {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

a.download:hover {
  border-color: var(--brand);
}

.download .meta {
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.download.unavailable {
  opacity: 0.6;
}

.note {
  color: var(--muted);
}

.command {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--page);
  border: 1px solid var(--line);
}

.command code {
  flex: 1;
  overflow-wrap: anywhere;
}

.copy {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
}

dt {
  font-weight: 600;
  margin-top: 12px;
}

dd {
  margin: 4px 0 0;
}

.inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.inputs label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.result.match {
  color: var(--brand);
}

.result.mismatch,
.result.missing {
  color: var(--bad);
}

footer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
