/*
  Layers demo only. how-it-works.css owns the shared 5:4 frame and the separate transition cover.
  Zoom lives on .visual-stage, outside .vp, so tile depth inside .vp is untouched.
  The pointer sits in .vp and is inverted into scene pixels; the transition cover stays above it.
*/

.how-it-works__product-frame[data-how-it-works-scene="layers"] {
  perspective: 1600px;
}

.how-it-works__product-frame[data-how-it-works-scene="layers"] > .how-it-works-layers__rotation {
  position: absolute;
  inset: 0;
  /* Resting pose; how-it-works-layers.js writes the tilt as an inline transform, not inherited variables. */
  transform: none;
  transform-origin: center;
  transform-style: preserve-3d;
}

.how-it-works__product-frame[data-how-it-works-scene="layers"].is-playing > .how-it-works-layers__rotation {
  will-change: transform;
}

.how-it-works__product-frame[data-how-it-works-scene="layers"] > .how-it-works-layers__rotation > .how-it-works__visual-product {
  /* All how-it-works use the same top-left anchor; width may extend beyond the shared frame to the right. */
  left: 0;
  transform-origin: 0 0;
  /* Resting pose; how-it-works-layers.js writes the zoom inline. */
  transform: none;
}

.how-it-works__product-frame[data-how-it-works-scene="layers"].is-playing > .how-it-works-layers__rotation > .how-it-works__visual-product {
  will-change: transform;
}

.how-it-works-layers__lift {
  position: absolute;
  z-index: 4;
  top: 147px;
  left: 349px;
  width: 1060px;
  height: 753px;
  overflow: visible;
  pointer-events: none;
  transform: translateZ(calc(var(--vp-z-now) + 24px));
}

.how-it-works-layers__popover {
  /* Keep the Figma component intact; how-it-works-layers.js uses this same scale for its anchor math. */
  --how-it-works-layers-popover-scale: 0.75;
  position: absolute;
  z-index: 6;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateZ(160px) scale(var(--how-it-works-layers-popover-scale));
  transform-origin: top left;
}

/* Figma real_cursor, hotspot at the arrow tip (12, 5) inside the 40×40 frame. */
.how-it-works-layers__pointer {
  position: absolute;
  z-index: 8;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  opacity: 0;
  pointer-events: none;
  transform: translateZ(200px);
  transform-origin: 12px 5px;
}

[data-how-it-works-scene="layers"] [data-tile="hoshing-prepare-for-sake-cmi-wed"] {
  transition: color 200ms ease, filter 1s linear;
}

[data-how-it-works-scene="layers"] [data-tile="hoshing-prepare-for-sake-cmi-wed"].is-raised {
  filter: drop-shadow(0 10px 12px rgb(11 11 15 / 0.22));
}

/* Committed look matches the default L2 blue tiles in visual-product.css. */
[data-how-it-works-scene="layers"] [data-tile="hoshing-prepare-for-sake-cmi-wed"].is-committed {
  --tile-fill: #4362cb;
  --tile-stroke: #2f4ba9;
  --tile-ink: #e4e9f8;
}

[data-how-it-works-scene="layers"] [data-tile="hoshing-prepare-for-sake-cmi-wed"].is-committed .vp-tile__title {
  font-weight: 600;
}

[data-how-it-works-scene="layers"] [data-tile="hoshing-prepare-for-sake-cmi-wed"] .vp-tile__clip {
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
