/* Substrate -------------------------------------------------------------------
   The project page. Builds on styles.css: same tokens, same type. The game's
   own frames carry the colour here, so the page stays quiet around them;
   Sodium only marks the two asks: the trailer and the playtest. */

.sb h3 {
  margin: 0;
  font-weight: 500;
  font-size: 1.1875rem;
  line-height: 1.3;
}

/* Hero ---------------------------------------------------------------------- */

.sb-hero {
  padding-block: clamp(2rem, 6cqw, 5rem) clamp(3rem, 6cqw, 5rem);
}

.sb-trail {
  margin: 0 0 clamp(1.5rem, 3cqw, 2.5rem);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-stretch: 100%;
  color: var(--dust);
}

.sb-trail a {
  text-decoration: underline;
  text-decoration-color: rgb(166 158 145 / 0.5);
  text-underline-offset: 0.2em;
  transition: color 150ms ease;
}

.sb-trail a:hover {
  color: var(--regolith);
}

/* The project lockup: frames nested inside frames, and one small figure. */
.sb-product {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 clamp(1.25rem, 2.5cqw, 2rem);
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.2rem + 1cqw, 2rem);
  font-weight: 640;
  line-height: 1;
}

.sb-mark {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.sb-mark rect {
  fill: none;
  stroke: var(--regolith);
}

.sb-mark-f1 { stroke-width: 2.5; }
.sb-mark-f2 { stroke-width: 1.6; stroke-opacity: 0.6; }
.sb-mark-f3 { stroke-width: 1; stroke-opacity: 0.35; }

.sb-mark .sb-mark-suit {
  fill: var(--sodium);
  stroke: none;
}

.sb-headline {
  font-size: clamp(3rem, 0.6rem + 6.8cqw, 8.25rem);
  line-height: 0.92;
  text-wrap: balance;
}

.sb-headline span {
  display: block;
}

.sb-lede {
  display: grid;
  justify-items: start;
  gap: 2rem;
  margin-top: clamp(1.75rem, 3cqw, 2.75rem);
}

.sb-lede .intro {
  max-width: 40ch;
  margin: 0;
}

.sb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.sb-status {
  margin: -0.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-stretch: 100%;
  color: var(--dust);
}

/* Frames from the game ------------------------------------------------------- */

.sb picture,
.sb picture img {
  display: block;
  width: 100%;
  height: auto;
}

.sb picture {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #0c0b0a;
  box-shadow: 0 0 0 1px var(--hairline);
}

.sb figure {
  margin: 0;
}

.sb figcaption {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-stretch: 100%;
  line-height: 1.5;
  color: var(--dust);
  text-wrap: pretty;
}

.sb .sb-plate {
  margin-inline: auto;
  padding-bottom: clamp(4rem, 9cqw, 8rem);
}

/* Sections ------------------------------------------------------------------ */

.sb-section {
  padding-block: clamp(3.5rem, 8cqw, 7rem);
  border-top: 1px solid var(--hairline);
}

.sb-section-head {
  display: grid;
  gap: 1rem;
  max-width: 50rem;
  margin-bottom: clamp(2.5rem, 5cqw, 4rem);
}

.sb-section-head p {
  max-width: 52ch;
  margin: 0;
  font-size: 1.1875rem;
  color: var(--dust);
  text-wrap: pretty;
}

.sb-h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 1rem + 3.2cqw, 3.75rem);
  font-weight: 640;
  letter-spacing: -0.01em;
  line-height: 1;
  text-wrap: balance;
}

/* The trailer: one frame of it, and a way through to YouTube. --------------- */

.trailer {
  position: relative;
  display: block;
  border-radius: 6px;
  text-decoration: none;
}

.trailer picture {
  transition: filter 300ms ease;
}

.trailer::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(to top, rgb(16 18 21 / 0.82), rgb(16 18 21 / 0) 55%);
  pointer-events: none;
}

.trailer-play {
  position: absolute;
  z-index: 1;
  left: clamp(1rem, 3cqw, 2.5rem);
  bottom: clamp(1rem, 3cqw, 2.5rem);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0 1.75rem 0 1.25rem;
  border-radius: 999px;
  background: var(--sodium);
  color: var(--basalt);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1;
  transition: background-color 150ms ease;
}

.trailer-play svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: currentColor;
}

.trailer-meta {
  position: absolute;
  z-index: 1;
  right: clamp(1rem, 3cqw, 2.5rem);
  bottom: clamp(1rem, 3cqw, 2.5rem);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-stretch: 100%;
  line-height: 52px;
  color: var(--regolith);
}

.trailer:hover .trailer-play {
  background: var(--sodium-lift);
}

.trailer:hover picture {
  filter: brightness(1.08);
}

/* The world ------------------------------------------------------------------- */

.world {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1.5rem clamp(2rem, 6cqw, 6rem);
  align-items: start;
}

.world .sb-section-head {
  margin: 0;
}

.world-copy p {
  max-width: 52ch;
  margin: 0 0 1.25rem;
  font-size: 1.1875rem;
  text-wrap: pretty;
}

.world-copy p:last-child {
  margin-bottom: 0;
}

/* How it plays: five steps in a row of rails. ------------------------------- */

.play {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem clamp(1rem, 2cqw, 2rem);
  margin: 0;
  counter-reset: step;
}

.play-group {
  padding-top: 1rem;
  border-top: 1.5px solid var(--regolith);
  counter-increment: step;
}

.play-group::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 1.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-stretch: 100%;
  color: var(--dust);
}

.sb .play-group h3 {
  font-family: var(--display);
  font-size: clamp(1.25rem, 0.9rem + 0.8cqw, 1.625rem);
  font-weight: 640;
  line-height: 1.05;
}

.play-group p {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--dust);
  text-wrap: pretty;
}

/* The gallery, in the trailer's order. --------------------------------------- */

.act + .act {
  margin-top: clamp(3rem, 7cqw, 6rem);
}

.act-title {
  margin: 0 0 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}

.sb .act-title {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dust);
}

.act-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3cqw, 2.5rem) clamp(1rem, 2cqw, 1.5rem);
}

.shot-wide {
  grid-column: 1 / -1;
}

/* Close ----------------------------------------------------------------------- */

.sb-close .sb-section-head {
  margin-bottom: 0;
}

.sb-close .sb-actions {
  margin-top: clamp(2rem, 4cqw, 3rem);
}

.button-quiet {
  border: 1px solid rgb(236 229 216 / 0.32);
  background: none;
  color: var(--regolith);
  transition: border-color 150ms ease, translate 150ms ease;
}

.button-quiet:hover {
  border-color: rgb(236 229 216 / 0.7);
  background: none;
}

/* Smaller screens ------------------------------------------------------------ */

@media (max-width: 1023px) {
  .world {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The steps turn vertical: the rail runs down the left edge. */
  .play {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .play-group {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    padding: 0 0 1.75rem 1.25rem;
    border-top: 0;
    border-left: 1.5px solid var(--regolith);
  }

  .play-group > * {
    grid-column: 2;
  }

  .play-group::before {
    grid-row: 1;
    margin: 0;
    line-height: 2.1;
  }

  .play-group p {
    max-width: 52ch;
  }
}

@media (max-width: 719px) {
  .act-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* No room for the label over the frame: it moves under it. */
  .trailer::after {
    display: none;
  }

  .trailer-play {
    position: static;
    margin-top: 1rem;
  }

  .trailer-meta {
    position: static;
    display: block;
    margin-top: 0.25rem;
    line-height: 1.5;
    color: var(--dust);
  }
}

@media (max-width: 480px) {
  .sb-headline {
    font-stretch: 88%;
    font-size: clamp(2.5rem, 1rem + 8.4cqw, 3.25rem);
  }

  .trailer-play {
    width: 100%;
    justify-content: center;
  }
}

@media (forced-colors: active) {
  .sb-mark rect { stroke: CanvasText; }
  .sb-mark .sb-mark-suit { fill: Highlight; }
  .trailer-play { border: 2px solid ButtonText; }
}
