/* Game select landing at the top of the home page. Extends the tokens in styles.css. */
.gs {
  padding: 2rem 0 3.5rem;
  overflow: hidden;
}

.gs-head {
  display: grid;
  gap: 0.5rem 2.5rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.gs-head h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  max-width: 16ch;
  margin: 0;
}

.gs-head .lead {
  margin: 0 0 0.9rem;
  max-width: 34rem;
}

.gs-head .actions {
  margin-top: 0;
}

/* Four parallelogram slices. --k is the horizontal offset of the slant (about 8 degrees at full height). */
.gs-slices {
  --k: 96px;
  --gap: 6px;
  display: flex;
  width: min(1440px, calc(100% - 2.5rem));
  height: clamp(560px, 82vh, 820px);
  margin-inline: auto;
  padding-right: calc(var(--k) - var(--gap));
}

.gs-slice {
  --g: var(--accent);
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin-right: calc(var(--gap) - var(--k));
  color: var(--text);
  text-decoration: none;
  outline: none;
  transition: flex-grow var(--speed) var(--ease), filter var(--speed) var(--ease);
}

.gs-slice:hover {
  color: var(--text);
}

.gs-shape,
.gs-art {
  position: absolute;
  clip-path: polygon(var(--k) 0, 100% 0, calc(100% - var(--k)) 100%, 0 100%);
}

.gs-shape {
  inset: 0;
  background: rgba(237, 239, 242, 0.14);
  transition: background-color var(--speed) var(--ease);
}

.gs-art {
  inset: 2px 3px;
  overflow: hidden;
  background: var(--surface);
}

.gs-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 20%);
  filter: grayscale(1) brightness(0.5);
  transform: scale(1);
  transition: filter var(--speed) var(--ease), transform 900ms var(--ease);
}

.gs-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 20, 32, 0) 45%, rgba(13, 20, 32, 0.92) 100%);
}

.gs-vname,
.gs-body,
.gs-go {
  position: absolute;
  z-index: 1;
}

.gs-vname {
  left: calc(var(--k) * 0.35);
  bottom: 2rem;
  writing-mode: vertical-rl;
  transform: rotate(188deg);
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.9vw, 1.7rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 160ms var(--ease);
}

.gs-body {
  left: 1.6rem;
  right: calc(var(--k) + 4.5rem);
  bottom: 1.6rem;
  display: grid;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity 160ms var(--ease);
}

.gs-name {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.gs-beta {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--g);
  border-radius: 3px;
  color: var(--g);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gs-hook {
  max-width: 26rem;
  min-width: 15rem;
  font-size: 1rem;
  line-height: 1.45;
}

.gs-cta {
  color: var(--g);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.gs-go {
  right: calc(var(--k) + 0.6rem);
  bottom: 1.6rem;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid rgba(237, 239, 242, 0.75);
  border-radius: 999px;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.gs-go svg {
  width: 18px;
  height: 18px;
  transform: rotate(90deg);
  transition: transform var(--speed) var(--ease);
}

/*
  The open slice. Without JS: CSS hover and focus, and the default slice when nothing is hovered.
  With JS: .is-active, so moving between slices never leaves a gap with nothing open.
*/
@media (min-width: 1024px) {
  .gs-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .gs-slices:not(.gs-js):hover .gs-slice:hover,
  .gs-slices:not(.gs-js) .gs-slice:focus-visible,
  .gs-slices:not(.gs-js):not(:hover):not(:focus-within) .gs-slice.is-default,
  .gs-slice.is-active {
    flex-grow: 2.3;
    filter: drop-shadow(0 0 16px color-mix(in srgb, var(--g) 55%, transparent));
  }

  .gs-slices:not(.gs-js):hover .gs-slice:hover .gs-vname,
  .gs-slices:not(.gs-js) .gs-slice:focus-visible .gs-vname,
  .gs-slices:not(.gs-js):not(:hover):not(:focus-within) .gs-slice.is-default .gs-vname,
  .gs-slice.is-active .gs-vname {
    opacity: 0;
  }

  .gs-slices:not(.gs-js):hover .gs-slice:hover .gs-body,
  .gs-slices:not(.gs-js) .gs-slice:focus-visible .gs-body,
  .gs-slices:not(.gs-js):not(:hover):not(:focus-within) .gs-slice.is-default .gs-body,
  .gs-slice.is-active .gs-body {
    opacity: 1;
    transition-delay: 90ms;
  }
}

.gs-slices:not(.gs-js):hover .gs-slice:hover .gs-shape,
.gs-slices:not(.gs-js) .gs-slice:focus-visible .gs-shape,
.gs-slices:not(.gs-js):not(:hover):not(:focus-within) .gs-slice.is-default .gs-shape,
.gs-slice.is-active .gs-shape {
  background: var(--g);
}

.gs-slices:not(.gs-js):hover .gs-slice:hover img,
.gs-slices:not(.gs-js) .gs-slice:focus-visible img,
.gs-slices:not(.gs-js):not(:hover):not(:focus-within) .gs-slice.is-default img,
.gs-slice.is-active img {
  filter: none;
  transform: scale(1.04);
}

.gs-slices:not(.gs-js):hover .gs-slice:hover .gs-go,
.gs-slices:not(.gs-js) .gs-slice:focus-visible .gs-go,
.gs-slices:not(.gs-js):not(:hover):not(:focus-within) .gs-slice.is-default .gs-go,
.gs-slice.is-active .gs-go {
  background: var(--g);
  border-color: var(--g);
  color: var(--bg);
}

.gs-slices:not(.gs-js):hover .gs-slice:hover .gs-go svg,
.gs-slices:not(.gs-js) .gs-slice:focus-visible .gs-go svg,
.gs-slices:not(.gs-js):not(:hover):not(:focus-within) .gs-slice.is-default .gs-go svg,
.gs-slice.is-active .gs-go svg {
  transform: rotate(0deg);
}

/* Phones and tablets: wide angled bands. With JS, the band nearest the middle of the screen lights up. */
@media (max-width: 1023px) {
  .gs-slices {
    --k: 0px;
    --m: 16px;
    flex-direction: column;
    width: 100%;
    height: auto;
    padding: 0;
  }

  .gs-slice {
    flex: none;
    height: max(22vh, 150px);
    margin: 0 0 calc(4px - var(--m));
  }

  .gs-shape,
  .gs-art {
    clip-path: polygon(0 var(--m), 100% 0, 100% calc(100% - var(--m)), 0 100%);
  }

  .gs-art {
    inset: 2px 0;
  }

  .gs-art img {
    filter: brightness(0.8);
    object-position: var(--pos-m, 50% 25%);
  }

  .gs-js .gs-slice:not(.is-active) .gs-art img {
    filter: grayscale(1) brightness(0.5);
  }

  .gs-art::after {
    background: linear-gradient(90deg, rgba(13, 20, 32, 0.9) 0%, rgba(13, 20, 32, 0.3) 70%, rgba(13, 20, 32, 0) 100%);
  }

  .gs-vname,
  .gs-cta {
    display: none;
  }

  .gs-body {
    left: 1.25rem;
    right: 5rem;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
  }

  .gs-name {
    font-size: 1.5rem;
    white-space: normal;
    flex-wrap: wrap;
  }

  .gs-hook {
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .gs-go {
    right: 1.25rem;
    bottom: auto;
    top: 50%;
    margin-top: -23px;
  }
}

/* Short text strip under the slices: what TCG Machine is, and where to read more. */
.gs-more {
  padding: 0 0 3.5rem;
}

.gs-more-inner {
  display: grid;
  gap: 1.25rem 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.gs-more h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  max-width: 26ch;
}

.gs-more p {
  color: var(--muted);
  max-width: 40rem;
}

.gs-more-links {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gs-more-links a {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0;
}

@media (min-width: 1024px) {
  .gs-more-inner {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}

/* Reduced motion: colour change only. No widening, no push in. */
@media (prefers-reduced-motion: reduce) {
  .gs-slices .gs-slice {
    flex-grow: 1 !important;
  }

  .gs-art img {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) and (min-width: 1024px) {
  .gs-vname {
    display: none;
  }

  .gs-body {
    opacity: 1 !important;
    left: 1.2rem;
    right: calc(var(--k) + 0.6rem);
    bottom: 5rem;
  }

  .gs-name {
    font-size: 1.35rem;
    white-space: normal;
    flex-wrap: wrap;
  }

  .gs-hook,
  .gs-cta {
    display: none;
  }
}
