/* Hand-off from the zoomed-out product map into the cards below. Studio > "Into the cards" sets html[data-handoff]:
   0 hard cut (before) · 1 surface · 2 waterline · 3 rising sheet · 4 surface + sheet. Driven from onScroll → handoff(). */
.hand-surf{position:absolute;inset:0;z-index:40;pointer-events:none;
  background:
    linear-gradient(to top,var(--ground,#FBFAF6) calc(var(--s,0)*140% - 40%),transparent calc(var(--s,0)*140%)),
    linear-gradient(rgba(4,22,44,var(--dim,0)),rgba(4,22,44,var(--dim,0)))}
html[data-handoff="1"] .ov{z-index:2;margin-top:calc(-1 * var(--ovpull,12vh));background:transparent}
html[data-handoff="1"] .ov-inner{position:relative}
html[data-handoff="1"] .ov::before{content:"";position:absolute;inset:var(--ovpull,12vh) 0 0;background:var(--ground,#FBFAF6);z-index:-1}
html[data-handoff="3"] .pin,html[data-handoff="4"] .pin{height:430vh}

/* 2 · waterline: the cards section carries a soft surface that dissolves the scene's bottom edge as it arrives */
html[data-handoff="2"] .ov{z-index:2}
html[data-handoff="2"] .ov::before{content:'';position:absolute;left:0;right:0;top:-16vh;height:16vh;pointer-events:none;
  background:linear-gradient(180deg,rgba(251,250,246,0) 0%,rgba(251,250,246,.1) 45%,rgba(251,250,246,.42) 100%)}
/* the waterline itself: a gentle wave with a light glint along its crest */
html[data-handoff="2"] .ov::after{content:'';position:absolute;left:0;right:0;top:-33px;height:34px;pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1440' height='34' viewBox='0 0 1440 34'%3E%3Cpath d='M0 20C180 6 360 6 540 18S900 32 1080 18 1350 6 1440 16V34H0Z' fill='%23FBFAF6'/%3E%3Cpath d='M0 20C180 6 360 6 540 18S900 32 1080 18 1350 6 1440 16' fill='none' stroke='%23FFFFFF' stroke-opacity='.85' stroke-width='1.5'/%3E%3C/svg%3E") 0 0/1440px 34px repeat-x}

/* 3/4 · rising sheet: the cards section slides up over the settled map like an app sheet */
html[data-handoff="3"] .ov,html[data-handoff="4"] .ov{z-index:3;margin-top:-100vh;border-radius:44px 44px 0 0;
  box-shadow:0 -1px 0 rgba(255,255,255,.9),0 -28px 80px rgba(6,34,70,.22)}
html[data-handoff="3"] .ov::after,html[data-handoff="4"] .ov::after{content:'';position:absolute;left:50%;top:12px;width:46px;height:5px;margin-left:-23px;border-radius:3px;background:#DCD8CD}

/* the cards rise in as they arrive (every option except the original) */
html:not([data-handoff="0"]) .rise{opacity:0;transform:translateY(28px);
  transition:opacity .7s ease var(--rd,0ms),transform .9s cubic-bezier(.2,.7,.2,1) var(--rd,0ms)}
html:not([data-handoff="0"]) .rise.risen{opacity:1;transform:none}
@media (prefers-reduced-motion: reduce){.hand-surf{display:none}html .rise{opacity:1!important;transform:none!important}
  html[data-handoff] .pin{height:auto}}

/* keep the moving layers on the compositor */
.pin .stage,.zhead,.hand-surf{will-change:transform,opacity}
html[data-handoff="1"] .pin .bg{bottom:-45%}
