/* Aly & Mimi — the card in depth (hero). Owned by the card-depth agent.
   Geometry is set by js/hero.js (card box in px, planes in % of the 1620x2160 canvas). */

.hero-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--paper, #f2d6ce);
  contain: layout paint;
}
/* phones: the card spans the width and the paper simply carries on above and below */
.hero-stage[data-mode="bleed"] {
  background: linear-gradient(to bottom, var(--hero-edge-top, #e8d2ca), var(--hero-edge-bottom, #efd2ca));
}
/* wider screens: the card lies on soft linen-coloured paper with a real shadow */
.hero-stage[data-mode="framed"] {
  background:
    radial-gradient(120% 90% at 50% 38%, rgba(255, 248, 242, 0.55), rgba(255, 248, 242, 0) 62%),
    var(--linen, #e9ddd3);
}

.hero-card {
  position: absolute;
  perspective: 1600px;
}

.hero-shadow {
  position: absolute;
  pointer-events: none;
  border-radius: 2px;
  box-shadow:
    0 1px 1px rgba(110, 72, 62, 0.10),
    0 3px 6px rgba(110, 72, 62, 0.08),
    0 18px 36px -12px rgba(110, 72, 62, 0.28),
    0 42px 80px -30px rgba(110, 72, 62, 0.34);
  opacity: 0;
  will-change: transform, opacity;
}
.hero-stage[data-mode="bleed"] .hero-shadow { display: none; }

.hero-tilt {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}

.hp {
  position: absolute;
  pointer-events: none;
  will-change: transform;
}
.hp-in {
  position: absolute;
  inset: 0;
  isolation: isolate;
  opacity: 0;
}
/* body = the plane's own box; inside a wipe it sits in the middle third and counter-moves */
.hp-body {
  position: absolute;
  inset: 0;
}
.hp-body--lit { isolation: isolate; }
.hp-body--wiped {
  inset: auto;
  left: 33.3333%;
  top: 33.3333%;
  width: 33.3334%;
  height: 33.3334%;
}
/* growth wipe: a 3x box whose soft-edged gradient mask travels along the growth direction */
.hp-wipe {
  position: absolute;
  inset: -100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.hp-body > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.hp-title-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
/* the botanicals' pen: a WebGL canvas over the plane's image while it is being drawn */
.hp-draw {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
/* sheet mode: a soft light that slides over the paper as the sheet turns (hidden at rest) */
.hero-sheen {
  position: absolute;
  left: -30%;
  top: -30%;
  width: 160%;
  height: 160%;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
  background: radial-gradient(42% 36% at 50% 50%, rgba(255, 251, 245, 0.85), rgba(255, 250, 243, 0.35) 45%, rgba(255, 250, 243, 0) 72%);
}
/* groups (botanicals) hold two images that sway together */
.hp-group > .hp {
  will-change: auto;
}

/* the moving light: a soft spot masked to the emboss plane's own shape */
.hp-light {
  position: absolute;
  inset: 0;
  overflow: hidden;
  mix-blend-mode: soft-light;
  opacity: 0;
  visibility: hidden;
  will-change: opacity;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.hp-spot {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 252, 246, 0.95), rgba(255, 250, 242, 0.45) 45%, rgba(255, 250, 242, 0) 100%);
  will-change: transform;
}

/* phones: the card's top and bottom edges melt into the paper band above and below (a taller,
   softer melt: the corner blooms and the vines dissolve into the paper instead of ending on a line) */
.hero-edge {
  position: absolute;
  left: 0;
  right: 0;
  height: 9%;
  pointer-events: none;
  opacity: 0;
}
/* the melts reach 8px into the paper band too: a sheet turning toward the viewer (rotateX) grows a
   few pixels past the card box, and those rows must land under the melt, not above it */
.hero-edge--top { top: -8px; height: calc(9% + 8px); background: linear-gradient(to bottom, var(--hero-edge-top, #e8d2ca) 30%, rgba(232, 210, 202, 0)); }
.hero-edge--bottom { bottom: -8px; height: calc(9% + 8px); background: linear-gradient(to top, var(--hero-edge-bottom, #efd2ca) 30%, rgba(239, 210, 202, 0)); }
.hero-stage[data-mode="framed"] .hero-edge { display: none; }

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

@media (prefers-reduced-motion: reduce) {
  .hp, .hp-spot, .hero-shadow { will-change: auto; }
}
