/* The stage dimensions belong to the menu layout. These masks center the
   actual lettering above the controls while keeping a shared lower baseline. */
.rift-glyphbox {
  container-type: size;
}
.rift-glyphbox .rift-glyph {
  -webkit-mask-position: center bottom;
  mask-position: center bottom;
}

/* The photographed leaf is a separate colour layer. Its square is 165 units
   wide in the 960×280 title canvas. The complete leaf + word spans 709.5
   units, with its left edge half that distance from the horizontal center. */
.rift-glyphbox::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 13.046875%;
  width: 17.1875%;
  height: 58.928571%;
  background: url("/v2/assets/brand/mint-leaf-384.webp") left bottom / contain no-repeat;
  pointer-events: none;
  opacity: 0;
  transform: translateX(var(--leaf-travel, -20px));
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

/* A downward resize may constrain the title by height before it reaches
   the available width. Use the same contain fit as the SVG mask in that case. */
@supports (width: 1cqw) {
  .rift-glyphbox::after {
    --leaf-side: min(17.1875cqw, 58.928571cqh);
    left: calc(50% - min(36.953125cqw, 126.696429cqh));
    width: var(--leaf-side);
    height: var(--leaf-side);
  }
}

.rift-glyphbox:has([data-glyph="mint-room"].active)::after {
  --leaf-travel: 0px;
  opacity: 1;
}

.rift-glyphbox:has([data-glyph="store"].active)::after { --leaf-travel: 20px; }
.rift-glyphbox:has([data-glyph="trade"].active)::after { --leaf-travel: 40px; }
.rift-glyphbox:has([data-glyph="roadmap"].active)::after { --leaf-travel: 60px; }
.rift-glyphbox:has([data-glyph="swap"].active)::after { --leaf-travel: 80px; }
