/* Seal unbox prototype layer (separate experiment only) */
html.locked, html.locked body { overflow: hidden; height: 100%; }
main { position: relative; padding-left: 24px !important; padding-right: 24px !important; padding-top: 42px !important; }
#cover { position: absolute; left: 0; right: 0; top: 0; z-index: 5; }
#cover-top { position: relative; padding: 42px 24px 0; }
#cover-top::before {
  content: ""; position: absolute; z-index: -1;
  inset: 0 0 56px; /* retained sheet ends at the strip's top line; below it the gap shows the page through transparent canvas */
  background: linear-gradient(178deg, rgba(255,252,244,.28), rgba(255,252,244,.05) 300px, rgba(94,74,54,.07) 680px, rgba(70,54,38,.16) 1000px), url('paper-tile.png');
  background-size: auto, 430px auto;
  background-repeat: repeat;
  background-position: 0 0, 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
#cover-top .wide-identity h1, #cover-top .wide-identity p,
#cover-top .contact-info h2, #cover-top .contact-row { color: #3a2c21; }
#seal-wrap { position: relative; margin: -13px -24px 0; height: 100px; pointer-events: none; }
#seal { display: block; width: 100%; height: 100px; touch-action: none; pointer-events: auto; cursor: grab; }
#seal.grabbing { cursor: grabbing; }
#tear-final {
  z-index: 2;
  display: block; position: absolute; left: 0; right: 0; top: 31px;
  clip-path: inset(0 100% 0 0); /* revealed progressively as the tear advances */
  height: 26px; width: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 9px);
  mask-image: linear-gradient(to bottom, transparent, black 9px);
}
#cover-bottom {
  position: absolute; left: 0; right: 0; top: calc(100% - 22px); /* its top edge is the strip's bottom line */
  height: calc(100vh + 40px);
  transform-style: preserve-3d;
  pointer-events: none;
}
/* nested chain of paper segments: each rotates on its top edge, compounding
   into a real curl while the sheet falls */
.sheet-seg {
  position: absolute; left: 0; right: 0; top: calc(100% - 0.6px); /* sub-pixel overlap seals the hinge against AA cracks */
  height: calc((100vh + 40px) / 7 + 0.6px);
  background: linear-gradient(rgba(70,54,38,.07), rgba(70,54,38,.07)), url('paper-tile.png');
  background-size: auto, 430px auto;
  background-repeat: repeat;
  background-position: 0 var(--cover-offset, -500px), 0 var(--cover-offset, -500px);
  transform-origin: 50% 0;
  transform-style: preserve-3d;
}
#cover-bottom > .sheet-seg { top: 0; }

#cover { perspective: 1100px; }
/* lower sheet's fibrous top edge appears once the strip is fully torn (during the drag the canvas draws the advancing torn fibers) */
#cover-bottom.fall > .sheet-seg::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 26px;
  background: url('tear-edge.png') center/cover no-repeat;
  transform: scaleY(-1);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 9px);
  mask-image: linear-gradient(to bottom, transparent, black 9px);
}
#cover-bottom.fall {
  box-shadow: 0 -9px 20px -9px rgba(46,34,22,.42);
}
/* paper fall: catches air, flaps, accelerates away - stays opaque like real paper */
@keyframes sheetFall {
  0%   { transform: translateY(0)      rotateZ(0deg)    rotateX(0deg); }
  16%  { transform: translateY(9vh)    rotateZ(-2.4deg) rotateX(11deg); }
  38%  { transform: translateY(34vh)   rotateZ(2.0deg)  rotateX(-7deg); }
  62%  { transform: translateY(72vh)   rotateZ(-1.4deg) rotateX(5deg); }
  82%  { transform: translateY(112vh)  rotateZ(0.8deg)  rotateX(-2deg); }
  100% { transform: translateY(150vh)  rotateZ(0deg)    rotateX(0deg); }
}
#cover-bottom.gone { display: none; }
