Hard and soft confinement effects on the glass transition of polymers confined to nanopores