/* The downloads page: one card per client with its recommended install,
   the steps after installing, the web chat and the older versions.
   Only var(--...) from /brand/tokens.css. */

.dl-page {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 7vw, 5.5rem) 0 var(--space-section);
}

.dl-aura {
  position: absolute;
  top: -30%;
  left: 50%;
  width: min(80rem, 140vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
  background: radial-gradient(closest-side, var(--color-accent-soft), var(--color-clear));
  opacity: 0.45;
  pointer-events: none;
}

.dl-page > .container {
  position: relative;
}

.dl-head {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  max-width: 46rem;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}

.dl-head h1 {
  margin: 0;
  font-size: var(--font-size-display);
  line-height: 0.98;
  letter-spacing: var(--tracking-display);
}

.dl-lead {
  margin: 0;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.5;
  color: var(--color-text-muted);
}

.dl-detected {
  margin: 0;
  padding: 0.35rem var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.dl-detected [hidden] {
  display: none;
}

/* Product cards */

.dl-products {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  align-items: stretch;
}

.dl-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.dl-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.dl-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transform: scale(1.02);
  transition: transform 0.8s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.dl-card-body {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
}

.dl-card-body > p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: var(--line-height-body);
}

.dl-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.dl-card-title h2 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-title);
}

/* The install box inside a card: aligned to the left, not centred. */
.dl-card .get {
  text-align: left;
}

.dl-card .get-ctas {
  justify-content: flex-start;
}

.dl-card .get-note,
.dl-card .get-alt {
  justify-self: start;
  text-align: left;
}

.dl-card .get-cmd {
  justify-items: stretch;
}

.dl-card .get-cmd-row {
  justify-self: stretch;
}

.dl-card .get-cmd-row code {
  font-size: var(--font-size-xs);
}

/* The web chat has its own card below: no second link in naos code. */
.dl-card .get-ctas a[href$="/chat"] {
  display: none;
}

.dl-card-body {
  align-content: start;
}

/* Other systems and files of a card */

.dl-more {
  border-top: 1px solid var(--color-border);
}

.dl-more summary,
.dl-older summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.dl-more summary::-webkit-details-marker,
.dl-older summary::-webkit-details-marker {
  display: none;
}

.dl-more summary::after,
.dl-older summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.dl-more[open] summary::after,
.dl-older[open] summary::after {
  transform: rotate(225deg);
}

.dl-more summary:hover,
.dl-older summary:hover {
  color: var(--color-text);
}

.dl-files {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-5) var(--space-5);
  display: grid;
  gap: var(--space-4);
}

.dl-file {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  min-width: 0;
}

.dl-file-head {
  display: grid;
  gap: 0.15rem;
}

.dl-file-meta,
.dl-file-note,
.dl-sum {
  font-family: var(--font-mono);
  font-size: var(--font-size-2xs);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.dl-file-body,
.dl-file-note {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.dl-file-body {
  color: var(--color-text-muted);
}

.dl-cmd {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.dl-cmd code {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--font-size-2xs);
  background: none;
}

.dl-file-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.dl-sum code {
  background: none;
  font-size: inherit;
}

/* After installing */

.dl-steps {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.dl-steps h2 {
  margin: 0 0 var(--space-6);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-title);
  text-align: center;
}

.dl-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  counter-reset: none;
}

.dl-steps li {
  display: grid;
  align-content: start;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.dl-step-n {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-full);
  background: var(--color-inverse-bg);
  color: var(--color-inverse-text);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

.dl-steps li b {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: var(--font-weight-medium);
}

.dl-steps li p {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
  line-height: 1.55;
  color: var(--color-text-muted);
}

.dl-steps li code {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--color-term-bg);
  color: var(--color-term-text);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

.dl-steps-foot {
  margin: var(--space-5) 0 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

/* Web chat */

.dl-web {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-inverse-bg);
  color: var(--color-inverse-text);
  text-decoration: none;
}

.dl-web b {
  font-weight: var(--font-weight-medium);
}

.dl-web-cta {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-term-ask);
}

/* Older versions */

.dl-older {
  margin-top: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.dl-table-wrap {
  overflow-x: auto;
  padding: 0 var(--space-5) var(--space-5);
}

.dl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.dl-table th {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.dl-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.dl-table tr:last-child td {
  border-bottom: 0;
}

.dl-sha {
  font-family: var(--font-mono);
  font-size: var(--font-size-2xs);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
  background: none;
}

@media (min-width: 52rem) {
  /* The desktop app first and across, the other clients two by two below. */
  .dl-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dl-card-main {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }

  .dl-card-main .dl-media {
    grid-row: 1 / -1;
    aspect-ratio: auto;
    min-height: 100%;
    border-bottom: 0;
    border-right: 1px solid var(--color-border);
  }

  .dl-card-main .dl-card-body {
    align-content: center;
    padding: var(--space-6);
  }

  .dl-card-main .dl-card-title h2 {
    font-size: var(--font-size-2xl, var(--font-size-xl));
  }

  .dl-card-main .dl-more {
    grid-column: 2;
  }

  .dl-steps ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dl-steps li {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .dl-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
  }

  .dl-card:hover .dl-video {
    transform: scale(1.06);
  }

  .js .dl-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.9, 0.2, 1);
  }

  .js .dl-reveal.in {
    opacity: 1;
    transform: none;
  }

  .js .dl-products > .dl-reveal:nth-child(2) { transition-delay: 0.08s; }
  .js .dl-products > .dl-reveal:nth-child(3) { transition-delay: 0.16s; }
}
