/* Prime Creation // Actuator reader teleport v3 // Phase-Fold
   Visual-only book-reader transition. Stable Reader remains the state owner. */

#pcReaderTeleport.pc-reader-teleport{
  --rt-origin-x:50vw;
  --rt-origin-y:50vh;
  --rt-origin-w:10rem;
  --rt-origin-h:14rem;
  --rt-duration:940ms;
  position:fixed!important;
  inset:0!important;
  z-index:10140!important;
  display:block!important;
  overflow:hidden!important;
  pointer-events:none!important;
  visibility:hidden!important;
  opacity:0!important;
  isolation:isolate!important;
  background:transparent!important;
  contain:layout paint style!important;
  perspective:1100px!important;
}
#pcReaderTeleport.pc-reader-teleport.is-active{visibility:visible!important;opacity:1!important}
#pcReaderTeleport :is(.pc-rt-backdrop,.pc-rt-depth,.pc-rt-folios,.pc-rt-ink,.pc-rt-scan,.pc-rt-flare){position:absolute!important;inset:0!important;pointer-events:none!important}

/* Dark optical field. The highlight is tied to the actual book-cover origin. */
#pcReaderTeleport .pc-rt-backdrop{
  z-index:1;
  opacity:0;
  background:
    radial-gradient(ellipse 38rem 26rem at var(--rt-origin-x) var(--rt-origin-y),rgba(110,226,255,.14),transparent 58%),
    radial-gradient(ellipse 24rem 42rem at var(--rt-origin-x) var(--rt-origin-y),rgba(127,79,255,.13),transparent 66%),
    linear-gradient(118deg,rgba(1,4,8,.96),rgba(3,8,15,.985) 46%,rgba(1,3,7,.985));
  backdrop-filter:blur(0px) saturate(1.18);
}

/* Receding shells create a tunnel without a generic circular portal. */
#pcReaderTeleport .pc-rt-depth{z-index:2;transform-style:preserve-3d;opacity:0}
#pcReaderTeleport .pc-rt-depth>i{
  position:absolute!important;
  left:var(--rt-origin-x)!important;
  top:var(--rt-origin-y)!important;
  width:calc(max(3.6rem,var(--rt-origin-w))*1.08)!important;
  height:calc(max(4.8rem,var(--rt-origin-h))*1.04)!important;
  margin:0!important;
  border:1px solid rgba(153,239,255,.3)!important;
  border-radius:clamp(.8rem,2.8vw,2.3rem)!important;
  box-shadow:0 0 0 1px rgba(255,255,255,.025) inset,0 0 24px rgba(88,221,255,.08)!important;
  transform:translate(-50%,-50%) translateZ(calc(var(--rt-shell)*-76px)) scale(calc(1 + var(--rt-shell)*.24));
  opacity:calc(.84 - var(--rt-shell)*.12);
}

/* The signature: two page-like optical leaves fold open around a white slit. */
#pcReaderTeleport .pc-rt-aperture{
  position:absolute!important;
  z-index:5!important;
  left:var(--rt-origin-x)!important;
  top:var(--rt-origin-y)!important;
  width:max(4rem,var(--rt-origin-w))!important;
  height:max(5rem,var(--rt-origin-h))!important;
  transform:translate(-50%,-50%)!important;
  transform-style:preserve-3d!important;
  opacity:0;
}
#pcReaderTeleport .pc-rt-aperture::before{
  content:"";
  position:absolute;
  inset:-10%;
  border-radius:16%;
  border:1px solid rgba(143,239,255,.48);
  box-shadow:0 0 1.4rem rgba(84,221,255,.3),0 0 4.4rem rgba(119,78,255,.18),0 0 0 1px rgba(255,255,255,.035) inset;
  opacity:.74;
}
#pcReaderTeleport .pc-rt-leaf{
  position:absolute!important;
  top:0!important;
  bottom:0!important;
  width:50.4%!important;
  overflow:hidden!important;
  backface-visibility:hidden!important;
  background:
    linear-gradient(90deg,rgba(255,255,255,.05),rgba(153,241,255,.22) 42%,rgba(255,255,255,.62) 50%,rgba(142,95,255,.16) 72%,rgba(5,12,19,.12)),
    repeating-linear-gradient(0deg,rgba(205,247,255,.1) 0 1px,transparent 1px 7px);
  border:1px solid rgba(166,241,255,.5)!important;
  box-shadow:0 0 28px rgba(75,216,255,.24),0 0 70px rgba(125,83,255,.14),inset 0 0 34px rgba(191,245,255,.12)!important;
}
#pcReaderTeleport .pc-rt-leaf-a{left:0!important;transform-origin:100% 50%!important;border-radius:16% 2% 2% 16%!important}
#pcReaderTeleport .pc-rt-leaf-b{right:0!important;transform-origin:0 50%!important;border-radius:2% 16% 16% 2%!important}
#pcReaderTeleport .pc-rt-core{
  position:absolute!important;
  left:50%!important;
  top:-8%!important;
  width:clamp(2px,.3vw,5px)!important;
  height:116%!important;
  transform:translateX(-50%) scaleY(.04)!important;
  transform-origin:50% 50%!important;
  border-radius:999px!important;
  background:#f7ffff!important;
  box-shadow:0 0 8px #fff,0 0 22px rgba(135,239,255,.98),0 0 56px rgba(112,92,255,.68),0 0 110px rgba(73,220,255,.48)!important;
  opacity:0;
}

/* Folios are thin illuminated page planes, not particle streaks. */
#pcReaderTeleport .pc-rt-folios{z-index:6;transform-style:preserve-3d;perspective:900px}
#pcReaderTeleport .pc-rt-folios>i{
  position:absolute!important;
  left:var(--rt-origin-x)!important;
  top:var(--rt-origin-y)!important;
  width:clamp(2.8rem,10vw,8.8rem)!important;
  height:clamp(.16rem,.38vw,.34rem)!important;
  border-radius:999px!important;
  background:linear-gradient(90deg,transparent,rgba(130,235,255,.3) 12%,rgba(224,253,255,.96) 46%,rgba(161,112,255,.62) 72%,transparent)!important;
  box-shadow:0 0 16px rgba(91,226,255,.46),0 0 34px rgba(130,80,255,.2)!important;
  transform-origin:0 50%!important;
  opacity:0;
}
#pcReaderTeleport .pc-rt-folios>i::after{
  content:"";
  position:absolute;
  left:18%;right:12%;top:-.7rem;height:1.4rem;
  background:repeating-linear-gradient(0deg,transparent 0 .2rem,rgba(214,249,255,.2) .2rem .24rem,transparent .24rem .42rem);
  opacity:.5;
  filter:blur(.2px);
}

/* Ink/glyph fragments make the transition feel specific to a book. */
#pcReaderTeleport .pc-rt-ink{z-index:7;transform-style:preserve-3d;opacity:0}
#pcReaderTeleport .pc-rt-ink>b{
  position:absolute!important;
  left:var(--rt-origin-x)!important;
  top:var(--rt-origin-y)!important;
  color:rgba(200,247,255,.78)!important;
  font:800 clamp(.44rem,.8vw,.72rem)/1 ui-monospace,SFMono-Regular,Consolas,monospace!important;
  letter-spacing:.02em!important;
  text-shadow:0 0 10px rgba(110,226,255,.6),0 0 18px rgba(139,91,255,.28)!important;
  opacity:0;
}

/* Scan plane and final optical flare. */
#pcReaderTeleport .pc-rt-scan{
  z-index:8;
  opacity:0;
  background:
    linear-gradient(90deg,transparent calc(var(--rt-origin-x) - 1px),rgba(169,247,255,.72) var(--rt-origin-x),transparent calc(var(--rt-origin-x) + 1px)),
    linear-gradient(0deg,transparent calc(100vh - var(--rt-origin-y) - 1px),rgba(169,247,255,.34) calc(100vh - var(--rt-origin-y)),transparent calc(100vh - var(--rt-origin-y) + 1px));
  mix-blend-mode:screen;
}
#pcReaderTeleport .pc-rt-flare{
  z-index:9;
  opacity:0;
  background:radial-gradient(ellipse 8rem 24rem at var(--rt-origin-x) var(--rt-origin-y),rgba(255,255,255,1) 0 2%,rgba(170,244,255,.92) 4%,rgba(117,91,255,.36) 13%,transparent 42%);
  mix-blend-mode:screen;
}

#pcReaderTeleport .pc-rt-label{
  position:absolute!important;
  z-index:10!important;
  left:max(.8rem,env(safe-area-inset-left))!important;
  bottom:max(.8rem,env(safe-area-inset-bottom))!important;
  display:grid!important;
  gap:.22rem!important;
  padding:.46rem .56rem!important;
  border:1px solid rgba(126,233,255,.18)!important;
  border-radius:.5rem!important;
  background:linear-gradient(180deg,rgba(4,12,20,.82),rgba(1,6,11,.9))!important;
  box-shadow:inset 0 1px rgba(255,255,255,.04),0 0 20px rgba(80,220,255,.08)!important;
  opacity:0;
}
#pcReaderTeleport .pc-rt-label b,#pcReaderTeleport .pc-rt-label em{font-family:ui-monospace,SFMono-Regular,Consolas,monospace!important;font-style:normal!important;text-transform:uppercase!important}
#pcReaderTeleport .pc-rt-label b{color:#d7fbff!important;font-size:.48rem!important;letter-spacing:.14em!important}
#pcReaderTeleport .pc-rt-label em{color:rgba(149,230,255,.62)!important;font-size:.4rem!important;letter-spacing:.1em!important}

/* OPEN // cover becomes a fold, then a depth tunnel, then resolves. */
#pcReaderTeleport.is-open.is-running .pc-rt-backdrop{animation:pcRtBackdropOpen var(--rt-duration) cubic-bezier(.2,.7,.18,1) both}
#pcReaderTeleport.is-open.is-running .pc-rt-depth{animation:pcRtDepthOpen var(--rt-duration) cubic-bezier(.12,.8,.18,1) both}
#pcReaderTeleport.is-open.is-running .pc-rt-depth>i{animation:pcRtShellOpen var(--rt-duration) cubic-bezier(.16,.82,.18,1) both;animation-delay:calc(var(--rt-shell)*22ms)}
#pcReaderTeleport.is-open.is-running .pc-rt-aperture{animation:pcRtApertureOpen var(--rt-duration) cubic-bezier(.16,.82,.18,1) both}
#pcReaderTeleport.is-open.is-running .pc-rt-leaf-a{animation:pcRtLeafAOpen var(--rt-duration) cubic-bezier(.15,.86,.16,1) both}
#pcReaderTeleport.is-open.is-running .pc-rt-leaf-b{animation:pcRtLeafBOpen var(--rt-duration) cubic-bezier(.15,.86,.16,1) both}
#pcReaderTeleport.is-open.is-running .pc-rt-core{animation:pcRtCoreOpen var(--rt-duration) cubic-bezier(.16,.84,.14,1) both}
#pcReaderTeleport.is-open.is-running .pc-rt-folios>i{animation:pcRtFolioOpen var(--rt-duration) cubic-bezier(.12,.78,.17,1) both;animation-delay:calc(var(--rt-i)*8ms)}
#pcReaderTeleport.is-open.is-running .pc-rt-ink{animation:pcRtInkField var(--rt-duration) ease both}
#pcReaderTeleport.is-open.is-running .pc-rt-ink>b{animation:pcRtGlyphOpen var(--rt-duration) cubic-bezier(.12,.78,.2,1) both;animation-delay:calc(var(--rt-i)*6ms)}
#pcReaderTeleport.is-open.is-running .pc-rt-scan{animation:pcRtScanOpen var(--rt-duration) ease both}
#pcReaderTeleport.is-open.is-running .pc-rt-flare{animation:pcRtFlareOpen var(--rt-duration) ease-out both}
#pcReaderTeleport.is-open.is-running .pc-rt-label{animation:pcRtLabelOpen var(--rt-duration) ease both}

/* CLOSE // reader collapses into a vertical seam, then snaps back to the cover. */
#pcReaderTeleport.is-close.is-running .pc-rt-backdrop{animation:pcRtBackdropClose var(--rt-duration) cubic-bezier(.2,.7,.18,1) both}
#pcReaderTeleport.is-close.is-running .pc-rt-depth{animation:pcRtDepthClose var(--rt-duration) cubic-bezier(.16,.8,.2,1) both}
#pcReaderTeleport.is-close.is-running .pc-rt-depth>i{animation:pcRtShellClose var(--rt-duration) cubic-bezier(.2,.76,.18,1) both;animation-delay:calc(var(--rt-shell)*12ms)}
#pcReaderTeleport.is-close.is-running .pc-rt-aperture{animation:pcRtApertureClose var(--rt-duration) cubic-bezier(.18,.82,.18,1) both}
#pcReaderTeleport.is-close.is-running .pc-rt-leaf-a{animation:pcRtLeafAClose var(--rt-duration) cubic-bezier(.18,.82,.18,1) both}
#pcReaderTeleport.is-close.is-running .pc-rt-leaf-b{animation:pcRtLeafBClose var(--rt-duration) cubic-bezier(.18,.82,.18,1) both}
#pcReaderTeleport.is-close.is-running .pc-rt-core{animation:pcRtCoreClose var(--rt-duration) ease both}
#pcReaderTeleport.is-close.is-running .pc-rt-folios>i{animation:pcRtFolioClose var(--rt-duration) cubic-bezier(.2,.74,.22,1) both;animation-delay:calc(var(--rt-i)*4ms)}
#pcReaderTeleport.is-close.is-running .pc-rt-ink{animation:pcRtInkField var(--rt-duration) ease both}
#pcReaderTeleport.is-close.is-running .pc-rt-ink>b{animation:pcRtGlyphClose var(--rt-duration) cubic-bezier(.18,.76,.2,1) both;animation-delay:calc(var(--rt-i)*3ms)}
#pcReaderTeleport.is-close.is-running .pc-rt-scan{animation:pcRtScanClose var(--rt-duration) ease both}
#pcReaderTeleport.is-close.is-running .pc-rt-flare{animation:pcRtFlareClose var(--rt-duration) ease-out both}
#pcReaderTeleport.is-close.is-running .pc-rt-label{animation:pcRtLabelClose var(--rt-duration) ease both}

@keyframes pcRtBackdropOpen{0%,100%{opacity:0;filter:blur(0)}12%{opacity:.24}34%{opacity:.94}58%{opacity:1}78%{opacity:.7}92%{opacity:.12}}
@keyframes pcRtDepthOpen{0%,8%{opacity:0}24%{opacity:.72}48%,68%{opacity:1}100%{opacity:0}}
@keyframes pcRtShellOpen{0%{opacity:0;transform:translate(-50%,-50%) translateZ(-340px) scale(.22)}24%{opacity:.7}52%{opacity:.9;transform:translate(-50%,-50%) translateZ(calc(var(--rt-shell)*-70px)) scale(calc(1 + var(--rt-shell)*.24))}100%{opacity:0;transform:translate(-50%,-50%) translateZ(260px) scale(calc(1.8 + var(--rt-shell)*.28))}}
@keyframes pcRtApertureOpen{0%{opacity:0;filter:blur(3px);transform:translate(-50%,-50%) scale(.82)!important}13%{opacity:1}50%{opacity:1;filter:blur(0);transform:translate(-50%,-50%) scale(1.02)!important}76%{opacity:.9}100%{opacity:0;filter:blur(2px);transform:translate(-50%,-50%) scale(1.24)!important}}
@keyframes pcRtLeafAOpen{0%,13%{transform:rotateY(0deg) translateZ(0)}42%{transform:rotateY(-76deg) translateZ(18px)}68%{transform:rotateY(-122deg) translateZ(42px)}100%{transform:rotateY(-148deg) translateZ(72px);opacity:0}}
@keyframes pcRtLeafBOpen{0%,13%{transform:rotateY(0deg) translateZ(0)}42%{transform:rotateY(76deg) translateZ(18px)}68%{transform:rotateY(122deg) translateZ(42px)}100%{transform:rotateY(148deg) translateZ(72px);opacity:0}}
@keyframes pcRtCoreOpen{0%,8%{opacity:0;transform:translateX(-50%) scaleY(.03)}18%{opacity:1}44%{opacity:1;transform:translateX(-50%) scaleY(1.1)}61%{opacity:.92;transform:translateX(-50%) scaleY(1.5) scaleX(2.4)}80%{opacity:.36;transform:translateX(-50%) scaleY(2.2) scaleX(7)}100%{opacity:0;transform:translateX(-50%) scaleY(3) scaleX(12)}}
@keyframes pcRtFolioOpen{0%,15%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(0) rotateY(84deg) scaleX(.18)}27%{opacity:.86}65%{opacity:.72;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(calc(var(--rt-side)*var(--rt-drift)*.42)) rotateY(calc(var(--rt-side)*28deg)) translateZ(calc(var(--rt-depth)*22px)) scaleX(1.1)}100%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(calc(var(--rt-side)*var(--rt-drift))) rotateY(calc(var(--rt-side)*52deg)) translateZ(calc(var(--rt-depth)*44px)) scaleX(1.8)}}
@keyframes pcRtInkField{0%,14%,100%{opacity:0}30%,68%{opacity:1}}
@keyframes pcRtGlyphOpen{0%,18%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(0) scale(.35)}34%{opacity:.8}70%{opacity:.52;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(calc(var(--rt-radius)*.62)) rotate(calc(var(--rt-a)*-.15)) scale(1)}100%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(var(--rt-radius)) scale(1.24)}}
@keyframes pcRtScanOpen{0%,18%,100%{opacity:0;transform:scale(.1)}35%{opacity:.72;transform:scale(.55)}52%{opacity:.94;transform:scale(1.08)}72%{opacity:.18;transform:scale(1.3)}}
@keyframes pcRtFlareOpen{0%,40%,100%{opacity:0;transform:scale(.2)}54%{opacity:.96;transform:scale(.78)}64%{opacity:.42;transform:scale(1.3)}74%{opacity:.08;transform:scale(1.9)}}
@keyframes pcRtLabelOpen{0%,100%{opacity:0;transform:translateY(7px)}12%{opacity:.2}26%,62%{opacity:.84;transform:translateY(0)}78%{opacity:.28}}

@keyframes pcRtBackdropClose{0%,100%{opacity:0}12%{opacity:.18}34%,64%{opacity:.96}84%{opacity:.32}}
@keyframes pcRtDepthClose{0%{opacity:0}18%{opacity:.72}46%,68%{opacity:1}100%{opacity:0}}
@keyframes pcRtShellClose{0%{opacity:0;transform:translate(-50%,-50%) translateZ(260px) scale(calc(1.8 + var(--rt-shell)*.28))}20%{opacity:.74}64%{opacity:.9;transform:translate(-50%,-50%) translateZ(calc(var(--rt-shell)*-70px)) scale(calc(1 + var(--rt-shell)*.24))}100%{opacity:0;transform:translate(-50%,-50%) translateZ(-340px) scale(.18)}}
@keyframes pcRtApertureClose{0%{opacity:0;filter:blur(2px);transform:translate(-50%,-50%) scale(1.22)!important}14%{opacity:1}66%{opacity:1;filter:blur(0);transform:translate(-50%,-50%) scale(1)!important}100%{opacity:0;filter:blur(2px);transform:translate(-50%,-50%) scale(.78)!important}}
@keyframes pcRtLeafAClose{0%{opacity:0;transform:rotateY(-148deg) translateZ(72px)}14%{opacity:1}56%{transform:rotateY(-72deg) translateZ(16px)}84%,100%{transform:rotateY(0deg) translateZ(0)}}
@keyframes pcRtLeafBClose{0%{opacity:0;transform:rotateY(148deg) translateZ(72px)}14%{opacity:1}56%{transform:rotateY(72deg) translateZ(16px)}84%,100%{transform:rotateY(0deg) translateZ(0)}}
@keyframes pcRtCoreClose{0%{opacity:0;transform:translateX(-50%) scaleY(2.8) scaleX(10)}18%{opacity:.62}46%{opacity:1;transform:translateX(-50%) scaleY(1.15) scaleX(1.8)}70%{opacity:1;transform:translateX(-50%) scaleY(.9)}100%{opacity:0;transform:translateX(-50%) scaleY(.02)}}
@keyframes pcRtFolioClose{0%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(calc(var(--rt-side)*var(--rt-drift))) rotateY(calc(var(--rt-side)*52deg)) scaleX(1.8)}20%{opacity:.74}62%{opacity:.86;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(calc(var(--rt-side)*var(--rt-drift)*.34)) rotateY(calc(var(--rt-side)*24deg)) scaleX(.9)}100%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(0) rotateY(84deg) scaleX(.12)}}
@keyframes pcRtGlyphClose{0%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(var(--rt-radius)) scale(1.18)}22%{opacity:.58}68%{opacity:.8;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(calc(var(--rt-radius)*.28)) scale(.72)}100%{opacity:0;transform:translate(-50%,-50%) rotate(var(--rt-a)) translateX(0) scale(.2)}}
@keyframes pcRtScanClose{0%,100%{opacity:0;transform:scale(1.3)}26%{opacity:.44}56%{opacity:.9;transform:scale(.72)}78%{opacity:.36;transform:scale(.26)}}
@keyframes pcRtFlareClose{0%,100%{opacity:0;transform:scale(1.7)}32%{opacity:.18}52%{opacity:.9;transform:scale(.62)}68%{opacity:.35;transform:scale(.28)}}
@keyframes pcRtLabelClose{0%,100%{opacity:0;transform:translateY(7px)}12%,56%{opacity:.72;transform:translateY(0)}72%{opacity:.24}}

html[data-prime-performance-tier="conserve"] #pcReaderTeleport .pc-rt-ink,
html[data-prime-data-mode="save"] #pcReaderTeleport .pc-rt-ink{display:none!important}
html[data-prime-performance-tier="conserve"] #pcReaderTeleport .pc-rt-folios>i:nth-child(n+9),
html[data-prime-data-mode="save"] #pcReaderTeleport .pc-rt-folios>i:nth-child(n+9){display:none!important}
html[data-prime-performance-tier="conserve"] #pcReaderTeleport .pc-rt-depth>i:nth-child(n+4){display:none!important}
html[data-prime-performance-tier="conserve"] #pcReaderTeleport .pc-rt-label{display:none!important}

@media(max-width:680px){
  #pcReaderTeleport .pc-rt-label{display:none!important}
  #pcReaderTeleport .pc-rt-folios>i{width:clamp(2.4rem,14vw,5.2rem)!important}
  #pcReaderTeleport .pc-rt-aperture{max-width:68vw!important;max-height:60vh!important}
}
@media(prefers-reduced-motion:reduce){#pcReaderTeleport{display:none!important}}
