/* scree® clear-backpack hero. Every size is N × --u, one pixel of a 1440 × 800 frame. */

.scree {
  --u: calc(100vw / 1440);
  --ground: #c3c3c3;
  --ink: #000;
  --paper: #fff;
  --eye: #d9d9d9;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  width: 100%;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font-family: Helvetica, "Helvetica Neue", Inter, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.scree.no-helvetica,
.no-helvetica .scree {
  font-family: Inter, Helvetica, sans-serif;
}

.scree *,
.scree *::before,
.scree *::after {
  box-sizing: border-box;
}

.scree-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.scree-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}

/* ---- Cascade ("block in") ---- */

.scree-blk {
  opacity: 0;
}

.scree.is-in .scree-blk {
  animation: scree-block-in 600ms var(--ease-expo) both;
  animation-delay: var(--d, 0ms);
}

@keyframes scree-block-in {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* ---- Chrome: buttons, logo, stash ---- */

.scree-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(115 * var(--u));
  height: calc(24 * var(--u));
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: calc(14 * var(--u));
  line-height: 1;
  letter-spacing: -0.08em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.scree-chip:focus-visible,
.scree-item-body:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: calc(3 * var(--u));
}

.scree-nav {
  position: absolute;
  top: calc(16 * var(--u));
  left: calc(16 * var(--u));
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, calc(115 * var(--u)));
  gap: calc(4 * var(--u));
}

.scree-logo {
  position: absolute;
  top: calc(16 * var(--u));
  left: 0;
  right: 0;
  z-index: 4;
  margin: 0;
  text-align: center;
  pointer-events: none;
}

.scree-logo span {
  display: inline-block;
  /* Balance the trailing tracking so the ink, not the box, sits on the centre. */
  padding-left: 0.11em;
  font-size: calc(38 * var(--u));
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.11em;
}

.scree-stash {
  position: absolute;
  top: calc(16 * var(--u));
  right: calc(16 * var(--u));
  z-index: 4;
}

/* ---- Bag (DOM copy: no-WebGL fallback and a11y) ---- */

.scree-bag {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  height: min(calc(580 * var(--u)), 72.5svh);
  aspect-ratio: 930 / 1162;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.scree-bag img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  transform-origin: 50% 50%;
}

.scree.has-gl .scree-bag {
  opacity: 0;
}

/* ---- Gear ---- */

.scree-item {
  position: absolute;
  left: calc(50% + (var(--x) - 720) * var(--u));
  top: calc(50% + (var(--y) - 400) * var(--u));
  width: calc(var(--s) * var(--u));
  height: calc(var(--s) * var(--u));
  z-index: 2;
}

.scree-item > .scree-blk {
  position: absolute;
  inset: 0;
}

.scree-item.is-dragging,
.scree-item.is-flying {
  z-index: 3;
}

.scree-item-body {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.scree-item.is-dragging .scree-item-body {
  cursor: grabbing;
}

.scree-item.is-packed .scree-item-body {
  visibility: hidden;
  pointer-events: none;
}

.scree-item-body img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.scree-frame {
  position: absolute;
  inset: 0;
  border: 1px solid var(--ink);
  opacity: 0;
  transition: opacity 120ms linear;
  pointer-events: none;
}

.scree-item.is-hover .scree-frame {
  opacity: 1;
}

.scree-name {
  position: absolute;
  top: calc(100% + 6 * var(--u));
  left: 0;
  height: calc(24 * var(--u));
  pointer-events: none;
}

.scree-name-ink {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.scree-name-text {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 calc(8 * var(--u));
  color: var(--paper);
  font-size: calc(14 * var(--u));
  line-height: 1;
  letter-spacing: -0.08em;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
}

/* ---- Description ---- */

.scree-desc {
  position: absolute;
  left: 50%;
  bottom: calc(32 * var(--u));
  z-index: 4;
  width: calc(307 * var(--u));
  margin: 0 0 0 calc(-153.5 * var(--u));
  transition:
    transform 700ms var(--ease-expo),
    opacity 500ms linear,
    filter 700ms var(--ease-expo);
}

.scree-desc.is-lifted {
  transform: translateY(calc(-40 * var(--u)));
  opacity: 0;
  filter: blur(10px);
}

.scree-text {
  margin: 0;
  font-size: calc(14 * var(--u));
  line-height: 1.2;
  letter-spacing: -0.06em;
  text-align: center;
}

/* ---- Mascot and bubble ---- */

.scree-mascot {
  position: absolute;
  right: calc(23 * var(--u));
  /* Clear the platform's "Powered by" badge when the store shows one. */
  bottom: calc(32 * var(--u) + var(--runner-watermark-clearance, 0px));
  z-index: 4;
  width: calc(92 * var(--u));
  height: calc(92 * var(--u));
}

.scree-mascot svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.scree-bubble {
  position: absolute;
  right: calc(107 * var(--u));
  bottom: calc(108 * var(--u) + var(--runner-watermark-clearance, 0px));
  z-index: 4;
}

.scree-bubble-pill {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(29 * var(--u));
  padding: calc(6 * var(--u)) calc(13 * var(--u));
  border-radius: calc(15 * var(--u));
  background: var(--ink);
  color: var(--paper);
  font-size: calc(14 * var(--u));
  line-height: 1.2;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.scree-bubble-pill::after {
  content: "";
  position: absolute;
  right: calc(-6 * var(--u));
  bottom: calc(1 * var(--u));
  width: calc(14 * var(--u));
  height: calc(11 * var(--u));
  background: var(--ink);
  clip-path: polygon(0 0, 100% 100%, 15% 100%);
}

.scree-caret {
  display: inline-block;
  width: max(1px, calc(1.5 * var(--u)));
  height: 1.05em;
  margin-left: calc(2 * var(--u));
  background: var(--paper);
  animation: scree-caret 1s steps(1) infinite;
}

@keyframes scree-caret {
  50% {
    opacity: 0;
  }
}

.scree-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- About (manifesto) ---- */

.scree-about {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 0;
  width: calc(1380 * var(--u));
  margin-left: calc(-690 * var(--u));
  opacity: 0;
  pointer-events: none;
}

.scree-about p {
  margin: 0;
  font-size: calc(47 * var(--u));
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-align: center;
}

.scree-about .tok {
  white-space: nowrap;
}

.scree-about .chip {
  display: inline-block;
  height: 0.72em;
  margin: 0 0.05em;
  vertical-align: baseline;
  object-fit: cover;
  max-width: none;
}

.scree-about .chip--wide {
  width: 1.58em;
  border-radius: 0.06em;
}

.scree-about .chip--square {
  width: 0.72em;
  border-radius: 0.06em;
}

.scree-about .chip--pill {
  width: 1.5em;
  border-radius: 0.36em;
}

.scree-about .chip--rock {
  width: 0.8em;
  height: 0.76em;
}

.scree-about .chip--rock svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scree-crew {
  display: block;
  width: calc(480 * var(--u));
  height: calc(320 * var(--u));
  margin: calc(110 * var(--u)) auto 0;
  object-fit: cover;
  max-width: none;
}

/* No WebGL: the bag is the <img>, the about section is plain flow under the hero. */
.scree.no-gl .scree-stage {
  position: relative;
}

.scree.no-gl .scree-about {
  position: static;
  width: auto;
  max-width: calc(1380 * var(--u));
  margin: 0 auto;
  padding: calc(120 * var(--u)) 0 calc(160 * var(--u));
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .scree-blk,
  .scree.is-in .scree-blk {
    animation: none;
    opacity: 1;
  }
  .scree-desc,
  .scree-frame {
    transition: none;
  }
  .scree-caret {
    animation: none;
  }
}
