/* The download page: Mobile and Desktop side by side, each one inset grouped
   list. The platform that is out is a large row with its button; the ones
   coming are quiet rows under it. Each group is a link target (#mobile,
   #desktop), kept clear of the masthead by html's scroll-padding-top. */

.downloads {
  display: grid;
  gap: 48px 32px;
  align-items: start;
}

@media (min-width: 1000px) {
  .downloads {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.download-group h2 {
  margin-bottom: 16px;
  font-size: var(--title-3);
  letter-spacing: var(--track-title-3);
}

/* The line under the desktop downloads, to the post on why it is needed. */
.download-why {
  margin: 12px 0 0;
  text-align: center;
}

.platform-art {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-button);
  background: var(--fill-2);
  color: var(--label);
}

.platform-art svg {
  width: 24px;
  height: 24px;
}

.platform.is-ready {
  grid-template-columns: auto minmax(0, 1fr);
  padding: 24px 20px;
}

.platform.is-ready .platform-art {
  width: 56px;
  height: 56px;
  border-radius: var(--r-group);
  background: var(--tint-fill);
  color: var(--tint);
}

.platform.is-ready .platform-art svg {
  width: 30px;
  height: 30px;
}

.platform.is-ready .group-copy b {
  font-size: var(--title-3);
  letter-spacing: var(--track-title-3);
}

.platform.is-ready .button {
  grid-column: 2;
  justify-self: start;
  margin-top: 12px;
}

.platform.is-soon {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

/* The hairline starts where the words do. */
.platform + .platform {
  --inset: 80px;
}

.platform.is-soon .group-copy b,
.platform.is-soon .platform-art {
  color: var(--label-2);
}

.terminal-install {
  margin-top: clamp(48px, 6vw, 72px);
  text-align: center;
}

@media (min-width: 1000px) {
  .terminal-install {
    width: calc((100% - 32px) / 2);
    margin-inline: auto;
  }
}

.terminal-install h2 {
  font-size: var(--title-3);
  letter-spacing: var(--track-title-3);
}

.install-lede {
  max-width: 60ch;
  margin: 8px auto 0;
  color: var(--label-2);
  font-size: var(--callout);
  line-height: 1.5;
}

.install-switch {
  position: relative;
  display: none;
  grid-template-columns: repeat(2, minmax(124px, 1fr));
  width: max-content;
  margin: 32px auto 18px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--fill);
}

.install-control[data-install-ready] .install-switch {
  display: grid;
}

.install-switch button {
  position: relative;
  z-index: 1;
  min-height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--label-2);
  font-size: var(--footnote);
  font-weight: 600;
  letter-spacing: var(--track-footnote);
  transition: color var(--fast) var(--ease-out-soft);
}

.install-switch button:hover,
.install-switch button[aria-pressed="true"] {
  color: var(--label);
}

.install-switch button:focus-visible {
  outline-offset: -2px;
}

.install-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: var(--r-pill);
  background: #5c5d62;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 3px 8px rgba(0, 0, 0, 0.18);
  transition: translate var(--spring-snappy-ms) var(--spring-snappy);
}

@media (prefers-color-scheme: light) {
  .install-thumb {
    background: #ffffff;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04), 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
  }
}

.install-switch[data-install-switch="windows"] .install-thumb {
  translate: 100% 0;
}

.install-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.install-control[data-install-ready] .install-panels {
  margin-top: 0;
}

.install-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 60px;
  padding: 0 12px 0 18px;
  border-radius: var(--r-group);
  background: var(--term-bg);
  color: var(--term-fg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.install-prompt {
  flex: none;
  color: var(--term-fg);
  font-family: var(--mono);
  font-size: var(--footnote);
  font-weight: 600;
  letter-spacing: -0.04em;
  opacity: 0.55;
  user-select: none;
}

.install-panel code {
  flex: 1;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-family: var(--mono);
  font-size: var(--footnote);
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-copy {
  display: none;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--term-fg);
  opacity: 0.55;
  transition:
    background-color var(--fast) var(--ease-out-soft),
    opacity var(--fast) var(--ease-out-soft);
}

.install-control[data-install-ready] .install-copy {
  display: grid;
}

.install-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.install-copy[data-copied] {
  opacity: 1;
}

.install-icon {
  width: 18px;
  height: 18px;
}

.install-icon-check {
  display: none;
  color: #5fd6bf;
}

.install-copy[data-copied] .install-icon-copy {
  display: none;
}

.install-copy[data-copied] .install-icon-check {
  display: block;
}

.join-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-panel);
  background: var(--surface);
  color: var(--label);
  box-shadow: var(--shadow-float), var(--highlight);
  overflow: hidden;
}

.join-dialog[open] {
  display: flex;
  flex-direction: column;
  height: min(86vh, 880px);
  height: min(86dvh, 880px);
}

.join-dialog::backdrop {
  background: rgba(0, 0, 0, 0.56);
}

.join-dialog-head {
  display: flex;
  flex: none;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  box-shadow: inset 0 -0.5px 0 var(--hairline);
}

.join-dialog-head h2 {
  font-size: var(--title-3);
  letter-spacing: var(--track-title-3);
}

.join-dialog-body {
  flex: 1;
  min-height: 0;
  background: #ffffff;
}

.join-dialog iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.join-dialog-note {
  flex: none;
  padding: 10px 20px;
  color: var(--label-2);
  font-size: var(--caption);
  line-height: 1.45;
}

.join-dialog-note a {
  color: var(--tint);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

body:has(.join-dialog[open]) {
  overflow: hidden;
}

@media (max-width: 560px) {
  .platform.is-ready .button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .join-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: var(--r-group);
  }

  .join-dialog[open] {
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
  }

  .join-dialog-head {
    padding: 12px 16px;
  }

  .join-dialog-note {
    padding: 8px 16px;
  }

  .install-switch {
    grid-template-columns: repeat(2, minmax(108px, 1fr));
    margin: 20px auto 14px;
  }

  .install-switch button {
    padding: 0 14px;
  }

  .install-panel {
    gap: 10px;
    min-height: 54px;
    padding: 0 8px 0 14px;
  }
}
