/* The store page: a gallery of the apps. It uses the tokens of site.css and follows the theme, as the other pages. */

.error {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-radius: 10px;
  border-left: 5px solid var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, var(--paper));
  color: var(--ink);
}

/* the first part: the title, and the panel of the USB link */
.st-hero {
  padding: clamp(32px, 5vw, 64px) 0 clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.st-hero-in {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
}

.st-head h1 {
  margin: 0 0 14px;
}

.st-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-2);
  max-width: 48ch;
  margin: 0;
}

.link-card {
  padding: 22px 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--raised);
}

.link-card h2 {
  font-size: 1.3rem;
  margin: 0 0 8px;
}

.link-card p {
  color: var(--ink-2);
  margin: 0 0 16px;
}

.link-note {
  font-size: 0.95rem;
}

.link-board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.link-board b {
  display: block;
  font-family: var(--font-d);
  font-stretch: 112%;
  font-weight: 620;
  font-size: 1.15rem;
}

.link-board span {
  color: var(--ink-2);
}

.dot {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 25%, transparent);
}

/* the bar over the gallery */
.st-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 18px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: 700 0.98rem/1 var(--font-b);
  cursor: pointer;
}

.chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.kind-pick {
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.kind-pick select {
  max-width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
}

/* the gallery */
.gallery {
  list-style: none;
  padding: 0;
  margin: 0 0 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  grid-auto-flow: dense;
  gap: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: var(--raised);
  border: 1px solid var(--line);
}

.card:hover {
  border-color: color-mix(in srgb, var(--ink) 35%, var(--line));
}

@media (min-width: 900px) {
  .card.wide {
    grid-column: span 2;
  }
}

.shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 640 / 172;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* the short video of a card: over the poster, it shows when it plays */
.shot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.shot video.on {
  opacity: 1;
}

/* an app with no preview: its own animated icon on a soft colour */
.shot.icon-only {
  display: grid;
  place-items: center;
  background: radial-gradient(70% 140% at 50% 0%, var(--tint, #3b2f9a), #07080d 75%);
}

.shot.icon-only canvas {
  height: 72%;
  width: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
  flex: 1;
}

.card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #0a0a20;
  image-rendering: pixelated;
}

.card-name {
  min-width: 0;
  flex: 1;
}

.card-name h3 {
  font-size: 1.18rem;
  margin: 0;
  line-height: 1.15;
}

.card-name h3 button {
  all: unset;
  cursor: pointer;
}

.card-name h3 button:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-2);
}

.tag.games {
  color: var(--violet);
}

.tag.tools {
  color: var(--teal);
}

.card-desc {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.97rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.card-meta {
  color: var(--ink-2);
  font-size: 0.88rem;
}

.card .btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.95rem;
}

/* in the gallery the install key of each card is quiet; the gold is for the window of one app */
.card .btn-primary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.card .btn-primary:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-gold);
}

.btn.done {
  border-color: var(--teal);
  color: var(--teal);
}

/* the progress of an install */
.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width 0.2s linear;
}

.card .bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0;
}

.card-msg {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.card-msg.bad,
.dlg-msg.bad {
  color: var(--bad);
}

.gallery .loading {
  grid-column: 1 / -1;
  padding: 40px 0;
  color: var(--ink-2);
  text-align: center;
}

/* the window of one app */
.app-dlg {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--raised);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: auto;
}

.app-dlg::backdrop {
  background: rgba(6, 7, 12, 0.72);
}

.dlg-media {
  background: #000;
}

.dlg-media img,
.dlg-media video {
  display: block;
  width: 100%;
  height: auto;
}

.dlg-media .shot video {
  position: static;
  opacity: 1;
}

.dlg-media .shot {
  width: 100%;
  height: auto;
}

.dlg-media .shot.icon-only {
  aspect-ratio: 640 / 200;
}

.dlg-body {
  padding: 18px 22px 22px;
}

.dlg-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.dlg-head .ico {
  width: 48px;
  height: 48px;
}

.dlg-head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.dlg-head > div {
  flex: 1;
}

.dlg-x {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.dlg-body > p {
  max-width: 72ch;
}

.he summary {
  cursor: pointer;
  color: var(--ink-2);
}

.facts-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 16px 0;
}

.facts-list dt {
  color: var(--ink-2);
}

.facts-list dd {
  margin: 0;
}

.dlg-extra {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.dlg-extra img {
  height: 160px;
  width: auto;
  border-radius: 10px;
  background: #000;
}

.dlg-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.dlg-msg {
  margin: 8px 0 0;
  color: var(--ink-2);
}

/* the part about the signatures */
.trust {
  max-width: 78ch;
  margin: 8px 0 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.trust h2 {
  font-size: 1.4rem;
}

.other-ways summary {
  cursor: pointer;
  font-weight: 700;
  margin-top: 12px;
}

.other-ways li {
  margin-bottom: 8px;
}

@media (max-width: 760px) {
  .st-hero-in {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shot video {
    transition: none;
  }
}
