.downloads-page {
  background: var(--canvas);
}

.downloads-main {
  min-height: calc(100vh - 3.5rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.downloads-hero {
  display: grid;
  max-width: 58rem;
  gap: var(--space-4);
  padding-top: clamp(4.5rem, 9vw, 7rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.downloads-eyebrow {
  color: var(--accent);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: 0.035em;
}

.downloads-hero h1 {
  font-size: clamp(3.25rem, 7vw, 6rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.downloads-hero > p:last-child {
  max-width: 42rem;
  color: var(--ink-secondary);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
}

.download-platforms {
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: clamp(1.25rem, 2vw, 1.75rem);
  background: var(--line);
  box-shadow: var(--shadow-sm);
}

.download-card {
  display: grid;
  min-width: 0;
  min-height: 18.5rem;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  gap: 1.15rem;
  padding: 1.35rem 1rem 1.2rem;
  background: var(--surface);
  text-align: center;
  transition: background var(--duration-fast) ease;
}

.download-card:hover,
.download-card:focus-within {
  background: color-mix(in srgb, var(--surface) 88%, var(--accent-soft));
}

.platform-mark {
  display: grid;
  width: 3.75rem;
  height: 3.75rem;
  place-items: center;
  margin-inline: auto;
  border: 1px solid color-mix(in srgb, currentColor 13%, transparent);
  border-radius: 1.15rem;
  background: linear-gradient(145deg, #edf4ff, #dceaff);
  color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 0.65rem 1.4rem rgba(25, 66, 126, 0.08);
}

.platform-mark img {
  display: block;
  width: 1.95rem;
  height: 1.95rem;
}

.platform-mark.is-macos {
  background: linear-gradient(145deg, #f7f8fa, #e6e9ef);
  color: #1f2937;
}

.platform-mark.is-linux {
  background: linear-gradient(145deg, #fff8e8, #ffedbd);
  color: #8a5700;
}

.platform-mark.is-android {
  background: linear-gradient(145deg, #effbea, #d9f5cf);
  color: #328523;
}

.platform-mark.is-iphone {
  background: linear-gradient(145deg, #f3f1ff, #e4e0fb);
  color: #443d74;
}

.download-card-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  justify-items: center;
  gap: 0.42rem;
}

.download-card h2 {
  font-size: 1.32rem;
  letter-spacing: -0.025em;
  line-height: 1.1;
  white-space: nowrap;
}

.download-client {
  color: var(--ink-secondary);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.download-version {
  display: inline-flex;
  min-height: 1.35rem;
  align-items: center;
  justify-content: center;
  padding-inline: 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.download-support {
  color: var(--ink-tertiary);
  font-size: 0.76rem;
  line-height: 1.3;
  white-space: nowrap;
}

.download-card-note {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-tertiary);
  font-size: 0.66rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-actions {
  display: grid;
  width: 100%;
  align-self: end;
  gap: 0.55rem;
}

.download-actions .button {
  width: 100%;
  min-height: 2.35rem;
  padding-inline: 0.6rem;
  font-size: 0.76rem;
}

.download-variants {
  display: flex;
  min-height: 1.15rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-size: 0.68rem;
  line-height: 1.25;
}

.download-variants .text-link,
.download-variant-note {
  font-size: inherit;
  white-space: nowrap;
}

.download-variants .text-link {
  display: inline-flex;
  min-height: 1.5rem;
  align-items: center;
  padding-inline: 0.25rem;
}

.download-variant-note {
  color: var(--ink-tertiary);
}

.download-source-note {
  margin-top: var(--space-3);
  color: var(--ink-tertiary);
  font-size: var(--text-caption);
  text-align: center;
}

.download-tools {
  display: grid;
  gap: var(--space-4);
  padding-bottom: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
}

.download-tools-header {
  display: grid;
  max-width: 44rem;
  gap: var(--space-2);
  padding-top: clamp(3rem, 6vw, 5rem);
}

.download-tools-header h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.download-tools-header > p:last-child {
  color: var(--ink-secondary);
  line-height: 1.55;
}

.download-tool-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 0.3fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: clamp(1rem, 2vw, 1.5rem);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.download-tool-copy {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
}

.download-tool-copy h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  letter-spacing: -0.025em;
}

.download-tool-copy > p:last-child {
  margin-top: 0.2rem;
  color: var(--ink-secondary);
  font-size: var(--text-small);
  line-height: 1.5;
}

.download-tool-actions {
  display: grid;
  justify-items: stretch;
  gap: 0.55rem;
}

.download-tool-actions .button {
  width: 100%;
}

.download-tool-meta {
  color: var(--ink-tertiary);
  font-size: var(--text-caption);
  text-align: center;
}

.download-guide {
  display: grid;
  grid-template-columns: minmax(13rem, 0.45fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  padding-top: clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--line);
}

.download-guide header {
  display: grid;
  align-content: start;
  gap: var(--space-3);
}

.download-guide h2 {
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.download-steps {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.download-steps li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: var(--space-4);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--line);
}

.download-steps li > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: var(--text-small);
  font-weight: 700;
}

.download-steps h3 {
  font-size: 1.05rem;
}

.download-steps p {
  margin-top: var(--space-1);
  color: var(--ink-secondary);
  line-height: 1.55;
}

.download-guide-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (max-width: 54rem) {
  .downloads-main {
    padding-bottom: 3rem;
  }

  .downloads-hero {
    gap: 0.55rem;
    padding-top: 1.75rem;
    padding-bottom: 1.35rem;
  }

  .downloads-hero h1 {
    font-size: clamp(2.55rem, 12vw, 3.35rem);
    line-height: 1;
  }

  .downloads-hero > p:last-child {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .download-platforms {
    padding-bottom: 2.5rem;
  }

  .download-grid {
    grid-template-columns: 1fr;
    gap: 1px;
    border-radius: 1.2rem;
  }

  .download-card {
    min-height: 7.1rem;
    grid-template-columns: 2.65rem minmax(0, 1fr) minmax(6.2rem, 0.52fr);
    grid-template-rows: none;
    align-content: center;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    text-align: left;
  }

  .platform-mark {
    width: 2.65rem;
    height: 2.65rem;
    margin-inline: 0;
    border-radius: 0.82rem;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.82),
      0 0.35rem 0.8rem rgba(25, 66, 126, 0.07);
  }

  .platform-mark img {
    width: 1.4rem;
    height: 1.4rem;
  }

  .download-card-copy {
    justify-items: start;
    gap: 0.24rem;
  }

  .download-card h2 {
    font-size: 1rem;
    letter-spacing: -0.015em;
  }

  .download-client,
  .download-support,
  .download-card-note {
    font-size: 0.64rem;
  }

  .download-version {
    min-height: 1.1rem;
    padding-inline: 0.38rem;
    font-size: 0.58rem;
  }

  .download-actions {
    align-self: center;
    gap: 0.35rem;
  }

  .download-actions .button {
    min-height: 2.5rem;
    padding-inline: 0.35rem;
    font-size: 0.68rem;
  }

  .download-variants {
    min-height: 1rem;
    gap: 0.45rem;
    font-size: 0.6rem;
    line-height: 1.3;
  }

  .download-source-note {
    display: none;
  }

  .download-tools {
    gap: 1rem;
    padding-bottom: 2.5rem;
  }

  .download-tools-header {
    gap: 0.45rem;
    padding-top: 2rem;
  }

  .download-tools-header h2 {
    font-size: clamp(1.9rem, 9vw, 2.55rem);
  }

  .download-tool-card {
    grid-template-columns: 2.65rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.8rem;
  }

  .download-tool-card .platform-mark {
    align-self: start;
  }

  .download-tool-copy h3 {
    font-size: 1.05rem;
  }

  .download-tool-copy .download-client,
  .download-tool-copy .download-version {
    font-size: 0.64rem;
  }

  .download-tool-copy > p:last-child {
    font-size: 0.72rem;
  }

  .download-tool-actions {
    grid-column: 2;
  }

  .download-tool-actions .button {
    min-height: 2.15rem;
    font-size: 0.72rem;
  }

  .download-card--iphone {
    grid-column: 1;
  }

  .download-card--iphone .download-variant-note {
    display: none;
  }

  .download-guide {
    grid-template-columns: 1fr;
  }

  .download-guide-actions {
    grid-column: 1;
  }
}

@media (max-width: 30rem) {
  .downloads-eyebrow {
    font-size: 0.78rem;
  }

  .download-guide-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .download-guide-actions .button {
    width: 100%;
  }
}
